Microsoft

AZ-204 Free Practice Questions — Page 4

Question 34

DRAG DROP - You have an Azure Virtual Machine (VM) named VM1 running Windows Server 2022 and an Azure Key Vault instance named kv1. You are developing a .NET application named App1 that you plan to deploy to VM1. You have the following requirements: • App1 will require access to kv1. • The identity used by App1 to access kv1 must be automatically deprovisioned when VM1 is deleted. You need to identify the procedure that will meet the requirements. Which three actions should you include in the procedure? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Illustration for AZ-204 question 34
Show Answer
Correct Answer: Create a system-assigned managed identity for the VM. Modify the access policy on kv1. Retrieve an access token from the Azure Instance Metadata Service endpoint.
Explanation:
A system-assigned managed identity is tied to the VM lifecycle and is deleted automatically with the VM. Granting this identity permissions on the Key Vault allows access, and the application authenticates by requesting a token from the Azure Instance Metadata Service (IMDS) without storing credentials.

Question 35

You develop applications that integrate with a Microsoft Entra tenant. You plan to implement a permission classification in the tenant. You need to select permissions to include in your classification. Which permissions should you select?

A. app-only access permissions that require admin consent
B. delegated permissions that require only user consent
C. app-only access permissions that require only user consent
D. delegated permissions that require admin consent
Show Answer
Correct Answer: B
Explanation:
Microsoft Entra permission classifications currently apply to **delegated permissions that require only user consent**. The classification feature is designed to label low‑risk delegated permissions so users can better understand what they are consenting to. App‑only permissions and permissions requiring admin consent are not supported for permission classification.

Question 36

HOTSPOT - You are developing a web application that makes calls to the Microsoft Graph API. You register the application in the Azure portal and upload a valid X509 certificate. You create an appsettings.json file containing the certificate name, client identifier for the application, and the tenant identifier of the Microsoft Entra ID. You create a method named ReadCertificate to return the X509 certificate by name. You need to implement code that acquires a token by using the certificate. How should you complete the code segment? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 36
Show Answer
Correct Answer: ConfidentialClientApplication scopes
Explanation:
To acquire a token with a certificate, MSAL requires a confidential client. ConfidentialClientApplication is used for app-only authentication with certificates, and acquire_token_silent expects the requested scopes as its first parameter.

Question 37

You have 100 Azure virtual machines (VMs) with the system-assigned managed identity enabled. You need to identify the value of the object ID attribute for each of the identities. Which command should you use?

A. Get-AzureADUser
B. Get-AzResource
C. Get-AzureADUserOwnedObject
D. az ad signed-in-user list-owned-objects
Show Answer
Correct Answer: B
Explanation:
System-assigned managed identities are represented as resource properties on the VM. Using Get-AzResource to list Microsoft.Compute/virtualMachines returns an Identity object that includes the PrincipalId, which is the object ID of the managed identity. The AzureAD and az ad commands relate to users or the signed-in user, not VM-managed identities.

Question 38

You have 100 Azure virtual machines (VMs) with the system-assigned managed identity enabled. You need to identify the value of the object ID attribute for each of the identities. Which command should you use?

A. az ad sp credential list
B. Get-AzVM
C. Get-AzureADUser
D. az resource show
Show Answer
Correct Answer: B
Explanation:
Get-AzVM returns VM objects that include the Identity property for system-assigned managed identities. This property exposes the principalId (object ID) for each VM, and it can be retrieved in bulk for many VMs, making it suitable for 100 VMs. The other options either target different Azure AD objects or require querying resources individually without efficiently listing identities.

Question 39

HOTSPOT - You have an Azure Blob Storage account named account1. You plan to grant permissions for access to blobs in account1 by using a combination of a shared access signature token and a stored access policy. You must set the duration of the token validity by using the stored access policy. You need to complete the configuration of the stored access policy and generate the shared access signature token. Which token setting and token type should you use? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 39
Show Answer
Correct Answer: Permissions Blob container shared access signatures
Explanation:
Stored access policies are supported only with service SAS. For Blob Storage, this means generating a blob container SAS and configuring permissions while the validity period is defined in the stored access policy.

Question 41

DRAG DROP - You manage an Azure subscription associated with a Microsoft Entra tenant named contoso.com. The subscription contains an Azure Blob Storage account named storage1. Your user account has the Contributor Azure role-based access control (RBAC) role within the scope of the subscription. You plan to implement secure access to containers and blobs in storage1. Your solution must satisfy the following requirements: • Authorization requests to access storage1 content must be authenticated by using Microsoft Entra credentials. • Authorized access to storage1 content must be time-limited based on arbitrary values specified when requests are raised. • The principle of least privilege must be satisfied. You need to implement the plan. Which three actions should you perform in sequence? To answer, move the appropriate secure access implementation options from the list of secure access implementations to the answer area and arrange them in the correct order.

Illustration for AZ-204 question 41
Show Answer
Correct Answer: Acquire an OAuth 2.0 token from Microsoft Entra ID. Request a user delegation key. Generate a shared access signature (SAS) token.
Explanation:
Microsoft Entra authentication is required first (OAuth 2.0). The OAuth token is then used to request a user delegation key from the storage account. That key is used to generate a user delegation SAS, which provides time-limited, least-privilege access to blobs and containers.

Question 42

DRAG DROP - You manage an Azure Cosmos DB for a NoSQL API account named account1. You configure account1 with the default consistency level. An application named app1 must access containers in account1 to perform read and write operations. The connections from app1 to account1 must be established by using the direct mode. You plan to configure app1 to override the default consistency level by using the Azure Cosmos DB SDK client. You need to set the maximum consistency level for app1 to use for read and write operations. Which consistency level should you set? To answer, move the appropriate maximum consistency levels to the correct operation types. You may use each maximum consistency level once, more than once, or not at all. You may need to move the split bar between panes or scroll to view content.

Illustration for AZ-204 question 42
Show Answer
Correct Answer: Reads: Session Writes: Session
Explanation:
The account’s default consistency level is Session. An SDK client can override consistency only up to (not stronger than) the account level. Writes are not configurable to a stronger level than the account default. Therefore, the maximum consistency for both reads and writes is Session.

Question 43

HOTSPOT - You have a Dockerfile that builds a container image named image1. The container image and its base image are stored in separate repositories of an Azure Container registry named registry1. The codebase of image1 is stored in a GitHub repo named app1 of an account named account1. You plan to implement automatic updates to image1 whenever its base image is updated or an update to the main branch of the GitHub repo occurs. You need to complete the Azure CLI command that will apply the planned implementation. How should you complete the command? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 43
Show Answer
Correct Answer: acr context
Explanation:
Automatic rebuilds in Azure Container Registry are configured using az acr task create. The acr subcommand is required to define an ACR Task, and the GitHub repository URL must be passed using the --context parameter so the task triggers on source code and base image updates.

Question 44

HOTSPOT - You have an Azure Function app named App1 written in C# and an Application Insights workspace named Workspace1. App is implemented with Application Insights enabled and is configured to send its telemetry to Workspace1. You observe that App1 telemetry collection regularly exceeds monthly quotas of Workspace1. You need to ensure that the telemetry volume remains within the monthly quotas of Workspace1. What should you do? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-204 question 44
Show Answer
Correct Answer: App1: Enable fixed-rate sampling Workspace1: Enable ingestion sampling
Explanation:
Fixed-rate sampling at the app level reduces telemetry volume before it is sent, giving predictable control over data generation. Ingestion sampling at the workspace level discards excess telemetry at ingestion to keep stored data within monthly quotas.

$19

Get all 447 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.