Tüm alıştırma soruları
26 soru
A backend API running on Azure Container Instances writes diagnostic log traces to Application Insights. You need to verify if any error-level logs have been recorded recently. Which Kusto Query Language (KQL) keywords complete the query to retrieve all traces with a severity level of 3 that occurred within the last 2 hours?
Aşağıdaki boşlukları doldurun
| where timestamp > (2h)
| where severityLevel == 3
You are analyzing application performance issues in Azure Application Insights. You need to write a Kusto Query Language (KQL) query to retrieve the timestamp, name, and duration for all requests that took longer than 2 seconds (2000 milliseconds). How should you complete the KQL query?
Aşağıdaki boşlukları doldurun
| duration > 2000
| timestamp, name, duration
A developer is investigating a performance bottleneck in an Azure Function App. They want to retrieve all dependency calls from the last 6 hours that took longer than the 90th percentile of all dependency durations during that same period. Complete the Kusto Query Language (KQL) query to retrieve these slow dependency calls by filling in the blanks.
Aşağıdaki boşlukları doldurun
let threshold = toscalar(
dependencies
| where timestamp > ago(6h)
| summarize (duration, 90)
);
dependencies
| where timestamp > ago(6h)
| where duration >
You are monitoring a high-volume Azure App Service web application using Azure Application Insights. You need to write an optimized Kusto Query Language (KQL) query to count the number of slow external HTTP dependency calls.
The query must meet the following requirements:
1. Dynamically calculate the 90th percentile duration of all HTTP dependencies over the last 24 hours and use this as a threshold.
2. Filter the `dependencies` table to include only HTTP calls whose duration exceeds this threshold.
3. Join the filtered dependencies with the `requests` table to associate them with their parent operations.
4. Group the results by the operation name (from the `requests` table) and the dependency target (from the `dependencies` table) to display the total count of slow dependency calls.
5. Apply time-range filters as early as possible to minimize the volume of data scanned and prevent query performance issues.
Complete the KQL query below by filling in the blanks with the correct KQL functions, table fields, or join operators.
Aşağıdaki boşlukları doldurun
let threshold = (
dependencies
| where timestamp >= start
| where type == "Http"
| summarize percentile(duration, 90)
);
dependencies
| where >= start
| where type == "Http" and duration > threshold
| join kind= (
requests
| where >= start
) on operation_Id
| summarize SlowCount = count() by RequestName = name, Target = target
An enterprise is migrating its legacy payment processing API to Azure API Management (APIM). To support blue-green deployments, the API gateway must route incoming requests dynamically based on a custom HTTP header named `X-Routing-Environment`. If the header value is `canary`, the gateway must route the request to a backend service registered with the ID `canary-endpoint`. Otherwise, the request should continue to the default backend.
Complete the following XML policy snippet to implement the dynamic routing logic. Fill in the blanks with the correct context variable and policy element name.
Aşağıdaki boşlukları doldurun
xml
<policies>
<inbound>
<base />
<choose>
<when condition="@(.Request.Headers.GetValueOrDefault("X-Routing-Environment") == "canary")">
< backend-id="canary-endpoint" />
</when>
</choose>
</inbound>
</policies>
You are developing a batch telemetry processing service in C# that consumes messages from an Azure Queue Storage queue named telemetry-ingest. The service must retrieve up to 32 messages at a time and prevent other instances from processing these messages for 5 minutes while they are being processed. Once a message is successfully processed, it must be permanently removed from the queue. Complete the C# code snippet by filling in the blanks with the correct Azure Storage Queues SDK for .NET method names.
Aşağıdaki boşlukları doldurun
using System.Threading.Tasks;
using Azure.Storage.Queues;
using Azure.Storage.Queues.Models;
public async Task ProcessTelemetryBatchAsync(QueueClient queueClient)
{
var response = await queueClient.(
maxMessages: 32,
visibilityTimeout: TimeSpan.FromMinutes(5)
);
foreach (var message in response.Value)
{
try
{
ProcessTelemetry(message.Body.ToString());
await queueClient.(message.MessageId, message.PopReceipt);
}
catch (Exception ex)
{
// Log error
}
}
}
You are developing a worker utility in C# that processes queue messages. You need to configure Application Insights telemetry programmatically without using dependency injection. Complete the following C# code snippet to initialize the telemetry configuration and apply the connection string. What are the correct API members to write in the blanks?
Aşağıdaki boşlukları doldurun
config. = "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-0.in.applicationinsights.azure.com/";
TelemetryClient client = new TelemetryClient(config);
An enterprise order processing application sends custom metric telemetry to Azure Application Insights to monitor message queue sizes. A custom metric named 'QueueBacklog' is recorded, and the specific queue's identifier is stored inside a custom dimension named 'QueueName'.
You need to write a Kusto Query Language (KQL) query to find the maximum backlog value for each queue over the last 36 hours. To ensure optimal query performance, you must filter by time range before performing any other operations.
How should you complete the KQL query?
Aşağıdaki boşlukları doldurun
| where timestamp > ago(36h) and name == "QueueBacklog"
| extend QueueName = (customDimensions.QueueName)
| summarize MaxBacklog = (value) by QueueName
Complete the statement to identify the XML element required to inherit and execute policies from a parent scope in Azure API Management.
Aşağıdaki boşlukları doldurun
You are configuring an inbound policy in Azure API Management to modify the request path before it is forwarded to the backend service. The policy must redirect the client request from the public URL structure to the backend endpoint path /users/{id}. Complete the policy XML block by identifying the missing element name to rewrite the path:
Aşağıdaki boşlukları doldurun
<base />
< template="/users/{id}" />
</inbound>
You are configuring Application Insights telemetry in a C# console application. You need to enrich all telemetry sent to Application Insights with a custom cloud role name by implementing and registering a telemetry initializer.
Complete the code snippet by identifying the correct types and properties for each blank.
Aşağıdaki boşlukları doldurun
using Microsoft.ApplicationInsights.Extensibility;
// A custom initializer to enrich all telemetry with cloud role details
public class CloudRoleNameInitializer :
{
public void Initialize( telemetry)
{
telemetry.Context.Cloud.RoleName = "OrderProcessingService";
}
}
// In the application startup code:
var config = TelemetryConfiguration.CreateDefault();
config.ConnectionString = "ConnectionStringValue";
config..Add(new CloudRoleNameInitializer());
An operations engineer needs to implement a message consumer in C# for Azure Queue Storage using the modern Azure.Storage.Queues SDK. The consumer must acquire a message, process it, and then immediately delete it from the queue.
Complete the C# code snippet below by filling in the blanks. What are the correct asynchronous method names to retrieve and delete the message?
Aşağıdaki boşlukları doldurun
QueueClient queueClient = new QueueClient(connectionString, "work-items");
// Retrieve the message
QueueMessage[] messages = await queueClient.(maxMessages: 1);
if (messages.Length > 0)
{
QueueMessage message = messages[0];
// Process the message...
// Permanently remove the message from the queue
await queueClient.(message.MessageId, message.PopReceipt);
}
You are configuring an inbound policy for an Azure API Management (APIM) instance. You need to route incoming API requests to a specific regional backend API based on the value of a custom header named `X-Region`. If the header value is `EU`, the request must be routed to `https://eu-backend.contoso.com/api`. Otherwise, the request must use the default backend. What are the correct API Management policy element names required to complete the XML configuration below?
Aşağıdaki boşlukları doldurun
<inbound>
<base />
<choose>
< condition="@(context.Request.Headers.GetValueOrDefault("X-Region") == "EU")">
< base-url="https://eu-backend.contoso.com/api" />
</>
</choose>
</inbound>
Complete the Azure API Management (APIM) policy snippet to append or replace a query parameter in the backend request with the client's subscription ID.
Aşağıdaki boşlukları doldurun
Complete the XML policy configuration by filling in the blanks.
xml
<inbound>
<base />
< name="client-id" exists-action="">
<value>@(context.Subscription.Id)</value>
</>
</inbound>
You are developing a .NET 8 background worker service that processes queue messages and communicates with an external database. You need to manually track the database call as a dependency using the Application Insights SDK, and ensure any thrown exceptions are logged to Application Insights.
Complete the code by filling in the blanks with the correct TelemetryClient method names.
Aşağıdaki boşlukları doldurun
using Microsoft.ApplicationInsights.DataContracts;
using System;
using System.Threading.Tasks;
public class QueueProcessor
{
private readonly TelemetryClient _telemetryClient;
private readonly IExternalService _externalService;
public QueueProcessor(TelemetryClient telemetryClient, IExternalService externalService)
{
_telemetryClient = telemetryClient;
_externalService = externalService;
}
public async Task ProcessJobAsync(string jobId)
{
// Start and correlate a dependency tracking operation
using (var operation = _telemetryClient.<DependencyTelemetry>("DatabaseCall"))
{
try
{
await _externalService.ExecuteAsync(jobId);
operation.Telemetry.Success = true;
}
catch (Exception ex)
{
operation.Telemetry.Success = false;
_telemetryClient.(ex);
throw;
}
}
}
}
You are developing a solution that uses Azure API Management (APIM). You need to configure an inbound policy that forwards the client's original IP address to the backend service by adding a custom request header named `X-Client-IP`. You must use a C# policy expression within the `<set-header>` policy.
Complete the policy configuration by filling in the missing C# expression in the blank. What is the C# expression to retrieve the client's IP address from the request context?
Aşağıdaki boşlukları doldurun
<base />
<set-header name="X-Client-IP" exists-action="override">
<value>@()</value>
</set-header>
</inbound>
You are developing an ASP.NET Core Web API with the Application Insights SDK. To optimize resource consumption in a containerized environment, you must programmatically disable the collection of performance counters and disable adaptive sampling. Complete the code snippet by filling in the correct properties of the ApplicationInsightsServiceOptions class.
Aşağıdaki boşlukları doldurun
builder.Services.AddApplicationInsightsTelemetry(options =>
{
options.ConnectionString = builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"];
options. = false; // Disables performance counter collection
options. = false; // Disables adaptive sampling
});
An enterprise application uses Azure API Management (APIM). You need to configure an inbound policy that evaluates the 'X-Client-Type' request header. If the header value is 'Internal', the request must route to an internal backend service. Otherwise, it should route to the default backend service. Which XML element names must be used to complete the conditional logic in the policy snippet?
Aşağıdaki boşlukları doldurun
<inbound>
<base />
<>
< condition="@(context.Request.Headers.GetValueOrDefault('X-Client-Type') == 'Internal')">
<set-backend-service base-url="https://internal-api.service.local" />
</>
</>
</inbound>
Complete the C# code below to define a custom telemetry processor that filters out successful dependency telemetry and register it within the ASP.NET Core dependency injection container.
Aşağıdaki boşlukları doldurun
{
private ITelemetryProcessor Next { get; set; }
public DependencyFilter(ITelemetryProcessor next)
{
this.Next = next;
}
public void Process(ITelemetry item)
{
if (item is DependencyTelemetry dependency && dependency.Success == true)
{
return; // Filter out
}
this.Next.Process(item);
}
}
// In Program.cs:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddApplicationInsightsTelemetry();
builder.Services.<DependencyFilter>();
You are developing an audit utility in C# that processes messages in an Azure Queue Storage queue named inventory-audit. The utility must read the content of up to 10 messages to log their metadata, but it must not lock the messages or make them invisible to other processing services. You are using the Azure.Storage.Queues SDK. Complete the code snippet below using explicit typing (do not use var) to retrieve the messages. Which code segments should you use to fill in the blanks?
Aşağıdaki boşlukları doldurun
// Inspect up to 10 messages without changing their visibility
[] messages = (await queueClient.(maxMessages: 10)).Value;