Azure CLI创建管理员用户

发布时间 2023-11-07 14:25:39作者: 衡子
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