作者:刘旭 | 来源:互联网 | 2023-09-03 17:34
我通过powershell如下创建了容器注册表。
$prop = @{
Location = "..."
ResourceName = "Resource1"
ResourceType = "microsoft.ContainerRegistry/registries"
ResourceGroupName = "ResourceGroup.."
Force = $true
Sku = @{"Name"="Premium"}
}
$registry = New-AzResource @prop"
它已成功创建,但是为此设置的内容信任策略已“禁用”
如何通过Powershell在创建过程中启用它
ACR的内容信任策略位于其属性中,因此您需要在命令中进行设置。最后,命令将如下所示:
$prop = @{
Location ="location"
ResourceName ="resourceName"
ResourceType ="Microsoft.ContainerRegistry/registries"
ResourceGroupName ="groupName"
Sku =@{"Name"="Premium"}
Properties =@{"Policies"=@{"TrustPolicy"=@{"Type"="Notary";"Status"="enabled"}}}
}
$registry = New-AzResource @prop