====== Azure CLI ====== Useful ''az'' commands. ===== Users ===== * ''az ad signed-in-user show'' -- get details of the logged-in user ===== Subscriptions ===== * ''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 %%'' -- change the current subscription to '''' Full list at https://docs.microsoft.com/en-us/cli/azure/account. ===== Function Apps ===== * ''%%az webapp show --resource_group --name --query outboundIpAddresses%%'' -- show function app's [[https://docs.microsoft.com/en-us/azure/azure-functions/ip-addresses|outbound IP addresses]]. * ''%%az webapp identity show --resource-group --name %%'' -- show function app's managed service identity ===== Queries ===== All ''az'' commands support the ''%%--query%%'' argument, allowing you to pipe output results into a [[https://jmespath.org/|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']"%%'' {{tag> azure cli}}