Azure PowerShell – Container Instance Cmdlets

Synopsis

This reference provides detailed information about the Azure PowerShell cmdlets used to manage Azure Container Instances (ACI). Use these cmdlets to create, configure, and manage containers in Azure without configuring complex orchestration services.

Available Cmdlets

CmdletPurpose
New-AzContainerGroupCreate a new container group.
Get-AzContainerGroupRetrieve details of a container group.
Stop-AzContainerGroupStop a running container group.
Remove-AzContainerGroupDelete a container group.
Update-AzContainerGroupUpdate configuration of an existing container group.
Invoke-AzContainerGroupLogStream logs from a container group.

Example: Deploy a Simple Nginx Container

# Install Azure PowerShell if not already installed
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

# Connect to your Azure account
Connect-AzAccount

# Select subscription (optional)
Select-AzSubscription -SubscriptionId "YOUR_SUBSCRIPTION_ID"

# Create a resource group
New-AzResourceGroup -Name "MyContainerRG" -Location "EastUS"

# Deploy an Nginx container group
New-AzContainerGroup -ResourceGroupName "MyContainerRG" `
    -Name "nginx-group" `
    -Location "EastUS" `
    -Image "nginx:latest" `
    -OsType Linux `
    -DnsNameLabel "my-nginx-demo" `
    -IpAddressType Public `
    -Port 80

# Verify deployment
Get-AzContainerGroup -ResourceGroupName "MyContainerRG" -Name "nginx-group"

Parameters Overview

ParameterTypeDescription
-ResourceGroupNameStringName of the resource group.
-NameStringContainer group name.
-LocationStringAzure region.
-ImageStringDocker image (e.g., nginx:latest).
-OsTypeStringOS type: Linux or Windows.
-DnsNameLabelStringLabel for the public FQDN.
-IpAddressTypeStringPublic or Private.
-PortIntPort to expose.

Related Resources