All practice questions
972 questions
You configure an Azure Cache for Redis instance for an application. You want to ensure that no keys are ever automatically deleted when the cache reaches its memory limit, and that any write operations fail with an error instead.
Which two options describe the correct configuration parameter or behavior for this scenario?
Select all that apply
An organization has deployed a set of backend microservices. You are provisioning a new Azure API Management (APIM) instance to act as a gateway for these services. You need to configure APIM to send diagnostic telemetry, including request and response details, to an Azure Application Insights instance. What should you do to configure the integration between API Management and Application Insights?
An organization runs a web API on an Azure App Service plan that currently has a capacity of instances. You need to configure Azure Monitor autoscale rules to scale the application. The scale-out rule must add instances when the average CPU percentage over a -minute time window exceeds . To prevent resource flapping while optimizing costs, you must configure a scale-in rule that decreases the instance count by when CPU usage drops. Which configuration successfully supports custom autoscale rules and prevents rule flapping?
An organization hosts a critical Web API on an Azure App Service. You are tasked with implementing a monitoring and alerting strategy using Azure Monitor.
The API must trigger an alert whenever its average response time exceeds 500 milliseconds over a rolling 5-minute window. When the alert fires, it must notify the support team via email and automatically invoke an Azure Function app containing a custom diagnostics logging script. The solution must minimize administrative overhead and avoid hardcoded credentials or manual key rotation.
Which two configurations should you implement to meet these requirements? Select two.
Select all that apply
You are developing a .NET background service using the Azure Cosmos DB .NET SDK v3. The service uses the Change Feed Processor to monitor product catalog updates in a source container and synchronize them to an Azure Cognitive Search index. You need to provision a new lease container in Azure Cosmos DB to store the state of the Change Feed Processor. Which partition key path must you define when creating the lease container to ensure the Change Feed Processor can initialize and run?
You are designing a serverless solution in Azure. You have an Azure Cosmos DB container named Orders. You deploy two separate Azure Functions, ProcessInvoice and UpdateInventory, within the same Function App. Both functions are triggered by changes in the Orders container using the Azure Cosmos DB trigger (CosmosDBTrigger). You configure both triggers to share a single lease container named leases to minimize resource consumption.
During testing, you observe that the two functions compete for partition leases, resulting in each update being processed by only one of the functions, rather than both. You need to ensure that both functions independently process every change feed event from the Orders container.
Which configuration action should you perform?
A digital publishing company is building a newsletter distribution system. They use an Azure Service Bus queue named `newsletter-campaigns` to manage subscriber email campaigns. They require that if a sending service instance fails while processing a newsletter message, the message must be automatically returned to the queue so that another instance can attempt to process it.
Which configuration or method should you use to meet this requirement?
An independent software vendor (ISV) is registering a new multi-tenant line-of-business application in Microsoft Entra ID. The application is designed to allow employees from any enterprise customer to log in with their work credentials, but it must reject sign-in attempts from personal Microsoft accounts.
Which configuration should the developer apply to the application manifest and the application's authentication endpoint?
You are deploying a new Azure Cache for Redis instance to store session data. To ensure that the cache has sufficient memory allocated for replication and synchronization overhead between primary and replica nodes, you must configure a dedicated memory reserve. Which configuration setting should you adjust?
You are designing a C# backend service to update a custom metadata tag on a blob in Azure Blob Storage. The target blob is currently protected by an active write lease. The operation must be authenticated using a Shared Access Signature (SAS) token adhering to the principle of least privilege, and the updated metadata value must be verified immediately after. Which C# code segment should you use to successfully perform this operation?
sas.SetPermissions(BlobSasPermissions.Read | BlobSasPermissions.Write);
var client = new BlobClient(blobUri, sas.ToSasQueryParameters(credential));
await client.SetMetadataAsync(new Dictionary<string, string> { { "Department", "Finance" } }, new BlobRequestConditions { LeaseId = leaseId });
var dept = (await client.GetPropertiesAsync()).Value.Metadata["department"];
sas.SetPermissions(BlobSasPermissions.Read | BlobSasPermissions.Write);
var client = new BlobClient(blobUri, sas.ToSasQueryParameters(credential));
await client.SetMetadataAsync(new Dictionary<string, string> { { "Department", "Finance" } });
var dept = (await client.GetPropertiesAsync()).Value.Metadata["department"];
sas.SetPermissions(BlobSasPermissions.Read | BlobSasPermissions.Write);
var client = new BlobClient(blobUri, sas.ToSasQueryParameters(credential));
await client.SetMetadataAsync(new Dictionary<string, string> { { "Department", "Finance" } }, new BlobRequestConditions { LeaseId = leaseId });
var dept = (await client.GetPropertiesAsync()).Value.Metadata["Department"];
sas.SetPermissions(BlobSasPermissions.All);
var client = new BlobClient(blobUri, sas.ToSasQueryParameters(credential));
await client.SetMetadataAsync(new Dictionary<string, string> { { "Department", "Finance" } }, new BlobRequestConditions { LeaseId = leaseId });
var dept = (await client.GetPropertiesAsync()).Value.Metadata["department"];
You are deploying a set of containerized microservices to an on-premises Docker environment. You want to use an existing Azure API Management (APIM) instance in the cloud to manage and secure these on-premises microservices. You decide to provision a self-hosted gateway.
Which of the following actions must you perform to configure and run the self-hosted gateway? (Select TWO)
Select all that apply
A telemetry processing application runs as a C# worker service on Azure Container Apps. The application uses the EventProcessorClient from the Azure.Messaging.EventHubs.Processor library to consume messages from an Azure Event Hub and uses an Azure Blob Storage container for checkpointing. The Container App is configured to use a user-assigned managed identity. During testing, you observe that partition ownership cannot be established, and checkpointing fails with access and lease errors. Which two actions must you perform to configure the storage client and resolve these issues? (Select two.)
Select all that apply
An enterprise application stores user profile updates in an Azure Cosmos DB container named Profiles. You need to implement two separate microservices using the .NET SDK v3: one to update a search index, and another to send welcome emails. Both microservices must process all change feed notifications from the Profiles container independently. You plan to use a single shared container named leases to store the lease state.
Which two of the following configuration steps must you perform to ensure both microservices process all changes?
Select all that apply
You are deploying an ASP.NET Core web application to an Azure App Service. The application must securely retrieve a database password stored as a secret in Azure Key Vault. You decide to use a system-assigned managed identity and Key Vault references to configure the application.
Which sequence of steps should you perform to configure the Azure resources and the App Service to resolve the secret?
Drag items to arrange them in the correct order
An operations engineer needs to implement a message consumer in C# for Azure Queue Storage using the modern Azure.Storage.Queues SDK. The consumer must acquire a message, process it, and then immediately delete it from the queue.
Complete the C# code snippet below by filling in the blanks. What are the correct asynchronous method names to retrieve and delete the message?
Fill in the blanks below
QueueClient queueClient = new QueueClient(connectionString, "work-items");
// Retrieve the message
QueueMessage[] messages = await queueClient.(maxMessages: 1);
if (messages.Length > 0)
{
QueueMessage message = messages[0];
// Process the message...
// Permanently remove the message from the queue
await queueClient.(message.MessageId, message.PopReceipt);
}
You are developing a .NET application that will write data to a newly provisioned Azure Cache for Redis instance. You need to connect to the cache and write a test key-value pair using the StackExchange.Redis library. Which sequence of steps should you perform? To answer, arrange the actions in the correct order.
Drag items to arrange them in the correct order
An application named App1 needs to be configured in Microsoft Entra ID. The application will be consumed by multiple external business partners who use their own corporate Entra ID directories, alongside external consultants who will sign in using their personal Microsoft accounts.
Which two configurations are required to support this authentication requirement? (Select two.)
Select all that apply
An organization hosts a retail web application on an Azure Virtual Machine Scale Set (VMSS) with a minimum instance count of and a maximum instance count of . You configure a scale-out rule that increases the instance count by instances when the average CPU Percentage is greater than . You need to configure a scale-in rule to reduce the instance count when demand drops. Which of the following scale-in configurations will prevent autoscale flapping? (Select two.)
Select all that apply
A C# application updates the custom metadata of an Azure Blob Storage block blob that has an active write lease. You are using the Azure.Storage.Blobs SDK (version 12) to add a metadata key-value pair of 'status' and 'processed'. Which of the following actions are required to complete this operation successfully without triggering exceptions? (Select TWO)
Select all that apply
You are configuring a custom domain for the gateway endpoint of an Azure API Management (APIM) instance. The TLS certificate for the custom domain is stored in an Azure Key Vault. You want to use the system-assigned managed identity of the APIM instance to authorize access to the Key Vault. Which of the following describes the correct set of actions to configure the custom domain?