Background:
I'm a relatively novice programmer and I've been experimenting with creating my own Blazor app and hosting it on Azure for the first time. I've had success creating SWAs on Azure before with Blazor, but my current project is a small demo of a to-do app, so I've been trying to create my first App Service. After little luck in deploying my current project, I decided to start from scratch by deploying the default Blazor template as an App Service to see if I could isolate what was going wrong, and what gaps there were any gaps in my own background knowledge.
Steps Taken:
- Project Initialization:
- Deployment Setup in Visual Studio:
- Navigated to Build > Publish and selected "Azure App Service (Windows)" as the target.
- Configured a new app service in a unique resource group with default settings.
- Set Deployment Type to CI/CD GitHub.
- GitHub Actions and Deployment:
- Monitored the GitHub action until it completed and deployed successfully.
- Upon accessing the deployed site's URL, I encounter a 403.14 Forbidden error, looking at the log stream on Azure I see the following:
Error Details:
HTTP Error 403.14 - Forbidden
You do not have permission to view this directory or page.
The Web server is configured to not list the contents of this directory.
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server. If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
Troubleshooting Conducted:
- Verification of Project Files: Confirmed the existence and integrity of
App.razor
within the untouched default project, which from my understanding is the equivalent of an Index or Host HTML file.
- Kudu Check: Accessed the Azure Kudu console to verify that
web.config
appropriately references the nested "wwwroot" directory, everything seems in order but I'm not sure I have a complete picture of the context for how my directories should appear laid out.
Insight Needed:
Given that the template is unmodified and the deployment settings were set as default, I'm puzzled by where this error stems from. It runs fine on the localhost, so I'm guessing something might be incorrectly configured to find or recognize how to start the web app when deployed on an actual server, but I haven't been able to find anything immediately apparent in the .NET documentation.
Questions:
- Could there be an overlooked setting in Azure or Visual Studio that's crucial for serving the default page of a Blazor project in an App Service environment?
- Why is the "wwwroot" nested in a directory of the same name?
- How does the interactive auto interact with setting up an App Service?
- What context am I missing as a novice to this process?
Any insights or experiences shared would be greatly appreciated, thanks!