Azure CLI - 创建subscription

创建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

az account | Microsoft Learn

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值