Florian Boehmak
Florian Boehmak

Reputation: 501

Deploying ZIP file to Azure App Services not working

I deploy a web app to Azure App Service using zip-deploy:

dotnet build /nologo /p:PublishProfile=Release /p:PackageLocation="c:\Repos\world\world" /p:OutDir="c:\Repos\world\world" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" 

az webapp deployment source config-zip --resource-group <resource-group> --name <app-name> --src world.zip

But the app does not start or is not executed properly, leading to the following error when accessing the application url:

You do not have permission to view this directory or page.

I tried using git-deploy and it works and by going to the URL I see

Hello, world!

I put all the code on GitHub for reference: https://github.com/fnbk/world

More details:

Upvotes: 1

Views: 6626

Answers (2)

nlawalker
nlawalker

Reputation: 6514

The file created with WebPublishMethod=Package is intended for deployment via Web Deploy, which is a very different deployment technology. You need to use dotnet publish instead, and zip the resulting directory yourself.

Upvotes: 1

Ryan Hill
Ryan Hill

Reputation: 1942

I don't think this will work. The zip file that gets created I think isn't mountable for Kudu. I did create a github issue (see https://github.com/dotnet/cli/issues/11254) though but since there are other methods, such as Azure local git, I'm not sure when this issue will get resolve.

Upvotes: 2

Related Questions