To run the Azure CLI in a Docker container, you can use the following command:
Azure CLI
docker run -it --rm -v ${PWD}:/work -w /work --entrypoint /bin/sh mcr.microsoft.com/azure-cli:latest
Login to Azure
az login
az account list
Output
[
{
"cloudName": "AzureCloud",
"id": "00000000-0000-0000-0000-000000000000",
"isDefault": true,
"name": "PAYG Subscription",
"state": "Enabled",
"tenantId": "00000000-0000-0000-0000-000000000000",
"user": {
"name": "user@example.com",
"type": "user"
}
}
]
Set suscription
az account set --subscription="00000000-0000-0000-0000-000000000000"
Top comments (0)