{"id":12254,"date":"2019-02-14T14:51:44","date_gmt":"2019-02-14T13:51:44","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/"},"modified":"2019-02-14T14:51:44","modified_gmt":"2019-02-14T13:51:44","slug":"how-to-deploy-a-new-container-group-using-azure-powershell","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/","title":{"rendered":"How To Deploy A New Container Group Using Azure PowerShell"},"content":{"rendered":"<h2>Deploying A New Container Group Using Azure PowerShell<\/h2>\n<p>Before starting, a\u00a0<span style=\"text-decoration: underline\"><strong>MSDN account<\/strong><\/span>\u00a0is needed to use the Azure platform, please\u00a0refer to your manager for further information.<\/p>\n<p>In this tutorial, the PowerShell commandlets will be used to\u00a0deploy a\u00a0Windows\u00a0image that packages Internet Information Services (IIS).<\/p>\n<p>Launch the command prompt and type\u00a0<span style=\"text-decoration: underline\"><strong>az login\u00a0<\/strong><\/span>to authenticate on the Azure platform (see below):<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az-login1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31121\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az-login1.png\" alt=\"az login1\" width=\"1024\" height=\"61\" \/><\/a><br \/>\nWait until a browser is launched so that you can login (see below):<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-31120\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png\" alt=\"az_authentication\" width=\"300\" height=\"183\" \/><\/a><br \/>\nYou have logged into Microsoft Azure!<\/p>\n<p>To create a new container, the following command will be used:<\/p>\n<ul>\n<li>New-AzResourceGroup<\/li>\n<li>New-AzContainer Group<\/li>\n<li>Get-AzcontainerGroup<\/li>\n<li>Get-AzContainerInstanceLog<\/li>\n<li>Remove-AzResourceGroup<\/li>\n<\/ul>\n<p>Open\u00a0the command prompt and type powershell to start.<\/p>\n<p>Define the variable\u00a0resource group that will hold the container group:<\/p>\n<ul>\n<li>$resourceGroup = &#8220;WinIIS-Tuto&#8221; (hit enter)<\/li>\n<\/ul>\n<p>Define the variable location:<\/p>\n<ul>\n<li>$location = &#8220;westeurope&#8221; (hit enter)<\/li>\n<\/ul>\n<p>Create the resource group and the location:<\/p>\n<ul>\n<li>New-AzResourceGroup\u00a0-Name $resourceGroup -location $location (hit enter)<\/li>\n<\/ul>\n<p>The resource group and the location are now created.<\/p>\n<p>Define the variable container group (only lowercase letters, numbers and dashes):<\/p>\n<ul>\n<li>$containerGroupName = &#8220;image-iis3&#8221; (hit enter)<\/li>\n<\/ul>\n<p>Create the container group:<\/p>\n<ul>\n<li>New-AzContainerGroup -ResourceGroupName\u00a0$resourceGroup `<\/li>\n<li>-Name $containerGroupName -Image microsoft\/iis:nanoserver `<\/li>\n<li>-IpAddressType Public -DnsNameLabel wind-iis2 `<\/li>\n<li>-osType Windows -Memory 2 -Cpu 2 -RestartPolicy OnFailure<\/li>\n<\/ul>\n<p>The <span style=\"text-decoration: underline\">DnsNamelabel<\/span> should be unique.<\/p>\n<p>Hit enter to execute the commands.<\/p>\n<p>During the execution process, use the following command-line to check the status\u00a0of the container group:<\/p>\n<ul>\n<li>Get-AzContainerGroup -ResourceGroupName `<\/li>\n<li>$resourceGroup -Name $containerGroupName<\/li>\n<\/ul>\n<p>The <span style=\"text-decoration: underline\">P<\/span><strong><span style=\"text-decoration: underline\">rovisioningState<\/span>\u00a0<\/strong>variable\u00a0display\u00a0the three state of creation of the container group which is\u00a0<span style=\"text-decoration: underline\">pending<\/span>,\u00a0<span style=\"text-decoration: underline\">creating<\/span>\u00a0and\u00a0<span style=\"text-decoration: underline\">succeeded<\/span>.<\/p>\n<p>A public random ip address is assigned and a fully qualified domain name which is <span style=\"text-decoration: underline\"><strong>wind-iis2<\/strong><strong>.westeurope.azurecontainer.io<\/strong><\/span><\/p>\n<p>To check if the container is up and running, open a browser and type the FQDN.<\/p>\n<p>To check the container group logs, type the following command:<\/p>\n<ul>\n<li>Get-AzContainerInstanceLog -ResourceGroupName `<\/li>\n<li>$resourceGroup -ContainerGroupName $containerGroupName<\/li>\n<\/ul>\n<p>As a test environment and to avoid paying extra cost, make sure to delete the resource group created if not used\u00a0(command-line below).<\/p>\n<ul>\n<li>Remove-AzResourceGroup -Name $resourceGroup -Force<\/li>\n<\/ul>\n<p>Need further details about deploying a container in Azure, please check <a title=\"Azure Container Instances\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/container-instances\/container-instances-quickstart-powershell\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deploying A New Container Group Using Azure PowerShell Before starting, a\u00a0MSDN account\u00a0is needed to use the Azure platform, please\u00a0refer to your manager for further information. In this tutorial, the PowerShell commandlets will be used to\u00a0deploy a\u00a0Windows\u00a0image that packages Internet Information Services (IIS). Launch the command prompt and type\u00a0az login\u00a0to authenticate on the Azure platform (see [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":12256,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[955],"tags":[],"type_dbi":[],"class_list":["post-12254","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How To Deploy A New Container Group Using Azure PowerShell - dbi Blog<\/title>\n<meta name=\"description\" content=\"Learn How To Deploy A New Container Group Using Azure PowerShell\" \/>\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.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Deploy A New Container Group Using Azure PowerShell\" \/>\n<meta property=\"og:description\" content=\"Learn How To Deploy A New Container Group Using Azure PowerShell\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-14T13:51:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"606\" \/>\n\t<meta property=\"og:image:height\" content=\"370\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"How To Deploy A New Container Group Using Azure PowerShell\",\"datePublished\":\"2019-02-14T13:51:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/\"},\"wordCount\":344,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png\",\"articleSection\":[\"Cloud\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/\",\"name\":\"How To Deploy A New Container Group Using Azure PowerShell - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png\",\"datePublished\":\"2019-02-14T13:51:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"description\":\"Learn How To Deploy A New Container Group Using Azure PowerShell\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png\",\"width\":606,\"height\":370},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Deploy A New Container Group Using Azure PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Deploy A New Container Group Using Azure PowerShell - dbi Blog","description":"Learn How To Deploy A New Container Group Using Azure PowerShell","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.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/","og_locale":"en_US","og_type":"article","og_title":"How To Deploy A New Container Group Using Azure PowerShell","og_description":"Learn How To Deploy A New Container Group Using Azure PowerShell","og_url":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/","og_site_name":"dbi Blog","article_published_time":"2019-02-14T13:51:44+00:00","og_image":[{"width":606,"height":370,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png","type":"image\/png"}],"author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"How To Deploy A New Container Group Using Azure PowerShell","datePublished":"2019-02-14T13:51:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/"},"wordCount":344,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png","articleSection":["Cloud"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/","url":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/","name":"How To Deploy A New Container Group Using Azure PowerShell - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png","datePublished":"2019-02-14T13:51:44+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"description":"Learn How To Deploy A New Container Group Using Azure PowerShell","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/az_authentication2.png","width":606,"height":370},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-deploy-a-new-container-group-using-azure-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Deploy A New Container Group Using Azure PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=12254"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12254\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/12256"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=12254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=12254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=12254"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=12254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}