Skip to content

[Feature Request] Provide native commands for appRoleAssignment API #22768

@jiasli

Description

@jiasli

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions