Azure CLI

Useful az commands.

  • az ad signed-in-user show – get details of the logged-in user
  • az account show – get details of the current subscription
  • az account list – get a list of subscriptions for the logged in account
  • az account set --subscription <subscription_name> – change the current subscription to <subscription_name>

Full list at https://docs.microsoft.com/en-us/cli/azure/account.

  • az webapp show --resource_group <group_name> --name <function_app> --query outboundIpAddresses – show function app's outbound IP addresses.
  • az webapp identity show --resource-group <group_name> --name <function_app> – show function app's managed service identity

All az commands support the --query argument, allowing you to pipe output results into a JMESPath query – see https://docs.microsoft.com/en-us/cli/azure/query-azure-cli.

For example:

  • search service principals by object ID

    az ad sp list --query "[?objectId=='15e4529c-113b-4872-a510-08e97f87af9b']"