0
votes

I have created an Azure DevOps pipeline to create new instances of Azure container instances (Windows) using an Azure CLI task with the following script:

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)'

Task fails with the following error:

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

Base image in Docker file is supported (I think):

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2016

Some notes:

  • Resource group already exists
  • I've tried with different number of cores/memory (e.g. 2 cores/8GB or 4 cores/16GB)
  • I have a similar pipeline that creates a Linux container that is working correctly, using the same resource group and the same Azure container registry
  • VNet and subnet are the same used in the pipeline that creates a Linux container

What am I missing here?

1
Do you try to use a different location?Charles Xu
@CharlesXu no, I haven't tried a different region - we have everything in West Europe, which is supposed to be supported according to docs.microsoft.com/bs-latn-ba/azure/container-instances/…Rui Jarimba
Maybe you miss something, it supports the image of Windows 2019 with that resource request.Charles Xu
@CharlesXu unfortunately there is no way to create Windows container instances with a virtual network at the moment - see my answer.Rui Jarimba

1 Answers

2
votes

After taking a good look into Resource availability for Azure Container Instances in Azure regions I realised that it's not possible to create Windows container instances with vnet/subnet.

According to the 1st table in that page, it's possible to create Windows containers instances in West Europe:

Azure container instances availability - General

But, scrolling down to the Availability - Virtual network deployment section, I can see that there is no virtual network support for Windows containers in any region:

enter image description here