Deploy a container instance in Azure using the Azure portal
Create a container instance
- Sign in to the Azure portal at https://portal.azure.com
- On the Azure portal homepage, select Create a resource.
- Select Containers > Container Instances.
- On the Basics page, choose a subscription and enter the following values for Resource group, Container name, Image source, and Container image.
- Resource group: Create new >
myresourcegroup
- Container name:
mycontainer
- Image source: Quickstart images
- Container image:
mcr.microsoft.com/azuredocs/aci-helloworld:latest
(Linux)
- Resource group: Create new >
- Leave the other values as their defaults, then select Next: Networking.
- On the Networking page, specify a DNS name label for your container. The name must be unique within the Azure region where you create the container instance. Your container will be publicly reachable at
<dns-name-label>.<region>.azurecontainer.io
. If you receive a “DNS name label not available” error message, try a different DNS name label.
An auto-generated hash is added as a DNS name label to your container instance’s fully qualified domain name (FQDN), which prevents malicious subdomain takeover. Specify the DNS name label scope reuse for the FQDN. You can choose one of these options:- Tenant
- Subscription
- Resource Group
- No reuse
- Any reuse (This option is the least secure.)
For this example, select Tenant.
- Leave all other settings as their defaults, then select Review + create.
- When deployment starts, a notification appears that indicates the deployment is in progress. Another notification is displayed when the container group has been deployed.
- Open the overview for the container group by navigating to Resource Groups > myresourcegroup > mycontainer. Make a note of the FQDN of the container instance and its Status.
- Once its Status is Running, navigate to the container’s FQDN in your browser.
View container logs
- Viewing the logs for a container instance is helpful when troubleshooting issues with your container or the application it runs.
- To view the container’s logs, under Settings, select Containers > Logs. You should see the HTTP GET request generated when you viewed the application in your browser.
Tag:Azure