Tüm alıştırma soruları
972 soru
You are developing a C# application using the Azure Cosmos DB .NET SDK v3 to manage document collaboration sessions. The container is configured with a partition key path of `/documentId`. The Azure Cosmos DB account is configured with the default consistency level of Session.
An update to a document is processed by Web App Instance A using the following code:
csharp
ItemResponse<Document> writeResponse = await container.ReplaceItemAsync<Document>(
updatedDocument,
updatedDocument.Id,
new PartitionKey(updatedDocument.DocumentId)
);
string token = writeResponse.Headers.Session;
Immediately after the update, Web App Instance B (which runs on a separate virtual machine and utilizes a different `CosmosClient` instance) needs to read the same document to display the latest updates to the same user.
Which C# code segment should you execute on Web App Instance B to guarantee a read-your-writes consistency guarantee for this operation?
{
ConsistencyLevel = ConsistencyLevel.Session
};
ItemResponse<Document> readResponse = await container.ReadItemAsync<Document>(
documentId,
new PartitionKey(documentId),
options
);
documentId,
new PartitionKey(documentId)
);
{
SessionToken = token
};
ItemResponse<Document> readResponse = await container.ReadItemAsync<Document>(
documentId,
new PartitionKey(documentId),
options
);
{
SessionToken = token
};
ItemResponse<Document> readResponse = await container.ReadItemAsync<Document>(
documentId,
new PartitionKey(userStatus),
options
);
You are deploying an Azure Container App named `task-processor` using a Bicep template. The container app needs to scale dynamically based on the number of messages in an Azure Storage Queue named `taskqueue` located in a storage account named `tasksstorage`.
You have created a user-assigned managed identity named `worker-identity` and granted it the Storage Queue Data Reader role on the storage account.
The identity block in your Bicep template is configured as follows:
bicep
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${workerIdentity.id}': {}
}
}
You need to configure the custom scale rule in the Bicep template to use the user-assigned managed identity for authenticating against the queue.
Which of the following configuration snippets must you use inside the custom scale rule?
type: 'azure-queue'
metadata: {
queueName: 'taskqueue'
accountName: 'tasksstorage'
queueLength: '5'
}
auth: [
{
triggerParameter: 'connection'
identity: workerIdentity.id
}
]
}
type: 'azure-queue'
metadata: {
queueName: 'taskqueue'
accountName: 'tasksstorage'
queueLength: '5'
}
auth: [
{
triggerParameter: 'connection'
identity: 'system'
}
]
}
type: 'azure-queue'
metadata: {
queueName: 'taskqueue'
accountName: 'tasksstorage'
queueLength: '5'
}
auth: [
{
triggerParameter: 'connection'
identity: 'UserAssigned'
}
]
}
type: 'azure-queue'
metadata: {
queueName: 'taskqueue'
accountName: 'tasksstorage'
queueLength: '5'
}
auth: [
{
triggerParameter: 'connection'
identity: 'worker-identity'
}
]
}
You are implementing a simple Durable Functions chaining workflow in C# to process a customer order. The workflow consists of an HTTP-triggered client function, an orchestrator function, and two activity functions: `ValidateOrder` and `ProcessPayment`.
Arrange the steps in the correct order of execution, starting from when a client submits an order.
Öğeleri doğru sıraya koymak için sürükleyin
You are developing a C# application that uses the Azure.Storage.Blobs SDK (v12) to manage blobs. You need to assign custom metadata to an existing blob to track the department that owns the blob. The metadata key must be 'Department' and the value must be 'Marketing'.
You write the following code:
csharp
BlobClient blobClient = new BlobClient(connectionString, containerName, blobName);
IDictionary<string, string> metadata = new Dictionary<string, string>();
// Code to add the metadata pair
await blobClient.SetMetadataAsync(metadata);
Which code segment should you use to add the metadata key-value pair?
An enterprise application uses an Azure Cosmos DB account distributed across three write regions (East US, West US, and North Europe) with multi-region writes enabled. You need to configure the consistency settings to meet the following requirements:
1. For user profile updates, the application must guarantee that a user always reads their own updates. The web application uses a load balancer, and subsequent requests from the same user may be routed to different web server instances, which must share the session state using the Azure Cosmos DB session token.
2. For a public news feed, the application must minimize read latency and Request Unit (RU) costs while ensuring that readers never see updates out of order.
Which two consistency levels should you select to meet these requirements? (Select two.)
Geçerli olan tümünü seçin
A developer is writing a .NET application using the Azure Cosmos DB .NET SDK v3. The target container is configured with a partition key path of `/userId`. Which of the following code snippets should the developer use to retrieve a user profile item where both the item ID and the user ID are "user123"?
A package delivery dispatch system is implemented using Azure Durable Functions. The workflow assigns a driver, waits up to 30 minutes for the driver to accept the assignment via an external event, and dispatches the delivery if accepted. The driver accepts the assignment 10 minutes after it is assigned.
How does the Durable Task Framework execute and replay the orchestrator function to complete this workflow? Order the execution and replay events chronologically from the initial start of the orchestrator to its completion.
Öğeleri doğru sıraya koymak için sürükleyin
An application running inside an Azure Container Instances (ACI) container group is configured to use a system-assigned managed identity to access an Azure Key Vault. When the application attempts to retrieve a secret, it receives an HTTP 403 Forbidden error. You confirm that the system-assigned managed identity is enabled on the container group. Which action must you perform to resolve the access error?
A telemetry processing service is hosted on an Azure App Service Web App running on a Standard (S1) App Service plan. The autoscale setting is configured to scale out by 1 instance when the average CPU Percentage is greater than 80% for 10 minutes. The instance limits are set to a minimum of 1, a default of 2, and a maximum of 4 instances. You want to configure the scale-in rule to decrease the instance count by 1 instance when CPU load drops, while preventing autoscale flapping.
Which scale-in threshold for the CPU Percentage metric should you configure to meet this requirement?
You are configuring a custom domain (api.contoso.com) for a public-facing Azure Container App named inventory-api. You need to ensure the custom domain is validated and secured with an SSL/TLS certificate.
Which sequence of steps must you perform to configure the custom domain and certificate?
Öğeleri doğru sıraya koymak için sürükleyin
A multi-tenant corporate wellness application tracks daily employee physical activity logs in an Azure Cosmos DB API for NoSQL container. The application's workload profile is as follows:
- The platform supports corporate clients (tenants), each with up to employees.
- Users write multiple activity log entries throughout the day.
- A background process performs transactional batch operations using `TransactionalBatch` to update an employee's daily activity summary item and append new activity log items. These operations must succeed or fail together.
- You must ensure the container scales to handle write ingestion without reaching the 20 GB logical partition limit or creating hot partitions.
Which two actions should you perform to implement a partitioning strategy that meets these requirements? (Select two.)
Geçerli olan tümünü seçin
You have a private Azure Container Registry named registry1 and an Azure Container App named app1. You need to configure app1 to pull images from registry1 using a system-assigned managed identity. The configuration must follow the principle of least privilege. Which three 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.
Öğeleri doğru sıraya koymak için sürükleyin
You are developing a web application hosted on an Azure App Service. You need to enable application logging to the file system and view the log messages in real-time using the Azure CLI. Which three 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.
Öğeleri doğru sıraya koymak için sürükleyin
You are developing a secure Azure Function App (V4 runtime). The Function App must retrieve a database connection string from an Azure Key Vault. To comply with security policies, the Function App must use a user-assigned managed identity to resolve Key Vault references.
Arrange the steps in the correct order to configure the Function App to use the user-assigned managed identity for resolving Key Vault references.
Öğeleri doğru sıraya koymak için sürükleyin
A development team is deploying a web application to Azure App Service named webapp-orders-prod. The application requires a connection string to a database. The connection string is stored in an Azure Key Vault named kv-orders-prod as a secret named DbConnectionString.
A system-assigned managed identity has been enabled for webapp-orders-prod.
The developer configures an application setting named ConnectionStrings:DefaultConnection on the web app with the value:
@Microsoft.KeyVault(SecretUri=https://kv-orders-prod.vault.azure.net/secrets/DbConnectionString)
However, when the application starts, it fails to connect to the database. Upon checking the Azure portal, the Key Vault reference for ConnectionStrings:DefaultConnection shows a status of 'Access Denied'.
Which configuration step must be performed to resolve this issue?
You need to write a C# application using the Azure.Storage.Blobs SDK (v12) to temporarily lock a blob for exclusive write access. Arrange the following steps in the correct order to acquire a 30-second lease, perform operations, and then clean up the lease resource.
Öğeleri doğru sıraya koymak için sürükleyin
You are developing a C# (.NET Isolated process) Durable Function orchestrator named InventoryAuditOrchestrator to coordinate a nightly inventory synchronization workflow. The orchestrator must retrieve a list of store locations, generate a unique audit tracking identifier (GUID) for each location, call an activity function to perform the audit, and record the completion timestamp.
You write the following orchestrator function code:
csharp
[Function("InventoryAuditOrchestrator")]
public static async Task RunOrchestrator(
[OrchestrationTrigger] TaskOrchestrationContext context)
{
var stores = await context.CallActivityAsync<List<string>>("GetStoreLocations", null);
foreach (var store in stores)
{
Guid auditId = Guid.NewGuid();
DateTime auditTime = DateTime.UtcNow;
var auditData = new AuditPayload(store, auditId, auditTime);
await context.CallActivityAsync("RunStoreAudit", auditData);
}
}
During testing, you notice that the workflow fails during execution replay, resulting in mismatched audit identifiers and timestamps across replays.
Which modification must you apply to the orchestrator code to resolve the replay errors and guarantee deterministic execution?
You have a web application deployed to an Azure App Service. You want to enable application logging to the local file system to troubleshoot a runtime issue. Which of the following actions should you perform to enable this logging?
You are designing an Azure Cosmos DB Core (SQL) API container for a smart home energy monitoring system that tracks electricity usage for 500,000 devices. Each device uploads energy telemetry logs every 10 seconds. The container must support transactional batches to update a device's telemetry log and its current state cache document atomically. Additionally, some high-frequency industrial devices will accumulate more than 20 GB of telemetry data over time. The most frequent read queries will retrieve all telemetry logs for a specific device during a given calendar month.
Which partition key strategy should you implement?
A smart home energy platform collects high-frequency telemetry data from millions of IoT smart meters. Each meter writes power consumption readings every 10 seconds. Each telemetry document contains `deviceId`, `timestamp`, `deviceType` (e.g., Thermostat, SmartPlug), and `powerUsage`.
The solution must meet the following requirements:
- Support a high volume of write ingestions without encountering hot partitions.
- Ensure that all telemetry readings and device state updates for a specific meter on a given day can be executed atomically as a single transaction.
- Prevent individual logical partitions from exceeding the 20 GB size limit as data accumulates over years of operation.
- Optimize queries that retrieve daily consumption metrics for a specific meter.
Which two partition key strategies or configurations should you implement to satisfy these requirements? (Select two.)
Geçerli olan tümünü seçin