You do not have permission to view this directory or page
this error usually happens when:
Your web app is pointing to the wrong directory.
I use below commands to successfully deploy my Web app using Azure Cli.
- Run the following command to generate the required files for publishing:
dotnet publish -c Release -o <output-folder>
- Log in to your Azure account by running:
az login
- Before deploying, zip the
<output-folder>
generated in step 1. - Deploy the zipped file to Azure using the following command:
az webapp deploy --resource-group <ResourceGroupName> --name <WebAppName> --src-path <ZipPath>
After running the above command, your app will be successfully deployed to Azure.
Check the Kudu Console for where your files are deployed in Azure App service using below URL:
https://<WebAppName>.scm.canadacentral-01.azurewebsites.net/DebugConsole
In my case my files are under site -> wwwroot -> publish:
I changed the virtual path from site\wwwroot
to site\wwwroot\publish
by navigating to:
Azure Web App -> Configuration -> path Mapping -> Virtual Path -> Edit - > Ok -> save:
By following above steps, It Avoid you don't have permission error.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.