在 Powershell 中创建 Azure API 管理标签

Creating Azure API Management tags in Powershell

是否有在 Powershell 中创建 Azure API 管理标签的方法?我已使用 Set-AzApiManagementProperty 创建命名值,但在 AzAPI 管理中似乎没有用于创建标签的等效项。

有人以前做过吗?

请看这里:

How to Add Tags to api of APIM via powershell script

您可以使用 New-AzResource 创建标签,试试下面的脚本,它会创建一个名为 tag1.

的标签
$ResourceName = "tag1"
$PropertiesObject = @{
    displayName = "tag1"
}
New-AzResource -PropertyObject $PropertiesObject -ResourceGroupName <resource-group-name> -ResourceType Microsoft.ApiManagement/service/tags -ResourceName "<API-Management-service-name>/$ResourceName" -ApiVersion 2018-01-01 -Force