I'm trying to deploy an ASP.NET web app to an Azure Container Instance, but I get this error:
New-AzureRmContainerGroup : The OS version of image 'bwcontainercr.azurecr.io/azurecontainertest:v1' is not supported.
Here are the steps to reproduce it:
File, New, Project, ASP .NET Web Application (.NET Framework)
Using .NET Framework 4.6.1
Type is MVC
Checked Enable Docker Support
Dockerfile contains
FROM microsoft/aspnet:4.7.1-windowsservercore-1709
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} .
I can press F5 and it runs in a local docker container with no issues.
I use this PowerShell to deploy to Azure.
Connect-AzureRmAccount
New-AzureRmResourceGroup -Name "bwcontainertestrg"-Location "EastUS"
$registry = New-AzureRMContainerRegistry -ResourceGroupName "bwcontainertestrg" -Name "bwcontainercr" -EnableAdminUser -Sku Basic
$creds = Get-AzureRmContainerRegistryCredential -Registry $registry
$creds.Password | docker login $registry.LoginServer -u $creds.Username --password-stdin
$image = $registry.LoginServer + "/" + "azurecontainertest:v1"
docker tag "azurecontainertest:dev" $image
docker push $image
$secpasswd = ConvertTo-SecureString $creds.Password -AsPlainText -Force
$pscred = New-Object System.Management.Automation.PSCredential($creds.Username, $secpasswd)
$dnsname = "bwcontainertest-" + (Get-Random -Maximum 99999)
New-AzureRmContainerGroup -ResourceGroup "bwcontainertestrg" -Name "bwcontainertestcg" -Image $image -RegistryCredential $pscred -Cpu 1 -MemoryInGB 1 -DnsNameLabel $dnsname -OsType Windows
It gives me the error above. It seems the base image is not compatible with Azure Container Instances. If I try to deploy it directly I get the same error
New-AzureRmContainerGroup -ResourceGroup bwContainerRG -Name "bwcontainertest-1709cg" -Image microsoft/aspnet:4.7.1-windowsservercore-1709 -RegistryCredential $pscred -Cpu 1 -MemoryInGB 1 -DnsNameLabel "bwcontainertest-1709" -OsType Windows
New-AzureRmContainerGroup : The OS version of image 'microsoft/aspnet:4.7.1-windowsservercore-1709' is not supported.
This is bad, since this image is what it uses when you add docker support in VS.
I've tried a number of different images. This one deploys by itself without my app.
New-AzureRmContainerGroup -ResourceGroup bwContainerRG -Name "bwcontainertest-corecg" -Image microsoft/aspnet:4.7.1-windowsservercore -RegistryCredential $pscred -Cpu 1 -MemoryInGB 1 -DnsNameLabel "bwcontainertest-core" -OsType Windows
So I referenced that image in my app. It builds and runs in a container on my local machine.
I deploy this and it succeeds. But when I go to the URL it gives me a 403 error.
What am I missing here?
TIA, Bill Wolohan