Azure CLI 中的新 AzureADServiceAppRoleAssignment? [英] New-AzureADServiceAppRoleAssignment in Azure CLI?
问题描述
Azure CLI 世界中是否有以下命令的挂件?
New-AzureADServiceAppRoleAssignment -ObjectId $clientManagedIdentityObjectId -Id $serverAppRoleId -ResourceId $serverEnterpriseAppObjectId -PrincipalId $clientManagedIdentityObjectId
我想将托管标识添加到企业应用程序中的 appRole
.
Is there a pendant in the Azure CLI world for the following command?
New-AzureADServiceAppRoleAssignment -ObjectId $clientManagedIdentityObjectId -Id $serverAppRoleId -ResourceId $serverEnterpriseAppObjectId -PrincipalId $clientManagedIdentityObjectId
I'd like to add a managed identity to an appRole
within an Enterprise Application.
az ad app permission add
does not seem to do the right thing or I am misinterpreting the underdocumented parameters.
There is no built-in cli command to do this, your option is to use az rest
call the Microsoft Graph - Grant an appRoleAssignment to a service principal
directly.
First, store a .json
file as below to your powershell execute location, the meaning of the values see this. e.g. my location is PS C:Usersjoyw>
, I store the file in C:Usersjoyw
folder.
{
"principalId": "principalId-value",
"resourceId": "resourceId-value",
"appRoleId": "appRoleId-value"
}
Then run the command
az rest --method POST --uri "https://graph.microsoft.com/v1.0/servicePrincipals/{object-id of your Managed identity}/appRoleAssignments" --headers 'Content-Type=application/json' --body `@body.json
这篇关于Azure CLI 中的新 AzureADServiceAppRoleAssignment?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!