Related command
az ad app permission admin-consent
Is your feature request related to a problem? Please describe.
Currently az ad app permission admin-consent uses "internal, deprecated, and unsupported" API at https://main.iam.ad.ext.azure.com/ to grand admin consent:
|
def admin_consent(cmd, client, identifier): |
|
from azure.cli.core.cloud import AZURE_PUBLIC_CLOUD |
|
from azure.cli.core.util import send_raw_request |
|
|
|
if cmd.cli_ctx.cloud.name != AZURE_PUBLIC_CLOUD.name: |
|
raise CLIError('This command is not yet supported on sovereign clouds') |
|
|
|
application = show_application(client, identifier) |
|
url = 'https://main.iam.ad.ext.azure.com/api/RegisteredApplications/{}/Consent?onBehalfOfAll=true'.format( |
|
application['appId']) |
|
send_raw_request(cmd.cli_ctx, 'post', url, resource='74658136-14ec-4630-ad9b-26e160ff0fc6') |
This API doesn't work on clouds other than AzureCloud, such as AzureChinaCloud, dogfood or Azure Stack.
Even though Graph team is working on an equivalent API on Microsoft Graph API, there is no ETA.
The alternative supported way is to utilize appRoleAssignment API to grant application permissions, even though there is still some feature gap between appRoleAssignment API and the old API.
Examples for using az rest to call appRoleAssignment API was previously given in #12137 (comment).
Still, it will be better if we can have native commands for appRoleAssignment API.
Related command
az ad app permission admin-consentIs your feature request related to a problem? Please describe.
Currently
az ad app permission admin-consentuses "internal, deprecated, and unsupported" API at https://main.iam.ad.ext.azure.com/ to grand admin consent:azure-cli/src/azure-cli/azure/cli/command_modules/role/custom.py
Lines 928 to 938 in 710c821
This API doesn't work on clouds other than
AzureCloud, such asAzureChinaCloud, dogfood or Azure Stack.Even though Graph team is working on an equivalent API on Microsoft Graph API, there is no ETA.
The alternative supported way is to utilize
appRoleAssignmentAPI to grant application permissions, even though there is still some feature gap betweenappRoleAssignmentAPI and the old API.Examples for using
az restto callappRoleAssignmentAPI was previously given in #12137 (comment).Still, it will be better if we can have native commands for
appRoleAssignmentAPI.