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?