創(chuàng)建subscription需要用到az account create命令。通常情況下,可能你的az account沒有create這個子命令。這并不是az版本的問題,而是az需要安裝subscription擴(kuò)展,才能有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.創(chuàng)建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"
}
]
創(chuàng)建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 表示企業(yè)協(xié)議
--display-name????????????????????????????subscription名稱
參考文檔
Automating creation of Azure Subscriptions with AZ CLI ? Data-Driven文章來源:http://www.zghlxwxcb.cn/news/detail-538641.html
az account | Microsoft Learn文章來源地址http://www.zghlxwxcb.cn/news/detail-538641.html
到了這里,關(guān)于Azure CLI - 創(chuàng)建subscription的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!