Azure CLI创建管理员用户

az ad user create --display-name ad --password xxxx --user-principal-name ad@abc.ink
az role assignment create --assignee ad@abc.ink --role Owner --scope /subscriptions/xxxxxxxx/
Body="{\"principalId\": \"xxxx\", \"roleDefinitionId\": \"62e90394-69f5-4237-9190-012177145e10\", \"directoryScopeId\": \"/\"}"
az rest --method POST --uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments --headers "Content-Type=application/json" --body $Body

 

posted @ 2023-11-07 14:20  衡子  阅读(10)  评论(0编辑  收藏  举报