{"id":38722,"date":"2020-03-28T13:14:59","date_gmt":"2020-03-28T20:14:59","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=38722"},"modified":"2020-03-18T13:29:23","modified_gmt":"2020-03-18T20:29:23","slug":"push-an-asp-net-core-api-container-to-azure-containter-registry-part-2-of-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/push-an-asp-net-core-api-container-to-azure-containter-registry-part-2-of-2\/","title":{"rendered":"Push an ASP.NET Core API Container to Azure Container Registry Part 2 of 2"},"content":{"rendered":"<p>App Dev Manager <a href=\"https:\/\/www.linkedin.com\/in\/greg-roe-3a7b66b\/\" target=\"_blank\" rel=\"noopener noreferrer\">Greg Roe<\/a> explores hosting cross platform ASP.NET Core Applications with containers in this two part series.<\/p>\n<hr \/>\n<p>This is part 2 of 2. See<a href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/hosting-and-asp-net-core-api-in-a-container-part-1-of-2-building-the-container\/\"> Part 1 \u201cHosting cross platform ASP.Net Core Applications\u201d<\/a>. Is the last article we built and demonstrated hosting an ASP.NET core api app \u201cBlue Yonder Hotel Service\u201d in a Docker Containers. The api will expose api service endpoint to call hotel services. In this Part 2 we will push the container to Azure Container Registry.<\/p>\n<p>To recap, ASP.NET Core is a cross-platform, <a href=\"https:\/\/github.com\/dotnet\/aspnetcore\">open-source<\/a> framework for building modern, cloud-based, connected applications. With ASP.NET core you can build web apps, API APS, microservices, mobile backends, and IoT apps. You can use your development tools of choice on Windows MacOS, and Linux. You can deploy in any cloud, or on premises. You can run in native cloud services such as Azure Web Apps, Linux, or, Containers. You can push and store the container in the secure Azure Container Registry.<\/p>\n<p>We\u2019ll use the <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/core\/tools\/\">dotnet cli<\/a> a cross platform took for developing, building, running, and publishing .Net Core apps and <a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code<\/a>, Microsoft\u2019s open source, cross-platform code editor that runs everywhere.<\/p>\n<ol>\n<li>Prerequisites:\n<ul>\n<li><a href=\"https:\/\/www.docker.com\/products\/docker-desktop\">Docker Desktop<\/a><\/li>\n<li>.<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/core\/install\/sdk?pivots=os-windows\">Net Core SDK<\/a><\/li>\n<li><a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code<\/a><\/li>\n<li>Azure Subscription<\/li>\n<\/ul>\n<\/li>\n<li>Create an Azure Container Registry instance:<\/li>\n<\/ol>\n<p>Logon to portal.azure.com<\/p>\n<p>Create resource\/ Container Registry<\/p>\n<p><img decoding=\"async\" width=\"1364\" height=\"857\" class=\"wp-image-38723\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-29.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-29.png 1364w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-29-300x188.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-29-1024x643.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-29-768x483.png 768w\" sizes=\"(max-width: 1364px) 100vw, 1364px\" \/><\/p>\n<p>Enter a Name,Resource Group, Location, and SKU.<\/p>\n<p><img decoding=\"async\" width=\"865\" height=\"904\" class=\"wp-image-38724\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-30.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-30.png 865w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-30-287x300.png 287w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-30-768x803.png 768w\" sizes=\"(max-width: 865px) 100vw, 865px\" \/><\/p>\n<p>Click Access Keys and then follow these steps<\/p>\n<p><img decoding=\"async\" width=\"715\" height=\"609\" class=\"wp-image-38725\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-31.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-31.png 715w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-31-300x256.png 300w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><\/p>\n<p>Login to ACR: Docker login gjracractivateazure.azurecr.io<\/p>\n<p>Get the image id: Docker Image<\/p>\n<p>Tag the image: docker tag 5d4fb8198d39 gjracractivateazure\/hotels_service:1.0<\/p>\n<ol start=\"3\">\n<li>Push the Container to Azure Container Registry<\/li>\n<\/ol>\n<p>Docker push gjracractivateazure\/hotels_service:1.0<\/p>\n<ol start=\"4\">\n<li>On the portal in your ACR instance, in \u201crepositories, you will see your pushed container image\u201d<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>ASP.NET Core is a cross-platform, open-source framework for building modern , cloud-based, connected applications. With ASP.NET core you can build web apps, API APS, Microservices, mobile backends, and IoT apps.<\/p>\n","protected":false},"author":582,"featured_media":38726,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[80],"tags":[67,97,3],"class_list":["post-38722","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","tag-asp-net","tag-azure-container-registry","tag-team"],"acf":[],"blog_post_summary":"<p>ASP.NET Core is a cross-platform, open-source framework for building modern , cloud-based, connected applications. With ASP.NET core you can build web apps, API APS, Microservices, mobile backends, and IoT apps.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/38722","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=38722"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/38722\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/38726"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=38722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=38722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=38722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}