Reputation: 91
How to add authroized client applications (in portal : app registration -> Expose API -> add Authorized client applications) during app registration using powershell Azure CLI.
Upvotes: 0
Views: 1795
Reputation: 11451
There is no az command to directly add preauthorized clients to a app registration instead you will have to use Graph API (beta) to update the same from Graph Explorer
or az rest
command.
Get OauthPermissionId with az command :
az ad app show --id $appId --query "oauth2Permissions[].id"
I tested the same from Graph Explorer :
Ran Patch : https://graph.microsoft.com/beta/applications/<appObjectId>
With Request body as :
{
"api": {
"preAuthorizedApplications": [
{
"appId": "authorizedappClientID",
"permissionIds": [
"oauth2PermissionId"
]
}
]
}
}
Output:
Reference for az rest can be fount in this SO thread answered by Joy Wang .
Upvotes: 1