All practice questions
972 questions
An API hosted on Azure App Service serves real-time inventory updates via an Azure CDN Standard from Microsoft endpoint. The requests use a query string to specify a store location (e.g., `/inventory/status?storeId=99`). You need to ensure that requests to `/inventory/status` always bypass the CDN cache and fetch the latest inventory data directly from the origin. Other paths on the same endpoint, such as `/assets/images`, must continue to cache assets based on their query strings. Which configuration should you apply to the CDN endpoint to meet these requirements?
You are troubleshooting a startup failure for a web application hosted on a Linux-based Azure App Service. You need to enable container logging, view the logs in real-time to identify the exception, and minimize administrative overhead. Move the actions from the list of actions to the answer area and arrange them in the correct order.
Drag items to arrange them in the correct order
You are deploying a .NET 8.0 web application to an Azure App Service. You want to implement Application Insights Profiler to identify performance bottlenecks and analyze the hot paths of your application's code execution.
Which two configurations or conditions must be met to enable Application Insights Profiler? Select two.
Select all that apply
You are configuring telemetry for an ASP.NET Core web application deployed to Azure Container Apps using the .NET SDK. In your `Program.cs` file, you register the Application Insights services using the following code:
csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddApplicationInsightsTelemetry();
You configure the Container App with an environment variable named `APPINSIGHTS_INSTRUMENTATIONKEY` containing the valid instrumentation key of your Application Insights resource.
After deploying the application, you observe that no telemetry data is being received by Application Insights. There are no exception messages in the application logs, and the application is running successfully.
Which of the following modifications is required to resolve this issue and enable telemetry collection?
You are deploying a C# ASP.NET Core web application to Azure App Service. The application is configured to use a system-assigned managed identity. The application must retrieve a database password from an Azure Key Vault named kv-finance-prod. The Key Vault is configured with the Vault access policy permission model.
The application contains the following C# code to retrieve the secret:
csharp
using System;
using Azure.Identity;
using Azure.Security.KeyVault.Secrets;
// ...
var client = new SecretClient(new Uri("https://kv-finance-prod.vault.azure.net/"), new DefaultAzureCredential());
KeyVaultSecret secret = await client.GetSecretAsync("DbPassword");
During testing, the call to GetSecretAsync fails with a RequestFailedException showing a 403 (Forbidden) error.
Which action should you perform to resolve the authorization issue using the minimum level of privileges?
A company is deploying an automated synchronization service named DeptSync that runs as a daily background task on an Azure virtual machine. The service must connect to Microsoft Graph to update the department and job title properties of all user accounts in Microsoft Entra ID. The service runs without any user interaction.
You need to configure the Microsoft Entra ID application registration for DeptSync to allow the service to authenticate and perform these updates securely using the principle of least privilege.
Which two actions should you perform? (Choose two.)
Select all that apply
You are configuring dead-lettering for an Azure Event Grid subscription that routes events for a customer portal. You must write dead-lettered events to an Azure Blob Storage container named `undelivered-events`. To meet corporate security compliance, you must use a system-assigned managed identity rather than access keys or SAS tokens. Which security configuration is required to allow Event Grid to write the dead-lettered events?
You are deploying a web application to Azure App Service. The application must retrieve database credentials from an Azure Key Vault. To follow organizational security policies, you decide to use a user-assigned managed identity to authenticate the application.
Which of the following actions are required to configure this security solution? (Select TWO.)
Select all that apply
You are developing a C# desktop application using MSAL.NET that will run on Windows 11 client machines. The application must authenticate users against Microsoft Entra ID and support Single Sign-On (SSO) using the native Windows Web Account Manager (WAM) broker. You need to configure the Microsoft Entra ID application registration and the C# initialization code. Which two configuration steps should you perform? Select two.
Select all that apply
A web application running in a Linux-based Azure App Service environment within resource group `rg1` is failing to start up. To diagnose the initialization error, you want to inspect the output sent to standard output (stdout) and standard error (stderr) by enabling local filesystem logging.
Which Azure CLI command should you execute to enable this diagnostic log collection for the app named `webapp1`?
An Azure Resource Manager configuration is being designed to host an API container image stored in a private Azure Container Registry named `acrcat.azurecr.io`. To comply with security guidelines, a dedicated user-assigned managed identity named `acr-reader-identity` has been assigned to the Azure Container App. To successfully pull the container image, which Bicep block must be defined under the `properties.configuration` section of the Container App resource?
{
server: 'acrcat.azurecr.io'
}
]
{
server: 'acrcat.azurecr.io'
identity: acrReaderIdentity.id
}
]
{
server: 'acrcat.azurecr.io'
identity: 'system'
}
]
{
server: 'acrcat.azurecr.io'
identityId: acrReaderIdentity.id
}
]
You are developing a C# gaming service that stores player session state in Azure Cosmos DB using the .NET SDK v3. Initially, the container was partitioned by a low-cardinality property path `/sessionType` (which had a static value of 'ActiveSession' for all items), causing hot partitions and high latency. To resolve this, you re-create the container with the partition key path set to `/playerId`. You need to write a method to upsert a player's session. Which C# code segment should you use?
ItemResponse<PlayerSession> response = await container.UpsertItemAsync<PlayerSession>(
session,
new PartitionKey(session.SessionType)
);
ItemResponse<PlayerSession> response = await container.UpsertItemAsync<PlayerSession>(
session,
new PartitionKey(session.PlayerId)
);
ItemResponse<PlayerSession> response = await container.UpsertItemAsync<PlayerSession>(
session
);
ResourceResponse<Document> response = await client.UpsertDocumentAsync(
UriFactory.CreateDocumentCollectionUri("GameDb", "Sessions"),
session,
new RequestOptions { PartitionKey = new PartitionKey(session.PlayerId) }
);
You are developing a web application that serves static assets from an Azure CDN Standard from Microsoft endpoint. You need to configure the CDN endpoint to automatically redirect all incoming HTTP requests to HTTPS using the CDN's Rules engine. Which five actions should you perform in sequence? To answer, arrange the appropriate actions in the correct order.
Drag items to arrange them in the correct order
You are developing a distributed application on Azure. The application components send telemetry to an Azure Application Insights instance. You need to configure an Azure Monitor Log Search Alert rule to monitor exception rates. The alert must trigger when the number of exceptions in a 15-minute window is greater than 50. When the alert triggers, it must execute a custom remediation API hosted on an Azure Function App. Which two of the following actions should you perform? (Choose two.)
Select all that apply
A developer is configuring an Azure CDN endpoint to distribute web pages for an online learning portal. The portal loads different course pages using a query string, such as `courses.html?courseid=42`. The developer must ensure that the CDN caches a unique version of the page for each individual course ID. Which query string caching behavior should the developer configure on the endpoint?
An organization requires secure delivery of events from an Azure Event Grid system topic to an Azure Service Bus queue. To minimize administration overhead, you need to configure the Event Grid topic with a managed identity whose lifecycle is automatically tied to the Azure resource itself. Which configuration should you apply to the Event Grid system topic?
You are troubleshooting a web application hosted on a Windows-based Azure App Service named `webapp1` in a resource group named `rg1`. You need to enable application logging to the local file system with a Verbose level, and then view the logs in real-time as they are generated. Which two Azure CLI commands should you run to meet these requirements?
Select all that apply
You need to set up availability monitoring for a public website using Application Insights. The test must periodically send an HTTP GET request to the homepage, verify that it returns an HTTP response, and run from multiple global geographic locations. You want to accomplish this with minimal configuration effort and without writing or deploying any custom code. Which monitoring configuration should you use?
You are implementing an end-to-end monitoring and alerting solution for a new API hosted on Azure. You must configure the API to send telemetry to Application Insights, write an efficient Kusto Query Language (KQL) query to analyze exception trends over the past day, and configure an Azure Monitor Action Group to trigger a webhook that requires an API key stored in Azure Key Vault.
Which combination of configurations should you implement to meet these requirements?
You are developing a C# service that periodically updates a shared configuration file stored as a block blob in Azure Blob Storage. To prevent concurrent writes, another process has acquired an active lease on the blob, and the lease ID is stored in a string variable named `currentLeaseId`. Which of the following code segments must you use to successfully overwrite the blob with new data while respecting the active lease?
{
Conditions = new BlobRequestConditions { LeaseId = currentLeaseId }
};
await blobClient.UploadAsync(dataStream, options);
await blobClient.UploadAsync(dataStream, accessCondition);
{
HttpHeaders = new BlobHttpHeaders { LeaseId = currentLeaseId }
};
await blobClient.UploadAsync(dataStream, options);