ExamGecko
Home Home / Microsoft / AZ-204

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

Question list
Search
Search

List of questions

Search

Related questions











DRAG DROP

You develop a gateway solution for a public facing news API.

The news API back end is implemented as a RESTful service and hosted in an Azure App Service instance.

You need to configure back-end authentication for the API Management service instance.

Which target and gateway credential type should you use? To answer, drag the appropriate values to the correct parameters. Each value 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 201
Correct answer: Question 201

Explanation:

Box 1: Azure Resource

Box 2: Client cert

API Management allows to secure access to the back-end service of an API using client certificates.

Reference:

https://docs.microsoft.com/en-us/rest/api/apimanagement/apimanagementrest/azure-api-management-rest-api-backend-entity

HOTSPOT

You are creating an app that uses Event Grid to connect with other services. Your app's event data will be sent to a serverless function that checks compliance. This function is maintained by your company.

You write a new event subscription at the scope of your resource. The event must be invalidated after a specific period of time.

You need to configure Event Grid.

What should you do? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.


Question 202
Correct answer: Question 202

Explanation:

Box 1: SAS tokens Custom topics use either Shared Access Signature (SAS) or key authentication. Microsoft recommends SAS, but key authentication provides simple programming, and is compatible with many existing webhook publishers.

In this case we need the expiration time provided by SAS tokens.

Box 2: ValidationCode handshake

Event Grid supports two ways of validating the subscription: ValidationCode handshake (programmatic) and ValidationURL handshake (manual).

If you control the source code for your endpoint, this method is recommended.

Incorrect Answers:

ValidationURL handshake (manual): In certain cases, you can't access the source code of the endpoint to implement the ValidationCode handshake. For example, if you use a third-party service (like Zapier or IFTTT), you can't programmatically respond with the validation code.

Reference:

https://docs.microsoft.com/en-us/azure/event-grid/security-authentication

DRAG DROP

You are developing a REST web service. Customers will access the service by using an Azure API Management instance.

The web service does not correctly handle conflicts. Instead of returning an HTTP status code of 409, the service returns a status code of 500. The body of the status message contains only the word conflict.

You need to ensure that conflicts produce the correct response.

How should you complete the policy? To answer, drag the appropriate code segments to the correct locations. Each code segment 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 203
Correct answer: Question 203

Explanation:

Box 1: on-error

Policies in Azure API Management are divided into inbound, backend, outbound, and on-error.

If there is no on-error section, callers will receive 400 or 500 HTTP response messages if an error condition occurs.

Box 2: context

Box 3: context

Box 4: set-status The return-response policy aborts pipeline execution and returns either a default or custom response to the caller. Default response is 200 OK with no body.

Custom response can be specified via a context variable or policy statements.

Syntax:

<return-response response-variable-name="existing context variable">

<set-header/>

<set-body/>

<set-status/>

</return-response>

Box 5: on-error

Reference:

https://docs.microsoft.com/en-us/azure/api-management/api-management-error-handling-policies

https://docs.microsoft.com/en-us/azure/api-management/api-management-transformation-policies

DRAG DROP

You are a developer for a Software as a Service (SaaS) company. You develop solutions that provide the ability to send notifications by using Azure Notification Hubs.

You need to create sample code that customers can use as a reference for how to send raw notifications to Windows Push Notification Services (WNS) devices. The sample code must not use external packages.

How should you complete the code segment? To answer, drag the appropriate code segments to the correct locations. Each code segment 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 204
Correct answer: Question 204

Explanation:

Box 1: windows

Example code:

var request = new HttpRequestMessage(method, $"{resourceUri}?api-version=2017-04");

request.Headers.Add("Authorization", createToken(resourceUri, KEY_NAME,

KEY_VALUE));

request.Headers.Add("X-WNS-Type", "wns/raw");

request.Headers.Add("ServiceBusNotification-Format", "windows");

return request;

Box 2: application/octet-stream

Example code capable of sending a raw notification:

string resourceUri = $"https://{NH_NAMESPACE}.servicebus.windows.net/{HUB_NAME}/messages/";

using (var request = CreateHttpRequest(HttpMethod.Post, resourceUri))

{

request.Content = new StringContent(content, Encoding.UTF8,

"application/octet-stream");

request.Content.Headers.ContentType.CharSet = string.Empty;

var httpClient = new HttpClient();

var response = await httpClient.SendAsync(request);

Console.WriteLine(response.StatusCode);

}

Reference:

https://stackoverflow.com/questions/31346714/how-to-send-raw-notification-to-azure-notification-hub/31347901

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You are developing an Azure solution to collect point-of-sale (POS) device data from 2,000 stores located throughout the world. A single device can produce 2 megabytes (MB) of data every 24 hours. Each store location has one to five devices that send data.

You must store the device data in Azure Blob storage. Device data must be correlated based on a device identifier. Additional stores are expected to open in the future.

You need to implement a solution to receive the device data.

Solution: Provision an Azure Event Hub. Configure the machine identifier as the partition key and enable capture.

Does the solution meet the goal?

A.
Yes
A.
Yes
Answers
B.
No
B.
No
Answers
Suggested answer: A

Explanation:

Reference:

https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-programming-guide

DRAG DROP

You are developing an Azure solution to collect inventory data from thousands of stores located around the world. Each store location will send the inventory data hourly to an Azure Blob storage account for processing.

The solution must meet the following requirements:

Begin processing when data is saved to Azure Blob storage.

Filter data based on store location information.

Trigger an Azure Logic App to process the data for output to Azure Cosmos DB.

Enable high availability and geographic distribution.

Allow 24-hours for retries.

Implement an exponential back off data processing.

You need to configure the solution.

What should you implement? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.


Question 206
Correct answer: Question 206

Explanation:

Box 1: Azure Event Grid

Blob storage events are pushed using Azure Event Grid to subscribers such as Azure Functions, Azure Logic Apps, or even to your own http listener. Event Grid provides reliable event delivery to your applications through rich retry policies and dead-lettering.

Box 2: Azure Logic App

Event Grid uses event subscriptions to route event messages to subscribers. This image illustrates the relationship between event publishers, event subscriptions, and event handlers.

Box 3: Azure Service Bus

The Event Grid service doesn't store events. Instead, events are stored in the Event Handlers, including ServiceBus, EventHubs, Storage Queue, WebHook endpoint, or many other supported Azure Services.

Reference:

https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-event-overview

https://docs.microsoft.com/en-us/java/api/overview/azure/messaging-eventgrid-readme

You are creating an app that will use CosmosDB for data storage. The app will process batches of relational data.

You need to select an API for the app.

Which API should you use?

A.
MongoDB API
A.
MongoDB API
Answers
B.
Table API
B.
Table API
Answers
C.
SQL API
C.
SQL API
Answers
D.
Cassandra API
D.
Cassandra API
Answers
Suggested answer: C

Explanation:

For relational data you will need the SQL API

Incorrect Answer:

A: The MongoDB API is not used for relational data.

B: The Table API only supports data in the key/value format

D: The Cassandra API only supports OLTP (Online Transactional Processing) and not batch processing.

Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/choose-api

HOTSPOT

You are developing a .NET application that communicates with Azure Storage.

A message must be stored when the application initializes.

You need to implement the message.

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.


Question 208
Correct answer: Question 208

Explanation:

Reference:

https://docs.microsoft.com/en-us/azure/storage/queues/storage-dotnet-how-to-use-queues?tabs=dotnetv11

HOTSPOT

A software as a service (SaaS) company provides document management services. The company has a service that consists of several Azure web apps. All Azure web apps run in an Azure App Service Plan named PrimaryASP.

You are developing a new web service by using a web app named ExcelParser. The web app contains a third-party library for processing Microsoft Excel files. The license for the third-party library stipulates that you can only run a single instance of the library.

You need to configure the service.

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

NOTE: Each correct selection is worth one point.


Question 209
Correct answer: Question 209

Explanation:

Reference:

https://docs.microsoft.com/en-us/azure/app-service/manage-scale-per-app

Note: This question-is part of a series of questions that present the same scenario. Each question-in the series contains a unique solution that might meet the stated goals. Some question-sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question-in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You develop an HTTP triggered Azure Function app to process Azure Storage blob data. The app is triggered using an output binding on the blob.

The app continues to time out after four minutes. The app must process the blob data.

You need to ensure the app does not time out and processes the blob data.

Solution: Update the functionTimeout property of the host.json project file to 10 minutes.

Does the solution meet the goal?

A.
Yes
A.
Yes
Answers
B.
No
B.
No
Answers
Suggested answer: B

Explanation:

Instead pass the HTTP trigger payload into an Azure Service Bus queue to be processed by a queue trigger function and return an immediate HTTP success response.

Note: Large, long-running functions can cause unexpected timeout issues. General best practices include:

Whenever possible, refactor large functions into smaller function sets that work together and return responses fast. For example, a webhook or HTTP trigger function might require an acknowledgment response within a certain time limit; it's common for webhooks to require an immediate response. You can pass the HTTP trigger payload into a queue to be processed by a queue trigger function. This approach lets you defer the actual work and return an immediate response.

Reference:

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

Total 345 questions
Go to page: of 35