az rest --help
-
$ az rest --help Command az rest : Invoke a custom request. Arguments --method -m [Required] : HTTP request method. Allowed values: delete, get, head, options, patch, post, put. Default: get. --uri -u [Required] : Request uri. For uri without host, CLI will assume "https://management.azure.com/". Common token '{subscriptionId}' will be replaced with the current subscription ID specified by 'az account set'. --body -b : Request body. Use @{file} to load from a file. --headers : Space-separated headers in KEY=VALUE format or JSON string. Use @{file} to load from a file. --output-file : Save response payload to a file. --resource : Resource url for which CLI should acquire a token in order to access the service. The token will be placed in the "Authorization" header. By default, CLI can figure this out based on "--url" argument, unless you use ones not in the list of "az cloud show --query endpoints". --skip-authorization-header : Do not auto append "Authorization" header. --uri-parameters : Space-separated queries in KEY=VALUE format or JSON string. Use @{file} to load from a file. Global Arguments --debug : Increase logging verbosity to show all debug logs. --help -h : Show this help message and exit. --output -o : Output format. Allowed values: json, jsonc, none, table, tsv, yaml. Default: json. --query : JMESPath query string. See http://jmespath.org/ for more information and examples. --subscription : Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`. --verbose : Increase logging verbosity. Use --debug for full debug logs. Examples Get Audit log through Microsoft Graph az rest --method get --uri https://graph.microsoft.com/beta/auditLogs/directoryAudits Update a Azure Active Directory Graph User's display name az rest --method patch --uri "https://graph.microsoft.com/v1.0/users/[email protected]" --body "{\"displayName\": \"jondoe2\"}" Get a virtual machine az rest --method get --uri /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName }/providers/Microsoft.Compute/virtualMachines/{vmName}?api-version=2019-03-01 Create a public IP address from body.json file az rest --method put --uri https://management.azure.com/subscriptions/{subscriptionId}/resou rceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddress Name}?api-version=2019-09-01 --body @body.json For more specific examples, use: az find "az rest"
© Lightnetics 2024