Angular, ASP.NET CORE, SQL SERVER, API and DB hosted on Azure 500 error

hpbcrowe 51 Reputation points
2025-03-06T03:07:25.9466667+00:00

Hi,

I have my ASP.NET CORE hosted on Azure, the SQLServer DB is also hosted on Azure. Before deploying the Angular front end I decided to test it to see if it would hit the deployed backend and database. I was getting a CORS error but, now that I have resolved that I am getting a 500 error.

User's image

Where can I check in Azure to see what the 500 error means?

I am thinking that it might have something to do with the following?

When I published the API using Visual Studio it showed at the bottom that I had 2 dependencies from the code I deployed:

User's image

I was able to connect the Azure SQL Database but I can't figure out how to connect to the Microsoft Identity platform. When I click the more ... button to the left it just gives the option to connect but when I click on that it does nothing.

User's image

Is there something I need to set up on Azure to configure Identity. I already shared the connection string for the web API with the database.

Here are the web and app log streams:

IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly. <li>IIS was not able to process configuration for the Web site or application.</li> <li>The authenticated user does not have permission to use this DLL.</li> <li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Screenshot 2025-03-07 222200

</li>

Developer technologies ASP.NET ASP.NET Core
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2025-03-08T20:56:23.3333333+00:00

    The identity platform configuration is done in entra id where you configure the application. The assumption is you are using msal for angular.

    https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-single-page-app-sign-in?pivots=workforce&tabs=angular-workforce%2Cjavascript-external#add-a-platform-redirect-uri

    Your 500 error is the application crashing. You appear to be using windows and IIS so the web.config should be configuring the asp.net core hosting module.


1 additional answer

Sort by: Most helpful
  1. hpbcrowe 51 Reputation points
    2025-03-23T03:44:16.17+00:00

    I finally was able to get my deployed Back End Services to connect to my deployed Azure SQL DB. I did a few things. I am not sure which exact item fixed my 500.0 error I was receiving.

    1. I read in the Microsoft documentation that if both your service and your database were in Azure you didn't need to put the IPV4 output range for the Web Api as a firewall rule for the DB server. You can enter 0.0.0.0 for the start and end 0.0.0.0
    2. The second thing I changed was I had been using the service connector in addition to putting a connection string in my appsettings.json. I deleted those connections in the service connector and in Visual Studio.

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

    1. I had forgotten that every time I changed to a different connection string and then published the app again it didn't overwrite the service dependencies, it created additional service dependency files.

    So I deleted all of the service dependencies and any additional files created by publishing to Azure. I discarded the changes in my Git version control in VSCode. I made sure I had the first option connection string for ADO.NET (Microsoft Entra passwordless authentication) I made sure I created an admin in the Microsoft Entra Id following these instructions: Microsoft Entra Id Instructions Then I gave the DB access to it.

    I then published that and it worked!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.