View Full Microsoft AZ-204 Exam Dumps and Practice Test Dumps
Q121. Which Kubernetes resource is used to manage the desired number of replicas and rolling updates for an application?
1) Service
2) ConfigMap
3) Deployment
4) Secret
Correct Answer: 3)
Explanation:
A Kubernetes Deployment manages the desired state of an application by defining how many pod replicas should run and how updates should be performed. When a Deployment is changed, Kubernetes can perform a rolling update, gradually replacing existing pods with new ones while maintaining application availability. Deployments also allow failed pods to be recreated to maintain the configured replica count. A Service provides networking, ConfigMaps store non-sensitive configuration, and Secrets store sensitive values. Therefore, a Deployment is the appropriate Kubernetes resource when developers need to manage application replicas and perform controlled rolling updates.
Q122. Which Kubernetes resource should be used to store sensitive information such as passwords or API tokens?
1) ConfigMap
2) Secret
3) Service
4) Deployment
Correct Answer: 2)
Explanation:
Kubernetes Secrets are designed to store sensitive information such as passwords, access tokens, certificates, and connection credentials separately from application images and ordinary configuration. Applications can consume Secrets as environment variables or mounted files. ConfigMaps are intended for non-sensitive configuration values and should not be used as the primary mechanism for protecting confidential information. Services provide networking, while Deployments manage application replicas and updates. Using Secrets helps separate sensitive configuration from application code and makes it easier to manage credentials across different deployment environments. Developers should also apply appropriate access controls and encryption practices when managing Kubernetes Secrets.
Q123. Which Azure Kubernetes Service feature can automatically adjust the number of nodes in a cluster based on resource requirements?
1) Cluster autoscaler
2) ConfigMap
3) Service discovery
4) Pod security policy
Correct Answer: 1)
Explanation:
The AKS cluster autoscaler can automatically increase or decrease the number of nodes in a Kubernetes cluster based on the scheduling requirements of pods. When existing nodes do not have sufficient capacity for pending pods, the autoscaler can add nodes. When nodes become unnecessary, it can remove them according to its configuration and constraints. This helps applications efficiently use compute resources as workloads change. ConfigMaps store configuration, service discovery provides networking information, and security policies address workload security. The cluster autoscaler is therefore the appropriate AKS capability when node capacity needs to adjust automatically according to workload demand.
Q124. Which Kubernetes mechanism automatically increases or decreases the number of pod replicas based on CPU or memory utilization?
1) Horizontal Pod Autoscaler
2) Azure Private Endpoint
3) ConfigMap
4) Service
Correct Answer: 1)
Explanation:
The Kubernetes Horizontal Pod Autoscaler, or HPA, adjusts the number of running pod replicas according to observed resource utilization or other configured metrics. If demand increases and utilization exceeds the configured target, HPA can increase the number of replicas. When demand decreases, it can reduce the number of replicas within the defined limits. This allows applications to respond dynamically to changing workloads without requiring manual scaling. A Service provides networking, a ConfigMap stores configuration, and a Private Endpoint provides private connectivity to supported Azure services. HPA is therefore the appropriate mechanism for automatically scaling application pods.
Q125. Which Azure Container Instances restart policy should be used when a container should run once and not restart after successful completion?
1) Always
2) Never
3) OnFailure
4) Continuous
Correct Answer: 2)
Explanation:
The ACI Never restart policy is appropriate for containers that should execute a task and then remain stopped after completing successfully. This is useful for short-lived jobs, batch processing, scripts, and other workloads that do not require a continuously running service. The Always policy is designed for workloads that should restart when they stop, while OnFailure is intended to restart a container when it exits unsuccessfully. Choosing the correct restart policy prevents unnecessary container restarts and helps align container behavior with the application’s execution model. Therefore, Never is the correct option when a successful completion should not trigger another execution.
Q126. Which Azure Container Instances restart policy is most appropriate for a batch job that should restart only when the container exits with an error?
1) Never
2) Always
3) OnFailure
4) Scheduled
Correct Answer: 3)
Explanation:
The OnFailure restart policy causes an Azure Container Instance to restart when the container terminates unsuccessfully. This is useful for batch jobs and processing tasks where an application should retry after an error but should remain stopped after successful completion. The Never policy does not restart the container, while Always continuously restarts it whenever it terminates. A failure-based policy can help applications recover automatically from transient or processing errors without repeatedly rerunning successful jobs. Therefore, OnFailure is the appropriate ACI restart policy when the requirement is to retry only unsuccessful executions.
Q127. Which Azure service is designed to store application secrets, encryption keys, and certificates securely?
1) Azure Key Vault
2) Azure Queue Storage
3) Azure Event Grid
4) Azure Table Storage
Correct Answer: 1)
Explanation:
Azure Key Vault provides centralized and secure management of secrets, cryptographic keys, and certificates used by applications and services. Instead of placing passwords, API keys, or certificates directly in application source code or configuration files, developers can store them in Key Vault and allow authorized applications to retrieve them securely. Access can be controlled through Microsoft Entra ID and role-based access mechanisms. Queue Storage is intended for asynchronous messaging, Event Grid provides event routing, and Table Storage stores NoSQL entities. Azure Key Vault is therefore the appropriate service when an application requires secure storage and controlled access to sensitive credentials and cryptographic material.
Q128. Which authentication mechanism allows an Azure-hosted application to access Key Vault without storing a client secret in its configuration?
1) Managed identity
2) Anonymous access
3) Hard-coded password
4) Public access key
Correct Answer: 1)
Explanation:
A managed identity allows an Azure resource to authenticate to supported services such as Azure Key Vault without requiring developers to store application credentials in code or configuration. Azure manages the identity and its credentials, while permissions can be assigned through appropriate role-based access controls. This significantly reduces the risk of accidentally exposing secrets in source repositories or deployment configuration. Hard-coded passwords and client secrets require credential management and rotation, while anonymous access is inappropriate for protected Key Vault data. Therefore, managed identity is the preferred authentication mechanism when an Azure-hosted application needs secure access to Key Vault without maintaining its own credentials.
Q129. Which Azure service provides centralized collection and analysis of logs from applications and Azure resources?
1) Azure Log Analytics
2) Azure Blob Storage
3) Azure Queue Storage
4) Azure Container Registry
Correct Answer: 1)
Explanation:
Azure Log Analytics provides a centralized environment for collecting, querying, and analyzing log data from applications, infrastructure, and Azure resources. It uses a powerful query language that allows developers and administrators to investigate events, identify problems, analyze trends, and build monitoring solutions. Log Analytics workspaces commonly serve as the data platform behind Azure Monitor and other monitoring capabilities. Blob Storage is designed for object data, Queue Storage supports messaging, and Container Registry stores container images. Therefore, Log Analytics is the appropriate choice when an organization needs centralized log collection and interactive analysis across Azure resources and applications.
Q130. Which Azure service provides application performance monitoring, request tracking, dependency tracking, and exception telemetry?
1) Azure Application Insights
2) Azure Storage Explorer
3) Azure Service Bus
4) Azure Container Registry
Correct Answer: 1)
Explanation:
Azure Application Insights provides application performance monitoring and telemetry capabilities for applications hosted in Azure and other supported environments. It can collect information about incoming requests, dependencies, exceptions, performance, availability, and other application behavior. Developers can use this telemetry to identify slow operations, failed requests, dependency problems, and application errors. Service Bus provides messaging, Container Registry manages container images, and Storage Explorer is a management tool rather than an application telemetry platform. Application Insights is therefore the appropriate service when developers need detailed visibility into application performance and runtime behavior.
Q131. Which Azure Monitor feature can notify administrators when a metric exceeds a configured threshold?
1) Alert rule
2) Blob versioning
3) Storage queue
4) Cosmos DB TTL
Correct Answer: 1)
Explanation:
Azure Monitor alert rules can evaluate metrics, logs, or other monitored signals and trigger an alert when defined conditions are satisfied. For example, an organization can create an alert when CPU utilization remains above a specific percentage, when application failures increase, or when available capacity falls below a threshold. Alerts can then invoke configured action groups to notify users or trigger automated responses. Blob versioning preserves previous blob versions, Storage Queue provides asynchronous messaging, and Cosmos DB TTL automatically expires data. Therefore, an Azure Monitor alert rule is the correct mechanism for detecting monitored conditions and initiating a notification or response.
Q132. Which Azure service can route users to the closest or healthiest application endpoint using global HTTP(S) routing?
1) Azure Front Door
2) Azure Table Storage
3) Azure Queue Storage
4) Azure Key Vault
Correct Answer: 1)
Explanation:
Azure Front Door provides global application delivery and HTTP(S) routing capabilities. It can direct client requests toward appropriate backend endpoints based on routing configuration, health information, and other supported policies. Front Door is useful for globally distributed web applications that require improved availability, performance, and centralized entry-point management. It can also provide features such as acceleration, TLS termination, and application-layer security capabilities depending on the configuration. Table Storage is a NoSQL data store, Queue Storage provides messaging, and Key Vault manages secrets. Therefore, Azure Front Door is the appropriate service for global HTTP(S) application routing.
Q133. Which Azure service is most appropriate for implementing a globally distributed NoSQL application that requires configurable consistency levels?
1) Azure SQL Database
2) Azure Cosmos DB
3) Azure Queue Storage
4) Azure Files
Correct Answer: 2)
Explanation:
Azure Cosmos DB is a globally distributed NoSQL database designed for applications that require low-latency access and flexible scalability across regions. It supports multiple consistency models, allowing developers to choose the appropriate balance between consistency, availability, latency, and throughput for their application. Cosmos DB also supports automatic indexing, partitioning, and global distribution. Azure SQL Database is a relational database service, Queue Storage is intended for messaging, and Azure Files provides managed file shares. Therefore, Cosmos DB is the best option when an application requires globally distributed NoSQL storage combined with configurable consistency behavior.
Q134. Which Cosmos DB concept determines how items are logically grouped and distributed across partitions?
1) Partition key
2) TTL
3) Change feed
4) Consistency level
Correct Answer: 1)
Explanation:
The Cosmos DB partition key identifies the property used to logically distribute items across partitions. Choosing an appropriate partition key is critical because it affects scalability, data distribution, query efficiency, and request unit consumption. A well-designed key should provide sufficient cardinality and distribute workload evenly while matching common application access patterns. TTL controls item expiration, change feed tracks modifications, and consistency levels determine how reads observe writes. The partition key is therefore a fundamental part of Cosmos DB data modeling and should be selected carefully when designing applications that need to scale across large volumes of data.
Q135. Which Cosmos DB consistency level provides the strongest guarantee that reads reflect the latest successful write?
1) Eventual
2) Consistent prefix
3) Bounded staleness
4) Strong
Correct Answer: 4)
Explanation:
The Strong consistency level provides the strongest consistency guarantee in Azure Cosmos DB. With strong consistency, a read is guaranteed to return the most recent committed version of data within the supported configuration. This can be important for applications where stale reads are unacceptable, although stronger consistency can involve trade-offs related to latency, availability, and geographic distribution. Eventual consistency provides the weakest guarantee and may temporarily return older data. Bounded staleness limits how stale data can become, while consistent prefix ensures reads do not observe writes out of order. Therefore, Strong consistency is the appropriate choice when the application requires the strongest read-after-write guarantee.
Q136. Which Azure Storage service is designed to provide SMB-based managed file shares that can be mounted by Windows or Linux systems?
1) Azure Files
2) Azure Queue Storage
3) Azure Table Storage
4) Azure Event Grid
Correct Answer: 1)
Explanation:
Azure Files provides fully managed file shares that can be accessed using protocols such as SMB and, for supported configurations, NFS. These shares can be mounted by applications and operating systems, making Azure Files useful when workloads require traditional file-system semantics rather than object storage. Azure Queue Storage is designed for asynchronous messaging, Table Storage provides NoSQL key-value storage, and Event Grid provides event routing. Azure Files can therefore be useful for shared application files, configuration files, migration scenarios, and workloads that need a managed network file share accessible from multiple systems.
Q137. Which Azure Storage service is most appropriate for storing simple key-value entities without requiring a relational database schema?
1) Azure Table Storage
2) Azure Files
3) Azure Queue Storage
4) Azure Blob Storage
Correct Answer: 1)
Explanation:
Azure Table Storage provides a NoSQL key-value data store for applications that need to store structured entities without the overhead of a traditional relational database. Each entity can contain properties, and partition and row keys help organize and access data efficiently. Table Storage can be useful for large amounts of structured but non-relational information where flexible schemas and scalable storage are important. Azure Files provides file shares, Queue Storage is intended for messages, and Blob Storage is optimized for unstructured object data. Therefore, Azure Table Storage is the appropriate choice for simple NoSQL key-value entity storage.
Q138. Which Azure service is designed for asynchronous communication where producers place messages into a queue and consumers process them independently?
1) Azure Queue Storage
2) Azure Key Vault
3) Azure Front Door
4) Azure Application Insights
Correct Answer: 1)
Explanation:
Azure Queue Storage provides simple asynchronous messaging between application components. A producer can place messages into a queue without waiting for a consumer to process them immediately. A consumer can retrieve and process messages independently, which helps decouple application components and absorb temporary differences in processing rates. Queue Storage is useful for background tasks, workload buffering, and simple distributed application communication. Key Vault manages secrets, Front Door provides application routing, and Application Insights provides telemetry. Therefore, Azure Queue Storage is appropriate when an application requires straightforward asynchronous communication between producers and consumers.
Q139. Which Azure service provides an in-memory data store commonly used for caching frequently accessed application data?
1) Azure Cache for Redis
2) Azure Event Grid
3) Azure Table Storage
4) Azure Container Registry
Correct Answer: 1)
Explanation:
Azure Cache for Redis provides a managed in-memory data store that can be used to cache frequently accessed information and reduce the workload placed on backend databases or APIs. By keeping commonly requested data in memory, applications can often achieve lower response times and improve scalability. Typical use cases include session state, frequently accessed reference data, and temporary application results. Event Grid handles event routing, Table Storage stores NoSQL entities, and Container Registry manages container images. Azure Cache for Redis is therefore the appropriate service when an application needs a high-speed cache to improve performance and reduce repeated backend data retrieval.
Q140. Which Azure service should be used when an application needs to publish events to subscribers without requiring the publisher to know the individual receiving systems?
1) Azure Event Grid
2) Azure Files
3) Azure SQL Database
4) Azure Key Vault
Correct Answer: 1)
Explanation:
Azure Event Grid supports event-driven architectures in which event publishers can emit events without needing direct knowledge of the systems that consume them. Event subscribers can independently register for relevant events, allowing applications to remain loosely coupled. This architecture is useful for scenarios such as reacting to resource changes, processing uploaded files, triggering workflows, and integrating distributed application components. Azure Files provides file storage, Azure SQL Database provides relational database capabilities, and Key Vault manages secrets and certificates. Event Grid is therefore the appropriate service when the primary requirement is loosely coupled event publication and subscription between distributed components.