【发布时间】:2021-06-29 08:23:57
【问题描述】:
我正在尝试使用更新命令将多个服务端点添加到子网,并使用一个变量来表示 SE
当它运行时,它会失败并出现错误,指出阵列使用了无效的服务名称。
在没有 SE 变量的情况下运行命令时,它运行没有任何问题。
$SE = "Microsoft.KeyVault Microsoft.Storage"
az network vnet subnet update --service-endpoints $SE --resource-group MyRg1 --vnet-name MyVnet --name MySnet
## Used to display the varaible format
Write-host "az network vnet subnet update --service-endpoints $SE --resource-group MyRg1 --vnet-name MyVnet --name MySnet"
使用循环并添加每个 SE 不是一个好的选择,因为更新 cmd 是幂等的。
【问题讨论】:
标签: azure service command-line-interface endpoint