All practice questions
972 questions
You are defining an Azure Container App named `order-processor` within an Azure Resource Manager Bicep template. The container app has the following deployment requirements:
1. It must pull its container image from a private Azure Container Registry named `myregistry.azurecr.io` using a user-assigned managed identity. The identity's resource ID is `/subscriptions/.../resourceGroups/.../providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity`.
2. It must accept public HTTPS traffic from the internet on port 8080 using the HTTP/2 transport protocol.
3. It must scale between 2 and 10 replicas based on average CPU usage.
Which of the following configuration blocks must be defined inside the `properties.configuration` section of the Bicep template to satisfy the registry credentials and ingress requirements? (Select TWO)
Select all that apply
{
server: 'myregistry.azurecr.io'
identity: '/subscriptions/.../resourceGroups/.../providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity'
}
]
external: true
targetPort: 8080
transport: 'http2'
}
{
server: 'myregistry.azurecr.io'
identity: 'system'
}
]
public: true
port: 8080
protocol: 'http2'
}
You are designing an Azure Blob Storage lifecycle management policy for a Standard General Purpose v2 (GPv2) storage account. The policy must automatically transition block blobs to the Cool tier if they have not been modified for 30 days. Additionally, the policy must only apply to blobs that have been tagged with a Blob Index tag where the key is `ArchiveStatus` and the value is `Ready`.
Which of the following JSON policy definitions should you use?
"rules": [
{
"enabled": true,
"name": "move-to-cool",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"blobIndexMatch": [
{
"name": "ArchiveStatus",
"op": "==",
"value": "Ready"
}
]
}
}
}
]
}
"rules": [
{
"enabled": true,
"name": "move-to-cool",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"blobIndexMatch": [
{
"Name": "ArchiveStatus",
"Op": "==",
"Value": "Ready"
}
]
}
}
}
]
}
"rules": [
{
"enabled": true,
"name": "move-to-cool",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"blobIndexMatch": [
{
"name": "ArchiveStatus",
"op": "==",
"value": "Ready"
}
]
},
"leaseAction": "ignoreActiveLease"
}
}
]
}
"rules": [
{
"enabled": true,
"name": "move-to-cool",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"blobIndexMatch": [
{
"name": "ArchiveStatus",
"op": "==",
"value": "Ready"
}
],
"sasTokenScope": "rwd"
}
}
}
]
}
You manage a web application named ShipRoute that is currently hosted on a Basic () App Service plan. During seasonal promotions, the application experiences high CPU utilization. You must configure autoscale rules to automatically increase the instance count by when the average CPU Percentage is greater than for minutes. You also need to scale in the application by decreasing the instance count by when CPU utilization drops, while ensuring that the scale-in action does not immediately trigger flapping when the instance count scales out from to .
What configuration should you apply?
You are developing a .NET application that stores user session data in an Azure Cosmos DB container. The container's partition key path is set to `/userId`. You need to perform point operations using the Azure Cosmos DB .NET SDK v3 to read and update a user's session data. To ensure session-level consistency across multiple independent clients, you must pass the session token obtained from the writer client to the reader client. Assuming `container` is a valid `Container` instance, `sessionData` is a populated `SessionData` object, and `writerSessionToken` is the session token from the writing client, which two of the following C# statements should you use to perform these operations? (Select two.)
Select all that apply
An application needs to assign custom metadata to an Azure Blob Storage container. You write C# code using the Azure.Storage.Blobs SDK (v12) to define the metadata. You want to store a custom key named Environment with the value Production.
Which of the following code snippets correctly defines the metadata dictionary?
{
{ "x-ms-meta-Environment", "Production" }
};
{
{ "Environment", "Production" }
};
{
{ "x-ms-meta-environment", "Production" }
};
{
{ "metadata-Environment", "Production" }
};
You are developing a document migration solution using Azure Durable Functions. The workflow uses a Fan-out/Fan-in pattern to process documents concurrently. One of the activity functions performs optical character recognition (OCR) on large PDF files; this task is CPU-intensive and can take up to 20 minutes to complete. The function app must also access files stored in an Azure Storage account that is secured behind a private endpoint inside an Azure Virtual Network.
You need to choose the most cost-effective hosting plan and configuration that meets these requirements.
Which hosting plan and configuration should you select?
You are developing a web API using Azure Functions. The API contains two HTTP-triggered functions: a function named GetProducts that retrieves public product catalog data, and a function named UpdateInventory that performs administrative inventory modifications. You must deploy these functions to a single Azure Function App. The security requirements are as follows: clients must be able to call GetProducts without providing any credentials or API keys; clients calling UpdateInventory must provide an API key, but you must minimize permissions and avoid using the master host key. Which configuration should you apply to the HTTP triggers to meet these requirements?
You are planning to deploy a containerized application to Azure Container Instances (ACI). The container requires access to a persistent volume hosted on an Azure File Share. You decide to use the Azure CLI to provision the resources and deploy the container. Which sequence of steps should you perform to create the storage resources and deploy the container with the mounted volume?
Drag items to arrange them in the correct order
A sports platform manages live match telemetry. Each match has a unique matchId. The platform stores match events (such as goals, penalties, and player substitutions) as separate documents in an Azure Cosmos DB for NoSQL container.
The application must meet the following requirements:
- Guarantee ACID compliance when executing updates on multiple event documents belonging to the same match using transactional batches.
- Avoid hot partitions during peak hours when many live matches are played simultaneously.
- Maintain high write throughput to handle real-time event ingestion.
Which property should you configure as the partition key for the container?
You need to use the Azure CLI to create a new application registration in Microsoft Entra ID, instantiate its service principal, and grant the service principal Contributor access to a resource group.
Which sequence of commands should you perform? To answer, move all 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 developing a solution that processes updates from an Azure Cosmos DB container using the .NET SDK v3 Change Feed Processor. The solution uses a monitored container and a lease container.
What is the primary purpose of the lease container?
You are deploying a new Azure Container App named `shipment-processor` to an Azure Container Apps environment. The container image is stored in a private Azure Container Registry (ACR) named `contosoregistry.azurecr.io`.
Security policies prohibit enabling the admin user on the ACR. You must configure the Container App to pull the image from the ACR using a managed identity with the least privilege.
You want to perform this deployment in a single CLI command execution without using temporary public images or bootstrap steps.
Which of the following approaches should you use to achieve this goal?
A logistics company is building a real-time shipment tracking application. You are developing a REST API hosted in Azure App Service that will subscribe to transit update events from an Azure Event Grid custom topic. The REST API must receive events via a Webhook endpoint and securely authorize Event Grid to write dead-letter events to a private Azure Storage account.
Which two of the following configuration tasks or code implementations must you perform to establish the connection and handle validation?
Select all that apply
An organization hosts a processing-heavy application named FlightDataAnalyzer on an Azure App Service Web App. The application currently runs on a Standard (S2) App Service plan. During daily data aggregation runs at 04:00 UTC, the application experiences a rapid spike in memory usage, causing performance degradation. You want to implement an autoscale setting with a scale-out rule that increases the instance count by 1 when the Memory Percentage exceeds . To minimize costs, you must also define a scale-in rule that decreases the instance count by 1 when load drops, while ensuring the system does not experience flapping when scaling between 1 and 2 instances. Which two configurations should you apply to meet these requirements? (Select TWO.)
Select all that apply
You are configuring a lifecycle management policy for a Standard General Purpose v2 (GPv2) storage account to automate data tiering for diagnostic logs. The logs are stored as block blobs.
You define the following JSON policy rule:
{
"rules": [
{
"enabled": true,
"name": "ArchiveAndCleanupLogs",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 30
},
"delete": {
"daysAfterModificationGreaterThan": 90
}
}
},
"filters": {
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"logs/daily"
],
"blobIndexMatch": [
{
"name": "environment",
"op": "==",
"value": "production"
}
]
}
}
}
]
}
Which two of the following statements regarding the behavior, configuration, and execution of this policy are correct?
Select all that apply
You are developing a .NET application using the Azure Cosmos DB .NET SDK v3 to manage configuration settings for smart electricity meters. The container uses `/meterId` as its partition key.
You need to write a method that updates a meter's configuration status (updating an existing item) and creates a status transition audit log entry (creating a new item) for the same meter. Both operations must succeed or fail together as a single atomic unit. You must also implement Optimistic Concurrency Control (OCC) for the status update to prevent overwriting concurrent updates.
You have the following partially completed method:
csharp
public async Task<bool> UpdateMeterStatusAndLogAsync(
Container container,
string meterId,
MeterStatus updatedStatus,
string expectedETag)
{
// Initialize the transactional batch
// Add the status update operation using OCC
// (Remaining operations to add the audit log and execute the batch are implemented elsewhere)
}
Which two code segments should you use to perform these actions? (Select two.)
Select all that apply
An organization is developing a globally distributed collaborative document editing application. The database is hosted on an Azure Cosmos DB Core (SQL) API account configured with two write regions (East US and West US) and multi-region writes enabled.
A background analytical microservice has independent instances running in both regions to process document updates. These worker instances do not share a client session or session tokens.
The application requirements are as follows:
- The worker instances must always read document updates in the exact order they were written.
- The configuration must minimize write latency and consume the fewest Request Units (RUs).
You need to configure the Cosmos DB account and application.
Which two actions should you perform? (Select two.)
Select all that apply
You are developing a C# application using the Azure.Storage.Blobs SDK (v12). You need to add a new custom metadata tag to an existing blob while preserving all existing metadata on that blob. How should you order the steps to perform this update?
Drag items to arrange them in the correct order
You are developing a lifecycle management policy for a Standard General Purpose v2 (GPv2) storage account to automate data tiering for telemetry log blobs. The storage account is configured with the following policy:
{
"rules": [
{
"name": "cool-rule",
"enabled": true,
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 14
}
}
},
"filters": {
"blobTypes": ["blockBlob"],
"prefixMatch": ["telemetry/"]
}
}
},
{
"name": "archive-rule",
"enabled": true,
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 90
}
}
},
"filters": {
"blobTypes": ["blockBlob"],
"prefixMatch": ["telemetry/"],
"blobIndexMatch": [
{
"name": "Archivable",
"op": "==",
"value": "true"
}
]
}
}
}
]
}
A new block blob is uploaded to `telemetry/log1.txt`. You need to trace the lifecycle transitions of this blob based on the actions taken by the client application and the lifecycle execution engine. What is the correct sequence of events from the initial upload to the archiving of the blob? Arrange the events in chronological order.
Drag items to arrange them in the correct order
You are troubleshooting an intermittent database connection timeout that occurs once every few days in an ASP.NET Core web application hosted on a Windows Azure App Service. You need to configure application logging to capture diagnostic traces written via the ILogger interface. The logging must remain active continuously for at least a week to ensure the event is captured.
Which configuration should you implement?