mspnp / AzureNamingTool

The Azure Naming Tool is a .NET 8 Blazor application, with a RESTful API. The UI consists of several pages to allow the configuration and generation of Azure Resource names. The API provides a programmatic interface for the functionality.
https://aka.ms/azurenamingtool
MIT License
308 stars 604 forks source link

500 Error from AppService #38

Closed tirrellcotton closed 7 months ago

tirrellcotton commented 8 months ago

I followed the instructions to deploy as an Azure Web App using Github Actions. Everything deployed as expected, but when I open the web app url I get a 500 error. The only way I can get in is to turn off authentication. Am I missing something? I'm pretty new to Azure so any assistance would be appreciated.

BryanSoltis commented 8 months ago

Hi @tirrellcotton,

Thank you for your feedback. Can you elaborate on the actual 500 error? Enabling the authentication is a highly recommended action so only authorized users can access it. Also, can you let me know the version of the tool you are running?

Thank you. -Bryan

tirrellcotton commented 8 months ago

I've synced with the latest master branch. When I launched the site it asked me to use a Microsoft credential, which I did (that same one that owns my Azure account), then after a few seconds I get a 500 stating that my site "cannot handle this request"

The site has the following authentication settings:

My site is running on Linux, F1 SKU

BryanSoltis commented 8 months ago

If you could provide any logs/error details, I can try and research what would be causing the issue. Here are some guides to help you research/find error logs.

https://learn.microsoft.com/en-us/azure/app-service/overview-diagnostics

https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-http-502-http-503

https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#enable-application-logging-linuxcontainer

-Bryan

tirrellcotton commented 8 months ago

Don't know why I cannot seem to get any logs, but do have a question. When adding the app service via GitHub actions, step 3: Enable Azure Web App Authentication I selected "Microsoft", but what name should I have entered? It seems my issue is with authentication and I feel this is where things may have gone wrong. I entered the same name as my app service, was this correct?

BryanSoltis commented 8 months ago

From a code perspective, there is very little interaction with Authentication, Primarily, the tool just looks for specific headers and if they are present, it enables some functionality. A 500 Error indicates the request got to the server, however, it threw an exception.

If you could provide any screen shots, it would help:

-Bryan

tirrellcotton commented 8 months ago

Here you go, thanks. app auth settings azure 500 error

BryanSoltis commented 8 months ago

OK, thank you for the info. I think seeing the actual 500 error being thrown is critical, as it will specify what the issue is. I would recommend using the links above to investigate the App Service diagnostics. This will be different if you are using a Windows vs Linux App Service.

You may want to create a new app service and try to the process again. Perhaps something got messed up in the initial deployment.

-Bryan

tirrellcotton commented 7 months ago

Redeployed as a Windows app service instead of Linux and that seems to work. Thanks for your time 😊

BryanSoltis commented 7 months ago

Thank you for the update. I have my dev site deployed to a Linux app, so perhaps something just got out of sync on your initial deployment. Glad to hear it's working for you now!