Search code examples
.netazurevisual-studio.net-corecontainers

Error "MANIFEST UNKNOWN" when publishing a standard ASP.NET Core web app to Azure Container Apps


I installed a clean new Visual Studio 2022 Community edition yesterday and created a new project with the following project template: ASP.NET Core Web App (Razor Pages).

After that I can successfully build and debug the web application locally but I did not make any other changes to the web app in Visual Studio.

As a second step, I wanted to test deploying it to Microsoft Azure as Azure Container App. So I configured this via the Properties of the web app of the Visual Studio project; connected my Azure account and did configure the following:

  • Target > Azure
  • Specific Target > Azure Container Apps (Linux)
  • Container App > Created a new one via wizard in VS
  • Registry > Created a new one via wizard in VS
  • Container Build > .NET SDK
  • Deployment Type > Publish (generates pubxml file)

This all worked and I seem to be able to publish; honestly I would expect that to work since I did not configure anything at all and just used all the defaults there without any code change on the VS project and also setting up publish was straight forward (besides setting a Name for the VS Solution and VS project).

Now when I publish in VS, I get the following popup as error message:

enter image description here

Unfortunately the error log in VS does NOT show any error message. The last lines in build console are:

Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== Build completed at 05:49 and took 39.045 seconds ========== Publish: 1 succeeded, 0 failed, 0 skipped ========== Publish completed at 05:49 and took 39.048 seconds ========== Pushing image to the container app Waiting for container app to be ready... Container app is ready.`

After googling and researching I tried to find the problem or at least a log in Azure. I found one error message in the Azure Container App resource which has been created by my setup process:

The following field(s) are either invalid or missing. Field 'template.containers.mywebname.image' is invalid with details: 'Invalid value: "mynameweb20240616214122.azurecr.io/myname.web:20240617034822": GET https:: MANIFEST_UNKNOWN: manifest tagged by "20240617034800" is not found; map';.

Further research did not lead to a solution for me and I still have the same issue; even after deleting all Azure resources and newly setting up the Visual Studio Publish settings > same result.

Interesting is, that there is a resource in Azure with 20240617034822 but NOT with 20240617034800.

Any help is appreciated, thanks!

In this very simple and 100% out of the box case I expected to be able to publish to Azure Container App with a standard Visual Studio ASP.NET Core web app - being able to deploy successfully to Azure.


Solution

  • You need to enable the container support while creating the template and select Container Build as .NET SDK.

    enter image description here

    • If your app is already set, then you can enable it from the Solution Explorer.

    enter image description here

    enter image description here

    • Check the Manifests in the Container Registry => Repositories.

    enter image description here

    • The below ItemGroup will be included in the .csproj file.
     <ItemGroup>
       <ContainerEnvironmentVariable Include="ASPNETCORE_HTTPS_PORTS">
         <Value>8081</Value>
       </ContainerEnvironmentVariable>
     </ItemGroup>
    

    Output:

    enter image description here