ERROR: Login failed for user '

Leilah Taouk 0 Reputation points
2025-01-13T02:49:18.1433333+00:00

I want to connect my Microsoft Azure Web App to an existing Azure SQL Database. I am using System Assigned Managed Identity. I have added DB_CONNECTION_STRING in App Settings & as a Connection String.

When I try to connect to the Azure SQL Database from my Web Application, I receive the following error: ERROR: Login failed for user '

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,311 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 23,786 Reputation points Microsoft Employee
    2025-01-13T06:07:39.87+00:00

    @Leilah Taouk Thanks for posting your question in Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on the shared information, I understand that you are trying to connect to SQL dB from app service using Managed identity and facing login failed error messages.

    As you are connecting via managed identity there is no need to use the dB connection string in app setting you need to create a user in Sql db as mentioned in this tutorial.

    Modify your code by following the document to connect to SQL dB via C# programmatically.

    Hope this helps, let me know if you have any further questions on this.

    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.