Develop Azure Compute Solutions

277 soru

Soru 1Soru

You are developing a document approval workflow using Azure Durable Functions in C# (.NET Isolated). The workflow must wait for an external approval event named `DocumentApproved` for up to 2424 hours. If the event is received within 2424 hours, the document is processed. If the 2424-hour limit is reached without receiving the event, the document must be marked as expired. You write the following orchestrator function code:

csharp
[Function("ApprovalOrchestrator")]
public static async Task Run(
[OrchestrationTrigger] TaskOrchestrationContext context)
{
var approvalTask = context.WaitForExternalEvent<bool>("DocumentApproved");
var timeoutTask = Task.Delay(TimeSpan.FromHours(24));

var completedTask = await Task.WhenAny(approvalTask, timeoutTask);
if (completedTask == approvalTask)
{
bool isApproved = approvalTask.Result;
await context.CallActivityAsync("ProcessDocument", isApproved);
}
else
{
await context.CallActivityAsync("ExpireDocument", null);
}
}

Which of the following describes the defect in this orchestrator code?

Cevabı ve açıklamayı göster

Cevap: The use of `Task.Delay` violates the determinism constraint of orchestrator functions; you should use `context.CreateTimer` instead.

Cevap

The use of Task.Delay violates the determinism constraint of orchestrator functions; you should use context.CreateTimer instead.
The correct answer is correct because orchestrator functions in Azure Durable Functions must be completely deterministic. Because they replay their execution state, developers must avoid non-deterministic APIs such as Task.Delay, Guid.NewGuid, or DateTime.UtcNow. Instead, durable orchestrator APIs like context.CreateTimer must be used to schedule timers, as this registers the timer event in the orchestration history and allows the orchestrator to safely suspend execution without blocking resources.

Adım Adım Çözüm

1
Analyze the orchestrator code to identify non-deterministic or blocking APIs.
Identify the use of Task.Delay(TimeSpan.FromHours(24)) on the second line.
Orchestrator functions must be deterministic, and Task.Delay is non-deterministic because it does not register with the Durable Functions state store.
2
Determine the correct Durable Functions API to replace the non-deterministic call.
Identify context.CreateTimer as the appropriate API for scheduling delays in orchestrators.
context.CreateTimer creates a durable timer that persists its state and allows the orchestrator to sleep and replay correctly.
3
Evaluate the rest of the orchestration logic (Task.WhenAny, WaitForExternalEvent, and CallActivityAsync).
Confirm that task orchestration and external events are correctly structured using task combinators.
Task.WhenAny is the correct asynchronous, non-blocking method to wait for the first of multiple tasks to complete.

Anahtar Kavram

Durable Functions Orchestrator Determinism
Soru 2Soru

A developer needs to push a locally built container image to an Azure Container Registry (ACR) named contosoacr. The developer has already logged into their Azure account on their workstation using the Azure CLI command az login. However, when they attempt to push the image, they receive an authentication error from the Docker daemon.

Which of the following Azure CLI commands should the developer run to authenticate the local Docker daemon to the registry?

Cevabı ve açıklamayı göster

Cevap: az acr login --name contosoacr

Cevap

Run the command az acr login --name contosoacr to authenticate the local Docker daemon to the registry.
The command az acr login --name contosoacr uses the active Azure CLI session to fetch a token and configure the local Docker daemon. This allows the subsequent docker push command to authenticate successfully against the private container registry.

Adım Adım Çözüm

1
Ensure the developer is signed in to Azure using the Azure CLI command az login.
The Azure CLI has an active authentication session on the workstation.
This provides the credentials necessary to access Azure resources, including the registry.
2
Run the command az acr login --name contosoacr.
The local Docker configuration is updated with credentials to access the registry.
This helper command bridges Azure CLI authentication with the Docker daemon configuration.
3
Execute the docker push command.
The container image is successfully pushed to the Azure Container Registry.
The Docker daemon is now authenticated and authorized to perform the push operation.

Anahtar Kavram

Authenticating a local developer workstation to Azure Container Registry using the Azure CLI.
Soru 3Soru

You are developing a serverless API using Azure Functions. The API must scale automatically to handle traffic spikes, but it requires that instances are pre-warmed to completely avoid cold-start latency. Which hosting plan should you select?

Cevabı ve açıklamayı göster

Cevap: Premium plan

Cevap

Premium plan
The Premium plan is the correct choice because it offers the same dynamic scaling as the Consumption plan while ensuring that instances are kept pre-warmed to prevent cold starts.

Adım Adım Çözüm

1
Identify the key requirements from the scenario.
The function app needs serverless automatic scaling and pre-warmed instances to eliminate cold start latency.
This determines which hosting plans meet both serverless scaling and zero cold start requirements.
2
Evaluate the capabilities of the Consumption plan.
The Consumption plan scales automatically but scales down to zero when idle, leading to cold starts on subsequent invocations.
This eliminates the Consumption plan as a valid option.
3
Evaluate the capabilities of the Premium plan.
The Premium plan scales automatically and maintains pre-warmed worker instances to avoid any cold start latency.
This confirms the Premium plan satisfies all criteria.

Anahtar Kavram

Azure Functions hosting plans capabilities and selection
Tahmini Süre:45s
Soru 4Soru

You are deploying an ASP.NET Core web application to an Azure App Service Web App named app-prod-01. The application requires a secret named DbConnectionString stored in an Azure Key Vault named kv-prod-01. The Web App has a system-assigned managed identity that is already configured with a GET access policy on the key vault. You must configure the application settings in the Web App to reference the Key Vault secret without modifying the code. Which configuration format must you use for the value of the DbConnectionString application setting?

Cevabı ve açıklamayı göster

Cevap: @Microsoft.KeyVault(VaultName=kv-prod-01;SecretName=DbConnectionString)

Cevap

The correct format is to use the key-value pair syntax with the @Microsoft.KeyVault prefix, specifying the VaultName and SecretName parameters separated by a semicolon.
The configuration syntax stating '@Microsoft.KeyVault(VaultName=kv-prod-01;SecretName=DbConnectionString)' is correct. App Service successfully parses this format, identifies the Key Vault resource by name, and fetches the secret using the web app's managed identity.

Adım Adım Çözüm

1
Identify the mandatory prefix for App Service Key Vault references.
The prefix must be @Microsoft.KeyVault.
Azure App Service parses application settings looking for this exact prefix to resolve secrets dynamically.
2
Select the correct parameters and delimiter for referencing the vault and secret name directly.
Use VaultName and SecretName parameters delimited by a semicolon.
The key-value pair syntax uses semicolons to separate parameters inside the parentheses.
3
Validate the final format structure.
The final structure is @Microsoft.KeyVault(VaultName=kv-prod-01;SecretName=DbConnectionString).
This matches the official syntax rules for referencing Key Vault secrets within App Service settings without relying on a full URI.

Anahtar Kavram

Azure App Service Key Vault references allow applications to securely access secrets from a key vault through environment variables without code modifications.
Tahmini Süre:1m 30s
Soru 5Soru

You are configuring an Azure Function App that runs on a Consumption hosting plan. You need to increase the execution timeout limit for all functions in the app to the maximum allowable duration under this hosting plan.

Which configuration should you apply to the host.json file?

Cevabı ve açıklamayı göster

Cevap: Set the "functionTimeout" property to "00:10:00" in the host.json file.

Cevap

Set the "functionTimeout" property to "00:10:00" in the host.json file.
The configuration setting the property to 10 minutes ('00:10:00') is correct. Under the Consumption hosting plan, Azure Functions are limited to a maximum execution duration of 10 minutes, up from the default of 5 minutes.

Adım Adım Çözüm

1
Identify the hosting plan constraints.
The function app runs on the Consumption plan, which has a default timeout of 5 minutes and a maximum hard limit of 10 minutes.
Knowing hosting plan limits is necessary to determine the maximum value that can be successfully configured.
2
Determine the host.json property used for configuring timeouts.
The correct property to configure function timeouts globally is "functionTimeout".
This property controls execution timeout behavior for all functions within the function app.
3
Format the timeout duration correctly.
The duration must be specified in a timespan format (HH:MM:SS), resulting in "00:10:00".
Azure Functions configuration parser requires timespan formatting for duration properties.

Anahtar Kavram

Azure Functions Consumption plan timeout configuration
Soru 6Soru

Your company deploys an Azure App Service web app named webapp-prod. The web app must retrieve a database connection string securely from an Azure Key Vault named kv-prod. You configure a user-assigned managed identity named id-webapp for webapp-prod and grant it the Key Vault Secrets User role on kv-prod. You need to configure the App Service application settings so that the web app can retrieve the latest version of the secret named DbConnectionString using the user-assigned identity. Which of the following configurations should you apply to the App Service application settings?

Cevabı ve açıklamayı göster

Cevap: Configure the DbConnectionString setting with the value @Microsoft.KeyVault(SecretUri=https://kv-prod.vault.azure.net/secrets/DbConnectionString) and add an application setting named keyVaultReferenceIdentity set to the resource ID of the user-assigned managed identity.

Cevap

Configure the DbConnectionString setting with the value @Microsoft.KeyVault(SecretUri=https://kv-prod.vault.azure.net/secrets/DbConnectionString) and add an application setting named keyVaultReferenceIdentity set to the resource ID of the user-assigned managed identity.
The correct configuration uses the standard `@Microsoft.KeyVault(SecretUri=...)` syntax to point to the secret URI. Additionally, because the application uses a user-assigned managed identity, the `keyVaultReferenceIdentity` application setting must be added, with its value set to the resource ID of that user-assigned managed identity, to let App Service know which identity to use to authenticate to the Key Vault.

Adım Adım Çözüm

1
Define the Key Vault reference in the application setting value.
The application setting is defined as @Microsoft.KeyVault(SecretUri=https://kv-prod.vault.azure.net/secrets/DbConnectionString).
This uses the correct syntax and standard SecretUri parameter format to tell App Service where to retrieve the secret.
2
Configure App Service to use the user-assigned managed identity for resolution.
The keyVaultReferenceIdentity application setting is added with the user-assigned managed identity's resource ID as its value.
By default, App Service attempts to use the system-assigned identity. To use a user-assigned identity, you must set the keyVaultReferenceIdentity app setting to point to the resource ID of the user-assigned identity.

Anahtar Kavram

Key Vault references in Azure App Service allow applications to securely retrieve secrets without exposing them in configuration. When using user-assigned managed identities, you must configure the keyVaultReferenceIdentity setting alongside the reference.
Tahmini Süre:2m 0s
Soru 7Soru

You are configuring a continuous integration pipeline in GitHub Actions to build and push a container image to an Azure Container Registry (ACR) named contosoacr.azurecr.io. The runner does not have the Azure CLI installed, but has the Docker CLI installed. You have created an Azure Active Directory (Azure AD) service principal with the AcrPush role.

You need to authenticate the Docker CLI on the runner to contosoacr.azurecr.io using the service principal credentials.

Which command should you execute in the pipeline runner?

Cevabı ve açıklamayı göster

Cevap: echo <clientSecret> | docker login contosoacr.azurecr.io --username <clientId> --password-stdin

Cevap

Run the command: echo <clientSecret> | docker login contosoacr.azurecr.io --username <clientId> --password-stdin
To authenticate the Docker CLI with an Azure Container Registry using a service principal when the Azure CLI is unavailable, you must use the standard docker login command. The username must be the service principal's Client ID, the password must be the Client Secret, and the target registry must be specified by its repository login server domain name.

Adım Adım Çözüm

1
Identify the target registry URL and the authentication tools available.
The target registry is contosoacr.azurecr.io, and only the Docker CLI is available on the runner.
The runner does not have Azure CLI installed, meaning az acr commands cannot be executed.
2
Formulate the Docker login command using the service principal credentials.
Use the client ID as the username and the client secret as the password targeting contosoacr.azurecr.io.
The Docker CLI requires the full login server domain to route the authentication request to Azure Container Registry rather than Docker Hub.
3
Securely pass the client secret to the Docker login command.
Pipe the client secret into docker login using the --password-stdin flag.
Passing passwords directly via command line arguments is insecure and can expose credentials in build logs.

Anahtar Kavram

Authenticating to Azure Container Registry using Docker CLI and service principal credentials.
Soru 8Soru

You are a developer managing container images in Azure. You need to copy a container image named application:v1 from a development Azure Container Registry named devreg to a production Azure Container Registry named prodreg. Both registries are in the same Azure subscription. To save network bandwidth and time, you want to perform this copy directly from registry to registry, without downloading the image to your local workspace or requiring a local Docker installation. Which Azure CLI command should you run?

Cevabı ve açıklamayı göster

Cevap: az acr import --name prodreg --source devreg.azurecr.io/application:v1 --image application:v1

Cevap

Run the command: az acr import --name prodreg --source devreg.azurecr.io/application:v1 --image application:v1
The correct command is the one starting with 'az acr import', as it enables registry-to-registry import directly in the cloud without downloading the image or requiring a local Docker installation.

Adım Adım Çözüm

1
Identify the target registry name and the fully qualified source image path.
Target registry is 'prodreg', source image path is 'devreg.azurecr.io/application:v1'.
The import command requires the destination registry name and the source image identifier.
2
Select the correct Azure CLI command for registry-to-registry image copying.
The correct command is 'az acr import'.
This command performs a registry-to-registry import entirely in the cloud without downloading image layers locally.
3
Construct and execute the command specifying the target registry, source registry/image, and target image name/tag.
The final command is: az acr import --name prodreg --source devreg.azurecr.io/application:v1 --image application:v1
This provides all required parameters to copy the image directly on the Azure backend.

Anahtar Kavram

Direct registry-to-registry container image importing in Azure Container Registry
Soru 9Soru

You are designing an automated deployment for a batch processing workload using Azure Container Instances (ACI). The workload has the following requirements:

1. It must run two containers: a file downloader (producer) and a data analyzer (consumer).
2. Both containers must share a temporary directory that only needs to persist during the lifecycle of the container group.
3. The container images are hosted in a private Azure Container Registry (ACR).
4. The consumer container must securely retrieve a database connection string from an Azure Key Vault.
5. The container group must be deployed inside a subnet of an existing Azure Virtual Network to connect to a private database.

Which three actions should you perform to meet these requirements?

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

Cevabı ve açıklamayı göster

Cevap: Delegate the target subnet within the Azure Virtual Network to the Microsoft.ContainerInstance/containerGroups service before deployment.; Configure a shared volume of type emptyDir in the container group YAML definition and mount it to both the producer and consumer containers.; Create a user-assigned managed identity, grant it the AcrPull role on the Azure Container Registry, and configure the container group to pull images using this identity.

Cevap

To deploy the solution, you must delegate the virtual network subnet to the container group service, configure an emptyDir volume for ephemeral shared storage, and configure a user-assigned managed identity with the AcrPull role on the private Azure Container Registry to authorize the image pull.
Delegating the subnet to the ACI service is required for VNet integration. Using an emptyDir volume provides shared, ephemeral file storage between containers in the same container group. Using a user-assigned managed identity with the AcrPull role is required because system-assigned identities do not exist in time to authorize the initial image pull during deployment.

Adım Adım Çözüm

1
Configure the virtual network by delegating a subnet to the Microsoft.ContainerInstance/containerGroups service resource type.
The subnet is reserved and configured to host Azure Container Instance container groups.
VNet integration for ACI requires a dedicated subnet that does not host other resource types.
2
Create a user-assigned managed identity and assign it the AcrPull role on the private Azure Container Registry.
The identity has the permission to pull images from the registry.
Since ACI must pull the image before creating the container group, a pre-existing user-assigned identity is required for authentication.
3
Define the container group in YAML or an ARM template, configuring an emptyDir volume and mounting it to both containers.
The containers share a temporary folder that persists for the lifecycle of the container group.
An emptyDir volume provides a shared, non-persistent directory suitable for temporary multi-container processing workloads.

Anahtar Kavram

Azure Container Instances networking, volumes, and private registry authentication
Soru 10Soru

Your company is deploying a web application to Azure App Service. The application requires a database connection string that is stored securely as a secret named 'db-conn' in an Azure Key Vault named 'kv-prod'. You need to configure the web app's application settings to reference this Key Vault secret using its name. Which value should you use for the application setting?

Cevabı ve açıklamayı göster

Cevap: @Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)

Cevap

The correct reference format is '@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)' because it uses the correct prefix, encloses the parameters in parentheses, and separates the VaultName and SecretName parameters with a semicolon.
The correct option is the one specifying '@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)'. In Azure App Service, Key Vault references in application settings must start with the '@Microsoft.KeyVault' prefix, enclose the properties in parentheses, and use a semicolon as the delimiter between key-value pairs like VaultName and SecretName.

Adım Adım Çözüm

1
Identify the required prefix for Key Vault references in Azure App Service application settings.
The prefix must be '@Microsoft.KeyVault'.
Azure App Service parses application setting values starting with '@Microsoft.KeyVault' to retrieve secrets at runtime.
2
Determine the parameter format when referencing a secret by the vault name and secret name.
The syntax requires 'VaultName=vault-name;SecretName=secret-name' inside the parentheses.
Parameters must be specified using key-value pairs separated by a semicolon.
3
Construct the final reference string with the given vault 'kv-prod' and secret 'db-conn'.
'@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)'
This matches the requirements of prefix, parameter names, semicolon separator, and parentheses wrapping.

Anahtar Kavram

Azure Key Vault references in Azure App Service Application Settings
Tahmini Süre:45s
Soru 11Soru

You are configuring a CI/CD pipeline script to push container images to an Azure Container Registry (ACR) named `myregistry`. The script runs in a lightweight container context where only the Docker CLI is available for the build and push steps. To authenticate, you have already retrieved a Microsoft Entra ID access token for the registry using the Azure CLI and stored it in a variable named `$TOKEN`.

You need to run the `docker login` command to authenticate the local Docker daemon to the registry using this token.

Which command should you run?

Cevabı ve açıklamayı göster

Cevap: docker login myregistry.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password $TOKEN

Cevap

docker login myregistry.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password $TOKEN
The correct command uses the docker login utility to target the myregistry.azurecr.io login server. When authenticating with an access token (such as a Microsoft Entra ID token), the registry requires the username parameter to be the specific GUID 00000000-0000-0000-0000-000000000000, and the password parameter to contain the token value.

Adım Adım Çözüm

1
Identify the registry's login server URL.
The login server URL for an ACR named myregistry is myregistry.azurecr.io.
The docker login command requires the full login server URL rather than just the registry name.
2
Determine the correct username for token-based authentication.
The designated username GUID is 00000000-0000-0000-0000-000000000000.
ACR requires the specific token GUID as the username when authenticating via an access token.
3
Formulate and run the docker login command.
docker login myregistry.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password $TOKEN
This successfully logs the local Docker daemon into the target Azure Container Registry using the retrieved token.

Anahtar Kavram

Authenticating with Azure Container Registry using tokens
Soru 12Soru

An organization is designing a serverless background processing solution using Azure Functions V4 to process large batches of files uploaded to an Azure Blob Storage container. The solution must satisfy the following constraints:
- Individual file processing operations are CPU-intensive and can take up to 15 minutes to complete.
- The function app must connect securely to an Azure SQL Database that is restricted to a private virtual network.
- The system must dynamically scale out the number of instances to handle sudden, unpredictable spikes in upload volume, and scale back down when idle.
- Cold start latency must be minimized for initial requests after periods of inactivity.

Which hosting plan should the organization choose to deploy the Azure Function app?

Cevabı ve açıklamayı göster

Cevap: Premium plan

Cevap

Premium plan
The Premium plan is the correct choice because it supports outbound virtual network integration, has a default execution timeout of 30 minutes (unbounded maximum), and provides event-based scaling via the Scale Controller to rapidly handle spikes while minimizing cold starts with pre-warmed instances.

Adım Adım Çözüm

1
Evaluate the runtime execution limit requirement.
The Consumption plan has a strict 10-minute maximum execution limit, which rules it out since processing can take up to 15 minutes.
Azure Functions hosting plans have different default and maximum execution timeouts.
2
Evaluate the network connectivity requirement.
The basic Consumption plan does not support virtual network integration, further ruling it out.
Securing database access behind a private virtual network requires a plan that supports outbound VNet integration.
3
Compare scaling behaviors of the Premium and Dedicated plans.
The Dedicated plan scales based on standard autoscale rules (e.g., CPU/Memory metrics), whereas the Premium plan scales rapidly based on events (e.g., number of blobs/messages) via the Scale Controller and provides pre-warmed instances to prevent cold starts.
Unpredictable spikes require the event-driven Scale Controller to add instances dynamically and proactively.

Anahtar Kavram

Azure Functions hosting plan features and limits, focusing on execution timeouts, network integration, and scaling behaviors.
Soru 13Soru

You are configuring an Azure Container Registry (ACR) task named `build-task` in a registry named `myregistry`. The task must build a container image from a remote GitHub repository and push it to `myregistry`. The build process requires pulling a private base image from an external Azure Container Registry named `sharedregistry.azurecr.io`.

You create a user-assigned managed identity named `task-identity` and assign it the `AcrPull` role on `sharedregistry.azurecr.io`.

You associate the identity with the task by running the following command:
azurecli
az acr task create \
--registry myregistry \
--name build-task \
--image myimage:latest \
--context https://github.com/myorg/myrepo.git#main \
--file Dockerfile \
--assign-identity /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/task-identity

When the task executes, the build fails during the base image pull from `sharedregistry.azurecr.io` with an HTTP 401 Unauthorized error.

Which command should you execute to enable the task to authenticate successfully to the external registry?

Cevabı ve açıklamayı göster

Cevap: az acr task credential add --name build-task --registry myregistry --login-server sharedregistry.azurecr.io --user-assigned-identity 11111111-1111-1111-1111-111111111111

Cevap

Execute the command: az acr task credential add --name build-task --registry myregistry --login-server sharedregistry.azurecr.io --user-assigned-identity 11111111-1111-1111-1111-111111111111
Executing the command that adds the credential with the user-assigned managed identity client ID matches the target login server to the identity. When ACR Tasks initiates the build and pulls the base image from the external login server, it retrieves an OAuth token representing the user-assigned managed identity to authenticate the pull request.

Adım Adım Çözüm

1
Identify the authentication failure source
The task fails when trying to pull the base image from the external registry sharedregistry.azurecr.io because it lacks credentials for it.
By default, the task only has built-in credentials for its home registry, not for external registries.
2
Determine the authentication mechanism
The task must use the user-assigned managed identity to authenticate to the external registry.
The user-assigned managed identity has already been granted the AcrPull role on the external registry.
3
Map the identity to the external registry in the task configuration
Execute the az acr task credential add command, specifying the home registry, task name, target login server, and the client ID of the user-assigned managed identity.
This registers the credentials within the ACR Task context so it can automatically inject the managed identity token when communicating with the external registry.

Anahtar Kavram

ACR Tasks cross-registry authentication using managed identities
Soru 14Soru

You are designing an Azure Function app (Runtime version 4.x) that processes sensitive financial transactions from an Azure Service Bus queue. The function requires outbound connectivity to an Azure SQL Database secured behind a private endpoint in a virtual network (VNet). The transaction processing logic is resource-intensive, requiring up to 25 minutes to complete per batch, and must avoid any cold start latency to meet strict Service Level Agreements (SLAs). Additionally, you must ensure that the function app does not scale beyond 20 concurrent VM instances to prevent connection pool exhaustion on the database. Which hosting plan and scale configuration should you implement to meet these requirements?

Cevabı ve açıklamayı göster

Cevap: Deploy the function app to an Elastic Premium plan. Configure outbound virtual network integration, set the function app timeout (functionTimeout in host.json) to 30 minutes, and set the functionAppScaleLimit property of the function app to 20.

Cevap

Deploy the function app to an Elastic Premium plan, configure outbound virtual network integration, set the timeout to 30 minutes, and set the functionAppScaleLimit property of the function app resource to 20.
The correct option correctly pairs the Elastic Premium plan—which provides outbound VNet integration, pre-warmed instances to avoid cold starts, and a configurable timeout limit beyond 10 minutes—with the functionAppScaleLimit property, which is the platform-supported way to cap instance scale-out on Premium plans.

Adım Adım Çözüm

1
Evaluate hosting plans based on execution duration.
The Consumption plan has a hard limit of 10 minutes for execution duration, which rules it out since the batch process takes 25 minutes. Both the Elastic Premium plan and Dedicated (App Service) plan support execution limits that can accommodate 25 minutes.
Choosing a plan that supports long-running executions prevents premature function timeouts.
2
Evaluate hosting plans based on network integration and cold start requirements.
The Elastic Premium plan and Dedicated plan both support regional outbound virtual network integration to reach the secured database. They also both support cold-start mitigation (via pre-warmed instances and Always On respectively), but the Premium plan offers serverless dynamic scaling that scales to zero when idle.
VNet integration is necessary for connecting to private endpoints, and pre-warmed instances ensure the first execution starts immediately.
3
Determine the correct scaling limit configuration method.
To restrict the number of instances for an Elastic Premium plan, the functionAppScaleLimit property on the function app resource must be set to 20. The WEBSITE_MAX_DYNAMIC_SCALE_OUT app setting only works on the Consumption plan. The maxConcurrentCalls setting in host.json only restricts per-instance concurrency, not VM scaling.
Configuring the correct scale limit property ensures that the function scaling behavior matches the platform configuration guidelines for the selected hosting plan.

Anahtar Kavram

Azure Functions hosting plans, execution timeouts, VNet integration, and scale-out configurations.
Soru 15Soru

You have an Azure App Service web app named app-contoso that runs in a Standard App Service plan. You need to configure a custom domain www.contoso.com for the web app and secure the domain using a free Azure App Service Managed Certificate.

Which four actions should you perform in sequence? To answer, arrange the actions 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: 1) Create a CNAME record with the DNS provider that maps the custom domain to the default web app domain. 2) Add the custom domain to the App Service web app. 3) Create an App Service Managed Certificate for the custom domain. 4) Add a TLS/SSL binding using the managed certificate and SNI SSL.
The correct sequence respects the dependency chain of Azure App Service domain configuration. First, the DNS record must be mapped to allow verification. Second, the domain is added to the web app using that verification. Third, the managed certificate is generated for the registered domain. Finally, the certificate is bound to the domain to secure the traffic using SNI.

Adım Adım Çözüm

1
Configure the DNS CNAME record mapping the subdomain to the web app's default URL.
The domain registrar or DNS server points traffic and validation requests to Azure.
Azure App Service requires verification of domain ownership before allowing a custom domain to be mapped.
2
Add the custom domain to the web app configuration in Azure App Service.
Azure verifies the CNAME record and registers the custom domain under the web app.
You cannot generate certificates or bindings for a custom domain that has not been mapped to the App Service web app.
3
Generate a free App Service Managed Certificate for the verified custom domain.
Azure provisions a free certificate for the custom domain.
The custom domain must already be validated and bound to the web app before Azure can issue a managed certificate for it.
4
Configure a TLS/SSL binding on the custom domain using the managed certificate.
The web app secures HTTPS traffic on the custom domain via SNI SSL.
Creating the certificate does not automatically secure the domain; you must bind the certificate to the domain to complete the setup.

Anahtar Kavram

Configuring custom domains and securing them with App Service Managed Certificates in Azure App Service.
Soru 16Soru

You are setting up a secure continuous integration (CI) pipeline to build and publish container images to an Azure Container Registry (ACR) named `acr2026`.

The pipeline must authenticate using an Azure Active Directory service principal named `sp-pipeline`. The service principal has just been created and has no permissions assigned.

You need to configure permissions, authenticate the pipeline runner, build a local image, and upload the image.

In which order should you perform the steps? To answer, arrange the actions in the correct sequence.

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

Cevabı ve açıklamayı göster

Cevap

The correct sequence of steps requires you to first assign the AcrPush role to the service principal. Next, log in to the registry using the docker login command with the service principal credentials and the registry's login server name (acr2026.azurecr.io). After authenticating, build the image locally with the docker build command, tag the image with the registry's namespace using the docker tag command, and finally push the tagged image to the registry with the docker push command.
To push an image to Azure Container Registry using a service principal, you must first authorize the principal with the AcrPush role. Next, authenticate Docker using the service principal's application ID and client secret against the registry login server. Then, build the image locally, tag it with the target registry's login server namespace, and finally push it.

Adım Adım Çözüm

1
Assign the AcrPush role to the service principal.
The service principal is authorized to push images to the registry.
By default, a new service principal has no access. Pushing images requires the AcrPush role.
2
Run docker login targeting the registry's login server with the service principal credentials.
The Docker client on the runner is authenticated to the registry.
Docker CLI commands like docker push require authentication to the registry's specific login server.
3
Run docker build to build the image locally.
A local container image is created.
The image must exist locally before it can be tagged or pushed.
4
Run docker tag to apply the registry namespace to the image.
The image is tagged with the fully qualified registry login server path.
Docker uses the image tag prefix to determine the target registry domain during a push operation.
5
Run docker push with the fully qualified tag.
The image is uploaded and stored in the Azure Container Registry.
This is the final action that uploads the local image layers to the authenticated registry endpoint.

Anahtar Kavram

Building and pushing container images to Azure Container Registry using service principal authentication and Docker CLI.
Soru 17Soru

You need to configure local Git deployment for a new Azure App Service web app. Which sequence of steps should you perform? To answer, move all 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

First, configure subscription-level deployment credentials with `az webapp deployment user set`. Second, enable local Git deployment on the web app using `az webapp deployment source config-local-git` to obtain the clone URL. Third, add the clone URL as a local remote named `azure` using `git remote add`. Finally, deploy the application code by running `git push azure main`.
The correct sequence begins by configuring subscription-level credentials with `az webapp deployment user set`. Once credentials are set, the next step is to enable local Git deployment on the target web app using `az webapp deployment source config-local-git`, which provides the Git repository clone URL. This URL is then added as a remote endpoint to the local Git repository using `git remote add azure`. Finally, the application code is deployed by pushing the local branch to the remote using `git push azure main`.

Adım Adım Çözüm

1
Run the command `az webapp deployment user set --user-name <username> --password <password>`.
Subscription-level deployment credentials are created or updated.
Azure App Service local Git deployment requires authentication credentials configured at the subscription level to authenticate the push operation.
2
Run the command `az webapp deployment source config-local-git --name <app-name> --resource-group <group-name>`.
Local Git deployment is enabled for the web app, and the Git repository URL is returned.
This establishes the remote Git endpoint inside Azure App Service for receiving deployments.
3
Run the command `git remote add azure <git-clone-url>` locally.
The local Git repository is configured with a new remote target named `azure`.
This registers the Azure repository endpoint as a remote branch source inside the local Git repository.
4
Run the command `git push azure main` locally.
The code is transferred, built, and deployed to the Azure App Service web app.
Pushing the commits to the `azure` remote triggers the server-side deployment engine (Kudu) to deploy the app.

Anahtar Kavram

Configuring local Git deployment for an Azure App Service web app requires setting deployment credentials, enabling the Git repository on the web app, configuring a local git remote pointing to the Azure Git URL, and pushing the code to trigger the build.
Soru 18Soru

You are developing a secure serverless solution using Azure Functions V4. You need to configure a Function App to retrieve a database connection string from an Azure Key Vault. The security team requires that you use a user-assigned managed identity rather than a system-assigned managed identity to access the Key Vault secrets.

Which five actions should you perform in sequence to configure the Function App? 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

To configure the Function App to use a user-assigned managed identity for Key Vault references, you must first create a user-assigned managed identity in Microsoft Entra ID. Next, associate the user-assigned managed identity with the Function App. Then, create an access policy or RBAC role assignment in Key Vault granting the identity Secret Get permissions. After that, set the keyVaultReferenceIdentity configuration of the Function App to the resource ID of the user-assigned identity. Finally, create a new application setting in the Function App using the @Microsoft.KeyVault reference syntax.
The correct sequence of steps requires first creating the user-assigned managed identity and associating it with the Function App. Then, the identity must be granted Secret Get permissions in the Key Vault. To ensure that Key Vault references resolve using this user-assigned identity instead of the default system-assigned identity, the Function App's configuration must be updated to specify the user-assigned identity as the key vault reference identity. Finally, the application setting is created using the Key Vault reference syntax, which allows the Function App to load the database connection string securely.

Adım Adım Çözüm

1
Create a user-assigned managed identity.
A managed identity resource is created in Microsoft Entra ID with a client ID and principal ID.
The identity is needed as the security principal that will be assigned permissions and associated with the Function App.
2
Associate the identity with the Function App.
The Function App is updated to include the user-assigned managed identity.
This allows the Function App to authenticate using this specific identity.
3
Configure Key Vault access permissions.
An access policy or Azure RBAC role assignment is created in the Key Vault allowing the user-assigned identity's principal to perform Get operations on secrets.
The identity must have permission to read the secret; otherwise, Key Vault reference resolution will fail.
4
Set the Key Vault reference identity for the Function App.
The Function App's configuration is updated with keyVaultReferenceIdentity set to the resource ID of the user-assigned managed identity.
By default, Azure Functions attempts to resolve Key Vault references using the system-assigned identity. To use a user-assigned identity, you must explicitly configure this setting.
5
Create the application setting with Key Vault reference syntax.
The application setting is added to the Function App using the format @Microsoft.KeyVault(SecretUri=...).
This triggers the Azure Functions host to automatically fetch the secret from Key Vault and inject it into the app environment settings.

Anahtar Kavram

Configuring Azure Functions to retrieve Key Vault secrets using a User-Assigned Managed Identity
Soru 19Soru

You are configuring an Azure Function App (Runtime version 4.x) to securely retrieve database credentials from Azure Key Vault. Security guidelines require the following constraints:
- You must use a user-assigned managed identity.
- You must not enable or use a system-assigned managed identity.
- The Azure Functions hosting platform must natively resolve the secrets without custom code.
- The configuration must follow the principle of least privilege, ensuring no intermediate state exposes unresolved secrets to the application runtime or results in service resolution failures.

In which order should you execute the configuration steps to successfully enable the Function App to resolve the Key Vault secrets?

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

Cevabı ve açıklamayı göster

Cevap

The correct sequence is: first create the user-assigned managed identity, associate it with the Function App, grant it the Key Vault Secrets User role on the Key Vault, configure the keyVaultReferenceIdentity property of the Function App to use this identity, and finally add the application setting using the Key Vault reference syntax.
To resolve Key Vault references using a user-assigned managed identity, the identity must first exist. It then must be associated with the Function App. Granting Key Vault Secrets User permissions ensures that the identity can retrieve the secret. The keyVaultReferenceIdentity property must be configured to point to this identity before the application setting is created. If the application setting is added first, the platform will attempt to resolve the reference using either the system-assigned identity (which is disabled) or will fail to resolve because it does not know which user-assigned identity to use.

Adım Adım Çözüm

1
Create the user-assigned managed identity.
A new user-assigned managed identity is provisioned in Microsoft Entra ID.
An identity must exist in Microsoft Entra ID before it can be assigned permissions or associated with any Azure resources.
2
Associate the user-assigned managed identity with the Function App.
The Function App's identity block is updated to include the user-assigned managed identity.
The identity must be associated with the Function App resource so that Azure's hosting platform recognizes it as a valid identity for the app.
3
Grant the user-assigned managed identity the 'Key Vault Secrets User' role on the Key Vault.
An RBAC role assignment is created, allowing the identity to read secrets from the Key Vault.
By default, identities have no permissions to access Key Vault secrets. This step ensures the identity has the necessary read access.
4
Set the 'keyVaultReferenceIdentity' property on the Function App to the resource ID of the user-assigned identity.
The Function App site configuration is updated to designate this specific identity for resolving Key Vault references.
By default, Azure Functions attempts to resolve Key Vault references using the system-assigned identity. Since only a user-assigned identity is used here, the platform must be explicitly told which identity to use.
5
Add the application setting using the @Microsoft.KeyVault(SecretUri=...) syntax.
The application setting is added, and the Azure Functions runtime resolves the secret value at startup.
Once all security, identity, and routing configurations are in place, the application setting can be safely added to trigger resolution without errors.

Anahtar Kavram

Configuring Azure Functions to retrieve app settings securely using User-Assigned Managed Identity and Key Vault References.
Soru 20Soru

An Azure App Service plan currently hosts a single instance of a web application. You configure a scale-out rule to add one instance to the plan when the average CPU usage exceeds 80%80\% for 1010 minutes. You need to configure a scale-in rule to remove one instance when the traffic decreases. Assuming the workload is distributed evenly across all instances after scaling out, which of the following is the maximum CPU threshold you should set for the scale-in rule to prevent autoscale flapping?

Cevabı ve açıklamayı göster

Cevap: 35%35\%

Cevap

The maximum CPU threshold for the scale-in rule should be set to 35%35\% to prevent autoscale flapping.
When the web app is running on a single instance and CPU usage hits 80%80\%, the scale-out rule triggers, increasing the instance count to two. Since the workload is distributed evenly, the CPU usage on each of the two instances will drop to approximately half of the total load: 80%÷2=40%80\% \div 2 = 40\%. If the scale-in threshold is set to 40%40\% or higher, the new CPU usage level of 40%40\% will immediately satisfy the scale-in condition. This triggers a scale-in back to one instance, causing the CPU usage to spike back to 80%80\%, triggering another scale-out, and creating an infinite loop (flapping). To prevent this, the scale-in threshold must be set below the expected post-scale-out CPU usage. A threshold of 35%35\% is strictly below 40%40\% and will prevent flapping.

Adım Adım Çözüm

1
Calculate the expected CPU usage per instance after a scale-out event.
With one instance scaling out to two instances under an 80%80\% CPU load, the expected CPU per instance is 80%×12=40%80\% \times \frac{1}{2} = 40\%.
This determines the new operating baseline CPU level immediately after the scale-out action occurs.
2
Analyze the flapping condition for scale-in thresholds.
To prevent immediate scale-in, the scale-in threshold must be strictly less than the post-scale-out CPU level of 40%40\%.
If the scale-in threshold is equal to or greater than the post-scale-out CPU usage, the scale-in rule triggers immediately, causing a loop.
3
Identify the correct option that satisfies the condition.
A threshold of 35%35\% is selected since 35%<40%35\% < 40\%, while all other options are greater than or equal to 40%40\%.
This is the only threshold configuration that successfully avoids autoscale flapping.

Anahtar Kavram

App Service Autoscale Rule Metric Configuration and Flapping Prevention
Sayfa 1 / 14Sonraki