Your web application hosted on Azure App Service needs to connect to an Azure SQL Database without storing the database connection string (including password) in any configuration file or environment variable. The solution must work without any code changes to the connection string format. Which feature achieves this?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Enable a system-assigned Managed Identity on the App Service and configure the SQL Database to allow that identity via Azure AD authentication, then use the DefaultAzureCredential in the connection string

Managed Identity eliminates the need for credentials entirely. The App Service obtains an Azure AD token automatically using its system-assigned identity, which is then used to aut...

๐Ÿ“‹Part of Microsoft Certified: Azure Developer Associate (AZ-204) ยท Azure Certification Practice
Real Exam ScenarioAzure App Service

Your web application hosted on Azure App Service needs to connect to an Azure SQL Database without storing the database connection string (including password) in any configuration file or environment variable. The solution must work without any code changes to the connection string format. Which feature achieves this?

โœ“ Correct Answer & ExplanationAzure App Service

Correct Answer

Enable a system-assigned Managed Identity on the App Service and configure the SQL Database to allow that identity via Azure AD authentication, then use the DefaultAzureCredential in the connection string

Why This Answer Is Correct

Managed Identity eliminates the need for credentials entirely. The App Service obtains an Azure AD token automatically using its system-assigned identity, which is then used to authenticate to Azure SQL. The connection string uses 'Authentication=Active Directory Managed Identity' โ€” no password required.

๐Ÿ“š What This Question Tests

This question evaluates your knowledge of Azure App Service โ€” a core concept tested in Microsoft Certified: Azure Developer Associate (AZ-204). Understanding Azure App Service is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.