Microsoft AZ-204 Practice Test Questions and Exam Dumps Part 2 Q21-40

View Full Microsoft AZ-204 Exam Dumps and Practice Test Dumps

 

Q21. Which Azure Functions trigger is most appropriate for starting a function when an HTTP request is received?

1) Timer trigger
2) HTTP trigger
3) Queue trigger
4) Blob trigger

Correct Answer: 2)

Explanation:

The HTTP trigger is designed to execute an Azure Function when an HTTP request reaches its endpoint. It is commonly used for creating REST-style APIs, webhooks, lightweight backend services, and integrations that require an HTTP-accessible endpoint. The function can respond to different HTTP methods such as GET, POST, PUT, and DELETE depending on its implementation. Unlike a timer trigger, it does not depend on a scheduled interval. Authentication and authorization can also be configured according to the application’s requirements. Therefore, when a function must respond directly to an incoming HTTP request, the HTTP trigger is the appropriate choice.

Q22. Which Azure Functions trigger should be used to execute code automatically at a scheduled time?

1) Timer trigger
2) HTTP trigger
3) Event Grid trigger
4) Cosmos DB trigger

Correct Answer: 1)

Explanation:

The Timer trigger is used when an Azure Function must execute according to a predefined schedule. It uses a CRON expression to define when the function should run, making it useful for recurring background tasks. Common examples include generating reports every night, performing scheduled cleanup, processing data periodically, or running maintenance operations. The function does not require an incoming HTTP request or message from a queue to start. The schedule is managed by the Azure Functions runtime. Therefore, when an application requires code to execute automatically at specific recurring times, a Timer trigger is the appropriate Azure Functions trigger.

Q23. Which Azure Functions trigger allows a function to execute when a new message is added to an Azure Storage Queue?

1) HTTP trigger
2) Timer trigger
3) Queue trigger
4) Blob trigger

Correct Answer: 3)

Explanation:

The Azure Storage Queue trigger starts an Azure Function when messages are available in the specified storage queue. This approach is useful for implementing asynchronous processing because an application can place work items into a queue while a function processes them independently. Queue-based processing can help separate application components and reduce the impact of temporary processing delays. The Functions runtime monitors the queue and invokes the function when messages need processing. This pattern is especially useful for background jobs, task processing, and workload decoupling. Therefore, the Queue trigger is the correct choice when function execution should be initiated by messages in Azure Storage Queue.

Q24. Which Azure Functions capability is designed to coordinate multiple function executions as part of a reliable workflow?

1) Azure App Configuration
2) Durable Functions
3) Azure CDN
4) Azure DNS

Correct Answer: 2)

Explanation:

Durable Functions extend Azure Functions by providing capabilities for stateful workflows and orchestration. They allow developers to coordinate multiple function executions while maintaining workflow state. Durable Functions can implement patterns such as function chaining, fan-out/fan-in, human interaction, and long-running workflows. The orchestration framework manages checkpoints and state so that workflows can continue after interruptions. This makes Durable Functions especially useful when a solution requires several activities to execute in a controlled sequence or parallel pattern. Therefore, Durable Functions are the appropriate Azure capability for coordinating multiple function executions as part of a reliable, stateful workflow.

Q25. What is the primary purpose of bindings in Azure Functions?

1) To replace Azure subscriptions
2) To configure virtual networks automatically
3) To connect functions to other services with simplified input and output handling
4) To create physical servers for functions

Correct Answer: 3)

Explanation:

Azure Functions bindings provide a simplified way for functions to connect with other services without requiring extensive service-specific integration code. Input bindings can provide data to a function, while output bindings can send function results to another service. Bindings can be used with services such as Azure Storage, Cosmos DB, Service Bus, and other supported resources. This model reduces repetitive connection and data-handling code and allows developers to focus on application logic. Although bindings do not eliminate every integration requirement, they provide a convenient abstraction for common scenarios. Therefore, connecting functions to external services through simplified input and output handling is the primary purpose of bindings.

Q26. Which Azure Functions authorization level determines whether a function request must include a function key?

1) Anonymous
2) Function
3) Public
4) System

Correct Answer: 2)

Explanation:

The Function authorization level requires callers to provide a function key when invoking an HTTP-triggered Azure Function. Function keys provide a basic mechanism for controlling access to HTTP endpoints without requiring a full authentication platform. The Anonymous level does not require a function key, while higher security requirements can be addressed using authentication and authorization mechanisms supported by Azure. Function keys should be protected and not embedded in publicly exposed source code or configuration files without appropriate safeguards. Therefore, when an HTTP-triggered function should require a function key for invocation, the Function authorization level is the appropriate setting.

Q27. Which App Service capability can automatically increase or decrease the number of instances based on workload conditions?

1) Autoscale
2) Deployment slot
3) Application setting
4) Custom domain

Correct Answer: 1)

Explanation:

Azure App Service Autoscale allows an application to automatically adjust the number of running instances according to defined conditions. Scaling rules can use metrics such as CPU utilization, memory usage, request counts, or other supported indicators. Increasing the number of instances can help applications handle higher demand, while reducing instances during periods of lower demand can help control resource consumption. Autoscale is particularly useful for applications with variable workloads because administrators do not need to manually change instance counts whenever traffic changes. Therefore, when the requirement is to automatically add or remove App Service instances based on workload conditions, Autoscale is the correct capability.

Q28. Where can an Azure App Service administrator configure application-specific environment settings such as connection strings and application settings?

1) App Service Configuration
2) Azure CDN
3) Azure DNS
4) Availability Sets

Correct Answer: 1)

Explanation:

App Service Configuration provides a centralized location for configuring application settings, connection strings, environment variables, and related runtime configuration. These settings allow applications to obtain configuration values without hard-coding them directly into source code. App Service settings can also support different configurations across deployment environments. For example, development, staging, and production environments can use different connection information while running the same application code. Sensitive values should still be protected using appropriate security mechanisms such as Key Vault when necessary. Therefore, App Service Configuration is the appropriate location for managing application-specific environment settings and connection strings.

Q29. Which feature allows an Azure App Service application to access supported Azure resources without storing credentials in application code?

1) Deployment slots
2) Managed identity
3) Custom domains
4) IP restrictions

Correct Answer: 2)

Explanation:

Managed identity allows an Azure App Service application to authenticate to supported Azure services without storing usernames, passwords, client secrets, or other credentials in application code. Azure provides an identity associated with the application, and administrators can grant that identity appropriate role-based permissions to resources such as Key Vault or storage services. This approach improves security because credential management is reduced and secrets do not need to be embedded in source code or configuration files. Developers can then use Azure authentication libraries or supported SDK mechanisms to obtain tokens. Therefore, managed identity is the appropriate feature for passwordless access from App Service to supported Azure resources.

Q30. Which App Service deployment slot setting ensures that a configuration value remains associated with a specific slot during a swap?

1) Read-only setting
2) Slot setting
3) Global setting
4) Shared setting

Correct Answer: 2)

Explanation:

A slot setting marks an App Service application setting or connection string as specific to a particular deployment slot. During a slot swap, values marked as slot settings remain with their original slot instead of moving to the target production slot. This is useful when staging and production require different configuration values, such as database connection strings or environment-specific settings. Without slot-specific configuration, a swap could unintentionally move values between environments. Therefore, when a configuration value must remain associated with its deployment slot during swapping, it should be configured as a slot setting.

Q31. Which Azure service provides a private registry for storing and managing container images?

1) Azure Container Registry
2) Azure Queue Storage
3) Azure Application Insights
4) Azure DNS

Correct Answer: 1)

Explanation:

Azure Container Registry, commonly called ACR, is a managed Azure service used to store, manage, and distribute private container images and related artifacts. Developers can push container images into a registry and later pull them when deploying workloads to services such as Azure Container Instances or Azure Kubernetes Service. ACR supports authentication and integration with Azure services, making it suitable for enterprise container workflows. It can also support automated image build and management scenarios. Therefore, when an application requires a private repository for container images that can be integrated with Azure deployment services, Azure Container Registry is the appropriate service.

Q32. Which Azure service is specifically designed to provide a managed Kubernetes environment?

1) Azure App Service
2) Azure Functions
3) Azure Kubernetes Service
4) Azure Storage

Correct Answer: 3)

Explanation:

Azure Kubernetes Service, or AKS, provides a managed Kubernetes environment for deploying and operating containerized applications. Kubernetes handles concepts such as pods, deployments, services, scaling, and workload scheduling, while AKS reduces the operational burden associated with managing the underlying Kubernetes control plane. Developers can use Kubernetes manifests, Helm charts, and other Kubernetes tools to deploy applications. AKS is appropriate when an application requires Kubernetes orchestration capabilities rather than simply running individual containers. Therefore, Azure Kubernetes Service is the correct choice when the requirement is to deploy and manage containerized applications using a managed Kubernetes platform.

Q33. Which Azure Container Instances setting determines what happens to a container after it stops?

1) Restart policy
2) DNS label
3) Storage tier
4) Deployment slot

Correct Answer: 1)

Explanation:

Azure Container Instances provides a restart policy that controls how containers should be restarted after they stop. Common policies include Always, Never, and OnFailure. An Always policy is useful for workloads that should continuously run, while Never can be appropriate for containers designed to execute a task and stop. OnFailure can restart a container when it terminates unsuccessfully. Selecting the correct policy depends on the workload’s behavior and operational requirements. Therefore, when an administrator needs to determine how Azure Container Instances should respond when a container stops, the Restart policy is the relevant configuration.

Q34. Which Azure Storage feature provides delegated, time-limited access to storage resources without sharing the storage account key?

1) Blob versioning
2) Shared Access Signature
3) Storage replication
4) Lifecycle management

Correct Answer: 2)

Explanation:

A Shared Access Signature, or SAS, provides delegated access to Azure Storage resources using a token that can specify permissions, resources, and an expiration period. This allows an application or user to access storage without receiving the storage account’s primary or secondary access key. SAS tokens can be restricted to operations such as reading, writing, or deleting resources, depending on the token configuration. Because SAS provides controlled and temporary access, it is useful for scenarios where direct credential sharing should be avoided. Therefore, Shared Access Signature is the Azure Storage feature designed for delegated, time-limited access.

Q35. Which Azure Storage capability can automatically move blobs to different access tiers or delete them based on defined conditions?

1) Storage lifecycle management
2) Azure Front Door
3) Managed identity
4) Azure Functions Premium plan

Correct Answer: 1)

Explanation:

Azure Storage lifecycle management allows administrators to define rules that automatically transition blobs between access tiers or delete them when specified conditions are met. For example, frequently accessed data can remain in the Hot tier, while older data can automatically move to Cool or Archive storage according to age-based rules. Lifecycle policies can also delete objects after they are no longer needed. This reduces the need for manual storage administration and can help optimize storage costs. Therefore, when the requirement is to automate blob tier transitions or deletion based on defined conditions, Azure Storage lifecycle management is the correct solution.

Q36. Which Azure Blob Storage access tier is generally optimized for data that is accessed frequently?

1) Archive
2) Cool
3) Hot
4) Offline

Correct Answer: 3)

Explanation:

The Hot access tier is designed for data that is expected to be accessed frequently. It generally provides lower access costs compared with less frequently accessed tiers, while storage costs are relatively higher. The Cool tier is intended for data accessed less frequently, and the Archive tier is designed for long-term data that is rarely accessed and can tolerate retrieval delays. Choosing an appropriate tier depends on access frequency, storage duration, and retrieval requirements. Therefore, when blobs are expected to be accessed frequently and need regular availability, the Hot access tier is generally the most appropriate choice.

Q37. Which Azure Storage security capability protects data at rest using encryption?

1) Storage Service Encryption
2) DNS resolution
3) Application Insights
4) Autoscale

Correct Answer: 1)

Explanation:

Azure Storage Service Encryption automatically encrypts data stored in Azure Storage at rest. This helps protect stored information from unauthorized access to the underlying storage infrastructure. Azure manages the encryption process, and organizations can use Microsoft-managed keys or customer-managed keys depending on the storage service and security requirements. Encryption at rest is different from encryption during network transmission, where mechanisms such as HTTPS or TLS are used. Storage encryption applies to supported Azure Storage data and is designed to provide protection without requiring application developers to implement their own encryption for every stored object. Therefore, Storage Service Encryption is the appropriate capability.

Q38. In Azure Cosmos DB, which property is most important when designing how data is distributed across logical partitions?

1) Connection string
2) Partition key
3) DNS name
4) Access tier

Correct Answer: 2)

Explanation:

The partition key is a fundamental design consideration in Azure Cosmos DB because it determines how items are logically grouped and distributed across physical partitions. A well-chosen partition key can help distribute requests and storage evenly, reducing the risk of creating hot partitions. The property should generally have sufficient cardinality and distribute workload effectively for the application’s access patterns. Changing partitioning strategy later can be difficult, so selecting an appropriate partition key during application design is important. Therefore, when designing how Cosmos DB data should be distributed across logical partitions, the partition key is the key property to evaluate.

Q39. In Azure Cosmos DB, what does an RU/s measure?

1) Number of resource users
2) Replication units per server
3) Request Units per second
4) Recovery units per subscription

Correct Answer: 3)

Explanation:

RU/s stands for Request Units per second and represents the provisioned throughput capacity of an Azure Cosmos DB resource. Different database operations consume different numbers of request units depending on factors such as item size, operation type, indexing, and query complexity. Provisioning sufficient RU/s helps an application handle its expected workload while avoiding excessive throttling. Developers should consider both read and write patterns when estimating throughput requirements. Monitoring consumption can help identify workloads that need optimization or additional capacity. Therefore, RU/s is the measurement used by Azure Cosmos DB to represent available request-processing throughput.

Q40. Which Azure Cosmos DB feature allows an application to choose among different consistency guarantees for replicated data?

1) Access tiers
2) Consistency levels
3) Deployment slots
4) Storage lifecycle policies

Correct Answer: 2)

Explanation:

Azure Cosmos DB provides configurable consistency levels that allow applications to balance data consistency, availability, latency, and performance according to workload requirements. Depending on the chosen level, applications can receive stronger or weaker guarantees about how quickly changes become visible across replicas. This flexibility is useful because different workloads have different requirements. For example, an application requiring predictable read consistency may choose a stronger level, while another application may prioritize lower latency and higher availability. Therefore, when the requirement is to control the consistency guarantees provided for replicated Cosmos DB data, the appropriate feature is Cosmos DB consistency levels.