Azure Container Quickstart for Developers

Get your applications running in containers on Azure, fast.

Welcome to the Azure Container Quickstart! This guide will walk you through the essential steps to deploy and manage your containerized applications on Microsoft Azure. Whether you're new to containers or looking to leverage Azure's robust platform, this quickstart will set you on the right path.

What are Containers?

Containers package an application and all its dependencies together, ensuring it runs consistently across different environments. Azure offers a variety of services to host and orchestrate your containers, including:

Prerequisites

Before you begin, ensure you have the following:

Quickstart Steps

1 Sign in to Azure

Open your terminal or command prompt and sign in to your Azure account:

az login

This will open a browser window for authentication. Follow the prompts to complete the sign-in process.

2 Create a Resource Group

A resource group is a logical container for your Azure resources. Create one for this quickstart:

az group create --name MyContainerResourceGroup --location eastus

Replace MyContainerResourceGroup and eastus with your desired names and Azure region.

3 Deploy a Container with Azure Container Instances (ACI)

ACI is the simplest way to run a container on Azure without managing underlying infrastructure. Let's deploy a sample application:

az container create --resource-group MyContainerResourceGroup --name my-container-app --image mcr.microsoft.com/azuredocs/aci-helloworld --dns-name-label my-aci-helloworld-app --ports 80

This command deploys the aci-helloworld image and exposes it on port 80. The --dns-name-label creates a public DNS name for your container.

4 Access Your Containerized Application

Once the deployment is complete, you can access your application via its public IP address or FQDN. First, get the IP address:

az container show --resource-group MyContainerResourceGroup --name my-container-app --query ipAddress.fqdn --output tsv

Copy the outputted FQDN (Fully Qualified Domain Name) and paste it into your web browser. You should see the Azure hello world sample page.

5 Clean Up Resources

To avoid incurring further charges, delete the resource group and all its resources:

az group delete --name MyContainerResourceGroup --yes --no-wait

This command deletes the resource group and all resources within it.

Next Steps:

This was a basic introduction. Explore deploying to Azure Kubernetes Service (AKS) for more complex orchestration, setting up Azure Container Registry (ACR) for your private images, and leveraging other Azure services like Azure App Service for containerized web apps.