All practice questions
972 questions
A developer is configuring local Git deployment for an Azure App Service web app named `app-hr-prod`. The developer needs to set up deployment credentials, retrieve the Git clone URL, and push the application code from a local repository to Azure.
Which sequence of steps should the developer perform to complete this configuration?
Drag items to arrange them in the correct order
You plan to map a custom domain to an Azure App Service web app and secure it using a free App Service Managed Certificate. You need to configure this using the Azure CLI.
Which sequence of steps should you perform to map the domain and configure the certificate? Arrange the steps in the correct order.
Drag items to arrange them in the correct order
You are deploying a new Azure Function App. You require a hosting plan that scales dynamically and automatically based on the number of incoming events, without requiring manual scale configuration or setting up autoscale metrics. Which of the following hosting plans meet this requirement? (Select TWO)
Select all that apply
You are configuring a deployment workflow on an Azure Virtual Machine (VM). The VM must build a container image locally and push it to a private Azure Container Registry (ACR) named gridregistry. You have created a User-Assigned Managed Identity named acr-pusher-identity and assigned it the AcrPush role on gridregistry. The VM is configured to use this identity. From the VM's command-line interface, you need to authenticate to Azure and push the local image app:v1 to the registry using the user-assigned managed identity. Which command sequence should you execute?
az acr login --name gridregistry
docker tag app:v1 gridregistry.azurecr.io/app:v1
docker push gridregistry.azurecr.io/app:v1
az acr login --name gridregistry
docker tag app:v1 gridregistry.azurecr.io/app:v1
docker push gridregistry.azurecr.io/app:v1
az acr login --name gridregistry.azurecr.io
docker tag app:v1 gridregistry.azurecr.io/app:v1
docker push gridregistry.azurecr.io/app:v1
az acr login --name gridregistry
docker tag app:v1 gridregistry/app:v1
docker push gridregistry/app:v1
You need to deploy a containerized application to Azure Container Instances (ACI). The container image is stored in a private Azure Container Registry (ACR) named `contosoacr`. You must use a user-assigned managed identity named `contoso-aci-identity` to authenticate the container group to pull the image from `contosoacr`. The solution must follow the principle of least privilege. Which sequence of Azure CLI commands should you perform to deploy the container instance?
Drag items to arrange them in the correct order
You are configuring an existing Azure Container App named `my-app` to pull container images from a private Azure Container Registry (ACR) named `myregistry.azurecr.io`. You want to use a User-Assigned Managed Identity for authentication to adhere to the principle of least privilege. What is the correct sequence of steps to configure the container app to use the managed identity and deploy the image?
Drag items to arrange them in the correct order
You are configuring an Azure App Service web app named app-finance to securely retrieve database credentials stored in an Azure Key Vault. You want to use a system-assigned managed identity to authenticate the web app. Which two configurations are required to complete this setup? (Select two.)
Select all that apply
You are deploying a container to Azure Container Instances (ACI) to run a data validation task. The task must run to completion. If the validation script fails with a non-zero exit code, the container must automatically restart to retry the task. If the script succeeds (zero exit code), the container must stop and not restart. Which restart policy should you apply to the container group?
A company hosts a critical Web API on an Azure App Service Web App that currently runs on the Shared (D1) pricing tier. The API experiences sudden CPU spikes during nightly batch processing jobs, leading to performance degradation. You must implement an automated scaling strategy that meets the following requirements:
- Automatically scales out up to 10 instances during high CPU load.
- Scales in to minimize costs when the load subsides.
- Prevents autoscale flapping.
- Minimizes administrative overhead by using the Azure CLI.
Which four actions should you perform in sequence? To answer, move the appropriate 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 deploy an Azure App Service web app named app-sales-prod and enable a system-assigned managed identity. You store a database password in an Azure Key Vault named kv-sales-prod.
To reference the secret in the web app, you create an application setting named DbPassword and configure its value as follows:
@Microsoft.KeyVault(SecretUri=https://kv-sales-prod.vault.azure.net/secrets/db-password/)
When testing the application, you notice the secret is not resolved, and the Key Vault reference status displays as 'Access to Key Vault was forbidden'.
Which of the following actions should you perform to resolve this error?
You are configuring an on-premises CI/CD runner to build and push container images to an Azure Container Registry named corpacr. The runner does not have the Azure CLI installed, and you must minimize additional tool installations. You have created a Microsoft Entra service principal named sp-cicd to authenticate the runner. Which two actions should you perform to configure permissions and authenticate the runner? (Choose two.)
Select all that apply
You are configuring an Azure Function App to retrieve a database connection string from Azure Key Vault using a Key Vault reference in the application settings. Which of the following is a requirement for the reference to resolve successfully?
You are developing a shipment monitoring workflow using C# Azure Durable Functions. The workflow must poll an external shipping provider API every 5 minutes for up to 2 hours, or terminate early if the status becomes 'Delivered'.
You write the following orchestrator function code:
csharp
[FunctionName("MonitorShipmentOrchestrator")]
public static async Task Run(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
string shipmentId = context.GetInput<string>();
DateTime endTime = DateTime.UtcNow.AddHours(2);
while (DateTime.UtcNow < endTime)
{
string status = await context.CallActivityAsync<string>("GetShipmentStatus", shipmentId);
if (status == "Delivered")
{
await context.CallActivityAsync("FinalizeOrder", shipmentId);
return;
}
await Task.Delay(TimeSpan.FromMinutes(5));
}
}
Which set of changes must you apply to the code to ensure that the orchestrator remains deterministic and executes correctly without blocking orchestrator threads?
You are deploying a containerized API application to Azure Container Instances (ACI). The container image is stored in a private Azure Container Registry (ACR). The application must retrieve database connection strings from Azure Key Vault at startup.
You want to implement a secure solution that uses managed identities to authenticate both the image pull from ACR and the secret retrieval from Key Vault, avoiding hardcoded credentials.
You attempt to deploy the container group using a system-assigned managed identity, but the deployment fails with an image pull authorization error.
Which of the following actions should you perform to resolve this deployment failure?
You are developing a Bicep template to deploy an Azure Container App named `order-processor`. The application must dynamically scale using KEDA based on the length of an Azure Service Bus queue named `orders-queue`. The Service Bus namespace is `sb-orders.servicebus.windows.net`.
Security requirements dictate that no connection strings or secrets may be stored within the Container App's settings or configuration. You have created a User-Assigned Managed Identity named `order-processor-identity` with the resource ID `/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity` and assigned it the 'Azure Service Bus Data Receiver' role.
Which Bicep configuration block correctly configures the managed identity at the resource level and the KEDA scale rule to use this identity for passwordless authentication?
type: 'UserAssigned'
userAssignedIdentities: {
'/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity': {}
}
}
properties: {
template: {
scale: {
minReplicas: 1
maxReplicas: 10
rules: [
{
name: 'queue-scaler'
custom: {
type: 'azure-servicebus'
metadata: {
queueName: 'orders-queue'
namespace: 'sb-orders.servicebus.windows.net'
messageCount: '10'
}
identity: '/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity'
}
}
]
}
}
}
type: 'UserAssigned'
userAssignedIdentities: {
'/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity': {}
}
}
properties: {
template: {
scale: {
minReplicas: 1
maxReplicas: 10
rules: [
{
name: 'queue-scaler'
custom: {
type: 'azure-servicebus'
metadata: {
queueName: 'orders-queue'
namespace: 'sb-orders.servicebus.windows.net'
messageCount: '10'
}
identity: 'system'
}
}
]
}
}
}
type: 'UserAssigned'
userAssignedIdentities: {
'/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity': {}
}
}
properties: {
template: {
scale: {
minReplicas: 1
maxReplicas: 10
rules: [
{
name: 'queue-scaler'
custom: {
type: 'azure-servicebus'
metadata: {
queueName: 'orders-queue'
namespace: 'sb-orders.servicebus.windows.net'
messageCount: '10'
}
identity: 'order-processor-identity'
}
}
]
}
}
}
type: 'UserAssigned'
userAssignedIdentities: {
'/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity': {}
}
}
properties: {
template: {
scale: {
minReplicas: 1
maxReplicas: 10
rules: [
{
name: 'queue-scaler'
custom: {
type: 'azure-servicebus'
metadata: {
queueName: 'orders-queue'
namespace: 'sb-orders.servicebus.windows.net'
messageCount: '10'
}
auth: [
{
triggerParameter: 'connection'
secretRef: 'order-processor-identity'
}
]
}
}
]
}
}
}
You are deploying a web application to an Azure App Service web app. The application must retrieve a database connection string stored as a secret named `DbPassword` in an Azure Key Vault named `vault-prod`. You configure a system-assigned managed identity for the web app and grant it the necessary Key Vault access. You need to configure a new application setting in the web app that references this secret. Which of the following application setting values uses the correct syntax to reference the Key Vault secret by vault and secret name?
You need to deploy a container to Azure Container Instances (ACI). The container must mount a persistent volume to store application logs. You decide to use an Azure Files share for the volume. Which three actions should you perform in sequence to deploy the container? To answer, move the appropriate 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 new Azure Function App (V4 runtime) to process background tasks. You must configure the environment to meet the following requirements:
1. Automatically scale instances to handle variable workloads, and scale down to zero instances during periods of inactivity to minimize costs.
2. Ensure that telemetry data is successfully captured and sent to an existing Application Insights instance.
3. Keep the configuration aligned with modern Azure security and SDK guidelines by avoiding deprecated settings.
Which of the following configuration actions should you perform? (Select TWO.)
Select all that apply
An organization runs a CPU-intensive background job processing application on an Azure App Service Web App that currently uses the Basic (B2) pricing tier. During business hours, the processing queue grows rapidly, causing delays. You must implement an autoscaling strategy that automatically scales the application out up to a maximum of instances when CPU utilization spikes, and scales in when demand drops. The solution must minimize monthly hosting costs and prevent autoscale flapping.
Which scaling configuration should you recommend?
You are configuring a custom domain for an Azure App Service web app. You have purchased an SSL/TLS certificate from a third-party certificate authority. You need to configure the web app to use the custom domain secured with this certificate. Which sequence of steps should you perform? Move all actions to the active list and arrange them in the correct order.
Drag items to arrange them in the correct order