ExamGecko
Home Home / Microsoft / AZ-204

Microsoft AZ-204 Practice Test - Questions Answers, Page 16

Question list
Search
Search

List of questions

Search

Related questions











You are developing an Azure function that connects to an Azure SQL Database instance. The function is triggered by an Azure Storage queue.

You receive reports of numerous System.InvalidOperationExceptions with the following message:

"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."

You need to prevent the exception.

What should you do?

A.
In the host.json file, decrease the value of the batchSize option
A.
In the host.json file, decrease the value of the batchSize option
Answers
B.
Convert the trigger to Azure Event Hub
B.
Convert the trigger to Azure Event Hub
Answers
C.
Convert the Azure Function to the Premium plan
C.
Convert the Azure Function to the Premium plan
Answers
D.
In the function.json file, change the value of the type option to queueScaling
D.
In the function.json file, change the value of the type option to queueScaling
Answers
Suggested answer: A

Explanation:

With the Premium plan the max outbound connections per instance is unbounded compared to the 600 active (1200 total) in a Consumption plan.

Note: The number of available connections is limited partly because a function app runs in a sandbox environment. One of the restrictions that the sandbox imposes on your code is a limit on the number of outbound connections, which is currently 600 active (1,200 total) connections per instance. When you reach this limit, the functions runtime writes the following message to the logs: Host thresholds exceeded: Connections.

Reference:

https://docs.microsoft.com/en-us/azure/azure-functions/manage-connections

https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits

You are developing applications for a company. You plan to host the applications on Azure App Services.

The company has the following requirements:

Every five minutes verify that the websites are responsive.

Verify that the websites respond within a specified time threshold. Dependent requests such as images and JavaScript files must load properly.

Generate alerts if a website is experiencing issues.

If a website fails to load, the system must attempt to reload the site three more times.

You need to implement this process with the least amount of effort.

What should you do?

A.
Create a Selenium web test and configure it to run from your workstation as a scheduled task.
A.
Create a Selenium web test and configure it to run from your workstation as a scheduled task.
Answers
B.
Set up a URL ping test to query the home page.
B.
Set up a URL ping test to query the home page.
Answers
C.
Create an Azure function to query the home page.
C.
Create an Azure function to query the home page.
Answers
D.
Create a multi-step web test to query the home page.
D.
Create a multi-step web test to query the home page.
Answers
E.
Create a Custom Track Availability Test to query the home page.
E.
Create a Custom Track Availability Test to query the home page.
Answers
Suggested answer: D

Explanation:

You can monitor a recorded sequence of URLs and interactions with a website via multi-step web tests.

Incorrect Answers:

A: Selenium is an umbrella project for a range of tools and libraries that enable and support the automation of web browsers.

It provides extensions to emulate user interaction with browsers, a distribution server for scaling browser allocation, and the infrastructure for implementations of the W3C WebDriver specification that lets you write interchangeable code for all major web browsers.

Reference:

https://docs.microsoft.com/en-us/azure/azure-monitor/app/availability-multistep

You develop and add several functions to an Azure Function app that uses the latest runtime host. The functions contain several REST API endpoints secured by using SSL. The Azure Function app runs in a Consumption plan.

You must send an alert when any of the function endpoints are unavailable or responding too slowly.

You need to monitor the availability and responsiveness of the functions.

What should you do?

A.
Create a URL ping test.
A.
Create a URL ping test.
Answers
B.
Create a timer triggered function that calls TrackAvailability() and send the results to Application Insights.
B.
Create a timer triggered function that calls TrackAvailability() and send the results to Application Insights.
Answers
C.
Create a timer triggered function that calls GetMetric("Request Size") and send the results to Application Insights.
C.
Create a timer triggered function that calls GetMetric("Request Size") and send the results to Application Insights.
Answers
D.
Add a new diagnostic setting to the Azure Function app. Enable the FunctionAppLogs and Send to Log Analytics options.
D.
Add a new diagnostic setting to the Azure Function app. Enable the FunctionAppLogs and Send to Log Analytics options.
Answers
Suggested answer: B

Explanation:

You can create an Azure Function with TrackAvailability() that will run periodically according to the configuration given in TimerTrigger function with your own business logic. The results of this test will be sent to your Application Insights resource, where you will be able to query for and alert on the availability results data. This allows you to create customized tests similar to what you can do via Availability Monitoring in the portal. Customized tests will allow you to write more complex availability tests than is possible using the portal UI, monitor an app inside of your Azure VNET, change the endpoint address, or create an availability test even if this feature is not available in your region.

Reference:

https://docs.microsoft.com/en-us/azure/azure-monitor/app/availability-azure-functions

DRAG DROP

You are developing an application to retrieve user profile information. The application will use the Microsoft Graph SDK.

The app must retrieve user profile information by using a Microsoft Graph API call.

You need to call the Microsoft Graph API from the application.

In which order should you perform the actions? To answer, move all actions from the list of actions to the answer area and arrange them in the correct order.


Question 154
Correct answer: Question 154

Explanation:

Step 1: Register the application with the Microsoft identity platform.

To authenticate with the Microsoft identity platform endpoint, you must first register your app at the Azure app registration portal

Step 2: Build a client by using the client app ID

Step 3: Create an authentication provider

Create an authentication provider by passing in a client application and graph scopes.

Code example:

DeviceCodeProvider authProvider = new DeviceCodeProvider(publicClientApplication, graphScopes);

// Create a new instance of GraphServiceClient with the authentication provider.

GraphServiceClient graphClient = new GraphServiceClient(authProvider);

Step 4: Create a new instance of the GraphServiceClient

Step 5: Invoke the request to the Microsoft Graph API

Reference:

https://docs.microsoft.com/en-us/graph/auth-v2-service

https://docs.microsoft.com/en-us/graph/sdks/create-client

DRAG DROP

You develop and deploy an Azure Logic App that calls an Azure Function app. The Azure Function App includes an OpenAPI (Swagger) definition and uses an Azure Blob storage account. All resources are secured by using Azure Active

Directory (Azure AD).

The Logic App must use Azure Monitor logs to record and store information about runtime data and events. The logs must be stored in the Azure Blob storage account.

You need to set up Azure Monitor logs and collect diagnostics data for the Azure Logic App.

Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.


Question 155
Correct answer: Question 155

Explanation:

Step 1: Create a Log Analytics workspace

Before you start, you need a Log Analytics workspace.

Step 2: Install the Logic Apps Management solution

To set up logging for your logic app, you can enable Log Analytics when you create your logic app, or you can install the Logic Apps Management solution in your Log Analytics workspace for existing logic apps.

Step 3: Add a diagnostic setting to the Azure Logic App

Set up Azure Monitor logs

1. In the Azure portal, find and select your logic app.

2. On your logic app menu, under Monitoring, select Diagnostic settings > Add diagnostic setting.

Reference:

https://docs.microsoft.com/en-us/azure/logic-apps/monitor-logic-apps-log-analytics

DRAG DROP

You develop an application. You plan to host the application on a set of virtual machines (VMs) in Azure.

You need to configure Azure Monitor to collect logs from the application.

Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.


Question 156
Correct answer: Question 156

Explanation:

Step 1: Create a Log Analytics workspace.

First create the workspace.

Step 2: Add a VMInsights solution.

Before a Log Analytics workspace can be used with VM insights, it must have the VMInsights solution installed.

Step 3: Install agents on the VM and VM scale set to be monitored.

Prior to onboarding agents, you must create and configure a workspace. Install or update the Application Insights Agent as an extension for Azure virtual machines and VM scalet sets.

Step 4: Create an Application Insights resource

Sign in to the Azure portal, and create an Application Insights resource.

Once a workspace-based Application Insights resource has been created, configuring monitoring is relatively straightforward.

Reference:

https://docs.microsoft.com/en-us/azure/azure-monitor/vm/vminsights-configure-workspace

https://docs.microsoft.com/en-us/azure/azure-monitor/app/create-workspace-resource

You develop and deploy an Azure App Service web app. The app is deployed to multiple regions and uses Azure Traffic Manager. Application Insights is enabled for the app.

You need to analyse app uptime for each month.

Which two solutions will achieve the goal? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point.

A.
Azure Monitor logs
A.
Azure Monitor logs
Answers
B.
Application Insights alerts
B.
Application Insights alerts
Answers
C.
Azure Monitor metrics
C.
Azure Monitor metrics
Answers
D.
Application Insights web tests
D.
Application Insights web tests
Answers
Suggested answer: B, D

Explanation:

Reference:

https://azure.microsoft.com/en-us/blog/creating-a-web-test-alert-programmatically-with-application-insights/

DRAG DROP

You develop and deploy an Azure App Service web app. The web app accesses data in an Azure SQL database.

You must update the web app to store frequently used data in a new Azure Cache for Redis Premium instance.

You need to implement the Azure Cache for Redis features.

Which feature should you implement? To answer, drag the appropriate feature to the correct requirements. Each feature may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

NOTE: Each correct selection is worth one point.


Question 158
Correct answer: Question 158

Explanation:

Reference:

https://www.red-gate.com/simple-talk/development/dotnet-development/overview-of-azure-cache-for-redis/

https://docs.microsoft.com/en-us/azure/architecture/best-practices/caching

HOTSPOT

You are developing an ASP.NET Core time sheet application that runs as an Azure Web App. Users of the application enter their time sheet information on the first day of every month.

The application uses a third-party web service to validate data.

The application encounters periodic server errors due to errors that result from calling a third-party web server. Each request to the third-party server has the same chance of failure.

You need to configure an Azure Monitor alert to detect server errors unrelated to the third-party service. You must minimize false-positive alerts.

How should you complete the Azure Resource Manager template? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.


Question 159
Correct answer: Question 159

Explanation:

Box 1: DynamicThresholdCriterion

Box 2: Http5xx

Server errors are in the 5xx range.

Client errors are in the 4xx range

Box 3: Low

Reference:

https://docs.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-dynamic-thresholds

You are developing a web application that uses Azure Cache for Redis. You anticipate that the cache will frequently fill and that you will need to evict keys.

You must configure Azure Cache for Redis based on the following predicted usage pattern: A small subset of elements will be accessed much more often than the rest.

You need to configure the Azure Cache for Redis to optimize performance for the predicted usage pattern.

Which two eviction policies will achieve the goal?

NOTE: Each correct selection is worth one point.

A.
noeviction
A.
noeviction
Answers
B.
allkeys-lru
B.
allkeys-lru
Answers
C.
volatile-lru
C.
volatile-lru
Answers
D.
allkeys-random
D.
allkeys-random
Answers
E.
volatile-ttl
E.
volatile-ttl
Answers
F.
volatile-random
F.
volatile-random
Answers
Suggested answer: B, D

Explanation:

Total 345 questions
Go to page: of 35