Deploy Azure Container Instance using Azure CLI

Introduction

Azure Container Instances (ACI) is a serverless container service offered by Microsoft Azure. It allows you to easily run containers without managing the underlying infrastructure. With ACI, you can deploy containers on-demand and only pay for the resources you consume, making it a cost-effective and efficient solution for running containerized applications.

In this post, We will show you how to deploy azure container instance using azure cli.

Step 1: Deploy Resource Group

To deploy an Azure Container Instance with specific CPUs and memory and assign a DNS label using Azure CLI, you can follow these steps:

Create a resource group if you haven’t already:

az group create --name YourResourceGroupName --location YourLocation

Replace YourResourceGroupName with your desired resource group name and YourLocation with your desired Azure region.

Step 2: Deploy the Azure Container Instance

Deploy the Azure Container Instance with the specified CPU, memory, and DNS label:

az container create \
    --resource-group YourResourceGroupName \
    --name YourContainerName \
    --image YourContainerImage \
    --cpu 2 \
    --memory 4 \
    --os-type Linux \
    --dns-name-label YourDNSLabel \
    --ip-address Public \
    --port 80

Replace YourContainerName with the name you want to give to your container instance, YourContainerImage with the URL to the Docker image you want to deploy, and YourDNSLabel with the desired DNS label.

Conclusion

We have successfully deployed the ACI container using Azure CLI , If you still have questions, please post them in the comments section below.

Author

Deploy Azure Container Instance using Azure CLI

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top