创建subscription需要用到az account create命令。通常情况下,可能你的az account没有create这个子命令。这并不是az版本的问题,而是az需要安装subscription扩展,才能有create子命令。
1.安装subscription extension
查看有哪些extension
az extension list
需要的subscription extension如下:
{
"experimental": false,
"extensionType": "whl",
"name": "subscription",
"path": "/root/.azure/cliextensions/subscription",
"preview": true,
"version": "0.1.5"
}
安装
az extension add -n subscription
2.创建subscription
获取enrollment account name
az billing enrollment-account list
[root@host /]# az billing enrollment-account list
[
{
"id": "/providers/Microsoft.Billing/enrollmentAccounts/44xxxx-xxxx-xxxx-xxxx-a8xxxxe",
"name": "44xxxx-xxxx-xxxx-xxxx-a8xxxxe",
"principalName": "test@example.com",
"type": "Microsoft.Billing/EnrollmentAccounts"
}
]
创建subscription - az account create
az account create --enrollment-account-name 44xxxx-xxxx-xxxx-xxxx-a8xxxxe \
--offer-type MS-AZR-0017P \
--display-name sub-1-test
--enrollment-account-name 命令“az billing enrollment-account list”查到的EA Name
--offer-type MS-AZR-0017P 表示企业协议
--display-name subscription名称
参考文档
Automating creation of Azure Subscriptions with AZ CLI • Data-Driven文章来源:https://www.toymoban.com/news/detail-538641.html
az account | Microsoft Learn文章来源地址https://www.toymoban.com/news/detail-538641.html
到了这里,关于Azure CLI - 创建subscription的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!