View Full Microsoft AZ-204 Exam Dumps and Practice Test Dumps
Q341. An Azure Function needs to access Azure Blob Storage without storing a storage account key in application settings. Which authentication approach should be preferred?
1) Hard-code the storage key
2) Store the key in source control
3) Use a managed identity
4) Put the key in the function name
Correct Answer: 3)
Explanation:
A managed identity allows an Azure Function to authenticate to supported Azure resources without requiring developers to store long-lived credentials in application code or configuration. The identity can be assigned the required Azure role or permissions, following the principle of least privilege. This reduces the risk associated with exposed storage keys and simplifies credential management because Azure handles the identity lifecycle. Hard-coding credentials or placing secrets in source control creates unnecessary security risks. For production applications running in Azure, managed identities are generally preferred when the target service supports Microsoft Entra-based authentication.
Q342. A Function App must execute every day at 2:00 AM without requiring an HTTP request or queue message. Which trigger should be configured?
1) Timer trigger
2) HTTP trigger
3) Queue trigger
4) Blob trigger
Correct Answer: 1)
Explanation:
The Azure Functions Timer trigger is designed for scheduled execution based on a timer expression. It can run a function at recurring times, such as every day at 2:00 AM, without requiring an external request. This makes it useful for scheduled maintenance, report generation, cleanup tasks, data synchronization, and other background jobs. HTTP triggers depend on incoming HTTP requests, queue triggers respond to messages, and blob triggers respond to changes involving blobs. A timer-triggered function is therefore the most appropriate option when execution must occur automatically according to a defined schedule.
Q343. A Function App must process each new message added to an Azure Storage Queue. Which trigger should be selected?
1) Timer trigger
2) Queue trigger
3) HTTP trigger
4) Event Grid trigger
Correct Answer: 2)
Explanation:
The Azure Functions Queue trigger automatically invokes a function when messages are available in an Azure Storage Queue. It is useful for background processing workloads where an application places work items into a queue and a function processes them asynchronously. This approach helps separate message producers from consumers and can support scalable processing. Timer triggers are designed for scheduled execution, HTTP triggers require web requests, and Event Grid triggers respond to published events. When the requirement specifically involves processing messages added to an Azure Storage Queue, the Queue trigger is the appropriate Azure Functions feature.
Q344. A developer wants an Azure Function to run whenever a new blob is created in a specified storage container. Which trigger should be used?
1) HTTP trigger
2) Timer trigger
3) Service Bus trigger
4) Blob trigger
Correct Answer: 4)
Explanation:
The Azure Functions Blob trigger allows a function to respond when blobs are created or updated in a configured Azure Storage container, depending on the trigger configuration and runtime behavior. It is useful for workloads such as processing uploaded documents, resizing images, extracting information from files, or initiating downstream workflows. An HTTP trigger requires an HTTP request, a Timer trigger runs according to a schedule, and a Service Bus trigger responds to Service Bus messages. Therefore, when blob activity should directly initiate function execution, the Blob trigger is the appropriate choice.
Q345. A developer wants an Azure Function to read customer information from a Cosmos DB container without writing custom SDK connection code. Which feature should be used?
1) Input binding
2) Output binding
3) Timer trigger
4) Deployment slot
Correct Answer: 1)
Explanation:
Azure Functions input bindings allow a function to access data from supported Azure services without requiring the developer to implement all connection and retrieval logic manually. A Cosmos DB input binding can provide documents or data to the function as part of its execution. This simplifies application code and keeps service integration configuration separate from business logic. Output bindings serve the opposite purpose by sending data to another service. Timer triggers control when functions execute, while deployment slots support application deployment and testing. For retrieving Cosmos DB data through function configuration, an input binding is appropriate.
Q346. An Azure Function must write the result of processing to an Azure Storage Queue. Which feature can simplify sending the output without manually creating a queue client?
1) Input binding
2) Output binding
3) Timer trigger
4) Health Check
Correct Answer: 2)
Explanation:
An Azure Functions output binding allows a function to send data to supported services, such as Azure Storage Queues, without requiring the developer to write all of the underlying client and connection-management code. The function can produce an output value that the binding delivers to the configured destination. This reduces boilerplate code and keeps integration configuration separate from business logic. Input bindings are used to retrieve data, while Timer triggers schedule execution and Health Check is an App Service availability feature. Therefore, an output binding is the appropriate choice for writing function results to a queue.
Q347. An application deployed to Azure App Service needs configuration values that vary between development and production. Which App Service feature should be used to store these values without changing the application code?
1) Deployment slots
2) Application settings
3) Health Check
4) Custom domains
Correct Answer: 2)
Explanation:
App Service application settings provide environment-specific configuration values that can be accessed by the application through environment variables. This allows development, testing, staging, and production environments to use different settings without modifying or recompiling application code. Examples include connection strings, API endpoints, feature configuration, and other environment-specific values. Deployment slots can help maintain separate application environments, but application settings are the direct mechanism for supplying configuration values. Health Check monitors application responsiveness, while custom domains provide user-friendly hostnames. Application settings therefore provide the appropriate configuration mechanism.
Q348. A team wants to test a new version of an App Service application in a staging environment before moving it into production. Which feature should be used?
1) Azure Queue Storage
2) Application Insights
3) Deployment slots
4) Azure Table Storage
Correct Answer: 3)
Explanation:
App Service deployment slots provide separate environments within an App Service application, such as staging and production. A development team can deploy a new application version to the staging slot, validate functionality, run tests, and then swap the slot with production when the release is ready. Slot-based deployment reduces downtime and provides a safer deployment workflow because the new version can be validated before becoming the production application. Application Insights provides monitoring, while Queue Storage and Table Storage provide data services. Deployment slots are therefore the appropriate App Service feature for controlled pre-production testing.
Q349. An App Service application should automatically increase its instance count when CPU usage remains high and decrease it when demand falls. Which capability should be configured?
1) Autoscale
2) Custom domain
3) Managed certificate
4) Access restriction
Correct Answer: 1)
Explanation:
Azure App Service autoscale allows an application to adjust its number of running instances according to configured rules and metrics. For example, rules can increase the instance count when CPU usage exceeds a defined threshold and reduce capacity when demand decreases. This helps applications respond to changing workloads while avoiding unnecessary resource consumption during lower-demand periods. Custom domains configure application hostnames, managed certificates provide TLS certificates, and access restrictions control inbound access. Autoscale is therefore the appropriate feature when an App Service application must dynamically adjust compute capacity based on workload conditions.
Q350. A web application hosted in Azure App Service must be accessible through www.contoso.com using HTTPS. Which configuration is required?
1) Queue trigger
2) Custom domain and TLS certificate binding
3) Event Grid subscription
4) Storage lifecycle policy
Correct Answer: 2)
Explanation:
To expose an App Service application through a custom hostname such as www.contoso.com, the custom domain must first be configured for the application. HTTPS then requires an appropriate TLS certificate to secure communication. App Service supports certificate binding so that the certificate is associated with the custom hostname. This enables clients to establish encrypted HTTPS connections to the application. Queue triggers and Event Grid subscriptions address application processing rather than web hosting configuration, while storage lifecycle policies manage stored data. Therefore, a custom domain combined with an appropriate TLS certificate binding is required.
Q351. An App Service application needs to access resources in an Azure virtual network, but the application should remain publicly accessible. Which networking feature should be used?
1) Private Endpoint only
2) VNet Integration
3) Azure Storage Queue
4) Deployment slot
Correct Answer: 2)
Explanation:
App Service VNet Integration allows an application to make outbound connections to resources accessible through an Azure virtual network while the App Service can continue to provide its normal public endpoint. This is useful when an application needs to communicate with private resources such as databases, internal APIs, or services connected through the virtual network. A Private Endpoint is generally used to provide private inbound access to a service rather than enabling an App Service application’s outbound integration. Deployment slots address application releases. Therefore, VNet Integration is the appropriate feature for this requirement.
Q352. A company wants to restrict an App Service application so that only requests from approved IP addresses can reach it. Which feature should be configured?
1) Access restrictions
2) Application Insights
3) Autoscale
4) Deployment slot settings
Correct Answer: 1)
Explanation:
App Service access restrictions allow administrators to control inbound access based on conditions such as IP addresses, virtual networks, and service tags, depending on the configuration. This can be used to restrict an application so that only approved sources can reach it. Access restrictions are particularly useful for protecting administrative applications, internal APIs, staging environments, or applications that should not accept traffic from arbitrary public sources. Application Insights provides monitoring, autoscale manages instance capacity, and slot settings control configuration behavior between deployment slots. Access restrictions are therefore the correct feature for controlling inbound application access.
Q353. An application hosted in App Service must remain responsive even when no user requests have arrived for a long period. Which feature can prevent the application from being unloaded due to inactivity?
1) Health Check
2) Always On
3) Custom domain
4) Access restrictions
Correct Answer: 2)
Explanation:
App Service Always On keeps the application loaded by sending periodic requests so that the application does not become unloaded because of inactivity. This is particularly useful for applications that need to respond quickly to requests or perform continuous background processing. Without Always On, supported App Service plans may unload an application after a period without traffic, which can result in slower response times when the next request arrives. Health Check serves a different purpose by monitoring application availability. Custom domains configure hostnames, and access restrictions control inbound traffic. Always On is therefore the appropriate feature for maintaining application readiness.
Q354. An App Service application must automatically remove instances from traffic when the application becomes unhealthy. Which feature can help identify unhealthy application instances?
1) App Service Health Check
2) Application settings
3) Custom domains
4) Deployment slot settings
Correct Answer: 1)
Explanation:
App Service Health Check monitors a configured health endpoint of an application and can help determine whether an instance is healthy. When an instance repeatedly fails health checks, App Service can stop routing traffic to that unhealthy instance and can take corrective scaling actions depending on the configuration and platform behavior. This improves application availability by preventing traffic from continuing to target unhealthy instances. Application settings manage configuration values, custom domains provide hostnames, and slot settings control which configuration values remain associated with a slot. Health Check is therefore the correct feature for monitoring instance health.
Q355. A company stores container images in Azure Container Registry and wants images to be automatically rebuilt whenever source code changes. Which ACR capability should be considered?
1) Repository deletion
2) ACR Tasks
3) Private Endpoint
4) Geo-replication
Correct Answer: 2)
Explanation:
Azure Container Registry Tasks can automate container image building, testing, and pushing workflows. A task can be configured to respond to source code changes or base image updates, depending on the scenario, allowing teams to maintain updated container images without manually executing every build. This supports automated container development workflows and can integrate image creation into a broader CI/CD process. Private Endpoint provides private network connectivity to the registry, while geo-replication distributes registry data across regions. Repository deletion removes images or repositories. ACR Tasks is therefore the appropriate capability for automated image builds.
Q356. A containerized application running in AKS needs to expose an HTTP endpoint and route incoming requests to different services based on URL paths. Which Kubernetes resource should be configured?
1) ConfigMap
2) PersistentVolume
3) Ingress
4) Secret
Correct Answer: 3)
Explanation:
Kubernetes Ingress provides HTTP and HTTPS routing into services within a Kubernetes cluster. It can route requests according to hostnames or URL paths, allowing a single external entry point to direct traffic to different Kubernetes Services. For example, /orders could route to an order service while /customers routes to a customer service. ConfigMaps store non-sensitive configuration, PersistentVolumes provide persistent storage, and Secrets store sensitive configuration data. Ingress is therefore the appropriate Kubernetes resource when an AKS application requires HTTP routing based on hosts or URL paths.
Q357. A Kubernetes Pod should not receive traffic until its application has completed initialization and is ready to serve requests. Which probe should be configured?
1) Readiness probe
2) Liveness probe
3) Startup probe only
4) Resource limit
Correct Answer: 1)
Explanation:
A Kubernetes readiness probe determines whether a Pod is ready to receive traffic. When the readiness probe fails, Kubernetes can remove the Pod from the endpoints used by a Service, preventing requests from being routed to an application that is not ready. This is especially important for applications that require time to initialize or temporarily become unavailable while processing internal state changes. A liveness probe determines whether a container should be restarted, while a startup probe can protect slow-starting applications during initialization. Resource limits control resource consumption. Readiness probing is therefore the correct choice for traffic control.
Q358. A Kubernetes container becomes unresponsive after running for several hours, but the Pod itself remains scheduled. The application should be automatically restarted when its health endpoint fails. Which probe should be used?
1) Readiness probe
2) Liveness probe
3) Ingress rule
4) ConfigMap
Correct Answer: 2)
Explanation:
A Kubernetes liveness probe checks whether a container is still functioning correctly. If the probe repeatedly fails according to the configured thresholds, Kubernetes can restart the affected container. This is useful for applications that can enter an unhealthy or deadlocked state while the Pod remains running. A readiness probe instead controls whether the Pod should receive traffic and does not primarily indicate that the container should be restarted. Ingress handles HTTP routing, while ConfigMaps provide configuration. Therefore, a liveness probe is the appropriate mechanism for automatically restarting an unresponsive container.
Q359. An AKS workload requires a file system that can be mounted by multiple Pods simultaneously. Which Azure storage option is generally appropriate?
1) Azure Managed Disk with exclusive attachment
2) Azure Files
3) Azure Queue Storage
4) Azure Table Storage
Correct Answer: 2)
Explanation:
Azure Files provides managed file shares that can be mounted by multiple clients and is commonly used when Kubernetes workloads require shared file-system access. In AKS, Azure Files can be used through persistent volumes so that multiple Pods can access shared data when the selected storage configuration supports the required access mode. Azure Managed Disks are generally designed around block storage and commonly provide single-node attachment patterns depending on the disk and configuration. Queue Storage is for messaging, while Table Storage provides NoSQL key-value-style data. Azure Files is therefore the appropriate option for shared file storage across Pods.
Q360. An AKS deployment needs to store database passwords and API keys separately from application container images and ordinary configuration. Which Kubernetes resource should be used?
1) ConfigMap
2) Deployment
3) Secret
4) Service
Correct Answer: 3)
Explanation:
Kubernetes Secrets are designed to store sensitive information such as passwords, tokens, certificates, and API keys separately from ordinary application configuration. Pods can consume Secrets through environment variables or mounted files, depending on the application design. ConfigMaps are intended for non-sensitive configuration values and should not be treated as the primary mechanism for protecting credentials. Deployments manage the desired state and rollout of Pods, while Services provide network access to workloads. Therefore, a Kubernetes Secret is the appropriate resource for separating sensitive credentials from application images and standard configuration.