Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.33 KB

azurecli_usage.md

File metadata and controls

62 lines (43 loc) · 1.33 KB

Use azurecli in the devops-toolkit

Prerequisite

An Azure account

azurecli document

Some document to help you start with azurecli

Run with Docker command

Note

To use the existing container instead of creating one, use docker exec command instead of docker run

docker exec -it my_devops_toolkit /bin/bash

Common Run Modes

For instructions on common run modes, visit DevOps Toolkit Common Run Mode.

Use case 1: Az login and run command

docker run --rm -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest

# Login with AZ CLI
az login --use-device-code
### To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <SHOWN_IN_SCREEN> to authenticate

# List all resource groups
az group list

Sample Result

root@f097467db632:~# az group list
[
  {
    "id": "/subscriptions/xxxxxxxx-yyyy-zzzz-ttttttttt/resourceGroups/your_resource_group",
    "location": "centralindia",
    "managedBy": null,
    "name": "your_resource_group",
    "properties": {
      "provisioningState": "Succeeded"
    },
    "tags": null,
    "type": "Microsoft.Resources/resourceGroups"
  },
  ...
]

Troubleshooting