Skip to content

Instantly share code, notes, and snippets.

@kolosovpetro
Last active August 20, 2023 14:31
Show Gist options
  • Save kolosovpetro/040a5b0a885b725d5fe0bd6afe80e3c9 to your computer and use it in GitHub Desktop.
Save kolosovpetro/040a5b0a885b725d5fe0bd6afe80e3c9 to your computer and use it in GitHub Desktop.
Azure commands

Az account management commands

Login

  • az login
  • az login --use-device-code

Subscription

  • az account subscription list
  • az account set --subscription "name or id"
  • az account list -o table

Service principal

  • az ad sp create-for-rbac --name "ansible" --role "Contributor" --scopes /subscriptions/e3b8e7eb-628d-4a3c-80e5-b80bf1eab292
  • az ad sp create-for-rbac --role contributor --scopes "/subscriptions/f32f6566-8fa0-4198-9c91-a3b8ac69e89a" --name "AzCopyPipelines" --sdk-auth
  • az ad sp list --display-name "AzCopyPipelines"

Logout

  • az logout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment