{"id":26175,"date":"2018-06-15T11:09:00","date_gmt":"2018-06-15T11:09:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=26175"},"modified":"2019-02-14T20:18:01","modified_gmt":"2019-02-15T03:18:01","slug":"container-why-not-app-services","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/container-why-not-app-services\/","title":{"rendered":"Container? Why not App Services?"},"content":{"rendered":"<p>In this post, Senior Premier Developer Consultant <a href=\"https:\/\/www.linkedin.com\/in\/caseykriutzfield\/\">Casey Kriutzfield<\/a> gives a walkthrough of deploying Linux Containers in Azure App Services.<\/p>\n<hr>\n<p>Containers have been popular lately, and Microsoft Azure has several products that are ready and able to serve your containers. <a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/introducing-azure-container-service-aks-managed-kubernetes-and-azure-container-registry-geo-replication\/\">Azure Kubernetes Service<\/a>, <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/container-instances\/\">Azure Container Instances<\/a>, and <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/service-fabric\/\">Service Fabric<\/a> are all great places to run enterprise containers and many organizations are spinning those services up. There is another place to run your containers, and it can be forgotten among the popular ones I mentioned.<\/p>\n<h2>A standard App Service.<\/h2>\n<p>Specifically, the Web App for Containers. With this product we are able to target a Linux Web App Container and deploy it into a Web App inside a Standard App Service. Doing this is fairly easy, and we get all the benefits of the App Service we are used to including Custom Domains, the ability to Scale Up and Scale out, Diagnostic Logs, Monitoring, and more. These features we can configure with Kubernetes, or another orchestrator inside Azure, but if we are hosting a web site inside a container, this is a pretty good option.<\/p>\n<p>To get started, from the Azure Portal we are going to find the App Service Plans and create a new App Service Plan. We will name it \u201cMyAppServicePlan\u201d, and also create a new Resource Group called \u201cMy Resource Group\u201d. In this case, we are going to want to create a \u201cLinux\u201d App Service Plan, as Windows on Containers is not yet supported. We are also going to keep the default Location as well as the Standard S1 Pricing Tier.<\/p>\n<p>Once the App Service Plan is configured, we can click \u201cCreate\u201d and we will be ready to go.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image0028.png\"><img decoding=\"async\" width=\"262\" height=\"484\" title=\"clip_image002\" alt=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image002_thumb7.png\" border=\"0\"><\/a><\/p>\n<p>For the purpose of this example, we are going to use an ASP.NET Core 2 application I\u2019ve called \u201cSimpleWebApp\u201d. You can get the solution from my GitHub site <a href=\"https:\/\/github.com\/ckriutz\/SimpleWebApp\/\">here<\/a>. <\/p>\n<p>The site itself is actually pretty simple. It\u2019s just a page that displays \u201cSimple Web App\u201d but will also display the name of the machine it\u2019s on. When you\u2019re running the application locally with Visual studio, it will give you a display that looks a little something like this:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image0036.png\"><img decoding=\"async\" width=\"244\" height=\"110\" title=\"clip_image003\" alt=\"clip_image003\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image003_thumb5.png\" border=\"0\"><\/a><\/p>\n<p>However, when you\u2019re running the application inside a container, it will give you a display that looks a little something like this instead:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image0048.png\"><img decoding=\"async\" width=\"244\" height=\"113\" title=\"clip_image004\" alt=\"clip_image004\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image004_thumb7.png\" border=\"0\"><\/a><\/p>\n<p>Of course, the machine names here depend on the name of your development machine, as well as the machine name Docker selects, but the point here is we can clearly see here that we would be running inside of a container. The code that\u2019s part of the solution in GitHub has the Dockerfile and is ready for you to build and use. Also, the container has been pushed to the <a href=\"https:\/\/hub.docker.com\">Docker Hub<\/a> and is located at ckriutz\/simplewebapp (<a href=\"https:\/\/hub.docker.com\/r\/ckriutz\/simplewebapp\/\">https:\/\/hub.docker.com\/r\/ckriutz\/simplewebapp\/<\/a>). For our example, we will use this image.<\/p>\n<p>We need to click \u201c<strong>Create a Resource<\/strong>\u201d, and look for \u201c<strong>Web App for Containers<\/strong>\u201d. <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image0055.png\"><img decoding=\"async\" width=\"244\" height=\"42\" title=\"clip_image005\" style=\"margin: 0px 12px\" alt=\"clip_image005\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image005_thumb4.png\" border=\"0\" hspace=\"12\"><\/a>Once you find it, we can create a new one and it will bring us to the right blade.<\/p>\n<p>The first thing we want to do is configure the container we want to use, we will select \u201c<strong>Docker Hub<\/strong>\u201d for our example.<\/p>\n<p>Next, our solution is a public solution, so we will select \u201c<strong>Public<\/strong>\u201d.<\/p>\n<p>Finally for \u201c<strong>Image and optional tag<\/strong>\u201d, we will type in <strong>ckriutz\/simplewebapp:latest<\/strong>.<\/p>\n<p>Clicking \u201c<strong>OK<\/strong>\u201d will satisfy our blade and we can configure the rest of the App Service.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image0065.png\"><img decoding=\"async\" width=\"493\" height=\"484\" title=\"clip_image006\" alt=\"clip_image006\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image006_thumb4.png\" border=\"0\"><\/a><\/p>\n<p>The App Service itself is going to be straightforward. Our App name needs to be unique. I got lucky and called it \u201cSimpleWebAppContainer\u201d, but you\u2019ll want to select something close that\u2019s available. Select your Subscription, and then we will use the existing Resource Group we created before: \u201cMyResourceGroup\u201d. Along with that, we will use the App Service Plan we created before: \u201cMyAppServicePlan\u201d. With those settings, we click \u201cCreate\u201d and we are good to go.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image0072.png\"><img decoding=\"async\" width=\"266\" height=\"484\" title=\"clip_image007\" alt=\"clip_image007\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/clip_image007_thumb2.png\" border=\"0\"><\/a><\/p>\n<p>When everything is all done, we should have our App Service up and running with our container inside. With a URL ready for us, all we need to do is click on it and we should see our ASP.NET Core 2 container up and running!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, Senior Premier Developer Consultant Casey Kriutzfield gives a walkthrough of deploying Linux Containers in Azure App Services. Containers have been popular lately, and Microsoft Azure has several products that are ready and able to serve your containers. Azure Kubernetes Service, Azure Container Instances, and Service Fabric are all great places to run [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[53,2],"class_list":["post-26175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","tag-app-services","tag-containers"],"acf":[],"blog_post_summary":"<p>In this post, Senior Premier Developer Consultant Casey Kriutzfield gives a walkthrough of deploying Linux Containers in Azure App Services. Containers have been popular lately, and Microsoft Azure has several products that are ready and able to serve your containers. Azure Kubernetes Service, Azure Container Instances, and Service Fabric are all great places to run [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/26175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=26175"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/26175\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=26175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=26175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=26175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}