az-204 practice-004

https://learn.microsoft.com/en-us/credentials/certifications/exams/az-204/practice/results?assessmentId=35&snapshotId=64681d59-5709-4cfc-a4de-4d1d8228bf59

Question 3 of 50

You develop a web application hosted on the Web Apps feature of Microsoft Azure App Service.

You need to enable and configure Azure Web Service Local Cache with 1.5 GB.

Which two code segments should you use? Each correct answer presents part of the solution.

`“WEBSITE_LOCAL_CACHE_OPTION”: “Always”`

`“WEBSITE_LOCAL_CACHE_SIZEINMB”: “1500”`

This item tests the candidate’s knowledge of configuring the settings of the Web Apps feature of Azure App Service.

By using WEBSITE_LOCAL_CACHE_OPTION = Always, local cache will be enabled. WEBSITE_LOCAL_CACHE_SIZEINMB will properly configure Local Cache with 1.5 GB of size. WEBSITE_LOCAL_CACHE_OPTION = Enable is not a valid value. 1.5 will not configure 1.5 GB for the local cache.

Configure web app settings - Training | Microsoft Learn

Local cache - Azure App Service | Microsoft Learn

 

Question 6 of 50

You plan to create an Azure function app named app1.

You need to ensure that app1 will satisfy the following requirements:

  • Supports automatic scaling.
  • Has event-based scaling behavior.
  • Provides a serverless pricing model.

Which hosting plan should you use?

Consumption

This item tests the candidate’s knowledge of selecting the appropriate hosting plan, which is part of the implementation of Azure Functions.

The Consumption hosting plan satisfies all requirements. It supports autoscaling, has event-based scaling behavior, and provides a serverless pricing model. The App Service, App Service Environment, and Functions Premium hosting plans support autoscaling but does not provide the serverless pricing model. Its scaling behavior is not event based but performance based.

Compare Azure Functions hosting options - Training | Microsoft Learn

Azure Functions scale and hosting | Microsoft Learn

 There are three basic hosting plans available for Azure Functions: Consumption plan, Premium plan, and App service plan (Dedicated)

 

Question 7 of 50

A company plans to implement a Microsoft Defender for Cloud solution.

The company has the following requirements:

  • Notifies when DNS domains are not deleted when a new function app is deleted.
  • Use native alerting.
  • Minimize costs.

You need to select a hosting plan.

Which hosting plan should you use?

Basic

This item tests the candidate's knowledge about securing Azure Functions.

The Basic plan supports both custom domains and Microsoft Defender for Cloud, which can automatically alert on dangling DNS domains.

The Consumption plan is incorrect because it does not support Microsoft Defender for Cloud. This can automatically alert on dangling DNS domains.

The Premium plan supports custom domains and Microsoft Defender for Cloud, which can automatically alert on dangling DNS domains. This, however, is not the lowest cost option.

The Free plan does not support custom domains, although it does support Microsoft Defender for Cloud, which can automatically alert on dangling DNS domains.

AZ-204: Implement Azure Functions - Training | Microsoft Learn

Microsoft Defender for App Service - the benefits and features | Microsoft Learn

Securing Azure Functions | Microsoft Learn

App Service Pricing | Microsoft Azure

 

 

Question 16 of 50

You manage an instance of Azure API Management. You define policies to multiple scopes.

You need to enforce a policy evaluation order.

What should you use?

the `base` element

This item tests the candidate’s knowledge of defining policies for APIs.

The <base /> element provides the ability to enforce policy evaluation order.

The <when /> element is part of the choose policy and is evaluated in order of its appearance within the policy.

The follow-redirects attribute is part of the forward request policy, so it does not have any impact on the policy evaluation order.

The condition attribute is part of the retry policy, so it does not have any impact on the policy evaluation order.

Explore API Management policies - Training | Microsoft Learn

How to set or edit Azure API Management policies | Microsoft Learn

 

Question 20 of 50

You are developing a .NET project that will manage messages in Azure Storage queues.

You need to verify the presence of messages in a queue without removing them from the queue.

Which method should you use?

`PeekMessages` 

This item tests the candidate’s knowledge of processing messages in Azure Queue Storage, which is an integral part of implementing solutions that use Azure Queue Storage queues.

Messages can be peeked at in the queue without removing them from the queue by calling the PeekMessages method of the QueueClient class. The Peek method of the QueueClient class is used with Azure Service Bus, not Azure Queue Storage. The ReceiveMessages method of the QueueClient class removes them from the queue. The ReceiveMessageAsync method of the QueueClient class is used with Azure Service Bus, not Azure Queue Storage.

Create and manage Azure Queue Storage and messages by using .NET - Training | Microsoft Learn

Get started with Azure Queue Storage using .NET - Azure Storage | Microsoft Learn

 

Question 26 of 50

You plan to generate a shared access signature (SAS) token for read access to a blob in a storage account.

You need to secure the token from being compromised.

What should you use?

Microsoft Entra ID credentials assigned the Contributor role

This item tests the candidate's knowledge of Azure Storage shared access signatures (SAS).

Microsoft Entra ID credentials are required to generate the SAS token. The account used must have the Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey permission, which is present in the following built-in roles: Contributor, Storage Account Contributor, Storage Blob Data Contributor, Storage Blob Data Owner, Storage Blob Data Reader, and Storage Blob Delegator. The account key can be used to generate the SAS token, but it can be more easily compromised.

Discover shared access signatures - Training | Microsoft Learn

Create a user delegation SAS - Azure Storage | Microsoft Learn

 

Question 33 of 50

You need to set a duration of 10 seconds for a key stored in Azure Cache for Redis.

Which code segment should you use?

``` using (var cache = ConnectionMultiplexer.Connect("")) { IDatabase db = cache.GetDatabase(); bool setValue = await db.StringSetAsync("test:key", "10", TimeSpan.FromSeconds(10)); }```

This item tests the candidate’s knowledge of implementing caching.

The code segment that includes TimeSpan.FromSeconds(10)); sets time to live of 10 seconds for a key. To set time to live for a key, the parameter ‘expiry’ (third parameter) of StringSet methods needs to be specified. The time to live parameter needs to be set as a TimeSpan, not a DateTime.

Develop for Azure Cache for Redis - Training | Microsoft Learn

Azure Redis Cache SDK for .NET - Azure for .NET Developers | Microsoft Learn

 

Question 35 of 50

You manage Azure Cache for Redis by using classes in the .NET StackExchange.Redis namespace.

You need to retrieve a reference to a Redis database by using the GetDatabase method.

What do you need to do first?

Create a `ConnectionMultiplexer` object.

This item tests the candidate’s knowledge of interacting programmatically with Azure Cache for Redis, which is an integral part of implementing secure and optimized application cache patterns, including data sizing, connections, encryption, and expiration.

Creating a ConnectionMultiplexer object is the first step required to retrieve a reference to a Redis database by using the GetDatabase method.

Creating a CdnManagementClient object is required when using Azure Content Delivery Network caching, not Azure Cache for Redis.

Calling a StringSet method allows you to manage the content of a Redis database, which happens once the ConnectionMultiplexer object, and the database have been created.

Calling a StringGet method allows you to retrieve the content of a Redis database, which happens once the ConnectionMultiplexer object, and the database have been created.

Interact with Azure Cache for Redis by using .NET - Training | Microsoft Learn

Quickstart: Use Azure Cache for Redis in .NET Framework | Microsoft Learn

 

Question 40 of 50

You plan to develop a web job that performs calculations on top of data that is collected from users.

You need to send pre-aggregated summary metrics to Azure Monitor.

Which Application Insights method should you use?

 `GetMetric`

This item tests the candidate’s knowledge of using metrics and log data.

The GetMetric method handles local pre-aggregation and then only submits an aggregated summary metric at a fixed interval of one minute. TrackMetric sends raw telemetry, missing pre-aggregation. SetMetric and LogMetric are not valid methods to send pre-aggregated summary metrics to Azure Monitor.

AZ-204: Instrument solutions to support monitoring and logging - Training | Microsoft Learn

Get-Metric in Azure Monitor Application Insights - Azure Monitor | Microsoft Learn

 

Question 41 of 50

You need to read an Azure Cosmos DB change feed by using a reactive model.

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

Azure Functions with an Azure Cosmos DB trigger

Change feed processor library

This item tests the candidate’s knowledge of developing solutions that use Azure Cosmos DB storage.

Azure Functions with an Azure Cosmos DB trigger allows you to select the container to connect, and the Azure Function is triggered whenever there is a change in the container. The change feed processor library follows the observer pattern, where the processing function is called by the library. The change feed processor library will automatically check for changes and, if changes are found, push them to the client. Azure Functions with an Event Grid trigger will execute the function when an Event Grid event is dispatched. It has no relationship with an Azure Cosmos DB change feed. A change feed pull model will use a pull model rather than a push model.

Consume an Azure Cosmos DB for NoSQL change feed using the SDK - Training | Microsoft Learn

Handle events with Azure Functions and Azure Cosmos DB for NoSQL change feed - Training | Microsoft Learn

Reading Azure Cosmos DB change feed | Microsoft Learn

 

Question 44 of 50

You have an application that writes data to Azure Cosmos DB.

The application must offer consistent prefix and monotonic reads.

You need to configure the consistency level.

Which consistency level should you use?

session

This item tests the candidate's knowledge of Azure Cosmos DB consistency levels.

Session consistency offers all the guarantees listed. It provides write latencies, availability, and read throughput comparable to that of eventual consistency. It also provides the consistency guarantees that suit the needs of applications written to operate in the context of a user. Strong consistency has reads guaranteed to return the most recent committed version of an item. A client never sees an uncommitted or partial write. Users are guaranteed to read the latest committed write. It has the highest write latency and lowest read throughput of all consistency levels. In bounded staleness consistency, the reads are guaranteed to honor the consistent-prefix guarantee. It should be used when there is a need for low write latencies but require a total global order guarantee. In eventual consistency, there is no ordering guarantee for reads. In the absence of any further writes, the replicas eventually converge. It is the weakest form of consistency because a client may read values that are older than the ones it had read before. Eventual consistency is ideal when the application does not require any ordering guarantees.

AZ-204: Develop solutions that use Azure Cosmos DB - Training | Microsoft Learn

Consistency levels in Azure Cosmos DB | Microsoft Learn

 

Question 49 of 50

A company implements a multi-region Azure Cosmos DB account.

You need to configure the default consistency level for the account. The consistency level must ensure that update operations made as a batch within a transaction are always visible together.

Which consistency level should you use?

 Consistent Prefix

This item tests the candidate’s knowledge of selecting the appropriate consistency level for operations in Azure Cosmos DB. The Consistent Prefix consistency level ensures that updates made as a batch within a transaction are returned consistently with the transaction in which they were committed. Write operations within a transaction of multiple documents are always visible together. The Bounded Staleness consistency level is used to manage the lag of data between any two regions based on an updated version of an item or the time intervals between read and write. The Session consistency level is used to ensure that within a single client session, reads are guaranteed to honor the read-your-writes and write-follows-reads guarantees. The Eventual consistency level is used when no ordering guarantee is required.

Explore consistency levels

Consistency levels in Azure Cosmos DB

 

Question 50 of 50

You are planning to host a static website in an Azure Storage account.

The website must be accessible only through HTTPS by using a custom domain name.

You enable the static website hosting feature. You set the default page to index.html and the error page to error.html.

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

 Integrate the static website with Azure Content Delivery Network (CDN)

  Upload the index.html and error.html files to the web hosting container.

This item tests the candidate’s knowledge of implementing static site hosting. To host a static website in a storage account, the feature must be enabled. When enabling it, the names of the default and error documents must be informed. This creates a $web container, with private access, where the site files must be uploaded to. A custom domain can be added to the site. For HTTP only access, it can be registered to the networking tab of the storage account. For HTTPS access, Azure Content Delivery Network (CDN) must be used.

Static website hosting in Azure Storage | Microsoft Learn

Host a static website in Azure Storage | Microsoft Learn

 

另外一个

https://learn.microsoft.com/en-us/credentials/certifications/exams/az-204/practice/results?assessmentId=35&snapshotId=d754b615-a78c-45bc-9b17-7b84e193f868

Question 23 of 50

You have an Azure Storage account container named container1.

You need to configure access to the container to meet the following requirements:

  • The shared access signature (SAS) token should be secured with Microsoft Entra ID credentials.
  • Role-based access control (RBAC) should be used.
  • The SAS token should support granting access to containers.

Which type of SAS should you use?

 user delegation

This item tests the candidate’s knowledge of securing an Azure Storage account, which is part of developing solutions that use blob storage.

User delegation SAS fulfills all the requirements, including securing the SAS token with Microsoft Entra ID credentials, RBAC support, and granting access to containers. Azure Storage supports creating a new type of SAS at the level of the storage account. A service SAS delegates access to a resource in just one of the storage services (i.e., Blob, Queue, Table, or File). A stored access policy serves to group shared access signatures and to provide additional restrictions for signatures that are bound by the policy. The account, service, and stored access policy SAS types do not fulfill the requirement of securing the SAS token with Microsoft Entra ID credentials and RBAC support to manage permissions.

Store application data with Azure Blob storage - Training | Microsoft Learn

Secure your Azure Storage account - Training | Microsoft Learn

Create a user delegation SAS - Azure Storage | Microsoft Learn

Create an account SAS - Azure Storage | Microsoft Learn

Create a service SAS - Azure Storage | Microsoft Learn

 

Question 33 of 50

You manage a multiregion deployment of an Azure Cosmos DB account named account1.

You need to configure the default consistency level for account1. The consistency level must maximize throughput and minimize latency for write operations.

Which consistency level should you use?

 eventual

This item tests the candidate’s knowledge of selecting the consistency level, which is part of developing Azure Cosmos DB solutions.

The eventual consistency level maximizes throughput and minimizes latency. The bounded staleness consistency level provides lower throughput and higher latency comparing with the remaining answer choices. The consistent prefix consistency level provides higher throughput and lower latency for write operations than the session consistency level but lower throughput and higher latency than the eventual consistency levels. The session consistency level provides higher throughput and lower latency for write operations than the bounded staleness consistency level but lower throughput and higher latency than the eventual and consistent prefix consistency levels.

Choose the right consistency level - Training | Microsoft Learn

Consistency levels in Azure Cosmos DB | Microsoft Learn

 

Question 40 of 50

You manage the deployment of an Azure Cosmos DB account.

You must define custom logic by using the .NET SDK change feed processor to process changes that the change feed reads.

You need to select the appropriate change feed processor component.

Which component should you use?

This item tests the candidate’s knowledge of implementing change feed notifications in Azure Cosmos DB. The change feed processor in Azure Cosmos DB simplifies the process of reading the change feed and can be used to distribute the event processing across multiple consumers effectively. There are four main components in the change feed processor: the monitored container, the lease container, the compute instance, and the delegate. The monitored container has the data from which the change feed is generated. The delegate component can be used to define custom logic to process the changes that the change feed reads. The compute instance hosts the change feed processor to listen for changes. It can be represented by a VM, a Kubernetes pod, an Azure App Service instance, or an actual physical machine. The lease container acts as a state storage and coordinates the processing of the change feed across multiple workers.

Understand change feed features in the SDK

Change feed processor in Azure Cosmos DB

 

Question 49 of 50

You need to capture user actions by using the Azure Application Insights API.

Which API call should you use?

This item tests the candidate's knowledge about Azure Application Insights API calls.

The TrackEvent API call tracks user actions and other events. It is used to track user behavior or to monitor performance. The TrackMetric API call is used to track performance measurements such as queue length. The TrackRequest API call is used to log the frequency and duration of server requests for performance analysis. The TrackTrace API call is used to capture Resource Diagnostic log messages and can also be used to capture third-party logs.

Instrument an app for monitoring - Training | Microsoft Learn

Application Insights API for custom events and metrics - Azure Monitor | Microsoft Learn

 

Question 50 of 50

You plan to develop a web job that performs calculations on top of data that is collected from users.

You need to send pre-aggregated summary metrics to Azure Monitor.

Which Application Insights method should you use?

 

This item tests the candidate’s knowledge of using metrics and log data.

The GetMetric method handles local pre-aggregation and then only submits an aggregated summary metric at a fixed interval of one minute. TrackMetric sends raw telemetry, missing pre-aggregation. SetMetric and LogMetric are not valid methods to send pre-aggregated summary metrics to Azure Monitor.

AZ-204: Instrument solutions to support monitoring and logging - Training | Microsoft Learn

Get-Metric in Azure Monitor Application Insights - Azure Monitor | Microsoft Learn

 

 

 

 

posted @ 2023-11-20 14:17  ChuckLu  阅读(36)  评论(0编辑  收藏  举报