Tüm alıştırma soruları

972 soru

Soru 701Soru

You are developing a .NET console application that uses the Azure.Storage.Blobs SDK to migrate security logs from a private container in a source storage account to a container in a destination storage account. The source storage account has public access disabled, and the migration must be done programmatically. Which two actions should you perform to copy the log blob to the destination storage account?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Generate a Shared Access Signature (SAS) token for the source blob that includes only the Read permission.; Call StartCopyFromUriAsync on the destination BlobClient instance and pass the source blob URI with the SAS token.

Cevap

Generate a Shared Access Signature (SAS) token for the source blob that includes only the Read permission, and call StartCopyFromUriAsync on the destination BlobClient instance passing the source blob URI with the SAS token.
To copy a blob from a secure source container to a destination container in a different storage account, you must generate a Shared Access Signature (SAS) token on the source blob with at least Read permissions so that the destination service can read the source file. Then, you initiate the copy by calling StartCopyFromUriAsync on the destination BlobClient, passing the source blob's URI containing the SAS token.

Adım Adım Çözüm

1
Generate a source SAS token with Read permission.
A SAS token is generated that allows secure read-only access to the private source blob.
Because the source storage account has public access disabled, the destination service requires a SAS token to authenticate and read the source blob.
2
Append the SAS token to the source blob URI.
A secure source URI is created.
The source URI must include the credentials (SAS token) so the copy engine can access the private blob.
3
Invoke StartCopyFromUriAsync on the destination BlobClient.
The asynchronous copy operation is initiated on the Azure Storage service.
The copy operation runs server-side and is initiated by telling the destination client where to pull the data from.

Anahtar Kavram

Asynchronous blob copying requires a source URI authenticated via a SAS token with Read permissions, and initiating the copy from the destination client using the SDK.
Soru 702Soru

An organization requires an Azure API Management (APIM) instance to securely retrieve a database password from an Azure Key Vault secret. The password will be exposed to API policies via a Named Value. You must use a user-assigned managed identity named apim-identity to authenticate from the APIM instance to the Key Vault.

Which two configurations should you implement to achieve this? (Choose two.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Associate the apim-identity user-assigned managed identity with the APIM instance.; Grant the apim-identity user-assigned managed identity the Secret Get permission in the Key Vault access policies or Azure Role-Based Access Control (RBAC).

Cevap

To configure the APIM instance to retrieve the secret from the Key Vault using a user-assigned managed identity, you must associate the user-assigned managed identity (apim-identity) with the APIM instance, and grant this identity the Secret Get permission on the Key Vault.
To retrieve a secret value from Key Vault for an APIM Named Value using a user-assigned managed identity, two configuration steps are required: 1) Associate the user-assigned managed identity with the APIM instance so it is available for use. 2) Grant the user-assigned managed identity the Secret Get permission on the Key Vault access policies or Azure RBAC so it has permission to read the secret value.

Adım Adım Çözüm

1
Associate the identity
The user-assigned managed identity named apim-identity is registered with the API Management instance.
The APIM instance needs to be associated with the identity to use it for outgoing authentication requests to other Azure resources.
2
Configure permissions
The user-assigned identity is granted the Secret Get permission in Key Vault.
Key Vault requires the Secret Get permission to read the value of secrets; other permissions like List or Backup are insufficient.
3
Create Named Value
A Named Value of type Key Vault is configured in APIM specifying the user-assigned identity and the secret URI.
This links the APIM Named Value to the Key Vault secret using the specified identity for authorization.

Anahtar Kavram

Configuring Azure API Management Named Values to retrieve secrets from Key Vault using a user-assigned managed identity.
Soru 703Soru

A backend data ingestion service runs on an Azure Virtual Machine Scale Set (VMSS) with a minimum capacity of 22 instances and a maximum capacity of 1010 instances. You need to configure autoscale rules based on the CPU percentage metric. The scale-out rule increases the capacity by 11 instance, and the scale-in rule decreases the capacity by 11 instance. Which of the following autoscale rule pairs will successfully prevent flapping when the VMSS is operating at its minimum capacity? (Select TWO)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Scale-out when the average CPU percentage is greater than 90%90\%; scale-in when the average CPU percentage is less than 50%50\%.; Scale-out when the average CPU percentage is greater than 75%75\%; scale-in when the average CPU percentage is less than 45%45\%.

Cevap

The correct autoscale rules are: (1) scale-out when average CPU percentage is greater than 90%90\% and scale-in when it is less than 50%50\%, and (2) scale-out when average CPU percentage is greater than 75%75\% and scale-in when it is less than 45%45\%.
The correct rule pairs prevent flapping because their scale-in thresholds are set lower than the post-scale-out average CPU load. Specifically, when starting from the minimum of 22 instances, scaling out to 33 instances reduces the average CPU to 23\frac{2}{3} of its pre-scale-out value. For a scale-out threshold of 90%90\%, the new average is 60%60\%, which is higher than the 50%50\% scale-in threshold. For a scale-out threshold of 75%75\%, the new average is 50%50\%, which is higher than the 45%45\% scale-in threshold.

Adım Adım Çözüm

1
Formulate the condition to prevent flapping when capacity scales out from 22 instances to 33 instances.
The average CPU after scale-out must be higher than the scale-in threshold: Scale-in threshold<23×Scale-out threshold\text{Scale-in threshold} < \frac{2}{3} \times \text{Scale-out threshold}.
This ensures that adding an instance does not immediately lower the average CPU below the scale-in threshold.
2
Evaluate the metric thresholds for each candidate option under this condition.
For the rule with thresholds 90%90\% and 50%50\%, 23×90%=60%>50%\frac{2}{3} \times 90\% = 60\% > 50\% (safe). For the rule with thresholds 80%80\% and 55%55\%, 23×80%53.33%<55%\frac{2}{3} \times 80\% \approx 53.33\% < 55\% (flapping occurs). For the rule with thresholds 75%75\% and 45%45\%, 23×75%=50%>45%\frac{2}{3} \times 75\% = 50\% > 45\% (safe). For the rule with thresholds 70%70\% and 40%40\%, 23×70%46.67%>40%\frac{2}{3} \times 70\% \approx 46.67\% > 40\% (mathematically safe).
To identify which threshold combinations prevent flapping.
3
Check the resource hosting plan constraints.
Autoscale features require Standard, Premium, or Isolated App Service plans, and are not supported on the Free tier.
To eliminate configurations that cannot be implemented due to hosting plan limitations.

Anahtar Kavram

Azure Monitor Autoscale Flapping Prevention and Plan Requirements
Soru 704Soru

You are implementing an event consumer application in C# using the Azure.Messaging.EventHubs.Processor library. The application will run on multiple virtual machine instances to process events from an Event Hub named telemetry-hub.

You need to configure the EventProcessorClient instances so that:
- The event processing load is distributed dynamically across all running virtual machine instances.
- Each partition is processed by only one active instance at any given time.
- Processing can resume from the last known state after an application restart or instance failure.

Which configuration strategy should you implement?

Cevabı ve açıklamayı göster

Cevap: Configure all instances to use the same consumer group and point them to the same Azure Blob Storage container for checkpointing and partition ownership management.

Cevap

Configure all instances to use the same consumer group and point them to the same Azure Blob Storage container for checkpointing and partition ownership management.
To distribute partition processing among multiple instances of an application (load balancing), they must all be configured to use the same consumer group. Additionally, the EventProcessorClient utilizes blobs within a single Azure Blob Storage container to establish leases (representing ownership of partitions) and record checkpoints. Using a shared container ensures instances can coordinate who owns which partition and where they can resume processing.

Adım Adım Çözüm

1
Determine the consumer group configuration.
Use the same consumer group across all instances.
In Event Hubs, instances must belong to the same consumer group to distribute partitions and load balance processing among themselves.
2
Determine the checkpoint and lease storage configuration.
Use a single, shared Azure Blob Storage container.
The EventProcessorClient uses blobs in a shared container to acquire leases (representing partition ownership) and save checkpoints. Sharing the container prevents multiple instances from taking over the same partitions simultaneously.

Anahtar Kavram

EventProcessorClient partition load balancing and checkpoint coordination
Tahmini Süre:1m 30s
Soru 705Soru

You are developing an application using the .NET Azure.Storage.Blobs SDK (version 12) to copy a blob from a source container to a destination container. The destination blob already exists and is locked with an active, exclusive write lease. You possess the lease ID for the destination blob. Which of the following approaches should you use to successfully perform the copy operation?

Cevabı ve açıklamayı göster

Cevap: Instantiate a BlobCopyFromUriOptions object, assign the lease ID to the LeaseId property of its DestinationConditions, and pass the options to StartCopyFromUriAsync.

Cevap

Instantiate a BlobCopyFromUriOptions object, assign the lease ID to the LeaseId property of its DestinationConditions, and pass the options to StartCopyFromUriAsync.
The option stating to instantiate a BlobCopyFromUriOptions object and assign the lease ID to its DestinationConditions is correct because it ensures that the active write lease on the destination blob is authorized during the write operation. The Azure Storage service validates this lease ID against the active lease on the destination blob to allow the copy operation to overwrite it.

Adım Adım Çözüm

1
Initialize a BlobRequestConditions object and assign the active lease ID of the destination blob to its LeaseId property.
A BlobRequestConditions instance configured with the correct lease authorization.
This condition ensures the write operation is permitted on the leased destination blob.
2
Instantiate a BlobCopyFromUriOptions object and assign the BlobRequestConditions to its DestinationConditions property.
A BlobCopyFromUriOptions instance specifying that the lease condition applies to the destination target.
The destination container and blob are the ones undergoing modification, so the lease ID must target the destination.
3
Invoke StartCopyFromUriAsync on the destination BlobClient, passing the source URI and the BlobCopyFromUriOptions object.
The asynchronous copy operation begins successfully without throwing a 412412 (Precondition Failed) error.
The Azure Storage service receives the lease ID in the request headers and allows the write to proceed on the leased blob.

Anahtar Kavram

Using BlobCopyFromUriOptions and DestinationConditions to overwrite a leased destination blob during a copy operation.
Soru 706Soru

You are developing a backend processing service that runs on an Azure App Service plan named `asp-worker` (currently on the Standard S1 tier). The service processes messages from an Azure Service Bus queue named `task-queue` within a Service Bus namespace named `sb-namespace-prod`.

You need to configure an Azure Monitor autoscale rule to increase the instance count of `asp-worker` when the volume of unprocessed tasks increases.

How should you configure the scale-out metric trigger?

Cevabı ve açıklamayı göster

Cevap: Target the Service Bus namespace as the metric resource, set the metric namespace to Microsoft.ServiceBus/namespaces, set the metric name to ActiveMessages, and add a dimension filter where DimensionName is set to EntityName and Values is set to the name of the queue.

Cevap

Target the Service Bus namespace as the metric resource, set the metric namespace to Microsoft.ServiceBus/namespaces, set the metric name to ActiveMessages, and add a dimension filter where DimensionName is set to EntityName and Values is set to the name of the queue.
The correct configuration requires setting the metric source to the namespace level because Azure Monitor aggregates Service Bus metrics at the namespace level. To isolate and target a specific queue within that namespace, the EntityName dimension filter must be applied. Furthermore, the App Service plan must remain on a supported pricing tier, such as the Standard S1 tier, since the Basic tier does not support autoscaling.

Adım Adım Çözüm

1
Determine the correct metric resource target and namespace.
Identify that Azure Monitor exposes Service Bus metrics at the namespace level (Microsoft.ServiceBus/namespaces) rather than individual queue resource endpoints.
Azure Monitor does not allow targeting individual queue resources directly for autoscaling metrics.
2
Identify the correct dimension to isolate the target queue.
Determine that the dimension name for filtering Service Bus namespace metrics by queue or topic name is EntityName.
Using dimensions allows the autoscale rule to aggregate active messages for only the queue processing the workload, rather than the entire namespace.
3
Verify App Service Plan pricing tier requirements.
Confirm that the App Service plan must remain on a tier that supports custom autoscale rules (Standard, Premium, or Isolated).
The Basic (B1) tier only supports manual scaling, so moving to the Basic tier would make metric-based autoscaling impossible.

Anahtar Kavram

Configuring autoscale rules based on external metrics and filtering by dimensions in Azure Monitor.
Soru 707Soru

Your organization is migrating the permission model of an Azure Key Vault named `kv-payment-prod` to use the Azure role-based access control permission model instead of Vault access policies. An Azure App Service web application named `app-payment-prod` uses a system-assigned managed identity to retrieve database connection secrets from this Key Vault. Immediately after you change the permission model to Azure RBAC, the web application fails to retrieve secrets, returning a `403 Forbidden` error. Which action should you perform to restore the application's access to the secrets while adhering to the principle of least privilege?

Cevabı ve açıklamayı göster

Cevap: Assign the Key Vault Secrets User role to the system-assigned managed identity of the App Service at the Key Vault scope.

Cevap

Assign the Key Vault Secrets User role to the system-assigned managed identity of the App Service at the Key Vault scope.
Assigning the Key Vault Secrets User role to the system-assigned managed identity at the Key Vault scope is correct because the Key Vault has been transitioned to the Azure RBAC permission model, where access policies are ignored. The Key Vault Secrets User role grants the necessary data-plane permissions (GET and LIST) to retrieve secrets, following the principle of least privilege.

Adım Adım Çözüm

1
Identify the active authentication identity of the App Service.
The application uses its system-assigned managed identity to authenticate against Azure Active Directory (Microsoft Entra ID).
We must grant permissions to the exact identity that requests token generation for accessing the Key Vault.
2
Determine the required permission scope and role.
The application needs to read secret values. Under Azure RBAC, the built-in role that allows reading secrets is the Key Vault Secrets User role.
Adhering to the principle of least privilege means avoiding broader roles like Key Vault Administrator or Key Vault Secrets Officer.
3
Assign the role using the Azure portal, CLI, or PowerShell.
The Key Vault Secrets User role is assigned to the system-assigned managed identity at the Key Vault resource scope.
This links the managed identity to the data-plane permission required to perform Key Vault GET operations on secrets.

Anahtar Kavram

Azure Key Vault RBAC permission model and data-plane role assignment
Tahmini Süre:1m 30s
Soru 708Soru

You are configuring an Azure App Service web application to retrieve a third-party payment provider API key stored as a secret in Azure Key Vault. The Key Vault, named kv-payment-prod, is configured to use the Azure role-based access control (Azure RBAC) permission model. The web application uses a system-assigned managed identity for authentication. You must reference the Key Vault secret directly within the App Service application settings under a setting named PaymentApiKey. You must follow the principle of least privilege. Which action should you perform to configure the application setting and permissions?

Cevabı ve açıklamayı göster

Cevap: Assign the Key Vault Secrets User role to the web application's system-assigned managed identity at the Key Vault scope, and set the value of the PaymentApiKey application setting to @Microsoft.KeyVault(SecretUri=https://kv-payment-prod.vault.azure.net/secrets/ApiKey/).

Cevap

Assign the Key Vault Secrets User role to the web application's system-assigned managed identity at the Key Vault scope, and set the value of the PaymentApiKey application setting to @Microsoft.KeyVault(SecretUri=https://kv-payment-prod.vault.azure.net/secrets/ApiKey/).
To allow the App Service to retrieve a secret from an Azure Key Vault configured with the Azure RBAC permission model, the application's system-assigned managed identity must be granted the Key Vault Secrets User role, which provides read access to the secret values. The App Service configuration reference must use the correct prefix @Microsoft.KeyVault(SecretUri=...) pointing to the secret's URI.

Adım Adım Çözüm

1
Determine the correct authorization role under the Azure RBAC model.
The Key Vault Secrets User role is selected as it grants the necessary data-plane permissions to read secret values, satisfying the principle of least privilege.
Other roles like Key Vault Reader do not grant access to the secret contents.
2
Formulate the App Service Key Vault reference syntax.
The syntax must follow the pattern @Microsoft.KeyVault(SecretUri=...) containing the full URI of the secret.
Incorrect prefixes such as @KeyVault(...) will prevent the App Service from resolving the reference.
3
Apply the configurations to the App Service setting.
Configure the system-assigned managed identity of the App Service with the Key Vault Secrets User role, and assign the valid Key Vault reference string to the PaymentApiKey setting.
This completes the authorization and reference mapping without requiring legacy access policies.

Anahtar Kavram

Azure Key Vault references in App Service configuration combined with Azure RBAC authorization.
Soru 709Soru

You are configuring security for an Azure Blob Storage container named `partner-imports` that multiple external clients use to upload diagnostic data. Each client requires write-only permissions. You must ensure that you can immediately revoke access for any individual client if their credentials are leaked, without affecting other clients and without rotating the storage account access keys. Which configuration should you use?

Cevabı ve açıklamayı göster

Cevap: A Service SAS associated with a unique Stored Access Policy for each client.

Cevap

A Service SAS associated with a unique Stored Access Policy for each client.
A Stored Access Policy (SAP) defines constraints on the container level. When a Service SAS is associated with an SAP, Azure Storage validates the SAS against the policy. Modifying or deleting the SAP immediately invalidates all Service SAS tokens associated with it. By using a unique SAP for each client, you can revoke access for an individual client by deleting or modifying their specific policy without affecting others.

Adım Adım Çözüm

1
Analyze the revocation and isolation requirements for external client access to Azure Blob Storage.
Identified that rotating the storage account access keys is not permitted, and revoking one client must not impact other clients.
This eliminates solutions that rely on account-level key rotation or shared credentials.
2
Evaluate the capability of ad-hoc Shared Access Signatures (SAS) to meet the revocation requirement.
Ad-hoc SAS tokens (whether Service or Account level) cannot be individually revoked before their expiration time without rotating the storage account key used to sign them.
Ad-hoc tokens do not have an external control mechanism once issued.
3
Select a mechanism that supports individual token invalidation without key rotation.
Stored Access Policies (SAPs) allow changing permissions or expiration times, or deleting the policy entirely, which instantly invalidates any associated Service SAS tokens.
Using a unique Stored Access Policy for each client provides the required isolation and instant revocation capability.

Anahtar Kavram

Stored Access Policies for Service SAS Revocation
Soru 710Soru

You are configuring Azure Monitor autoscale rules for an Azure App Service plan named `asp-payment` that currently runs a critical web API on 44 instances. The minimum instance count is configured as 44, and the maximum is 1010.

You have already configured the scale-out rule as follows:
* Metric: CPU Percentage
* Time aggregation: Average
* Duration (Time window): 1010 minutes
* Operator: Greater than
* Threshold: 75%75\%
* Operation: Increase count by 22

You need to configure the scale-in rule to decrease the instance count by 11 when the workload decreases, while ensuring that the configuration does not cause autoscale flapping under a constant workload.

Which of the following configurations should you select? (Select TWO)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: A scale-in threshold of 45%45\% CPU percentage.; Set the scale-in metric statistic (instance aggregation) to Average.

Cevap

Select a scale-in threshold of 45%45\% CPU percentage and set the scale-in metric statistic to Average.
The correct options are selecting a scale-in threshold of 45%45\% CPU percentage and setting the metric statistic to Average. Under a constant workload of 300%300\% CPU (derived from 44 instances running at 75%75\% CPU), scaling out by 22 instances increases the total instances to 66, reducing the average CPU to 50%50\%. A scale-in threshold of 45%45\% (which is below 50%50\%) ensures the rule does not immediately trigger. Selecting the Average metric statistic ensures that the autoscale engine evaluates the overall cluster load consistently across both scale-out and scale-in rules.

Adım Adım Çözüm

1
Calculate the total workload at the scale-out threshold.
The total workload is calculated as: 44 instances ×75%=300%\times 75\% = 300\% CPU equivalent.
To find the average CPU per instance after a scale-out event occurs under the same workload.
2
Calculate the new average CPU percentage per instance after scaling out.
The new instance count is 4+2=64 + 2 = 6. The new average CPU per instance is: 300%6=50%\frac{300\%}{6} = 50\%.
The scale-in threshold must be set below this value to prevent the scale-in rule from triggering immediately after a scale-out.
3
Determine the maximum threshold for scale-in to prevent flapping.
The scale-in threshold must be strictly less than 50%50\% (e.g., 45%45\%) and the metric statistic must be set to Average to maintain consistency with the scale-out rule.
Setting the threshold to 55%55\% causes immediate scale-in when CPU drops to 50%50\%, leading to flapping. Setting the metric statistic to Average ensures the rule aggregates CPU across all instances correctly.

Anahtar Kavram

Autoscale flapping occurs when a scale-out action immediately satisfies the condition for a scale-in action (or vice versa) under a constant workload. To prevent this, the scale-in threshold must be set lower than the average load on the expanded scale set.
Soru 711Soru

You have a Standard tier Azure API Management (APIM) instance named apim-service with the default gateway URL apim-service.azure-api.net. You need to configure a custom domain api.contoso.com for the gateway endpoint. The TLS certificate must be managed and automatically renewed by Azure. Which sequence of steps should you perform to configure the custom domain?

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

To configure a custom domain with an Azure-managed certificate, you must first create a DNS CNAME record pointing the custom domain to the default gateway hostname, add the custom domain for the Gateway endpoint in the Azure portal, choose the Managed certificate option, and then save the configuration to trigger verification and provisioning.
The correct order ensures that domain ownership can be verified dynamically by API Management. The CNAME record must exist in DNS before saving the custom domain configuration in Azure. Once the configuration is saved with the Managed certificate option selected, Azure verifies the CNAME record and requests the certificate from the Certificate Authority.

Adım Adım Çözüm

1
Create a CNAME record in your DNS provider pointing the custom domain to the default API Management gateway hostname.
The DNS system starts propagating the CNAME record.
Azure API Management requires the CNAME record to be in place before configuring the custom domain with a managed certificate, as it queries the DNS to verify domain ownership.
2
In the Azure portal, navigate to the API Management Custom domains settings and add a custom domain for the Gateway endpoint.
The custom domain configuration form is opened and populated with the custom hostname.
This associates the custom domain with the Gateway service endpoint of your API Management instance.
3
Set the Certificate type to Managed.
API Management is configured to request a free, managed TLS certificate instead of requiring an uploaded custom certificate or Azure Key Vault integration.
Choosing the Managed option tells Azure to handle both the creation and automatic renewal of the TLS certificate.
4
Save the custom domain configuration.
The API Management service validates the CNAME record and begins provisioning the TLS certificate.
Saving the configuration triggers the asynchronous ownership verification and certificate binding process.

Anahtar Kavram

Configuring custom domains with Azure Managed Certificates in API Management
Soru 712Soru

You are authoring a Bicep template to deploy a new Azure Key Vault. The Key Vault must meet the following security requirements:

* Use Azure Role-Based Access Control (RBAC) for authorization instead of vault access policies.
* Prevent the permanent deletion of the Key Vault, its secrets, keys, and certificates by any user, including administrators.

Which two properties must you configure within the `properties` block of the Key Vault resource definition?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: `enableRbacAuthorization` set to `true`; `enablePurgeProtection` set to `true`

Cevap

Configure `enableRbacAuthorization` set to `true` and `enablePurgeProtection` set to `true`.
To configure Azure Key Vault via a Bicep/ARM template for Azure RBAC authorization and prevent permanent deletion, you must configure two key properties within the vault's properties block: setting `enableRbacAuthorization` to `true` ensures that Azure RBAC is used for data-plane authorization, and setting `enablePurgeProtection` to `true` prevents the immediate purging of deleted items. This enforces the soft-delete retention policy and secures key vault content against accidental or malicious permanent deletion.

Adım Adım Çözüm

1
Enable Azure RBAC for key vault authorization by setting the `enableRbacAuthorization` property to `true` in the Bicep template's properties block.
This ensures that authorization is controlled via Azure Role-Based Access Control rather than traditional inline key vault access policies.
This directly satisfies the requirement to use Azure RBAC instead of vault access policies.
2
Enable purge protection by setting the `enablePurgeProtection` property to `true` in the properties block.
This prevents anyone, including administrators, from immediately and permanently deleting (purging) the Key Vault or any deleted secrets/keys/certificates before the soft-delete retention period expires.
This satisfies the security requirement to prevent permanent deletion of the vault and its objects.

Anahtar Kavram

Configuring Azure Key Vault properties in infrastructure-as-code templates to enforce RBAC authorization and purge protection.
Soru 713Soru

You are developing a C# transaction ingestion service that processes events from an Azure Event Hub. The service is built using the Azure.Messaging.EventHubs.Processor library and runs on multiple host instances. During performance testing, you encounter lease conflict exceptions when host instances scale up. You need to ensure that the checkpoint store is configured correctly and that partition ownership is managed properly. Which of the following describes the correct storage configuration and client behavior for implementing checkpointing with the EventProcessorClient?

Cevabı ve açıklamayı göster

Cevap: Use Azure Blob Storage as the checkpoint store, allowing the EventProcessorClient to automatically manage partition ownership by creating and acquiring leases on metadata blobs.

Cevap

Use Azure Blob Storage as the checkpoint store, allowing the EventProcessorClient to automatically manage partition ownership by creating and acquiring leases on metadata blobs.
The correct answer represents the native behavior of the EventProcessorClient. When provided with a BlobContainerClient, the processor client manages partition load balancing and checkpoints internally by creating metadata blobs inside the blob container and acquiring leases on them. There is no need for developers to manually manage these leases.

Adım Adım Çözüm

1
Identify the storage service required by the .NET SDK EventProcessorClient.
Azure Blob Storage is identified as the required storage service because it supports blob leasing mechanisms used for load balancing and checkpointing.
The EventProcessorClient class is designed specifically to integrate with Azure Blob Storage via a BlobContainerClient.
2
Determine how partition ownership and load balancing are coordinated.
The EventProcessorClient automatically creates metadata blobs in the container and acquires leases on them to represent partition ownership.
This automated leasing avoids partition processing conflicts when multiple consumer instances run concurrently.
3
Select the option that reflects automated lease management using Blob Storage.
The option stating that EventProcessorClient automatically manages partition ownership via leases on metadata blobs in Azure Blob Storage is selected.
It correctly identifies the service and highlights that leasing is handled transparently by the client rather than manually.

Anahtar Kavram

Partition checkpointing and load balancing automation in Azure Event Hubs using Azure Blob Storage leases.
Soru 714Soru

You are implementing a method in a C# application using the `Azure.Storage.Blobs` SDK (v12) to generate a temporary upload URI for a client. The client must be allowed to upload a single blob named `report.pdf` to a container named `documents`.

The implementation must meet the following security requirements:
- Limit permissions strictly to uploading the specified blob.
- Enforce the HTTPS protocol for the upload request.
- Sign the SAS using Microsoft Entra ID credentials rather than the storage account's shared access key.
- Prevent authentication failures due to clock skew between the client and Azure Storage.

You have the following code segment:

csharp
var credential = new DefaultAzureCredential();
var blobServiceClient = new BlobServiceClient(
new Uri("https://mystorage.blob.core.windows.net"),
credential
);

// [Block 1]

var sasBuilder = new BlobSasBuilder()
{
BlobContainerName = "documents",
BlobName = "report.pdf",
Resource = "b",
// [Block 2]
};
sasBuilder.SetPermissions(BlobSasPermissions.Write);

Which of the following code segments should you use to complete the implementation? (Select two.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: For [Block 1]:
csharp
var userDelegationKey = await blobServiceClient.GetUserDelegationKeyAsync(
DateTimeOffset.UtcNow.AddMinutes(-15),
DateTimeOffset.UtcNow.AddHours(2)
);
; For [Block 2]:
csharp
StartsOn = DateTimeOffset.UtcNow.AddMinutes(-15),
ExpiresOn = DateTimeOffset.UtcNow.AddHours(2),
Protocol = SasProtocol.Https

Cevap

To generate a secure SAS using Microsoft Entra ID with clock skew allowance and HTTPS enforcement, you should obtain a User Delegation Key with a 15-minute start buffer and a 2-hour duration, and configure the BlobSasBuilder with corresponding start/expiration bounds and the HTTPS-only protocol option.
The correct implementation requires obtaining a User Delegation Key and setting up a BlobSasBuilder. To sign with Microsoft Entra ID, the application must use `GetUserDelegationKeyAsync` with a start time that accounts for clock skew (e.g., subtracting 15 minutes) and a duration matching the lifetime requirements. Similarly, the SAS builder must be configured to start 15 minutes prior to the current time, expire in 2 hours, and enforce HTTPS-only connections using `SasProtocol.Https`.

Adım Adım Çözüm

1
Obtain a User Delegation Key using Microsoft Entra ID credentials
The application calls GetUserDelegationKeyAsync on the BlobServiceClient.
Signing a SAS with Microsoft Entra ID (User Delegation SAS) is more secure than using the storage account key, as it respects Azure RBAC permissions and avoids exposing account access keys.
2
Account for potential clock skew during key generation
Set the start time of the User Delegation Key to 15 minutes in the past.
If the client's system clock is slightly ahead of the Azure Storage server clock, a token starting exactly at UtcNow will be rejected as not yet valid. A clock skew buffer prevents this.
3
Configure the BlobSasBuilder properties to restrict protocol and set correct lifetime limits
Assign StartsOn, ExpiresOn, and set Protocol to SasProtocol.Https.
This enforces HTTPS-only communication and ensures the token lifetime matches the 2-hour constraint while preserving the clock skew buffer.

Anahtar Kavram

Generating a User Delegation SAS token using Azure.Storage.Blobs SDK in .NET, applying least privilege, HTTPS enforcement, and clock skew mitigation.
Soru 715Soru

You are designing autoscale rules for several Azure solutions to optimize performance and prevent rapid oscillation (flapping). Match each Azure Monitor autoscale configuration setting on the left to the corresponding workload requirement it satisfies on the right.

Soldaki öğeye tıklayın, sonra eşleşen sağdaki öğeye tıklayın

Öğeler

Time aggregation set to Maximum for CPU Percentage
Cool-down period set to 2020 minutes for scale-in rules
Metric set to Service Bus queue message count
Time aggregation set to Average for CPU Percentage

Eşleşmeler

Cevabı ve açıklamayı göster

Cevap

Time aggregation set to Maximum for CPU Percentage matches with triggering scale-out if any single instance is overloaded. Cool-down period set to 2020 minutes for scale-in rules matches with avoiding reducing capacity too quickly. Metric set to Service Bus queue message count matches with scaling based on the total queue backlog. Time aggregation set to Average for CPU Percentage matches with scaling based on the overall, balanced resource utilization.
The correct pairings align each autoscale configuration parameter with its direct operational outcome. Time aggregation set to Maximum ensures that scale-out occurs if a single instance is overloaded. The cool-down period delays scale-in actions to prevent flapping. The Service Bus queue message count reflects the total workload backlog. Time aggregation set to Average measures overall, balanced pool utilization.

Adım Adım Çözüm

1
Analyze the impact of Time Aggregation Maximum on autoscale behavior.
Maximum looks at the peak value among all instances, which correlates directly with detecting if any single instance is overloaded.
This matches the requirement to prevent individual instance degradation.
2
Evaluate the function of the scale-in cool-down period.
The cool-down period prevents the autoscale engine from performing another scale-in action for a set time (e.g., 2020 minutes) after a scaling event.
This is used to stabilize the system and allow active tasks to finish without immediate scale-down.
3
Identify the metric suitable for queue backlog workloads.
Service Bus queue message count represents the work queue backlog.
This matches the workload's scaling requirement based on pending work.
4
Determine the application of Time Aggregation Average.
Average computes the mean value across all instances, representing balanced workload pressure.
This is suitable for standard web apps where traffic is evenly distributed.

Anahtar Kavram

Azure Monitor Autoscale rule metric parameters and aggregation types are configured to match specific workload scaling patterns and prevent flapping.
Soru 716Soru

You are developing a C# background service that processes high-volume telemetry data from an Azure Event Hub using the EventProcessorClient class. The background service runs across multiple instances in an Azure App Service plan, and you must use Azure Blob Storage for checkpointing and load balancing partition ownership. Some telemetry payloads can occasionally exceed 64 KB. You need to configure the authentication and storage access for the application while ensuring it can handle the payload sizes and follow security best practices. Which configuration and authentication approach should you implement to meet these requirements?

Cevabı ve açıklamayı göster

Cevap: Initialize the EventProcessorClient using a user-assigned managed identity that is granted the Azure Event Hubs Data Receiver role on the Event Hub and the Storage Blob Data Contributor role on the Azure Blob Storage account.

Cevap

Initialize the EventProcessorClient using a user-assigned managed identity that is granted the Azure Event Hubs Data Receiver role on the Event Hub and the Storage Blob Data Contributor role on the Azure Blob Storage account.
The correct approach is to initialize the EventProcessorClient using a user-assigned managed identity, which can be shared across multiple scaled App Service instances. This identity must be granted the Azure Event Hubs Data Receiver role to pull events from the Event Hub, and the Storage Blob Data Contributor role to allow the processor to manage lease blobs and store checkpoints in Azure Blob Storage.

Adım Adım Çözüm

1
Select the appropriate managed identity type.
A user-assigned managed identity is chosen to enable credential sharing across multiple scaled App Service instances under a shared identity lifecycle.
System-assigned identities are tied to a single resource and cannot be shared across separate services.
2
Grant the necessary role-based access control (RBAC) roles.
The identity is assigned the Azure Event Hubs Data Receiver role on the Event Hub namespace or instance, and the Storage Blob Data Contributor role on the storage account containing the checkpoint container.
The client must be authorized to pull telemetry events and to read/write state checkpoint files and ownership lease blobs.
3
Initialize the EventProcessorClient in code.
Initialize the client using the EventProcessorClient constructor, passing the BlobContainerClient initialized with the DefaultAzureCredential configured for the user-assigned identity.
Allows the EventProcessorClient to automatically balance partitions and write checkpoint data securely using the specified identity.

Anahtar Kavram

Configuring secure authentication and checkpoint storage for Azure Event Hubs EventProcessorClient using Azure Blob Storage and RBAC.
Soru 717Soru

You are developing a C# command-line interface (CLI) tool that will be executed by system administrators on headless Linux servers. The tool must authenticate the administrators using their individual Microsoft Entra ID credentials to access a secure downstream Web API. The administrators' accounts have multi-factor authentication (MFA) enabled. Which MSAL.NET method should you use to acquire the token?

Cevabı ve açıklamayı göster

Cevap: IPublicClientApplication.AcquireTokenWithDeviceCode

Cevap

IPublicClientApplication.AcquireTokenWithDeviceCode
The method utilizing the Device Code flow is correct because it allows user authentication on headless or input-constrained devices by prompting the user to complete the login process, including any required Multi-Factor Authentication (MFA), on a separate device with a web browser.

Adım Adım Çözüm

1
Analyze the environment and constraints.
The application runs on a headless server without a web browser or GUI, and administrators must authenticate individually with MFA-enabled accounts.
This rules out interactive browser flows and non-interactive username/password flows which cannot complete MFA.
2
Identify the required identity type.
The requirement demands individual user authentication rather than application authentication.
This rules out client credential flows (service principals) which only authenticate the application itself.
3
Select the appropriate OAuth 2.0 flow.
The Device Authorization Grant (Device Code Flow) is selected because it permits interactive authentication on a secondary device while running on a headless machine.
Using the Device Code method allows the administrator to complete MFA safely on their primary workstation or phone.

Anahtar Kavram

Selecting the correct OAuth 2.0 authentication flow in MSAL.NET for input-constrained and headless environments.
Soru 718Soru

You are developing an API gateway solution using Azure API Management (APIM). You have a backend API hosted on an Azure App Service that is secured with Microsoft Entra ID. You want to configure APIM to authenticate to the backend API using the APIM instance's system-assigned managed identity. Which of the following configurations and actions should you use to implement this authentication mechanism?

Cevabı ve açıklamayı göster

Cevap: Add the <authentication-managed-identity resource="https://backend-api.azurewebsites.net" /> policy to the <inbound> section of the APIM policy, and ensure the backend App Service accepts the APIM system-assigned managed identity.

Cevap

Add the <authentication-managed-identity resource="https://backend-api.azurewebsites.net" /> policy to the <inbound> section of the APIM policy, and ensure the backend App Service accepts the APIM system-assigned managed identity.
To authenticate against a backend App Service using a system-assigned managed identity, the <authentication-managed-identity> policy must be placed in the <inbound> section of the API policy. By omitting the client-id attribute, APIM will automatically use the system-assigned identity to obtain a token for the specified resource. The backend App Service must also be configured to accept and authorize this identity.

Adım Adım Çözüm

1
Determine the correct policy section for setting the authentication headers.
The inbound section is selected because request authentication must happen before forwarding the request to the backend.
Outbound policies process the response after the backend call, which is too late to authenticate the request.
2
Select the correct identity configuration parameters.
The policy should use authentication-managed-identity without a client-id parameter.
Specifying client-id instructs the system to look for a user-assigned managed identity instead of the system-assigned identity.
3
Verify that backend service authorization is in place.
Ensure the system-assigned managed identity of the APIM instance is authorized in the backend App Service configuration.
Obtaining a token is only the first step; the backend must also trust and authorize that token.

Anahtar Kavram

Azure API Management policies allow dynamic request modification and authentication. The authentication-managed-identity policy can acquire an Entra ID token using either system-assigned or user-assigned managed identities. Inbound policies execute before forwarding requests, making them the correct location for authentication configuration.
Soru 719Soru

An energy management company is deploying a distributed system to monitor smart meter readings. Telemetry data is streamed to an Azure Event Hub, and you must build a C# subscriber application using the Azure.Messaging.EventHubs SDK to process the data in parallel across multiple virtual machine instances. The application must ensure that partitions are balanced dynamically among the running instances and that event processing resumes from the last known checkpoint in the event of an instance failure. Which of the following actions are required to implement the event consumer using the EventProcessorClient class? Select two.

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Initialize a BlobContainerClient that points to an Azure Blob Storage container, and pass it to the constructor of EventProcessorClient.; Assign event handlers to the ProcessEventAsync and ProcessErrorAsync events on the EventProcessorClient instance before starting execution.

Cevap

Initialize a BlobContainerClient pointing to the storage container and pass it to the EventProcessorClient, and register event handler delegates for both ProcessEventAsync and ProcessErrorAsync before starting the processor.
To consume events using the EventProcessorClient class, you must provide a BlobContainerClient pointing to an Azure Blob Storage container. The client uses this container to store partition ownership and checkpoint data. Additionally, before calling StartProcessingAsync, you must register event handler delegates for both ProcessEventAsync (to process events) and ProcessErrorAsync (to handle errors) as they are mandatory for the processor to function.

Adım Adım Çözüm

1
Create a BlobContainerClient instance pointing to the designated Azure Blob Storage container.
An initialized BlobContainerClient that is ready to act as the checkpoint store.
The EventProcessorClient relies on Azure Blob Storage to maintain partition ownership via blob leases and to persist progress checkpoints.
2
Instantiate the EventProcessorClient, passing the BlobContainerClient along with the consumer group, namespace connection string, and Event Hub name.
An initialized EventProcessorClient instance.
The client requires the storage provider client to manage its state metadata during horizontal scale-out.
3
Register handler delegates to the ProcessEventAsync and ProcessErrorAsync event properties of the client.
Configured event handlers for processing telemetry and handling errors.
These handlers are required by the SDK; attempting to start the processing loop without them registered will result in a runtime exception.

Anahtar Kavram

Configuring the EventProcessorClient lifecycle with Blob Storage checkpointing and event handlers.
Soru 720Soru

You are developing a C# console application that will run on multiple Azure Virtual Machines. The application must authenticate to the Microsoft Identity Platform and access Microsoft Graph using a managed identity. Because the application runs on multiple virtual machines, they must all share the same managed identity. You use MSAL.NET to implement the authentication code. You write the following code:

csharp
string clientId = "00000000-0000-0000-0000-000000000000";
string resource = "https://graph.microsoft.com";

// Initialize the managed identity application
IManagedIdentityApplication app = [Snippet 1]
.Build();

// Acquire the token
AuthenticationResult result = await app.[Snippet 2]
.ExecuteAsync();

Which two code segments should you use to complete the implementation? (Select two.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: ManagedIdentityApplicationBuilder.Create(ManagedIdentityId.WithUserAssignedClientId(clientId)); AcquireTokenForManagedIdentity(resource)

Cevap

Initialize the application using a user-assigned managed identity client ID and acquire the token using the dedicated managed identity token acquisition method.
To fulfill the requirement where multiple virtual machines share the same identity, a user-assigned managed identity must be used. In MSAL.NET, you instantiate this using the builder's Create method along with `ManagedIdentityId.WithUserAssignedClientId(clientId)`. To acquire the token, you must call the dedicated `AcquireTokenForManagedIdentity` method passing the resource URI.

Adım Adım Çözüm

1
Determine the type of managed identity required based on sharing requirements.
Since multiple virtual machines must share the identity, a user-assigned managed identity is selected.
System-assigned managed identities are locked to a single resource lifecycle and cannot be shared across resources.
2
Construct the managed identity configuration using the user-assigned client ID in MSAL.NET.
Use ManagedIdentityApplicationBuilder.Create with ManagedIdentityId.WithUserAssignedClientId.
This registers the user-assigned identity's client ID with the MSAL builder.
3
Use the correct token acquisition method for managed identity applications.
Invoke the AcquireTokenForManagedIdentity method on the application object.
Managed identity token requests in MSAL.NET use AcquireTokenForManagedIdentity rather than client credentials or public client methods.

Anahtar Kavram

Acquiring tokens via MSAL.NET using a user-assigned managed identity for shared workloads.
Tahmini Süre:2m 0s
ÖncekiSayfa 36 / 49Sonraki
Tüm alıştırma soruları — Microsoft Azure Developer (AZ-204) | Examkin