DEV Community

Nelson Hernández
Nelson Hernández

Posted on

 

How to run Azure CLI with Docker

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
Enter fullscreen mode Exit fullscreen mode

Login to Azure

az login
az account list
Enter fullscreen mode Exit fullscreen mode

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"
    }
  }
]
Enter fullscreen mode Exit fullscreen mode

Set suscription

az account set --subscription="00000000-0000-0000-0000-000000000000"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.