DP-300 Implement a secure environment Practice Question
You are the database administrator for an Azure SQL Database that uses Microsoft Entra ID authentication. A new application must connect to the database using a managed identity. The application runs on an Azure virtual machine. You have assigned the managed identity to the VM. What should you do next to allow the application to authenticate to the database?
⚠ Common exam trap
The trap here is thinking that assigning a managed identity to a VM is sufficient for database access, when in fact a contained database user must be created inside the database to map the identity to a principal.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create a contained database user in the target database that maps to the managed identity and grant the required permissions.
When an application uses a managed identity to connect to Azure SQL Database, the identity must be represented as a contained database user in the target database. The user is created with CREATE USER [identity-name] FROM EXTERNAL PROVIDER, and then permissions are granted. This allows the identity to authenticate and access only the objects it needs, following least privilege. Without this user, the token-based login will not map to a database principal.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add the managed identity as a server-level Microsoft Entra ID administrator.
Why it's wrong here
Adding the managed identity as a server-level Microsoft Entra ID administrator grants it broad administrative rights over the entire logical server, which violates the principle of least privilege. The application only needs specific permissions in one database. This approach would also require changing the server administrator, which is disruptive and not the intended method for application access.
- ✗
Store the managed identity's client secret in Azure Key Vault and configure the application to retrieve it.
Why it's wrong here
Managed identities do not use client secrets; they obtain tokens from the Azure Instance Metadata Service or the identity endpoint. Storing a secret is unnecessary and would not work because the managed identity does not have a secret to store. This option reflects a misunderstanding of how managed identities authenticate and adds complexity without solving the access requirement.
- ✓
Create a contained database user in the target database that maps to the managed identity and grant the required permissions.
Why this is correct
For a managed identity to access Azure SQL Database, you must create a contained database user that represents the identity and then assign permissions. The user is created with the FROM EXTERNAL PROVIDER clause, which maps the identity to a database principal. Without this step, the managed identity can obtain a token but will not have a database user, so authentication will fail at the database level.
- ✗
Enable Microsoft Entra ID authentication on the server and set the managed identity as the server admin.
Why it's wrong here
Microsoft Entra ID authentication is already in use, as stated in the scenario. Setting the managed identity as the server admin would grant excessive privileges and is not required for application access. The correct approach is to create a contained database user rather than elevating the identity to an administrative role, which would be a security risk.
Go deeper
Related to this question
Learn chapter
Managing Identity and Access for Azure SQL
Key term
Azure SQL Performance Tuning
Azure SQL Performance Tuning is the process of optimizing the speed and efficiency of queries and database operations in Microsoft Azure SQL Database or SQL Managed Instance to reduce latency and improve throughput.
Key term
Azure SQL Authentication
Azure SQL Authentication is the process of verifying a user's identity to access an Azure SQL database using either a username and password (SQL Authentication) or a Microsoft Entra ID (formerly Azure AD) identity.
About these practice questions
One of 574 original DP-300 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Microsoft exam blueprint
This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.