Friday, 24 January 2025

AZ-204 Question and Answer Part 12

Question #151
HOTSPOT
-

You are developing an application that includes two Docker containers.

The application must meet the following requirements:

• The containers must not run as root.
• The containers must be deployed to Azure Container Instances by using a YAML file.
• The containers must share a lifecycle, resources, local network, and storage volume.
• The storage volume must persist through container crashes.
• The storage volume must be deployed on stop or restart of the containers.

You need to configure Azure Container Instances for the application.

Which configuration values should you use? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Correct Answer:

Question #152
You develop Azure Durable Functions to manage vehicle loans.

The loan process includes multiple actions that must be run in a specified order. One of the actions includes a customer credit check process, which may require multiple days to process.

You need to implement Azure Durable Functions for the loan process.

Which Azure Durable Functions type should you use?
  1. A
    orchestrator
  2. B
    client
  3. C
    entity
  4. D
    activity

Correct Answer:
A

The orchestrator function is indeed the best pick for managing a loan process in Azure Durable Functions, particularly because of its ability to coordinate and sequence multiple actions efficiently. This is crucial given the complexity of a vehicle loan process, which includes sequential tasks like credit checks that might extend over several days. Through the orchestrator function, these tasks are not only orchestrated logically but can also be set to interact with other functions, such as activity functions for specific tasks, maintaining an orderly execution in the specified sequence.


Question #153
HOTSPOT
-

You are developing an Azure Function app.

All functions in the app meet the following requirements:

• Run until either a successful run or until 10 run attempts occur.
• Ensure that there are at least 20 seconds between attempts for up to 15 minutes.

You need to configure the host.json file.

How should you complete the code segment? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Correct Answer:

Question #154
You develop Azure Web Apps for a commercial diving company. Regulations require that all divers fill out a health questionnaire every 15 days after each diving job starts.

You need to configure the Azure Web Apps so that the instance count scales up when divers are filling out the questionnaire and scales down after they are complete.

You need to configure autoscaling.

What are two possible auto scaling configurations to achieve this goal? Each correct answer presents a complete solution.

NOTE: Each correct selection is worth one point.
  1. A
    Recurrence profile
  2. B
    CPU usage-based autoscaling
  3. C
    Fixed date profile
  4. D
    Predictive autoscaling

Correct Answer:
CD

The correct answer choices, C "Fixed date profile" and D "Predictive autoscaling," align perfectly with the needs stated in the question. The Fixed date profile is ideal as it allows for pre-scheduled scaling based on known busy periods every 15 days, meeting regulatory requirements efficiently. Predictive autoscaling complements this by adjusting the resources in anticipation of varying workloads, based on trends and patterns, ensuring the application matches real-time demand and provides seamless user experience during high traffic questionnaire completion times. These together ensure optimal resource utilization tailored to the specific operational cycles of the diving company.


Question #156
HOTSPOT
-

You develop an application that sells AI generated images based on user input. You recently started a marketing campaign that displays unique ads every second day.

Sales data is stored in Azure Cosmos DB with the date of each sale being stored in a property named ‘whenFinished’.

The marketing department requires a view that shows the number of sales for each unique ad.
You need to implement the query for the view.

How should you complete the query? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Correct Answer:


Question #157
HOTSPOT
-

You implement an Azure solution to include Azure Cosmos DB, the latest Azure Cosmos DB SDK, and the Core (SQL) API. You also implement a change feed processor on a new container instance by using the Azure Functions trigger for Azure Cosmos DB.

A large batch of documents continues to fail when reading one of the documents in the batch. The same batch of documents is continuously retried by the triggered function and a new batch of documents must be read.

You need to implement the change feed processor to read the documents.

Which feature should you implement? To answer, select the appropriate features in the answer area.

NOTE: Each correct selection is worth one point.

Correct Answer:


Question #158
You are developing an application to store business-critical data in Azure Blob storage.

The application must meet the following requirements:

• Data must not be modified or deleted for a user-specified interval.
• Data must be protected from overwrites and deletes.
• Data must be written once and allowed to be read many times.

You need to protect the data in the Azure Blob storage account.

Which two actions should you perform? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point.
  1. A
    Configure a time-based retention policy for the storage account.
  2. B
    Create an account shared-access signature (SAS).
  3. C
    Enable the blob change feed for the storage account.
  4. D
    Enable version-level immutability support for the storage account.
  5. E
    Enable point-in-time restore for containers in the storage account.
  6. F
    Create a service shared-access signature (SAS).

Correct Answer:
AF

The correct options to ensure data protection in Azure Blob Storage, based on the user requirements, are indeed A) Configure a time-based retention policy for the storage account and D) Enable version-level immutability support for the storage account. Option A provides a Write-Once, Read-Many (WORM) capability, locking the data from modifications or deletions during the specified retention period. This directly supports two needs: preventing overwrites and deletions, and specifying a user-defined immutable period. Option D is essential to apply option A at the version level, further safeguarding each version of the blob against modifications or deletions beyond general immutability settings, aligning with the application’s strict data protection requirements.


Question #159
You are updating an application that stores data on Azure and uses Azure Cosmos DB for storage. The application stores data in multiple documents associated with a single username.

The application requires the ability to update multiple documents for a username in a single ACID operation.

You need to configure Azure Cosmos DB.

Which two actions should you perform? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point.
  1. A
    Create a collection sharded on username to store documents.
  2. B
    Configure Azure Cosmos DB to use the Gremlin API.
  3. C
    Create an unsharded collection to store documents.
  4. D
    Configure Azure Cosmos DB to use the MongoDB API.

Correct Answer:
CD

When configuring Azure Cosmos DB to handle updates across multiple documents in a single ACID transaction, it's important to focus on the partitioning and API selection. Opting for an unsharded collection ensures that all documents reside in the same logical partition, crucial for maintaining ACID properties during transactions. Additionally, using the MongoDB API is advantageous as it supports multi-document ACID transactions, allowing the application to perform complex updates consistently and reliably across various documents linked by username.


Question #160
You develop Azure solutions.

You must connect to a No-SQL globally-distributed database by using the .NET API.

You need to create an object to configure and execute requests in the database.

Which code segment should you use?
  1. A
    database_name = 'MyDatabase'
    database = client.create_database_if_not_exists(id=database_name)
  2. B
    client = CosmosClient(endpoint, key)
  3. C
    container_name = 'MyContainer'
    container = database.create_container_if_not_exists(
    id=container_name, partition_key=PartitionKey(path="/lastName"), offer_throughput=400 )

Correct Answer:
C

Option B, which initializes the CosmosClient using the specified endpoint and key, is essential for setting up a client to interact with Azure Cosmos DB. This step is fundamental because it establishes the connection necessary to carry out any operations within the database, including creating databases and containers as seen in the other options. It's crucial to have the client set before configuring or executing any requests to ensure that the operations are directed towards the correct database context in Azure. Therefore, initializing CosmosClient first is not only a best practice but a prerequisite in the workflow of working with Cosmos DB using the .NET API.


No comments:

Post a Comment