You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Quickstart: Deploy a container instance in Azure using Azure PowerShell
14
14
15
15
Use Azure Container Instances to run serverless Docker containers in Azure with simplicity and speed. Deploy an application to a container instance on-demand when you don't need a full container orchestration platform like Azure Kubernetes Service.
16
16
17
-
In this quickstart, you use Azure PowerShell to deploy an isolated Windows container and make its application available with a fully qualified domain name (FQDN). A few seconds after you execute a single deployment command, you can browse to the application running in the container:
17
+
In this quickstart, you use Azure PowerShell to deploy an isolated Windows container and make its application available with a fully qualified domain name (FQDN) and port. A few seconds after you execute a single deployment command, you can browse to the application running in the container:
18
18
19
19
![App deployed to Azure Container Instances viewed in browser][qs-powershell-01]
20
20
@@ -36,22 +36,28 @@ First, create a resource group named *myResourceGroup* in the *eastus* location
You can expose your containers to the internet by specifying one or more ports to open, a DNS name label, or both. In this quickstart, you deploy a container with a DNS name label so it's publicly reachable. In this guide, we'll do both, but first, you need to create a port object in PowerShell for your container instance to use.
Now that you have a resource group, you can run a container in Azure. To create a container instance with Azure PowerShell, you'll first need to create a `ContainerInstanceObject` by providing a nameand image for the container. In this quickstart, you use the public `mcr.microsoft.com/windows/servercore/iis:nanoserver` image. This image packages Microsoft Internet Information Services (IIS) to run in Nano Server.
49
+
Now that you have a resource group and port, you can run a container that's exposed to the internet in Azure. To create a container instance with Azure PowerShell, you'll first need to create a `ContainerInstanceObject` by providing a name, image, and port for the container. In this quickstart, you use the public `mcr.microsoft.com/azuredocs/aci-helloworld` image.
Next, use the [New-AzContainerGroup][New-AzContainerGroup] cmdlet. You need to provide a name for the container group, your resource group's name, a location for the container group, the container instance you just created, the operating system type, and a unique IP address DNS name label.
48
56
49
-
You can expose your containers to the internet by specifying one or more ports to open, a DNS name label, or both. In this quickstart, you deploy a container with a DNS name label so that IIS is publicly reachable.
50
-
51
57
Execute a command similar to the following to start a container instance. Set a `-IPAddressDnsNameLabel` value that's unique within the Azure region where you create the instance. If you receive a "DNS name label not available" error message, try a different DNS name label.
$containerGroup = New-AzContainerInstanceObject -ResourceGroupName myResourceGroup -Name myContainerGroup -Location EastUS -Container myContainer -OsType Windows -IPAddressDnsNameLabel aci-quickstart-win -IpAddressType Public -IPAddressPort @($port)
55
61
```
56
62
57
63
Within a few seconds, you should receive a response from Azure. The container's `ProvisioningState` is initially **Creating**, but should move to **Succeeded** within a minute or two. Check the deployment state with the [Get-AzContainerGroup][Get-AzContainerGroup] cmdlet:
@@ -60,12 +66,17 @@ Within a few seconds, you should receive a response from Azure. The container's
The container's provisioning state, fully qualified domain name (FQDN), and IP address appear in the cmdlet's output:
69
+
You can also print out the $containerGroup object and filter the table for the container's provisioning state, fully qualified domain name (FQDN), and IP address.
Id : /subscriptions/<Subscription ID>/resourceGroups/myResourceGroup/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup
71
82
Name : myContainerGroup
@@ -86,9 +97,9 @@ State : Pending
86
97
Events : {}
87
98
```
88
99
89
-
Once the container's `ProvisioningState` is **Succeeded**, navigate to its `Fqdn` in your browser. If you see a web page similar to the following, congratulations! You've successfully deployed an application running in a Docker container to Azure.
100
+
If the container's `ProvisioningState` is **Succeeded**, go to its FQDN in your browser. If you see a web page similar to the following, congratulations! You've successfully deployed an application running in a Docker container to Azure.
90
101
91
-
![IIS deployed using Azure Container Instances viewed in browser][qs-powershell-01]
102
+
![View an app deployed to Azure Container Instances in browser][./media/container-instances-quickstart/view-an-application-running-in-an-azure-container-instance.png]
92
103
93
104
## Clean up resources
94
105
@@ -105,9 +116,6 @@ In this quickstart, you created an Azure container instance from an image in the
0 commit comments