All practice questions
972 questions
An API gateway implemented via Azure API Management (APIM) needs to forward requests to a backend microservice secured by Microsoft Entra ID. The APIM instance is configured with a user-assigned managed identity named `apim-identity`. The backend service expects an Entra ID access token from this specific managed identity. Which policy configuration should you apply to authenticate requests using this user-assigned managed identity?
You are developing a C# console application that needs to authenticate users using the Microsoft Identity Platform. The application must support signing in users from any Microsoft Entra ID tenant, but must explicitly prevent users with personal Microsoft accounts (such as Xbox, Outlook.com, or Skype accounts) from signing in.
You have the following C# code to build the public client application:
csharp
var app = PublicClientApplicationBuilder.Create(clientId)
.WithAuthority(authority)
.WithRedirectUri(redirectUri)
.Build();
Which value should you assign to the `authority` variable?
A developer is designing a distributed caching system using Azure Cache for Redis to store product catalog data for a highly concurrent e-commerce platform. The system must implement the Cache-Aside pattern, prevent race conditions during concurrent database updates, and prevent memory exhaustion under high load. Which two practices should the developer implement? (Select two).
Select all that apply
You are configuring database persistence for a newly provisioned Azure Cache for Redis instance in the Premium tier to ensure data can be recovered in the event of a cache failure. You decide to implement Redis database (RDB) persistence.
Which sequence of steps must you perform in the Azure Portal to configure and enable RDB persistence?
Drag items to arrange them in the correct order
You are developing a logistics tracking application that processes real-time location updates from delivery vehicles. To maintain the correct timeline of movements, updates for each vehicle must be processed in the exact chronological order they are received. You configure an Azure Service Bus queue with session support enabled.
You need to write the C# code using the Azure.Messaging.ServiceBus SDK to read these messages reliably. If a processing node fails, the message must not be lost.
Which approach should you use to instantiate and configure the receiver?
You are developing a secure C# application using the Azure.Storage.Blobs SDK (v12) to generate a User Delegation SAS token. An external client requires temporary, read-only access to a specific blob named "backup.bak" in a container named "db-backups".
The security requirements are as follows:
- Access must be restricted to HTTPS only.
- Access must be restricted to the client's IP address "203.0.113.88".
- The token must account for potential client-server clock desynchronization (clock skew).
- The token must grant only the minimum necessary permissions.
You write the following code:
csharp
var sasBuilder = new BlobSasBuilder
{
BlobContainerName = "db-backups",
BlobName = "backup.bak",
Resource = [PLACEHOLDER_RESOURCE],
StartsOn = [PLACEHOLDER_START],
ExpiresOn = DateTimeOffset.UtcNow.AddHours(2),
Protocol = [PLACEHOLDER_PROTOCOL],
IPRange = [PLACEHOLDER_IP]
};
sasBuilder.SetPermissions([PLACEHOLDER_PERMISSIONS]);
Which set of properties correctly configures the BlobSasBuilder to meet the security requirements?
You maintain a Premium tier Azure Cache for Redis instance that supports a high-throughput data processing application. The application frequently writes, updates, and deletes large, complex serialized objects. During peak loads, the hosting virtual machines experience out-of-memory (OOM) crashes, even though the Used Memory metric reported by the cache remains below the allocated maxmemory limit. You observe that the memory fragmentation ratio is high. You need to configure the cache to prevent these VM-level OOM crashes by forcing Redis to perform evictions or fail writes before physical memory is exhausted. Which configuration setting should you adjust?
You are developing a containerized API that will run on Azure Container Instances. The container groups are frequently created, destroyed, and recreated via automated workflows. The API must authenticate to the Microsoft Identity Platform to retrieve configuration keys from Azure App Configuration. You must ensure that recreating the Container Instances does not require updating permission grants in Azure App Configuration. Which two configurations should you implement? (Select two.)
Select all that apply
A gaming company uses an Azure Cache for Redis instance to store real-time leaderboard statistics and user session states. The leaderboard keys must persist indefinitely and are not configured with a Time-to-Live (TTL). The user session keys are configured with a sliding TTL. During peak gaming events, the cache reaches its memory limit, causing write operations to fail. You need to configure the cache to automatically evict the user session keys that are accessed the least frequently to free up memory, while ensuring that the leaderboard keys are never evicted. Which eviction policy should you configure to meet these requirements?
You are developing a solution that stores sensitive media files in an Azure Blob Storage container named mediafiles. You need to grant a partner application temporary access to read and list the blobs in this container. The security requirements state that you must be able to revoke this access immediately if a compromise occurs, without rotating the storage account keys or affecting other SAS tokens.
Which two actions should you perform to implement this security requirement?
Select all that apply
You are developing a C# console application to consume messages from an Azure Service Bus queue using the Azure.Messaging.ServiceBus SDK. You need to initialize, execute, and cleanly terminate a ServiceBusProcessor to process messages asynchronously. Which of the following sequences represents the correct chronological order of steps required to achieve this?
Drag items to arrange them in the correct order
Your company is configuring SSL/TLS certificates for a web application and wants to automate the certificate renewal lifecycle using an integrated Certificate Authority (CA) partner, DigiCert. You need to configure Azure Key Vault to automatically request and renew certificates from DigiCert. Which sequence of actions must you perform to configure the integrated certificate auto-renewal?
Drag items to arrange them in the correct order
You are configuring policies for an Azure API Management (APIM) gateway that routes requests to a backend microservice. You must meet the following requirements:
1. Authenticate the gateway to the backend microservice by using the APIM instance's system-assigned managed identity to acquire a Microsoft Entra ID token.
2. Strip the X-Powered-By header from the response returned by the backend microservice before the response is sent back to the clients.
Which policy configuration should you use?
<inbound>
<base />
<authentication-managed-identity resource="https://graph.microsoft.com" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
<set-header name="X-Powered-By" exists-action="delete" />
</outbound>
<on-error>
<base />
</on-error>
</policies>
<inbound>
<base />
<authentication-managed-identity resource="https://graph.microsoft.com" />
<set-header name="X-Powered-By" exists-action="delete" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
<inbound>
<base />
<authentication-managed-identity resource="https://graph.microsoft.com" client-id="87654321-4321-4321-4321-210987654321" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
<set-header name="X-Powered-By" exists-action="delete" />
</outbound>
<on-error>
<base />
</on-error>
</policies>
<inbound>
<base />
<set-header name="Authorization" exists-action="override">
<value>@("Bearer " + {{vault-token}})</value>
</set-header>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
<set-header name="X-Powered-By" exists-action="delete" />
</outbound>
<on-error>
<base />
</on-error>
</policies>
You are designing an ASP.NET Core Web API that is called by a web-based front-end client application. The Web API needs to request data from a downstream reporting database service. To comply with data privacy policies, the requests to the downstream service must execute under the security context of the specific user who logged into the front-end application, allowing the reporting service to audit access by individual user accounts. Which authentication flow and client application type should you implement in the Web API to meet these requirements?
An application uses Azure Cache for Redis to store both temporary catalog search results and active shopping cart details. The transient catalog search results are configured with a defined Time-to-Live (TTL), while the shopping cart details are stored without a TTL. During periods of peak traffic, the cache memory becomes fully utilized. You must ensure that the Redis instance evicts the catalog search results based on a least-recently-used (LRU) algorithm when the memory limit is reached, while preserving all shopping cart details. In addition, you must reserve memory for replication and fragmentation overhead to prevent out-of-memory (OOM) conditions.
Which two configuration settings should you configure to meet these requirements?
Select all that apply
A hotel reservation system uses an Azure Service Bus queue named `reservation-bookings` to process guest bookings. The processing application must ensure that booking requests are not lost if the application crashes during database updates.
You write a C# worker service using the `Azure.Messaging.ServiceBus` SDK to process these messages.
Which approach should you use to guarantee at-least-once delivery and processing of the booking messages?
You are developing a C# .NET 8 console application that runs on-premises and needs to manually send custom exception reports to Azure Application Insights. You retrieve the connection string from a secure local store.
You write the following code:
csharp
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Extensibility;
var connectionString = GetSecureConnectionString();
var configuration = TelemetryConfiguration.CreateDefault();
// INSERT CODE HERE
var telemetryClient = new TelemetryClient(configuration);
You need to complete the code to ensure that the Application Insights SDK is properly initialized and telemetry data is transmitted to the correct Azure resource. Which line of code should you insert?
Complete the Azure API Management (APIM) policy snippet to append or replace a query parameter in the backend request with the client's subscription ID.
Fill in the blanks below
Complete the XML policy configuration by filling in the blanks.
xml
<inbound>
<base />
< name="client-id" exists-action="">
<value>@(context.Subscription.Id)</value>
</>
</inbound>
A developer is configuring a C# ASP.NET Core web application hosted on an Azure App Service. The application must retrieve a database connection string stored in an Azure Key Vault named kv-prod using a Key Vault reference in the App Service configuration. The App Service is configured with a system-assigned managed identity. Which configuration should the developer apply to retrieve the secret value successfully?
You are developing a C# background worker service that runs on an on-premises server. The service must periodically query a secured downstream web API without any user interaction. You register the service in Microsoft Entra ID as a daemon application. You need to write code using MSAL.NET to acquire an access token for the downstream API.
Which two code segments should you use to instantiate the application client and acquire the token? (Select two.)
Select all that apply