All practice questions
972 questions
You are developing a .NET application for a fleet management system that logs vehicle telemetry. You need to write C# code using the Azure Cosmos DB .NET SDK v3 to insert a new status record into a container. Arrange the steps in the correct order to initialize the required SDK components and execute the item creation operation.
Drag items to arrange them in the correct order
An organization uses a Standard General Purpose v2 (GPv2) storage account to store telemetry data. You need to configure an Azure Blob Storage lifecycle management policy. The policy must move all block blobs in the `telemetry` container to the Archive tier if they have not been modified for more than days. Additionally, the policy must only apply to blobs that have a blob index tag named `Project` with a value of `Alpha`.
Which JSON policy definition should you use?
"rules": [
{
"enabled": true,
"name": "ArchiveTelemetry",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 90
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"prefixMatch": [ "telemetry/" ],
"blobIndexMatch": [
{
"name": "Project",
"op": "==",
"value": "Alpha"
}
]
}
}
}
]
}
"rules": [
{
"enabled": true,
"name": "ArchiveTelemetry",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 90
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"prefixMatch": [ "telemetry/" ],
"blobIndexMatch": [
{
"name": "project",
"op": "==",
"value": "alpha"
}
]
}
}
}
]
}
"rules": [
{
"enabled": true,
"name": "ArchiveTelemetry",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 90
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"prefixMatch": [ "telemetry/" ],
"blobIndexMatch": [
{
"name": "Project",
"op": "==",
"value": "Alpha"
}
]
},
"security": {
"authorization": "SasToken",
"sasToken": "?sv=2025-04-08&ss=b&srt=o&sp=rwd"
}
}
}
]
}
"rules": [
{
"enabled": true,
"name": "ArchiveTelemetry",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 90,
"ignoreActiveLease": true
}
}
},
"filters": {
"blobTypes": [ "blockBlob" ],
"prefixMatch": [ "telemetry/" ],
"blobIndexMatch": [
{
"name": "Project",
"op": "==",
"value": "Alpha"
}
]
}
}
}
]
}
You are designing an Azure Cosmos DB Core (SQL) API container for a health technology platform that tracks daily patient health metrics during clinical trials.
Each document in the container contains the following fields:
- `tenantId`: A unique identifier for the pharmaceutical sponsor
- `trialId`: A unique identifier for the clinical trial
- `patientId`: A unique identifier for the patient
- `recordDate`: The date of the measurement in `YYYY-MM-DD` format
- `heartRate`: The patient's heart rate value
The database solution must meet the following requirements:
- Write Ingestion: High-frequency writes from thousands of patient devices uploading metrics concurrently. Write operations for a single patient's daily metrics must be executed as a transactional batch to ensure atomicity.
- Read Queries: Clinical researchers frequently query all metrics for a specific clinical trial (`trialId`) within a date range of to days.
- Scalability: Individual logical partitions must not exceed the storage limit, and write throughput (RUs) must be distributed evenly to avoid rate-limiting.
Which partition key strategy should you implement?
An organization is deploying an inventory tracking application using an Azure Cosmos DB SQL API account. The account is configured with a single write region in East US and a read replica in West US. To group inventory by availability, the container is partitioned using the /availabilityStatus property, which has only three possible values: 'InStock', 'LowStock', and 'OutOfStock'. The application must meet the following requirements:
- Users must always read their own updates immediately, regardless of which regional application instance they connect to.
- The solution must support stateless web client instances without requiring the application layer to manage or pass session tokens between requests.
During load testing, the application encounters frequent request rate limiting (HTTP status code 429) on write operations.
Which default consistency level must you configure for the Cosmos DB account to meet the consistency and session requirements?
You are implementing a data retention solution for a high-throughput microservices logging platform that writes log blobs to an Azure Storage account named telemetrydata. The account is provisioned as a Premium Block Blobs storage account. You need to configure a lifecycle management policy to automate the following requirements:
- Automatically delete block blobs 14 days after modification if they have a blob index tag named Environment set to Staging.
- Automatically transition block blobs to the Cool tier 30 days after modification if they have a blob index tag named Environment set to Production, and delete them after 90 days.
Which of the following actions should you take to achieve these requirements?
A retail company is deploying a Python-based processing service to a V4 Azure Function App. The function is configured with a Service Bus queue trigger, where the trigger's Connection property is set to QueueConnection. Company security guidelines mandate that credentials must not be stored in configuration files or key vaults, and the connection must utilize the function's system-assigned managed identity. Which application setting must be added to the Function App to establish a successful connection?
An administrator is configuring a Web App named `inventory-api` on Azure App Service. The application must satisfy the following requirements:
1. Retrieve database credentials from Azure Key Vault without storing them in the application code.
2. Authenticate to the Key Vault using a managed identity that is tied to the lifecycle of the Web App.
3. Automatically increase the instance count when CPU usage exceeds 80%, and decrease the instance count when CPU usage drops below 70% without causing flapping.
Which two of the following configuration actions must you perform? Select two.
Select all that apply
You are deploying a new Azure Container App named order-api to an Azure Container Apps environment. The container image is hosted in a private Azure Container Registry (ACR) named contosoacr.azurecr.io.
You are writing a Bicep template to perform the initial deployment of the container app. You must configure the container app to pull the image from the registry securely using a managed identity. The deployment must succeed on the first run without requiring any post-deployment manual configuration or secondary deployments.
Which configuration strategy and Bicep resource definition snippet should you use?
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${userAssignedIdentity.id}': {}
}
}
properties: {
configuration: {
registries: [
{
server: 'contosoacr.azurecr.io'
identity: userAssignedIdentity.id
}
]
}
}
identity: {
type: 'SystemAssigned'
userAssignedIdentities: {}
}
properties: {
configuration: {
registries: [
{
server: 'contosoacr.azurecr.io'
identity: 'system'
}
]
}
}
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${userAssignedIdentity.id}': {}
}
}
properties: {
configuration: {
registries: [
{
server: 'contosoacr.azurecr.io'
username: userAssignedIdentity.properties.clientId
passwordRef: 'acr-password-secret'
}
]
}
}
identity: {
type: 'SystemAssigned'
}
properties: {
configuration: {
registries: [
{
server: 'contosoacr.azurecr.io'
identityId: reference(resourceId('Microsoft.App/containerApps', 'order-api'), '2023-05-01').identity.principalId
}
]
}
}
You are developing a C# application using the Azure Cosmos DB .NET SDK v3 to manage configuration settings for a multi-tenant SaaS application. The target container uses '/tenantId' as its partition key path. You need to retrieve a single configuration item with an id of 'config-100' for a tenant whose tenantId is 'tenant-99' using the most efficient operation (lowest latency and RU cost). Which code segment should you use?
You are developing a Python application that uses the azure-storage-blob SDK to retrieve properties for an Azure Storage blob. The blob has custom metadata configured with a key of Department and a value of Sales. You retrieve the blob's properties using properties = blob_client.get_blob_properties(). Which of the following code segments should you use to retrieve the metadata value?
You are developing a C# application that uses the Azure.Storage.Blobs SDK (v12) to manage files in Azure Blob Storage. You need to delete a blob that currently has an active, exclusive-write lease. Which two actions can you perform to successfully delete the blob? (Select two.)
Select all that apply
A team is troubleshooting an Azure App Service web application named myApp. They want to configure the application to write diagnostic trace messages to the local filesystem and view the incoming log messages live in their terminal.
Which two Azure CLI commands should they run?
Select all that apply
An organization hosts a report generation web application named contoso-reports on an Azure App Service Web App. The web application currently runs on an App Service plan named asp-free using the Free (F1) pricing tier.
During scheduled weekly report generation, the web application experiences severe CPU spikes that cause performance degradation. You need to implement an autoscale strategy using the Azure CLI that meets the following requirements:
- The hosting plan must be changed to the lowest cost tier that supports autoscale rules.
- The instance count must scale out by 1 instance when average CPU utilization is greater than 85% for 10 minutes.
- The instance count must scale in by 1 instance when average CPU utilization drops below 40% for 10 minutes.
- The configuration must prevent autoscale flapping.
Which four Azure CLI commands should you execute in sequence? To answer, move the appropriate commands from the list of commands to the answer area and arrange them in the correct order. (Note: Configure the scale-out rule before the scale-in rule.)
Drag items to arrange them in the correct order
You have an Azure subscription that contains a General Purpose v1 (GPv1) storage account named storage1 in a resource group named group1. You need to implement an Azure Blob Storage lifecycle management policy to automatically move inactive blobs to the Cool and Archive tiers. You plan to define the policy rules in a local file named policy.json and apply the policy using the Azure CLI. Which four actions should you perform in sequence? To answer, arrange the actions in the correct order.
Drag items to arrange them in the correct order
You are developing a .NET microservice that processes user orders in a multi-tenant SaaS application. Each tenant has their own partition in an Azure Cosmos DB SQL API container, and all operations within a single order lifecycle must be executed within a single transaction. You need to write C# code using the Azure Cosmos DB .NET SDK v3 to configure the client, access the container, and run a transactional batch of operations. In which sequence should you perform the steps to configure the client and execute the transactional batch?
Drag items to arrange them in the correct order
You are deploying a latency-sensitive Azure Function App (V4 runtime) that processes messages from an Azure Service Bus queue. The application must meet the following requirements:
- Avoid cold start latency for all invocations.
- Scale dynamically and automatically based on the volume of incoming queue messages.
- Keep a minimum of two instances pre-warmed and ready to handle requests at all times.
Which two actions should you perform? (Select two.)
Select all that apply
An organization has a workflow that polls the status of a long-running data export job. The workflow is implemented using Python Azure Durable Functions.
The orchestrator function is defined as follows:
python
import azure.functions as func
import azure.durable_functions as df
import datetime
import time
my_app = df.DFApp(http_auth_level=func.AuthLevel.ANONYMOUS)
@my_app.orchestration_trigger(context_name="context")
def export_monitor_orchestrator(context: df.DurableOrchestrationContext):
job_id = context.get_input()
expiry_time = datetime.datetime.utcnow() + datetime.timedelta(hours=2)
while datetime.datetime.utcnow() < expiry_time:
status = yield context.call_activity("CheckJobStatus", job_id)
if status == "Completed":
yield context.call_activity("SendSuccessAlert", job_id)
return "Finished"
time.sleep(300)
yield context.call_activity("SendTimeoutAlert", job_id)
return "Timeout"
The function app is hosted on an Azure Functions Consumption plan. During testing, the orchestration fails to complete successfully and frequently times out.
Which two modifications should you make to resolve the issues and ensure the orchestrator runs reliably? (Select two.)
Select all that apply
A logistics company is designing an Azure Cosmos DB for NoSQL database to track inventory movements across 15 high-volume regional warehouses. The system has the following requirements:
* Each warehouse processes up to 100,000 inventory transaction logs per day.
* To maintain inventory accuracy, the system must use the Azure Cosmos DB SDK's TransactionalBatch to perform atomic, multi-document updates (such as deducting stock from one bin and adding it to another) within a warehouse context.
* While the write throughput is extremely high and distributed across the warehouses, business analysts run daily reporting queries to analyze the complete historical data of a single warehouse, which requires scanning months of logs.
* The design must prevent logical partitions from exceeding the 20 GB storage limit while maintaining transactional integrity.
Which two of the following strategies should you implement to satisfy these requirements?
Select all that apply
You are developing a daemon application that runs on an on-premises physical server. The application must authenticate programmatically to Azure Key Vault to retrieve secrets. You need to configure the identity for this application. Which identity configuration should you use?
You are preparing to deploy a containerized application to Azure Container Instances (ACI). The container image is stored in a private Azure Container Registry (ACR). You need to configure the container group to pull the image from the registry using a managed identity to avoid using container registry credentials.
Which managed identity configuration must you use to allow the container group to pull the image?