Microsoft AZ-204 Practice Test Questions and Exam Dumps Part 14 Q261-280

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

 

Q261. Which Kubernetes probe determines whether a container should be restarted because it is no longer functioning correctly?

1) Readiness probe
2) Liveness probe
3) Startup command
4) Service probe

Correct Answer: 2)

Explanation:

A Kubernetes liveness probe determines whether a container is still functioning correctly. If the probe repeatedly fails, Kubernetes can restart the container according to the configured Pod behavior. This helps recover applications that become unresponsive or enter an unhealthy state without requiring manual intervention. A readiness probe has a different purpose: it determines whether the container is ready to receive traffic. Startup probes are useful for applications that require significant time to initialize. Therefore, the liveness probe is the appropriate mechanism for detecting an unhealthy running container and allowing Kubernetes to restart it automatically.

Q262. Which Kubernetes feature is useful for applications that require significant time to initialize before liveness checks should begin?

1) Startup probe
2) ClusterIP
3) ConfigMap
4) Horizontal Pod Autoscaler

Correct Answer: 1)

Explanation:

A Kubernetes startup probe is designed for containers that may require a long time to initialize. It allows Kubernetes to determine whether an application has successfully started before liveness and readiness checks become active according to the configured probe behavior. This prevents a slow-starting application from being incorrectly restarted because it has not yet completed initialization. ClusterIP provides internal service networking, ConfigMaps store configuration data, and Horizontal Pod Autoscaler adjusts the number of Pod replicas based on resource or custom metrics. Therefore, a startup probe is the correct feature for protecting applications with lengthy startup processes.

Q263. Which Kubernetes feature automatically adjusts the number of Pod replicas based on CPU or memory utilization?

1) Pod Disruption Budget
2) Horizontal Pod Autoscaler
3) ConfigMap
4) Ingress

Correct Answer: 2)

Explanation:

The Kubernetes Horizontal Pod Autoscaler, or HPA, automatically adjusts the number of replicas in a workload based on configured metrics. CPU and memory utilization are common examples, although supported custom and external metrics can also be used. HPA is useful when application demand changes over time because it can increase the number of Pods during periods of high demand and reduce them when demand decreases. A Pod Disruption Budget protects availability during voluntary disruptions, ConfigMaps store configuration values, and Ingress manages HTTP routing into a cluster. Therefore, HPA is the appropriate Kubernetes feature for automatically changing Pod replica counts based on workload demand.

Q264. Which AKS feature automatically adds or removes virtual machine nodes when additional cluster capacity is required?

1) Cluster autoscaler
2) Readiness probe
3) Kubernetes Secret
4) Service selector

Correct Answer: 1)

Explanation:

The AKS cluster autoscaler automatically adjusts the number of nodes in a node pool based on workload requirements. When Pods cannot be scheduled because available cluster capacity is insufficient, the autoscaler can add nodes. When capacity is no longer needed, it can remove nodes according to configured limits and conditions. This differs from the Horizontal Pod Autoscaler, which changes the number of application Pods rather than the number of underlying nodes. Readiness probes control application traffic, Secrets store sensitive configuration, and service selectors identify Pods for network routing. Therefore, the cluster autoscaler is the correct feature for automatically managing AKS node capacity.

Q265. Which Kubernetes object stores sensitive information such as passwords and access tokens?

1) ConfigMap
2) Secret
3) Deployment
4) Service

Correct Answer: 2)

Explanation:

A Kubernetes Secret is designed to store sensitive information such as passwords, access tokens, certificates, and other confidential configuration values. Secrets can be exposed to containers through environment variables or mounted files, depending on the application requirements. Although Kubernetes Secrets provide a dedicated mechanism for sensitive values, organizations should still apply appropriate security controls and consider integrating AKS with external secret-management solutions such as Azure Key Vault for stronger centralized management. ConfigMaps are intended for non-sensitive configuration, Deployments manage application Pods, and Services provide networking. Therefore, Secret is the correct Kubernetes object for storing sensitive application information.

Q266. Which Kubernetes object stores non-sensitive configuration values that can be consumed by Pods?

1) ConfigMap
2) Secret
3) Service
4) PersistentVolume

Correct Answer: 1)

Explanation:

A Kubernetes ConfigMap stores non-sensitive configuration information separately from application container images. Values from a ConfigMap can be provided to containers as environment variables, command-line arguments, or mounted configuration files. This allows the same container image to be reused across different environments while configuration values are supplied independently. Secrets should be used for sensitive information, Services provide stable networking endpoints, and PersistentVolumes provide storage. Separating configuration from container images improves application portability and simplifies environment-specific configuration. Therefore, ConfigMap is the correct Kubernetes object for storing ordinary, non-sensitive application configuration.

Q267. Which Kubernetes object provides a stable network endpoint for accessing a set of Pods?

1) Deployment
2) Service
3) ConfigMap
4) Secret

Correct Answer: 2)

Explanation:

A Kubernetes Service provides a stable network endpoint for accessing a group of Pods selected according to configured labels. Because Pods can be created, deleted, or replaced during normal Kubernetes operations, clients should not depend directly on individual Pod IP addresses. A Service provides a stable abstraction that allows applications to communicate with the appropriate Pods even as the underlying Pod instances change. Deployments manage application replicas and updates, ConfigMaps store configuration, and Secrets store sensitive information. Therefore, the Kubernetes Service object is the correct choice when an application needs stable network access to a set of Pods.

Q268. Which Kubernetes object is commonly used to expose HTTP and HTTPS routes to services inside an AKS cluster?

1) Ingress
2) ConfigMap
3) PersistentVolume
4) Secret

Correct Answer: 1)

Explanation:

A Kubernetes Ingress provides rules for routing HTTP and HTTPS traffic to services within a Kubernetes cluster. It can support host-based or path-based routing and can provide a centralized entry point for multiple application services. In AKS, an Ingress controller implements these routing rules and handles the actual network traffic according to the configured controller. ConfigMaps store configuration data, PersistentVolumes provide storage, and Secrets manage sensitive information. Therefore, Ingress is the correct Kubernetes resource when an application needs HTTP or HTTPS routing from an external entry point to services inside the cluster.

Q269. Which Kubernetes object provides persistent storage independently of the lifecycle of an individual Pod?

1) PersistentVolume
2) ConfigMap
3) Service
4) Deployment

Correct Answer: 1)

Explanation:

A Kubernetes PersistentVolume, or PV, represents storage that exists independently from the lifecycle of an individual Pod. This allows application data to persist even when Pods are deleted, recreated, or rescheduled. PersistentVolumes can be backed by supported storage systems such as Azure Disk or Azure Files in AKS. A PersistentVolumeClaim can be used by workloads to request the required storage. ConfigMaps store configuration, Services provide networking, and Deployments manage application replicas. Therefore, PersistentVolume is the appropriate Kubernetes object when an application requires storage that persists beyond the lifecycle of individual Pods.

Q270. Which Kubernetes object allows a Pod to request a specific amount of persistent storage?

1) Service
2) PersistentVolumeClaim
3) ConfigMap
4) Deployment

Correct Answer: 2)

Explanation:

A PersistentVolumeClaim, or PVC, allows a Kubernetes workload to request persistent storage with specified requirements such as capacity and access mode. Kubernetes can use the claim to bind the workload to an appropriate PersistentVolume that satisfies those requirements. This abstraction allows application developers to request storage without necessarily managing the underlying storage resource directly. Services provide networking, ConfigMaps store non-sensitive configuration, and Deployments manage application replicas. In AKS, PVCs can be backed by Azure storage solutions according to the configured storage class. Therefore, PersistentVolumeClaim is the correct object for requesting persistent storage for a Pod.

Q271. Which Azure service provides managed Kubernetes orchestration for containerized applications?

1) Azure Container Instances
2) Azure Kubernetes Service
3) Azure App Configuration
4) Azure Queue Storage

Correct Answer: 2)

Explanation:

Azure Kubernetes Service, or AKS, provides managed Kubernetes orchestration for running containerized applications. It reduces the operational effort required to manage Kubernetes infrastructure while providing Kubernetes capabilities such as deployments, services, scaling, networking, and workload scheduling. AKS is appropriate for applications that require orchestration across multiple containers and may benefit from advanced Kubernetes functionality. Azure Container Instances provides simpler container execution without requiring a full Kubernetes cluster, while App Configuration manages application settings and Queue Storage provides messaging. Therefore, Azure Kubernetes Service is the correct Azure offering for managed Kubernetes orchestration.

Q272. Which Azure service is best suited for running a single container without managing a Kubernetes cluster?

1) Azure Kubernetes Service
2) Azure Container Instances
3) Azure Front Door
4) Azure App Configuration

Correct Answer: 2)

Explanation:

Azure Container Instances, or ACI, allows developers to run containers directly in Azure without provisioning or managing virtual machines or a Kubernetes cluster. It is suitable for simple container workloads, short-lived tasks, batch processing, and scenarios where full orchestration capabilities are unnecessary. Developers can specify container resources, networking, and restart behavior while Azure manages the underlying infrastructure. AKS is more appropriate when applications require Kubernetes orchestration and cluster-level capabilities. Front Door provides global web routing, while App Configuration manages application settings. Therefore, Azure Container Instances is the best choice for running a container without managing Kubernetes infrastructure.

Q273. Which Azure Container Instances restart policy ensures that a container is restarted only when it exits unsuccessfully?

1) Always
2) Never
3) OnFailure
4) Scheduled

Correct Answer: 3)

Explanation:

The Azure Container Instances OnFailure restart policy causes a container to restart when it terminates with a failure condition. This behavior is useful for workloads such as batch jobs or processing tasks where a successful completion should not cause the container to start again, but an unsuccessful execution should trigger a retry. The Always policy restarts the container regardless of its exit status, while Never prevents automatic restarts. A scheduled restart policy is not the standard ACI restart-policy option. Therefore, OnFailure is the correct choice when a container should restart only after an unsuccessful execution.

Q274. Which Azure Container Instances restart policy prevents a container from being restarted after it stops?

1) Always
2) OnFailure
3) Never
4) Automatic

Correct Answer: 3)

Explanation:

The Never restart policy instructs Azure Container Instances not to restart a container after it stops. This can be useful for one-time or batch workloads where the container should execute once and remain stopped after completion. In contrast, the OnFailure policy restarts a container when it terminates unsuccessfully, while Always causes the container to restart regardless of its exit condition. Choosing the correct restart policy is important because different workloads have different execution patterns. Therefore, Never is the appropriate policy when the container should not automatically restart after stopping.

Q275. Which Azure Container Registry capability can build container images from source code without requiring a local Docker environment?

1) ACR Tasks
2) Azure Files
3) Azure Front Door
4) Azure Monitor

Correct Answer: 1)

Explanation:

ACR Tasks provide managed container image build capabilities within Azure Container Registry. Developers can configure automated builds from source code or use triggers based on events such as source changes or base-image updates. This allows image-building workflows to execute in Azure without requiring developers to maintain a local Docker environment for every build. ACR Tasks can also integrate with container image management workflows and automate tagging or pushing images. Azure Files provides shared storage, Front Door handles global web routing, and Azure Monitor provides monitoring capabilities. Therefore, ACR Tasks are the correct solution for cloud-based automated container image builds.

Q276. Which Azure Container Registry feature allows an application to pull container images from a geographically closer registry replica?

1) Geo-replication
2) Access restrictions
3) Deployment slots
4) Application Insights

Correct Answer: 1)

Explanation:

Azure Container Registry geo-replication allows container registry content to be replicated across selected Azure regions. Applications running in different geographic locations can pull images from a nearby registry replica, which can improve image-pull performance and reduce latency. Geo-replication is especially useful for globally distributed applications and multi-region deployment architectures. Access restrictions control access to services, deployment slots are an App Service deployment feature, and Application Insights provides application monitoring. Therefore, geo-replication is the appropriate Azure Container Registry capability when container images need to be available closer to workloads in multiple regions.

Q277. Which Azure Functions trigger starts a function when a new message is added to an Azure Storage Queue?

1) HTTP trigger
2) Timer trigger
3) Queue trigger
4) Event Grid trigger

Correct Answer: 3)

Explanation:

An Azure Functions Queue trigger automatically invokes a function when messages become available in an Azure Storage Queue. This provides a simple event-driven pattern for processing background tasks asynchronously. For example, a web application can place a task message into a queue and allow a Function to process it independently. HTTP triggers execute when HTTP requests are received, Timer triggers execute according to schedules, and Event Grid triggers respond to Event Grid events. Therefore, the Queue trigger is the correct choice when a function should execute in response to messages placed in Azure Queue Storage.

Q278. Which Azure Functions trigger executes a function according to a defined schedule?

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

Correct Answer: 2)

Explanation:

The Azure Functions Timer trigger allows a function to execute according to a defined schedule. Developers can use a timer trigger for recurring tasks such as periodic data processing, maintenance operations, scheduled reports, or cleanup activities. The schedule is configured according to the supported timer syntax and the Functions runtime. Queue triggers respond to messages, Blob triggers respond to changes in Blob Storage, and HTTP triggers respond to web requests. Therefore, the Timer trigger is the appropriate choice when a function needs to run automatically at predefined intervals rather than in response to an incoming request or event.

Q279. Which Azure Functions trigger allows a function to execute when a new or updated blob is detected in Azure Blob Storage?

1) Blob trigger
2) HTTP trigger
3) Timer trigger
4) Service Bus trigger

Correct Answer: 1)

Explanation:

The Azure Functions Blob trigger allows a function to execute when supported changes are detected in Azure Blob Storage. This is useful for event-driven workloads such as processing uploaded files, transforming images, analyzing documents, or initiating downstream workflows after data is placed in a storage container. HTTP triggers respond to HTTP requests, Timer triggers run according to schedules, and Service Bus triggers respond to messages in Service Bus entities. Therefore, the Blob trigger is the correct choice when an Azure Function should respond automatically to blob-related changes in Azure Storage.

Q280. Which Azure Functions feature allows a function to receive data from an external service without manually writing the complete client connection logic?

1) Input binding
2) Deployment slot
3) Function key
4) Host timeout

Correct Answer: 1)

Explanation:

Azure Functions input bindings allow a function to receive data from supported external services without requiring developers to implement all the underlying connection and retrieval logic manually. Bindings can simplify access to resources such as Blob Storage, Cosmos DB, queues, and other supported services. This reduces boilerplate code and allows developers to focus on the application’s business logic. Output bindings provide the complementary capability of sending data to external resources. Deployment slots support application versioning, function keys provide access control for supported HTTP functions, and timeout settings control execution duration. Therefore, an input binding is the correct choice for retrieving external data through the Functions binding model.