{"id":15393,"date":"2020-08-06T06:43:01","date_gmt":"2020-08-06T06:43:01","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=15393"},"modified":"2020-08-07T03:55:55","modified_gmt":"2020-08-07T03:55:55","slug":"run-a-custom-windows-container-in-azure","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/","title":{"rendered":"Run a custom Windows container in Azure"},"content":{"rendered":"\n<p>This tutorial will guide you about how to Run a custom Windows container in Azure. Azure App Service&nbsp;makes available pre-defined application stacks on Windows like ASP.NET or Node.js, running on IIS. The preconfigured Windows environment locks down the operating system from administrative access, software installations, transforms to the global assembly cache, and so on.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-an-aspnet-web-app\"><strong>Create an ASP.NET web app<\/strong><\/h3>\n\n\n\n<p>Create an ASP.NET web app by following the below mentioned steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, Open Visual Studio and then choose <strong>Create a new project<\/strong>.<\/li><li>In&nbsp;<strong>Create a new project<\/strong>, find and select&nbsp;<strong>ASP.NET Web Application (.NET Framework)<\/strong>&nbsp;for C#, then choose&nbsp;<strong>Next<\/strong>.<\/li><li>Also, In&nbsp;<strong>Configure your new project<\/strong>, name the application&nbsp;as <em>myfirstazurewebapp<\/em>, and then choose&nbsp;<strong>Create<\/strong>.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/media\/app-service-web-get-started-windows-container\/configure-web-app-project-container.png\" alt=\"Configure your web app project\"\/><figcaption>Image Source &#8211; Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Now, You can choose to deploy any type of ASP.NET web app to Azure.<\/li><li>choose&nbsp;<strong>Docker support<\/strong>, and make sure the authentication you choose is set to&nbsp;<strong>No Authentication<\/strong>. Choose&nbsp;<strong>Create<\/strong>.<\/li><li>Furthermore, If the&nbsp;<em>Dockerfile<\/em>&nbsp;file isn&#8217;t going to open automatically, you have to open it from the&nbsp;<strong>Solution Explorer<\/strong>.<\/li><li>Also, You need choose a&nbsp;supported parent image.<\/li><li>Finally, From the Visual Studio menu, choose&nbsp;<strong>Debug<\/strong>&nbsp;&gt;&nbsp;<strong>Start Without Debugging<\/strong>&nbsp;to run the web app locally.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"publish-to-docker-hub\"><strong>Publish to Docker Hub<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Firstly, In&nbsp;<strong>Solution Explorer<\/strong>, right-click the&nbsp;<strong>myfirstazurewebapp<\/strong>&nbsp;project and choose&nbsp;<strong>Publish<\/strong>.<\/li><li>Select&nbsp;<strong>App Service<\/strong>&nbsp;and then choose&nbsp;<strong>Publish<\/strong>.<\/li><li>Then In Pick a&nbsp;<strong>publish target<\/strong>, choose&nbsp;<strong>Container Registry<\/strong>&nbsp;and&nbsp;<strong>Docker Hub<\/strong>, and then select&nbsp;<strong>Publish<\/strong>.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/media\/app-service-web-get-started-windows-container\/publish-to-docker-vs2019.png\" alt=\"Publish from project overview page\"\/><figcaption>Image Source &#8211; Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Furthermore, Supply your Docker Hub account credentials and choose&nbsp;<strong>Save<\/strong>.<\/li><li>Please Wait for the deployment to complete. The&nbsp;<strong>Publish<\/strong>&nbsp;page now displays the repository name to use later.<\/li><li>Finally, Copy this repository name for later.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-a-windows-container-app\"><strong>Create a Windows container app<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>The first step always is to Sign in to the&nbsp;Azure portal.<\/li><li>Select to&nbsp;<strong>Create a resource<\/strong>&nbsp;in the upper left-hand corner of the Azure portal.<\/li><li>In the search box above the list of Azure Marketplace resources, start search for&nbsp;<strong>Web App for Containers<\/strong>, and choose&nbsp;<strong>Create<\/strong>.<\/li><li>In&nbsp;<strong>Web App Create<\/strong>, select your subscription and a&nbsp;<strong>Resource Group<\/strong>. You can choose a new resource group if needed.<\/li><li>Provide an app name, such as&nbsp;<em>win-container-demo<\/em>&nbsp;and select&nbsp;<strong>Windows<\/strong>&nbsp;for&nbsp;<strong>Operating System<\/strong>. choose&nbsp;<strong>Next: Docker<\/strong>&nbsp;to continue.<\/li><li>For&nbsp;<strong>Image Source<\/strong>,select&nbsp;<strong>Docker Hub<\/strong>&nbsp;and for&nbsp;<strong>Image and tag<\/strong>, enter the repository name that you copied in&nbsp;Publish to Docker Hub.<\/li><li>If you have a custom image some where else for your web application, such as in&nbsp;Azure Container Registry&nbsp;or in any other private repository, you can configure it here.<\/li><li>choose&nbsp;<strong>Review and Create<\/strong>&nbsp;and then&nbsp;<strong>Create<\/strong>&nbsp;and wait for Azure to reach to the required resources.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-locally-and-redeploy\"><strong>Update locally and redeploy<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to the Visual Studio, in&nbsp;<strong>Solution Explorer<\/strong>, open&nbsp;<strong>Views<\/strong>&nbsp;&gt;&nbsp;<strong>Home<\/strong>&nbsp;&gt;&nbsp;<strong>Index.cshtml<\/strong>.<\/li><li>Find the&nbsp;<code>&lt;div class=\"jumbotron\"&gt;<\/code>&nbsp;HTML tag near the top, and choose to replace the entire element with the code.<\/li><li>To redeploy to Azure, right-click the&nbsp;<strong>myfirstazurewebapp<\/strong>&nbsp;project in&nbsp;<strong>Solution Explorer<\/strong>&nbsp;and select&nbsp;<strong>Publish<\/strong>.<\/li><li>On the publish page, choose&nbsp;<strong>Publish<\/strong>&nbsp;and wait for publishing to complete.<\/li><li>To tell App Service to pull in any of the new image from Docker Hub, restart the app. Back in the app page in the portal, choose&nbsp;<strong>Restart<\/strong>&nbsp;&gt;&nbsp;<strong>Yes<\/strong>.<\/li><li>Start to Browse to the container app&nbsp;again. As you refresh the webpage, the app should reply to the &#8220;Starting up&#8221; page at first, then be displaying the updated webpage again after a few minutes when you complete.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"use-a-different-parent-image\"><strong>Use a different parent image<\/strong><\/h3>\n\n\n\n<p>You&#8217;re free to use a totally different custom Docker image to run your app. However, you must select the right&nbsp;parent image (base image)&nbsp;for the framework you want:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, To deploy .NET Framework apps, try to choose a parent image based on the Windows Server Core 2019&nbsp;Long-Term Servicing Channel (LTSC)&nbsp;release.<\/li><li>Also, To deploy .NET Core apps, try to choose a parent image based on the Windows Server Nano 1809&nbsp;Semi-Annual Servicing Channel (SAC)&nbsp;release.<\/li><\/ul>\n\n\n\n<p>It takes some time to download a parent image when app start-up. However, you can reduce start-up time by using one of the following parent images that are already available in Azure App Service:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, mcr.microsoft.com\/dotnet\/framework\/aspnet:4.7.2-windowsservercore-ltsc2019<\/li><li>Subsequently, mcr.microsoft.com\/windows\/nanoserver:1809 &#8211; this image is the base container used across Microsoft&nbsp;ASP.NET Core&nbsp;Microsoft Windows Nano Server images.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/microsoft-azure-architect-technologies-az-303-free-practice-test\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png\" alt=\"free practice test for AZ- 303\" class=\"wp-image-13928\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png 960w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5-750x117.png 750w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-az-303-microsoft-azure-architect-technologies\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Go back to home page <\/strong><\/a><\/p>\n\n\n\n<p class=\"has-text-align-right\"><strong>Reference documentation &#8211;<\/strong> <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/app-service-web-get-started-windows-container\" target=\"_blank\" rel=\"noreferrer noopener\">Run a custom Windows container in Azure (Preview)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will guide you about how to Run a custom Windows container in Azure. Azure App Service&nbsp;makes available pre-defined application stacks on Windows like ASP.NET or Node.js, running on IIS. The preconfigured Windows environment locks down the operating system from administrative access, software installations, transforms to the global assembly cache, and so on.&nbsp; Create&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-15393","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Run a custom Windows container in Azure - Testprep Training Tutorials<\/title>\n<meta name=\"description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Run a custom Windows container in Azure! Start preparing now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Run a custom Windows container in Azure - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Run a custom Windows container in Azure! Start preparing now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-07T03:55:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/media\/app-service-web-get-started-windows-container\/configure-web-app-project-container.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/\",\"name\":\"Run a custom Windows container in Azure - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2020-08-06T06:43:01+00:00\",\"dateModified\":\"2020-08-07T03:55:55+00:00\",\"description\":\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Run a custom Windows container in Azure! Start preparing now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Run a custom Windows container in Azure\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Run a custom Windows container in Azure - Testprep Training Tutorials","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Run a custom Windows container in Azure! Start preparing now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/","og_locale":"en_US","og_type":"article","og_title":"Run a custom Windows container in Azure - Testprep Training Tutorials","og_description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Run a custom Windows container in Azure! Start preparing now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2020-08-07T03:55:55+00:00","og_image":[{"url":"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/media\/app-service-web-get-started-windows-container\/configure-web-app-project-container.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/","name":"Run a custom Windows container in Azure - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2020-08-06T06:43:01+00:00","dateModified":"2020-08-07T03:55:55+00:00","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Run a custom Windows container in Azure! Start preparing now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/run-a-custom-windows-container-in-azure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Run a custom Windows container in Azure"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=15393"}],"version-history":[{"count":2,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15393\/revisions"}],"predecessor-version":[{"id":15644,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15393\/revisions\/15644"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=15393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=15393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=15393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}