aiastia / note

笔记
17 stars 5 forks source link

azure 知识点 #68

Open aiastia opened 2 years ago

aiastia commented 2 years ago

协同管理开启: 订阅->访问控制->添加->添加共同管理员->输入邮箱确认 订阅->访问控制->添加->添加角色->输入邮箱->角色:所有者

aiastia commented 2 years ago

wget https://raw.githubusercontent.com/aiastia/note/master/az.ps1

./az.ps1

aiastia commented 2 years ago

3.zip

aiastia commented 2 years ago

wget --trust-server-names az.124678.xyz

aiastia commented 2 years ago

API获取方法:

方法1:使用cloudshell by Powershell

多订阅:az ad sp create-for-rbac --role owner --scopes /subscriptions/订阅ID

单订阅:$sub_id=$(az account list --query [].id -o tsv) ; az ad sp create-for-rbac --role owner --scopes /subscriptions/$sub_id

方法2:cloudshell by Bash

sub_id=$(az account list --query [].id -o tsv) && az ad sp create-for-rbac --role contributor --scopes /subscriptions/$sub_id

如果自定义请参考Azure API文档:https://docs.microsoft.com/zh-cn/cli/azure/role