Exploring Azure App Service – Introduction - Printable Version +- Sick Gaming (https://www.sickgaming.net) +-- Forum: Programming (https://www.sickgaming.net/forum-76.html) +--- Forum: C#, Visual Basic, & .Net Frameworks (https://www.sickgaming.net/forum-79.html) +--- Thread: Exploring Azure App Service – Introduction (/thread-85162.html) |
Exploring Azure App Service – Introduction - xSicKxBot - 06-11-2018 Exploring Azure App Service – Introduction <div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/exploring-azure-app-service-introduction.png" width="611" height="484" title="" alt="" /></div><div><p>Have you ever needed to quickly stand up a web site, or web API app that was publicly available? Is your team or organization thinking about moving to the cloud but aren’t sure the best place to start? One of the first places you should look is <a href="https://docs.microsoft.com/en-us/azure/app-service/app-service-web-overview">Azure App Service Web Apps</a>. In this post we’ll look at how easy it is to get started, and a quick overview of key concepts.</p> <p>App Service offers the following benefits:</p> <ul> <li>A fully managed platform, meaning Azure automatically updates the operating system and runtime as security and stability fixes are released.</li> <li>10 free plans to every subscriber, so it won’t cost you money or credits to try your app in Azure.</li> <li>First class support in Visual Studio, meaning that you can go from your app running on your local machine to running in App Service in less than 2 minutes.</li> <li>If offers <a href="https://docs.microsoft.com/en-us/azure/app-service/web-sites-staged-publishing">deployment slots</a>, which enable you to stage multiple versions of your app, and route varying amounts of traffic to the various versions (i.e. do A/B testing, or a ringed release model).</li> <li>Scale up and down quickly and automatically based on load</li> <li>For a more see <a href="https://docs.microsoft.com/en-us/azure/app-service/app-service-web-overview#why-use-web-apps">Why use Web Apps?</a></li> </ul> <p>In this blog post, I’ll provide an overview of App Service’s key features and concepts by walking through using Visual Studio to publish an ASP.NET application to Azure App Service.</p> <h2>Let’s get going</h2> <p>To get started, you’ll first need:</p> <ul> <li>Visual Studio 2017 with the <i>ASP.NET and web development</i> workload installed (<a href="https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15&utm_source=azuremscom&utm_medium=clickbutton&utm_campaign=tailored_azuredlpage&rid=34348">download now</a>)</li> <li>An Azure account: </li> <li>Any ASP.NET or ASP.NET Core app, for the purposes of this post, I’ll use a basic ASP.NET Core app</li> </ul> <p>To start I’ll right click my project in Solution Explorer and choose “Publish”</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2018/05/clip_image0011.png"><img title="clip_image001" alt="clip_image001" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/exploring-azure-app-service-introduction.png" width="611" height="484" border="0" /></a></p> <p>This brings up the Visual Studio publish target dialog, which will default to the Azure App Service pane. The “Create new” radio button is already selected to, so I’ll click the “Publish” button on the bottom right.</p> <p>This will open the Create App Service dialog in Visual Studio.</p> <h2>Key App Service Concepts</h2> <p>The dialog has four fields that represent key concepts of creating an App Service:</p> <ol> <li><b>App Name:</b> Will be the default public facing URL in Azure (it will be of the form https://<App_Name>.azurewebsites.net –you can configure domain names later if needed).</li> <li><b>Subscription: </b>The Azure Subscription to create the resources in if you have more than one</li> <li><b>Resource Group:</b> Groups your application and any dependent resources (SQL Databases, Storage Accounts, etc., <a href="https://docs.microsoft.com/en-us/azure/architecture/cloud-adoption-guide/adoption-intro/resource-group">see resource group design to learn more</a>). To edit the name, click “New…”.</li> <li><b>Hosting Plan:</b> The hosting plan is a set of reserved resources for your app. You can choose to host multiple apps in a single hosting plan (we’ll explore this further in a minute).</li> </ol> <p><b><a href="https://msdnshared.blob.core.windows.net/media/2018/05/clip_image003.jpg"><img title="clip_image003" alt="clip_image003" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/exploring-azure-app-service-introduction.jpg" width="1025" height="772" border="0" /></a></b></p> <p>One concept that can be confusing is the relationship between the “Hosting Plan” (or App Service plan”) and the “App Service”:</p> <ul> <li><b>The Hosting/App Service plan</b> is the virtual machine resources you are reserving in Azure to host your application. This is what you are paying or using credits for.</li> <li><b>The App Service</b> is your app and associated settings that run inside of the plan. You can run multiple apps (App Services) in the same plan (virtual machine) with the same implications as sharing any other server or VM between apps.</li> </ul> <p>To explore the App Service plan further, click the “New…” button next to the Hosting Plan dropdown to open the “Configure Hosting Plan” dialog that has three fields:</p> <ol> <li><b>App Service Plan:</b> A non-public facing name for the plan.</li> <li><b>Location:</b> Is the region your app will run in. You generally want to pick a region that is close to customers that will be accessing the site.</li> <li><b>Size: </b>The size of the virtual machine you want to reserve for your application and the capabilities you want (e.g. deployment slots require a Standard or Premium plan).<br /><i>Note: Free and Shared plans run in the same VM as other App Service apps and are intended for development and testing, </i><a href="https://docs.microsoft.com/en-us/azure/app-service/azure-web-sites-web-hosting-plans-in-depth-overview"><i>see App Service plan overview for more details</i></a><i /></li> </ol> <h2>Publishing the app</h2> <p>At this point I’m ready to publish my app to App Service. The bottom right panel of the Create App Service dialog will show me all the resources I’m going to create in Azure (in this case a Hosting Plan and App Service). Everything looks good, so I just need to click “Create”:</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2018/05/clip_image005.jpg"><img title="clip_image005" alt="clip_image005" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/06/exploring-azure-app-service-introduction-1.jpg" width="1028" height="771" border="0" /></a></p> <p>Visual Studio will create all the resources on my behalf, publish my application, and open my default browser to the URL of the published application.</p> <h2>Conclusion</h2> <p>Hopefully, this overview of App Service concepts has been helpful and inspired you to give App Service a try. We believe that for many people, App Service is the easiest place to get started with cloud development, even if you need to move to other services in the future for further capabilities (<a href="https://docs.microsoft.com/en-us/azure/app-service/choose-web-site-cloud-service-vm">compare hosting options</a> to see additional choices). As always, let us know if you run into any issues, or have any questions below or <a href="https://twitter.com/AndrewBrianHall">via Twitter</a>. If you’re interested in exploring more, see the next post in our series <a href="https://blogs.msdn.microsoft.com/webdev/2018/05/18/exploring-azure-app-service-web-apps-and-sql-azure/">introducing how to setup and use SQL Server with App Service</a></p> <p> </p> </div> |