Tüm alıştırma soruları

972 soru

Soru 101Soru

A developer is configuring local Git deployment for an Azure App Service web app named `app-hr-prod`. The developer needs to set up deployment credentials, retrieve the Git clone URL, and push the application code from a local repository to Azure.

Which sequence of steps should the developer perform to complete this configuration?

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

Cevabı ve açıklamayı göster

Cevap

Configure user-level deployment credentials, enable local Git deployment on the App Service, add the generated Git URL as a remote in your local repository, and push the code.
To configure local Git deployment for an Azure App Service web app, you must first establish the user-level deployment credentials. Next, you enable local Git deployment on the App Service web app to generate the Git repository clone URL. You then register this URL as a remote destination in your local Git repository. Finally, you push the local branch to the Azure remote to build and deploy the web application.

Adım Adım Çözüm

1
Run `az webapp deployment user set` to configure deployment credentials.
User-level deployment credentials are established globally for the Azure subscription.
A deployment user must be configured to authenticate local Git push requests to Azure App Service.
2
Run `az webapp deployment source config-local-git` for the target web app.
Local Git deployment is enabled on the web app, and the Azure Git repository URL is returned.
This exposes the endpoint needed to associate the local Git repository with the Azure host.
3
Run `git remote add azure <url>` inside the local repository directory.
The local repository has a new Git remote named 'azure' pointing to the App Service repository.
Git needs the remote URL configured locally before it can transmit code to that endpoint.
4
Run `git push azure main` to push code to Azure.
The code is uploaded, built, and deployed to the active App Service slot.
Pushing the commits triggers the deployment workflow on Azure App Service.

Anahtar Kavram

Local Git deployment configuration for Azure App Service
Soru 102Soru

You plan to map a custom domain to an Azure App Service web app and secure it using a free App Service Managed Certificate. You need to configure this using the Azure CLI.

Which sequence of steps should you perform to map the domain and configure the certificate? Arrange the steps in the correct order.

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

Cevabı ve açıklamayı göster

Cevap

The correct sequence is: first, retrieve the web app's custom domain verification ID; second, create the TXT and CNAME records at your DNS registrar; third, add the custom domain hostname to the web app; fourth, generate the App Service Managed Certificate; and fifth, bind the certificate to the custom domain using SNI.
To successfully configure a custom domain with an App Service Managed Certificate, you must perform the steps in a strict logical order. First, get the verification ID using `az webapp show`. Second, configure the TXT and CNAME records at your DNS registrar. Third, map the hostname using `az webapp config hostname add`. Fourth, generate the certificate using `az webapp config ssl create`. Finally, bind the certificate to the domain using `az webapp config ssl bind`.

Adım Adım Çözüm

1
Retrieve the custom domain verification ID using `az webapp show`.
The `customDomainVerificationId` property is retrieved.
This ID is required to create the TXT validation record at the DNS provider.
2
Create a TXT record (prefixed with `asuid.`) containing the verification ID, and a CNAME record pointing to the default app URL at the DNS registrar.
The DNS records are created and propagate.
Azure queries these records to verify ownership before allowing the custom hostname to be mapped.
3
Add the custom hostname to the web app using `az webapp config hostname add`.
The custom domain mapping is successfully added to the App Service.
You cannot issue an App Service Managed Certificate for a domain that is not mapped to the web app.
4
Generate the managed certificate using `az webapp config ssl create`.
An App Service Managed Certificate is created, and its thumbprint is returned.
The certificate must exist in the App Service environment before it can be bound.
5
Configure the TLS/SSL binding using `az webapp config ssl bind` with the certificate thumbprint.
The custom domain is secured with HTTPS.
This binds the certificate to the custom hostname using SNI SSL.

Anahtar Kavram

Azure App Service custom domain and SSL binding configuration requires verifying ownership via DNS records before adding hostnames, and binding the hostname before generating or assigning an App Service Managed Certificate.
Soru 103Soru

You are deploying a new Azure Function App. You require a hosting plan that scales dynamically and automatically based on the number of incoming events, without requiring manual scale configuration or setting up autoscale metrics. Which of the following hosting plans meet this requirement? (Select TWO)

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

Cevabı ve açıklamayı göster

Cevap: Consumption plan; Elastic Premium plan

Cevap

The Consumption plan and Elastic Premium plan both support dynamic and automatic scaling based on the number of incoming events.
The correct hosting plans are the Consumption plan and the Elastic Premium plan. Both of these plans scale instances dynamically and automatically in response to incoming events. The Consumption plan scales down to zero when idle, while the Elastic Premium plan maintains pre-warmed instances to prevent cold starts, but both utilize the serverless scaling infrastructure.

Adım Adım Çözüm

1
Analyze the scaling requirements of the scenario.
The scenario requires automatic, dynamic scaling based on event count without manual scale configuration.
This points to the serverless hosting options in Azure Functions.
2
Evaluate the hosting plans for Azure Functions.
The Consumption and Elastic Premium plans scale instances dynamically as event count increases. Dedicated or Basic App Service plans run on pre-allocated VMs and do not dynamically scale out-of-the-box based on events.
Identifying which plans provide serverless scale-out capabilities determines the correct answers.

Anahtar Kavram

Azure Functions hosting plans and their scaling capabilities.
Tahmini Süre:45s
Soru 104Soru

You are configuring a deployment workflow on an Azure Virtual Machine (VM). The VM must build a container image locally and push it to a private Azure Container Registry (ACR) named gridregistry. You have created a User-Assigned Managed Identity named acr-pusher-identity and assigned it the AcrPush role on gridregistry. The VM is configured to use this identity. From the VM's command-line interface, you need to authenticate to Azure and push the local image app:v1 to the registry using the user-assigned managed identity. Which command sequence should you execute?

Cevabı ve açıklamayı göster

Cevap: az login --identity --username <client_id_of_acr-pusher-identity>
az acr login --name gridregistry
docker tag app:v1 gridregistry.azurecr.io/app:v1
docker push gridregistry.azurecr.io/app:v1

Cevap

Execute the sequence that logs in using the user-assigned identity's client ID, logs into the registry using the name 'gridregistry', tags the image with the login server 'gridregistry.azurecr.io/app:v1', and pushes the image.
The correct command sequence first authenticates the Azure CLI with the VM's user-assigned managed identity by explicitly passing the client ID via the --username parameter. It then logs in to the registry using the short name 'gridregistry'. Finally, it tags the image with the registry's fully qualified login server domain 'gridregistry.azurecr.io' and pushes it to the registry.

Adım Adım Çözüm

1
Authenticate the Azure CLI session using the user-assigned managed identity.
az login --identity --username <client_id_of_acr-pusher-identity> is executed.
For VMs with a user-assigned managed identity, you must specify the identity's client ID, object ID, or resource ID using the --username parameter; otherwise, Azure CLI defaults to the system-assigned identity.
2
Authenticate the local Docker daemon to the Azure Container Registry.
az acr login --name gridregistry is executed.
The az acr login command uses the active Azure CLI session to obtain an access token and log in to Docker. The command expects the registry name (not the login server URL) for the --name parameter.
3
Tag the local container image with the target registry's login server domain.
docker tag app:v1 gridregistry.azurecr.io/app:v1 is executed.
Docker requires the image tag to begin with the registry's fully qualified login server name (registryname.azurecr.io) in order to route the push command to the correct registry.
4
Push the tagged image to the Azure Container Registry.
docker push gridregistry.azurecr.io/app:v1 is executed.
Uploads the container image layers to the gridregistry repository.

Anahtar Kavram

Azure Container Registry authentication and image pushing using a User-Assigned Managed Identity from an Azure VM.
Soru 105Soru

You need to deploy a containerized application to Azure Container Instances (ACI). The container image is stored in a private Azure Container Registry (ACR) named `contosoacr`. You must use a user-assigned managed identity named `contoso-aci-identity` to authenticate the container group to pull the image from `contosoacr`. The solution must follow the principle of least privilege. Which sequence of Azure CLI commands should you perform to deploy the container instance?

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

Cevabı ve açıklamayı göster

Cevap

To deploy a container in ACI that pulls an image from a private ACR using a user-assigned managed identity, you must first create the identity, retrieve its principal ID and the ACR resource ID, assign the AcrPull role to the identity at the ACR scope, and finally run the container creation command referencing the identity.
The correct order follows the logical dependency chain of Azure resources. The user-assigned managed identity must first exist. Once it exists, its principal ID and the target ACR resource ID are retrieved to configure the role assignment. The role assignment granting 'AcrPull' must be active before deployment is initiated. Finally, the container group is deployed using the container creation CLI command, which references the identity to pull the image.

Adım Adım Çözüm

1
Create the user-assigned managed identity
The identity resource is provisioned in Azure.
You must establish the identity's resource lifecycle before configuring permissions or assigning it.
2
Retrieve required security identifier (Principal ID) and resource identifier (ACR Resource ID)
The necessary resource IDs are retrieved for role mapping.
Role assignments require target identity and target resource scopes defined by Azure Resource Manager IDs.
3
Assign the AcrPull role to the identity
The identity has authorization to pull images from the registry.
This permission must be in place before the container is deployed, as ACI will pull the image during provisioning.
4
Deploy the ACI container group referencing the identity
The container group is deployed, using the identity to successfully pull the image from ACR.
Using both parameters ensures the identity is bound to the container group and utilized specifically for registry authentication.

Anahtar Kavram

Deploying container groups to ACI with secure registry authentication using user-assigned managed identities.
Soru 106Soru

You are configuring an existing Azure Container App named `my-app` to pull container images from a private Azure Container Registry (ACR) named `myregistry.azurecr.io`. You want to use a User-Assigned Managed Identity for authentication to adhere to the principle of least privilege. What is the correct sequence of steps to configure the container app to use the managed identity and deploy the image?

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

Cevabı ve açıklamayı göster

Cevap

Create the User-Assigned Managed Identity, assign the AcrPull role to it over the registry scope, associate the identity with the Container App, configure the Container App registry credential helper, and then update the Container App image.
The correct order resolves dependencies strictly. The User-Assigned Managed Identity must be created first to obtain its configuration details. Then, permissions must be granted to the identity to authenticate with the container registry. Next, the identity must be bound to the Container App before configuring the app's registry settings to use it. Finally, the container image can be updated, allowing the app to authenticate, pull the image, and spin up a new revision.

Adım Adım Çözüm

1
Provision the User-Assigned Managed Identity using the Azure CLI.
The identity resource is generated with a unique principal ID and resource ID.
You must establish the identity principal first to retrieve its properties for downstream role assignments and associations.
2
Grant the AcrPull role to the identity over the Azure Container Registry.
The managed identity is authorized to pull images from the ACR.
Authentication relies on role-based access control (RBAC). Without this permission, the Container App will fail to pull the image even if the identity is correctly assigned.
3
Assign the User-Assigned Managed Identity to the Container App resource.
The container app is associated with the identity's resource ID in its identity block.
Azure Resource Manager validates that the identity is associated with the Container App before letting you configure it for container registry authentication.
4
Establish the registry configuration on the Container App.
The Container App registry block is updated to specify the target ACR server and user-assigned identity.
This links the ACR server path to the identity credentials so the platform knows how to authenticate for subsequent pull requests.
5
Update the image on the Container App.
A new revision is created and the private image is pulled successfully.
Since the registry mappings, identity association, and RBAC permissions are configured, the platform resolves the registry reference and pulls the private image with zero authentication failures.

Anahtar Kavram

Deploying Azure Container Apps with private registry pull using User-Assigned Managed Identity
Soru 107Soru

You are configuring an Azure App Service web app named app-finance to securely retrieve database credentials stored in an Azure Key Vault. You want to use a system-assigned managed identity to authenticate the web app. Which two configurations are required to complete this setup? (Select two.)

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

Cevabı ve açıklamayı göster

Cevap: Enable a system-assigned managed identity on the Azure App Service web app.; Configure an access policy in Azure Key Vault that grants Get secret permission to the web app's managed identity.

Cevap

To allow the web app to securely retrieve secrets from Azure Key Vault, you must enable a system-assigned managed identity on the App Service web app and configure an access policy in Key Vault granting the identity Get secret permission.
To retrieve secrets, the App Service web app needs an identity to authenticate with Microsoft Entra ID, which is achieved by enabling a system-assigned managed identity on the web app. Once configured, the Key Vault must trust and authorize this identity, which requires creating an access policy in the Key Vault that grants Get secret permission to the web app's identity.

Adım Adım Çözüm

1
Enable the system-assigned managed identity on the App Service web app.
The web app is registered in Microsoft Entra ID and receives an Object ID.
This establishes a secure identity for the web app to use when calling other services.
2
Configure an access policy in the Azure Key Vault instance.
The web app's managed identity is granted permission to get secrets.
This completes the authorization flow, allowing the web app to read the secret values.

Anahtar Kavram

Configuring Azure App Service managed identity and Key Vault access permissions.
Soru 108Soru

You are deploying a container to Azure Container Instances (ACI) to run a data validation task. The task must run to completion. If the validation script fails with a non-zero exit code, the container must automatically restart to retry the task. If the script succeeds (zero exit code), the container must stop and not restart. Which restart policy should you apply to the container group?

Cevabı ve açıklamayı göster

Cevap: OnFailure

Cevap

The correct policy is OnFailure.
The restart policy configured as 'OnFailure' is correct because it restarts the container only when the process exits with a non-zero exit code, allowing the container to retry the validation task if it fails, while remaining stopped when the task succeeds.

Adım Adım Çözüm

1
Analyze the requirements for container execution and lifecycle behavior.
The container needs to run a task to completion, retry if it fails (non-zero exit code), and remain stopped if it succeeds (zero exit code).
This establishes the logical trigger conditions for restarting the container.
2
Evaluate the supported restart policies in Azure Container Instances (ACI).
ACI supports three restart policies: Always, Never, and OnFailure.
Knowing the valid options eliminates unsupported configurations like OnSuccess.
3
Match the required restart trigger conditions with the correct policy.
The OnFailure policy matches the need to retry only on failure and stop on success.
Selecting OnFailure fulfills the scenario requirements while preventing unnecessary resource billing.

Anahtar Kavram

Azure Container Instances restart policies determine how containers inside a container group are restarted after their processes terminate.
Soru 109Soru

A company hosts a critical Web API on an Azure App Service Web App that currently runs on the Shared (D1) pricing tier. The API experiences sudden CPU spikes during nightly batch processing jobs, leading to performance degradation. You must implement an automated scaling strategy that meets the following requirements:
- Automatically scales out up to 10 instances during high CPU load.
- Scales in to minimize costs when the load subsides.
- Prevents autoscale flapping.
- Minimizes administrative overhead by using the Azure CLI.

Which four 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

Cevabı ve açıklamayı göster

Cevap

The correct sequence of actions is: First, scale the App Service Plan to the S1 tier; second, initialize the autoscale setting targeting the plan; third, add the scale-out rule for CPU usage above 80%; and fourth, add the scale-in rule with a 30% CPU threshold to prevent flapping.
The correct sequence begins by scaling the App Service Plan to the Standard (S1) tier, as the Basic and Shared tiers do not support custom autoscale features. Next, the autoscale setting must be created for the App Service Plan before rules can be assigned. The scale-out rule is then added to monitor for CPU spikes. Finally, a scale-in rule is configured with a threshold of 30% CPU utilization, which prevents flapping because it is sufficiently low compared to the scale-out threshold.

Adım Adım Çözüm

1
Scale the App Service Plan to the Standard (S1) tier.
The App Service Plan is updated to the Standard tier, which unlocks autoscale capabilities and supports scaling up to 10 instances.
The existing Shared (D1) tier and the Basic (B1) tier do not support automated scale-out features.
2
Create the autoscale setting targeting the App Service Plan resource.
An autoscale setting profile is created with defined limits (minimum of 1, maximum of 10, default of 1).
An autoscale configuration must be initialized before individual scaling rules can be registered under it.
3
Add the scale-out rule targeting the autoscale setting.
A rule is added to scale out the instances by 1 when the average CPU percentage exceeds 80% for 10 minutes.
This fulfills the requirement of scaling out the App Service instances during high CPU utilization.
4
Add the scale-in rule with a safe CPU threshold.
A rule is added to scale in the instances by 1 when the average CPU percentage drops below 30% for 10 minutes.
A 30% CPU threshold prevents flapping. If the scale-in threshold were too high (like 75%), scaling out from 1 to 2 instances would immediately drop the average CPU utilization per instance and trigger an immediate scale-in, causing an infinite loop of scaling up and down.

Anahtar Kavram

Configuring Azure App Service plan autoscaling rules via CLI, ensuring the correct pricing tier is selected, and configuring appropriate scale-in thresholds to avoid autoscale flapping.
Soru 110Soru

You deploy an Azure App Service web app named app-sales-prod and enable a system-assigned managed identity. You store a database password in an Azure Key Vault named kv-sales-prod.

To reference the secret in the web app, you create an application setting named DbPassword and configure its value as follows:

@Microsoft.KeyVault(SecretUri=https://kv-sales-prod.vault.azure.net/secrets/db-password/)

When testing the application, you notice the secret is not resolved, and the Key Vault reference status displays as 'Access to Key Vault was forbidden'.

Which of the following actions should you perform to resolve this error?

Cevabı ve açıklamayı göster

Cevap: Assign the 'Key Vault Secrets User' Azure role to the web app's system-assigned managed identity at the key vault scope.

Cevap

Assign the 'Key Vault Secrets User' Azure role to the web app's system-assigned managed identity at the key vault scope.
To resolve the 'Access to Key Vault was forbidden' error, the managed identity must be granted data plane access to read the secrets. Assigning the 'Key Vault Secrets User' Azure RBAC role at the key vault scope provides the identity with the required permissions to retrieve the secret value.

Adım Adım Çözüm

1
Analyze the error status 'Access to Key Vault was forbidden'.
Determine that the App Service managed identity is successfully attempting to reach the Key Vault but lacks authorization to read the secret.
The error specifically indicates authorization failure (HTTP 403 Forbidden) rather than a syntax or connectivity issue.
2
Evaluate the difference between control plane and data plane permissions.
Identify that reading secret values is a data plane operation requiring roles such as 'Key Vault Secrets User' or specific Key Vault Access Policies.
Administrative roles like 'Key Vault Contributor' do not grant access to data plane secrets by default.
3
Identify the correct configuration for a system-assigned managed identity.
Confirm that system-assigned identities do not require the 'UserAssignedIdentity' parameter in the reference syntax.
The reference syntax for system-assigned identities automatically uses the default identity assigned to the App Service.

Anahtar Kavram

Key Vault References in App Service and authorization using Managed Identities
Tahmini Süre:1m 30s
Soru 111Soru

You are configuring an on-premises CI/CD runner to build and push container images to an Azure Container Registry named corpacr. The runner does not have the Azure CLI installed, and you must minimize additional tool installations. You have created a Microsoft Entra service principal named sp-cicd to authenticate the runner. Which two actions should you perform to configure permissions and authenticate the runner? (Choose two.)

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

Cevabı ve açıklamayı göster

Cevap: Assign the AcrPush role to the sp-cicd service principal for the corpacr registry resource.; Execute the docker login command on the runner using the application ID of sp-cicd as the username and its client secret as the password.

Cevap

To configure permissions and authenticate the on-premises runner without installing the Azure CLI, you must assign the AcrPush role to the service principal to allow image uploads, and execute a standard docker login command using the service principal's application ID and client secret.
To push images to Azure Container Registry, the identity must have the AcrPush role assigned. For environments without the Azure CLI installed, authentication is achieved by calling docker login with the registry login server, specifying the service principal application ID as the username and the client secret as the password.

Adım Adım Çözüm

1
Assign the appropriate Role-Based Access Control (RBAC) role to the service principal.
The service principal has authorization to push images.
The AcrPush role provides both pull and push permissions, which are necessary for CI/CD pipelines to publish container images.
2
Authenticate from the runner using Docker CLI commands rather than Azure CLI.
The runner is authenticated to the registry.
Since the Azure CLI is not installed on the runner, standard docker login must be used with the service principal's application ID as the username and client secret as the password.

Anahtar Kavram

Azure Container Registry authentication and permission management using Service Principals.
Tahmini Süre:1m 30s
Soru 112Soru

You are configuring an Azure Function App to retrieve a database connection string from Azure Key Vault using a Key Vault reference in the application settings. Which of the following is a requirement for the reference to resolve successfully?

Cevabı ve açıklamayı göster

Cevap: The Function App's managed identity must be granted GET permissions for secrets in the Key Vault.

Cevap

The Function App's managed identity must be granted GET permissions for secrets in the Key Vault.
For Key Vault references to resolve successfully, the Function App's managed identity (whether system-assigned or user-assigned) must be granted the GET permission on secrets in the Key Vault. This allows the Azure Functions runtime to retrieve the connection string on behalf of the application.

Adım Adım Çözüm

1
Enable a managed identity (either system-assigned or user-assigned) on the Azure Function App.
The Function App obtains an identity registered in Microsoft Entra ID.
An identity is required so that Azure Key Vault can authenticate and authorize the Function App's access request.
2
Create an access policy or Azure RBAC role assignment on the Azure Key Vault that grants the Secret GET permission to the Function App's managed identity.
The Function App's identity is authorized to retrieve secret values from the Key Vault.
Without explicit read authorization, the Key Vault will reject the reference resolution request from the Function App runtime.
3
Configure the application setting in the Function App using the correct reference syntax: @Microsoft.KeyVault(SecretUri=secret_uri) or @Microsoft.KeyVault(VaultName=vault_name;SecretName=secret_name).
The runtime detects the Key Vault reference and fetches the secret during startup or configuration loading.
Using the correct syntax tells the Azure Functions host runtime to intercept the setting and fetch it from Key Vault.

Anahtar Kavram

Configuring Azure Functions to securely retrieve secrets using Key Vault references and managed identities.
Soru 113Soru

You are developing a shipment monitoring workflow using C# Azure Durable Functions. The workflow must poll an external shipping provider API every 5 minutes for up to 2 hours, or terminate early if the status becomes 'Delivered'.

You write the following orchestrator function code:

csharp
[FunctionName("MonitorShipmentOrchestrator")]
public static async Task Run(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
string shipmentId = context.GetInput<string>();
DateTime endTime = DateTime.UtcNow.AddHours(2);

while (DateTime.UtcNow < endTime)
{
string status = await context.CallActivityAsync<string>("GetShipmentStatus", shipmentId);
if (status == "Delivered")
{
await context.CallActivityAsync("FinalizeOrder", shipmentId);
return;
}

await Task.Delay(TimeSpan.FromMinutes(5));
}
}

Which set of changes must you apply to the code to ensure that the orchestrator remains deterministic and executes correctly without blocking orchestrator threads?

Cevabı ve açıklamayı göster

Cevap: Replace DateTime.UtcNow with context.CurrentUtcDateTime, and replace await Task.Delay(TimeSpan.FromMinutes(5)) with await context.CreateTimer(context.CurrentUtcDateTime.AddMinutes(5), CancellationToken.None).

Cevap

Replace DateTime.UtcNow with context.CurrentUtcDateTime, and replace await Task.Delay(TimeSpan.FromMinutes(5)) with await context.CreateTimer(context.CurrentUtcDateTime.AddMinutes(5), CancellationToken.None).
The correct choice resolves both non-deterministic violations by using context.CurrentUtcDateTime, which guarantees the same timestamp is returned during replays, and context.CreateTimer, which registers a durable timer with the execution history and yields execution back to the runtime.

Adım Adım Çözüm

1
Analyze the orchestrator's temporal checks for non-determinism.
DateTime.UtcNow will yield different timestamps on replays.
Durable orchestrators replay their execution history to reconstruct state; using the system clock directly violates the determinism constraint.
2
Identify the proper replacement for tracking current time in the orchestrator.
Use context.CurrentUtcDateTime.
This property returns a deterministic timestamp that is saved in the orchestration history and replayed consistently.
3
Analyze the delay mechanism used in the orchestrator.
await Task.Delay(TimeSpan.FromMinutes(5)) is non-deterministic and fails to schedule a durable timer.
Orchestrator functions must not call non-durable async APIs that create unmanaged tasks or sleep threads.
4
Replace the delay with the durable framework's timer API.
Use await context.CreateTimer(context.CurrentUtcDateTime.AddMinutes(5), CancellationToken.None).
This registers a durable timer with the framework, allowing the orchestrator to safely sleep, free up resources, and resume later.

Anahtar Kavram

Durable Functions Orchestrator Code Constraints and Determinism
Soru 114Soru

You are deploying a containerized API application to Azure Container Instances (ACI). The container image is stored in a private Azure Container Registry (ACR). The application must retrieve database connection strings from Azure Key Vault at startup.

You want to implement a secure solution that uses managed identities to authenticate both the image pull from ACR and the secret retrieval from Key Vault, avoiding hardcoded credentials.

You attempt to deploy the container group using a system-assigned managed identity, but the deployment fails with an image pull authorization error.

Which of the following actions should you perform to resolve this deployment failure?

Cevabı ve açıklamayı göster

Cevap: Configure the container group to use a user-assigned managed identity, grant that identity the AcrPull role on the Azure Container Registry, and specify this identity for the registry credentials and container identity.

Cevap

Configure the container group to use a user-assigned managed identity, grant that identity the AcrPull role on the Azure Container Registry, and specify this identity for the registry credentials and container identity.
To pull an image from a private Azure Container Registry using a managed identity, you must use a user-assigned managed identity. A system-assigned managed identity cannot be used because it is created concurrently with the container group, meaning it does not exist when the image pull request is initiated. By using a user-assigned identity and assigning it the AcrPull role, Azure Container Instances can successfully authenticate to the registry and pull the image before creating the container.

Adım Adım Çözüm

1
Create a user-assigned managed identity in Azure.
A standalone identity resource is provisioned with its own Principal ID and Client ID.
We need an identity that exists independently of the container group's lifecycle so it is available during the container image pull phase.
2
Assign the AcrPull role to the user-assigned managed identity on the Azure Container Registry scope, and grant it secret access permissions on the Azure Key Vault.
The identity is authorized to pull images from the registry and read secrets from the Key Vault.
This establishes the necessary permissions required for both phases of the container group lifecycle (deployment and execution).
3
Deploy the container group specifying the user-assigned managed identity for the container group identity and the registry credentials configuration.
The deployment succeeds as Azure Container Instances uses the pre-existing user-assigned identity to authenticate the image pull and runs the container with the same identity to fetch secrets.
This binds the identity to both the registry access configuration and the container group's runtime identity.

Anahtar Kavram

Authentication to Azure Container Registry from Azure Container Instances using a user-assigned managed identity.
Soru 115Soru

You are developing a Bicep template to deploy an Azure Container App named `order-processor`. The application must dynamically scale using KEDA based on the length of an Azure Service Bus queue named `orders-queue`. The Service Bus namespace is `sb-orders.servicebus.windows.net`.

Security requirements dictate that no connection strings or secrets may be stored within the Container App's settings or configuration. You have created a User-Assigned Managed Identity named `order-processor-identity` with the resource ID `/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity` and assigned it the 'Azure Service Bus Data Receiver' role.

Which Bicep configuration block correctly configures the managed identity at the resource level and the KEDA scale rule to use this identity for passwordless authentication?

Cevabı ve açıklamayı göster

Cevap: identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity': {}
}
}
properties: {
template: {
scale: {
minReplicas: 1
maxReplicas: 10
rules: [
{
name: 'queue-scaler'
custom: {
type: 'azure-servicebus'
metadata: {
queueName: 'orders-queue'
namespace: 'sb-orders.servicebus.windows.net'
messageCount: '10'
}
identity: '/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/order-processor-identity'
}
}
]
}
}
}

Cevap

The configuration that sets the root identity type to 'UserAssigned', includes the full resource ID of the user-assigned managed identity, and defines the scale rule using the custom block with the exact same resource ID in the identity property.
The correct Bicep snippet defines the root identity property as 'UserAssigned' and lists the full resource ID of the identity. In the scale rule, it configures KEDA by using the custom property block. For managed-identity based scaling on Azure Service Bus, KEDA needs the Service Bus namespace and queue name under metadata, and the full resource ID of the User-Assigned Managed Identity assigned directly to the scale rule's custom 'identity' property.

Adım Adım Çözüm

1
Enable the User-Assigned Managed Identity on the Container App resource.
The identity property is set with type 'UserAssigned' and the key-value pair of the user-assigned managed identity's resource ID.
This registers the identity with the container app so that it has permission to assume it.
2
Define the scaling rule using the custom scaler structure for KEDA.
The scaler type is set to 'azure-servicebus', and metadata contains the queue name and Service Bus namespace instead of a connection string.
By using the namespace field, the scaler knows it must authenticate using passwordless methods rather than a connection string.
3
Configure the identity property within the custom scale rule block.
The identity field is set to the full resource ID of the User-Assigned Managed Identity.
Azure Container Apps scale rules require the full resource ID of the user-assigned identity to authenticate KEDA against the Service Bus namespace.

Anahtar Kavram

Configuring passwordless KEDA scale rules in Azure Container Apps using User-Assigned Managed Identities in Bicep.
Soru 116Soru

You are deploying a web application to an Azure App Service web app. The application must retrieve a database connection string stored as a secret named `DbPassword` in an Azure Key Vault named `vault-prod`. You configure a system-assigned managed identity for the web app and grant it the necessary Key Vault access. You need to configure a new application setting in the web app that references this secret. Which of the following application setting values uses the correct syntax to reference the Key Vault secret by vault and secret name?

Cevabı ve açıklamayı göster

Cevap: @Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)

Cevap

The application setting value must be set to `@Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)`.
The syntax `@Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)` is correct because it uses the standard `@Microsoft.KeyVault` prefix and specifies both required parameters: `VaultName` and `SecretName` separated by a semicolon.

Adım Adım Çözüm

1
Identify the Key Vault reference prefix.
The correct prefix to use in Azure App Service application settings is `@Microsoft.KeyVault`.
This prefix tells the App Service runtime to parse the value as a Key Vault reference rather than a plain string.
2
Determine the parameters required for key-value pair referencing.
When not using a full secret URI, the reference requires both `VaultName` and `SecretName` parameters.
App Service needs both the target vault name and the specific secret name to locate the secret.
3
Construct the full configuration string using proper syntax.
The parameters must be enclosed in parentheses, formatted as `VaultName=vault-prod;SecretName=DbPassword`.
The parameters must match the expected key-value format separated by a semicolon inside the parentheses.

Anahtar Kavram

Configuring Key Vault references in Azure App Service application settings.
Soru 117Soru

You need to deploy a container to Azure Container Instances (ACI). The container must mount a persistent volume to store application logs. You decide to use an Azure Files share for the volume. Which three actions should you perform in sequence to deploy the container? 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

Cevabı ve açıklamayı göster

Cevap

Create an Azure Storage account and file share, retrieve the storage account access key, and then run the az container create command specifying the volume parameters.
To mount an Azure Files share to a container in Azure Container Instances, you must first create the storage account and the file share. Next, you retrieve the storage account key, which is required by ACI for authentication. Finally, you execute the deployment using the az container create command, passing the file share name, storage account name, storage account key, and the mount path.

Adım Adım Çözüm

1
Create storage resources
An Azure Storage account and a file share are created.
Before mounting an Azure Files share in ACI, the storage account and file share must exist.
2
Retrieve access key
The storage account access key is retrieved.
ACI requires the storage account access key to authenticate and mount the file share.
3
Deploy the container group
The container group is deployed with the file share mounted.
Running the az container create command with the appropriate volume parameters mounts the file share to the container.

Anahtar Kavram

Mounting persistent storage to Azure Container Instances using Azure Files
Soru 118Soru

You are deploying a new Azure Function App (V4 runtime) to process background tasks. You must configure the environment to meet the following requirements:
1. Automatically scale instances to handle variable workloads, and scale down to zero instances during periods of inactivity to minimize costs.
2. Ensure that telemetry data is successfully captured and sent to an existing Application Insights instance.
3. Keep the configuration aligned with modern Azure security and SDK guidelines by avoiding deprecated settings.

Which of the following configuration actions should you perform? (Select TWO.)

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

Cevabı ve açıklamayı göster

Cevap: Choose the Consumption hosting plan for the Function App.; Add an application setting named APPLICATIONINSIGHTS_CONNECTION_STRING containing the connection string of the Application Insights instance.

Cevap

To meet the requirements, you should choose the Consumption hosting plan for the Function App and add an application setting named APPLICATIONINSIGHTS_CONNECTION_STRING with the connection string of the Application Insights instance.
To satisfy the requirements, the Function App must be deployed on the Consumption plan, which automatically scales instances and shuts down all instances when idle to avoid charges. In addition, the modern Azure Functions V4 runtime requires using the APPLICATIONINSIGHTS_CONNECTION_STRING app setting to configure telemetry integration with Application Insights.

Adım Adım Çözüm

1
Select the appropriate Azure Functions hosting plan.
The Consumption plan is selected because it dynamically scales and scales down to zero instances when idle, minimizing costs.
This satisfies the requirement to scale dynamically and avoid paying for idle instances.
2
Configure telemetry logging integration.
The APPLICATIONINSIGHTS_CONNECTION_STRING application setting is added to the Function App configuration with the resource's connection string.
This complies with modern Azure SDK security practices and enables Application Insights integration for the V4 runtime.

Anahtar Kavram

Azure Functions hosting plans and monitoring configuration
Soru 119Soru

An organization runs a CPU-intensive background job processing application on an Azure App Service Web App that currently uses the Basic (B2) pricing tier. During business hours, the processing queue grows rapidly, causing delays. You must implement an autoscaling strategy that automatically scales the application out up to a maximum of 88 instances when CPU utilization spikes, and scales in when demand drops. The solution must minimize monthly hosting costs and prevent autoscale flapping.

Which scaling configuration should you recommend?

Cevabı ve açıklamayı göster

Cevap: Scale the App Service Plan to the Standard (S1) tier. Configure a scale-out rule to increase the instance count by 11 when the average CPU Percentage is greater than 80%80\% for 1010 minutes, and a scale-in rule to decrease the instance count by 11 when the average CPU Percentage is less than 35%35\% for 1010 minutes.

Cevap

Scale the App Service Plan to the Standard (S1) tier. Configure a scale-out rule to increase the instance count by 11 when the average CPU Percentage is greater than 80%80\% for 1010 minutes, and a scale-in rule to decrease the instance count by 11 when the average CPU Percentage is less than 35%35\% for 1010 minutes.
The configuration using the Standard (S1) tier and a 35%35\% scale-in threshold is correct because the Standard tier is the lowest-cost tier that supports automated scale-out (up to 1010 instances). The 35%35\% scale-in threshold ensures that when scaling down from 22 instances to 11 instance, the CPU load of the remaining instance will not exceed the 80%80\% scale-out threshold, thereby preventing autoscale flapping.

Adım Adım Çözüm

1
Determine the minimum pricing tier that supports autoscale up to 88 instances.
Standard (S1) tier is selected. Basic tier does not support autoscale rules, and Premium tiers are more expensive and unnecessary for a maximum of 88 instances.
The solution must minimize monthly hosting costs while supporting autoscale up to 88 instances.
2
Analyze the autoscale thresholds to prevent flapping when scaling in.
The scale-in threshold must be configured such that the load on the remaining instances after scale-in does not immediately trigger a scale-out. Mathematically, for a scale-out threshold of 80%80\%, scaling down from 22 instances to 11 instance requires the scale-in threshold to be less than 40%40\% (since 2×39%=78%2 \times 39\% = 78\%, which is less than 80%80\%, whereas 2×65%=130%2 \times 65\% = 130\%, which is greater than 80%80\%, triggering an immediate scale-out).
Flapping occurs when a scale-in operation immediately causes the remaining instances to exceed the scale-out threshold, triggering a scale-out again.
3
Select the configuration option that satisfies both the tier and threshold criteria.
Standard (S1) tier combined with a scale-out threshold of 80%80\% and a scale-in threshold of 35%35\% satisfies all requirements.
This is the only option that uses the cheapest valid pricing tier and prevents autoscale flapping.

Anahtar Kavram

App Service Plan pricing tier capabilities and autoscale rule configuration to prevent flapping.
Soru 120Soru

You are configuring a custom domain for an Azure App Service web app. You have purchased an SSL/TLS certificate from a third-party certificate authority. You need to configure the web app to use the custom domain secured with this certificate. Which sequence of steps should you perform? Move all actions to the active list and arrange them in the correct order.

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

Cevabı ve açıklamayı göster

Cevap

Create the CNAME record at your registrar, add the custom domain to the web app, upload the private certificate, and then create the TLS/SSL binding.
The correct order requires first creating the DNS record (CNAME) so Azure can verify ownership when mapping the domain. After mapping the domain, you upload the private certificate so it is available in the App Service environment. Finally, you bind the certificate to the domain to secure the connection.

Adım Adım Çözüm

1
Create a CNAME record pointing to the default hostname.
The DNS record is resolvable.
Allows Azure to verify ownership of the domain.
2
Add the custom domain in the Azure portal or CLI.
The domain is successfully mapped.
The domain must exist in the web app configuration before binding.
3
Upload the private .pfx certificate.
The certificate is stored in Azure App Service.
Prepares the certificate for use in the binding step.
4
Create the TLS/SSL binding.
HTTPS is enabled on the custom domain.
Secures the custom domain traffic.

Anahtar Kavram

Configuring custom domains and TLS/SSL certificate bindings in Azure App Service
Tahmini Süre:1m 30s
ÖncekiSayfa 6 / 49Sonraki
Tüm alıştırma soruları — Microsoft Azure Developer (AZ-204) | Examkin