无法创建 Azure 容器实例 (Windows)
Cannot create Azure container instance (Windows)
我已经使用 Azure CLI 任务和以下脚本创建了一个 Azure DevOps 管道来创建 Azure 容器实例 (Windows) 的新实例:
az container create \
-g $(BuildAgent.ResourceGroup) \
--name $(BuildAgent.ContainerName) \
--image $(BuildAgent.DockerImage):$(BuildAgent.DockerImageVersion) \
--cpu $(BuildAgent.Cpu) \
--memory $(BuildAgent.Memory) \
--os-type $(BuildAgent.OsType) \
--restart-policy OnFailure \
--vnet $(BuildAgent.VNet) \
--subnet $(BuildAgent.VNetSubnet) \
--registry-username $(BuildAgent.RepositoryUserName) \
--registry-password $(BuildAgent.RepositoryPassword) \
-e \
VSTS_ACCOUNT=$(BuildAgent.VstsAccount) \
VSTS_POOL=$(BuildAgent.AgentPool) \
VSTS_AGENT='$(BuildAgent.ContainerName)' \
--secure-environment-variables \
VSTS_TOKEN='$(BuildAgent.AccessToken)'
任务失败并出现以下错误:
The requested resource is not available in the location 'westeurope' at this moment. Please retry with a different resource request or in another location. Resource requested: '4' CPU '8' GB memory 'Windows' OS virtual network
Docker 文件中的基本图像是 supported(我认为):
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2016
一些注意事项:
- 资源组已经存在
- 我试过不同数量的 cores/memory(例如 2 cores/8GB 或 4 cores/16GB)
- 我有一个类似的管道,它使用相同的资源组和相同的 Azure 容器注册表创建了一个正常工作的 Linux 容器
- VNet 和子网与创建 Linux 容器的管道中使用的相同
我在这里错过了什么?
仔细研究 Resource availability for Azure Container Instances in Azure regions 后,我意识到 无法使用 vnet/subnet 创建 Windows 容器实例。
根据该页面中的第一个 table,可以在西欧创建 Windows 个容器实例:
但是,向下滚动到 Availability - Virtual network deployment 部分,我可以看到任何区域都没有对 Windows 容器的虚拟网络支持:
我已经使用 Azure CLI 任务和以下脚本创建了一个 Azure DevOps 管道来创建 Azure 容器实例 (Windows) 的新实例:
az container create \
-g $(BuildAgent.ResourceGroup) \
--name $(BuildAgent.ContainerName) \
--image $(BuildAgent.DockerImage):$(BuildAgent.DockerImageVersion) \
--cpu $(BuildAgent.Cpu) \
--memory $(BuildAgent.Memory) \
--os-type $(BuildAgent.OsType) \
--restart-policy OnFailure \
--vnet $(BuildAgent.VNet) \
--subnet $(BuildAgent.VNetSubnet) \
--registry-username $(BuildAgent.RepositoryUserName) \
--registry-password $(BuildAgent.RepositoryPassword) \
-e \
VSTS_ACCOUNT=$(BuildAgent.VstsAccount) \
VSTS_POOL=$(BuildAgent.AgentPool) \
VSTS_AGENT='$(BuildAgent.ContainerName)' \
--secure-environment-variables \
VSTS_TOKEN='$(BuildAgent.AccessToken)'
任务失败并出现以下错误:
The requested resource is not available in the location 'westeurope' at this moment. Please retry with a different resource request or in another location. Resource requested: '4' CPU '8' GB memory 'Windows' OS virtual network
Docker 文件中的基本图像是 supported(我认为):
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2016
一些注意事项:
- 资源组已经存在
- 我试过不同数量的 cores/memory(例如 2 cores/8GB 或 4 cores/16GB)
- 我有一个类似的管道,它使用相同的资源组和相同的 Azure 容器注册表创建了一个正常工作的 Linux 容器
- VNet 和子网与创建 Linux 容器的管道中使用的相同
我在这里错过了什么?
仔细研究 Resource availability for Azure Container Instances in Azure regions 后,我意识到 无法使用 vnet/subnet 创建 Windows 容器实例。
根据该页面中的第一个 table,可以在西欧创建 Windows 个容器实例:
但是,向下滚动到 Availability - Virtual network deployment 部分,我可以看到任何区域都没有对 Windows 容器的虚拟网络支持: