![](/img/trans.png)
[英]Importing publish settings file from azure storage using power shell
[英]Is there a way to use Azure Power Shell to redeploy an ACI using a YAML file?
我想使用 YAML 文件重新部署 Azure 容器实例。 以下使用 CLI 的命令有效:
az container create --resource-group <resource group> --file <yaml file>
但是,我想执行相同但作为 Azure Power Shell 脚本。 任何人都可以提供对此的见解吗?
非常感谢。
AFAIK,我们不能用 PowerShell 脚本而不是 CLI 来传递它,以不同的方式尝试过,目前不可能。
取而代之的是,您可以使用 PowerShell cmdlts
can create container
。
New-AzContainerGroup -ResourceGroupName myResourceGroup -Name mycontainer -Image mcr.microsoft.com/windows/servercore/iis:nanoserver -OsType Windows -DnsNameLabel aci-demo-win
以下是 PowerShell 支持的参数列表: New-AzContainerGroup
或者,您可以通过 YAML 发布管道运行 azure powershell 脚本,如@ Tarta的此SO THREAD中所述。
有关更多信息,请参阅此博客| 使用 YAML 部署 Azure 容器实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.