How to Authenticate Azure SQL Server Database from Azure Web Apps

Bina Trivedi 6 Reputation points
2022-10-14T05:02:23.647+00:00

Hii,
I am Deploying my Spring boot application from Azure DevOps Pipeline into the Azure windows web app,
my spring boot application requires a connection with the Azure SQL Database,
Please suggest how I can connect with the azure SQL database from the web app using Azure Active Directory Authentication.
do I need to do any configuration while creating the azure DevOps pipeline during deployment, or any configuration in the azure web app?

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

1 answer

Sort by: Most helpful
  1. Andriy Bilous 10,996 Reputation points MVP
    2022-10-14T06:03:12.96+00:00

    Hello @Bina Trivedi

    I would recommend you to use Azure SQL Database Passwordless Connections as this is the most secured way for DB connection.
    There are simple configurations steps in Azure SQL and Azure App Service:

    • Enable Azure AD authentication with Azure SQL
    • Activate the Managed Identity
    • Create the database user for the created Managed Identity
    • Assign permissions in Azure SQL for a user
    • Use Azure.Identity in Java code