Unable to connect the sql server using windows authentication from asp.net application

Thyagarajulu B M 121 Reputation points
2023-09-06T08:04:26.6666667+00:00

Hi Team,

Please find the details below.

Current Infrastructure Setup:

  1. AzurewebappVM
  2. AzureDBVM
  3. Created new Windows domain account (ABC\Test) in the on-premises Active directory.
  4. Merged on-premises activity directory and Azure Active Directory with the help of Azure AD Connect

Database Access:

We have added the ABC\Test Windows account to the SQL server on Azure VM and provided the required databases access.

Issue:

When we are trying to connect the SQL server on an Azure VM using Windows authentication from asp.net application in the Azure Web app, we are getting an error.

Kindly help us on this issue. Are we taking the right approach to connecting the SQL server?

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

1 answer

Sort by: Most helpful
  1. Ben Gimblett 4,560 Reputation points Microsoft Employee
    2023-09-07T10:35:43.6266667+00:00

    Hi thanks for the question
    Az App Service does not support Windows Authentication (it's the same for most PaaS services)

    You do have the option of using AAD Auth here as per https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/configure-azure-ad-authentication-for-sql-vm?view=azuresql&tabs=azure-portal
    App service supports managed identities - so if it's App to app you need then using a user-assigned or system-assigned MSI toward SQL on the VM would be preferable


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.