你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
以编程方式部署和管理 Azure Arc 扩展安全更新许可证
本文提供关于通过 Azure Arc WS2012 ESU ARM API 以编程方式预配和管理 Windows Server 2012 和 Windows Server 2012 R2 扩展安全更新生命周期操作的说明。
对于本文讲解的每个 API 命令,请务必根据特定方案输入准确的位置、状态、版本、类型和处理器参数信息。
注意
需要创建服务主体才能使用 Azure API 管理 ESU。 有关详细信息,请参阅将混合计算机大规模连接到 Azure 和 Azure REST API 参考。
预配许可证
若要预配许可证,请执行以下命令:
PUT
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview
{
"location": "ENTER-REGION",
"properties": {
"licenseDetails": {
"state": "Activated",
"target": "Windows Server 2012",
"Edition": "Datacenter",
"Type": "pCore",
"Processors": 12
}
}
}
从批量许可转换
以编程方式,可以使用 Azure CLI 生成新许可证,通过输入相应的发票编号,在第 1 年批量许可权利中指定 Volume License Details
参数。 必须在 Azure Arc 的许可证预配中明确指定发票 ID(编号):
az connectedmachine license create --license-name
--resource-group
[--edition {Datacenter, Standard}]
[--license-type {ESU}]
[--location]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--processors]
[--state {Activated, Deactivated}]
[--tags]
[--target {Windows Server 2012, Windows Server 2012 R2}]
[--tenant-id]
[--type {pCore, vCore}]
[--volume-license-details]
关联许可证
若要关联许可证,请执行以下命令:
PUT
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/machines/MACHINE_NAME/licenseProfiles/default?api-version=2023-06-20-preview
{
"location": "SAME_REGION_AS_MACHINE",
"properties": {
"esuProfile": {
"assignedLicense": "RESOURCE_ID_OF_LICENSE"
}
}
}
取消关联许可证
若要取消关联许可证,请执行以下命令:
PUT
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/machines/MACHINE_NAME/licenseProfiles/default?api-version=2023-06-20-preview
{
"location": "SAME_REGION_AS_MACHINE",
"properties": {
"esuProfile": {
}
}
}
修改许可证
若要修改许可证,请执行以下命令:
PUT/PATCH
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview
{
"location": "ENTER-REGION",
"properties": {
"licenseDetails": {
"state": "Activated",
"target": "Windows Server 2012",
"Edition": "Datacenter",
"Type": "pCore",
"Processors": 12
}
}
}
注意
对于 PUT,必须提供所有属性。 对于 PATCH,可以提供子集。
删除许可证
若要删除许可证,请执行以下命令:
DELETE
https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.HybridCompute/licenses/LICENSE_NAME?api-version=2023-06-20-preview