Skip to content

Fix az ad app permission grant in the docs #17416

Description

@dgroh

Describe the bug
The docs for az ad app permission add says to invoke az ad app permission grant, but when invoking it a 404 error is shown. Workaround is to use az ad app permission admin-consent instead.

image

To Reproduce

Run the follwoing commands with powershell:

 $appRegistration = az ad app create `
     --display-name "AppName" `
     --reply-urls "http://localhost/auth" `
     --oauth2-allow-implicit-flow true `
     --available-to-other-tenants false `
     -o json | 
 ConvertFrom-Json

 az ad app permission add --id $appRegistration.appId `
     --api '00000003-0000-0000-c000-000000000000' `
     --api-permissions @("c5366453-9fb0-48a5-a156-24f0c49a4b84=Scope", "1ca167d5-1655-44a1-8adf-1414072e1ef9=Scope")

 az ad app permission grant --api 00000003-0000-0000-c000-000000000000 --id $appRegistration.appId

This error is showing:

image

There is a related issue on StackOverflow about it from a months ago: https://stackoverflow.com/questions/62883453/add-graph-api-via-az-ad-app-permission-fails

Expected behavior
The doc should specify when to exactly use it. In case the issue is with the cli, this should be fixed.

Environment summary
Powershell and Azure CLI 2.21.0

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Graph(doesn't work with label-triggered comments; use Graph.Microsoft instead) az ad

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions