Exam AZ-204 All QuestionsBrowse all questions from this exam
Question 369

DRAG DROP -

You need to implement the Log policy.

How should you complete the Azure Event Grid subscription? To answer, drag the appropriate JSON segments to the correct locations. Each JSON segment may be used once, more than once, or not at all. You may need to drag the split bar between panes to view content.

NOTE: Each correct selection is worth one point.

Select and Place:

    Correct Answer:

    Box 1:WebHook -

    Scenario: If an anomaly is detected, an Azure Function that emails administrators is called by using an HTTP WebHook. endpointType: The type of endpoint for the subscription (webhook/HTTP, Event Hub, or queue).

    Box 2: SubjectBeginsWith -

    Box 3: Microsoft.Storage.BlobCreated

    Scenario: Log Policy -

    All Azure App Service Web Apps must write logs to Azure Blob storage. All log files should be saved to a container named logdrop. Logs must remain in the container for 15 days.

    Example subscription schema -

    {

    "properties": {

    "destination": {

    "endpointType": "webhook",

    "properties": {

    "endpointUrl": "https://example.azurewebsites.net/api/HttpTriggerCSharp1?code=VXbGWce53l48Mt8wuotr0GPmyJ/nDT4hgdFj9DpBiRt38qqnnm5OFg=="

    }

    },

    "filter": {

    "includedEventTypes": [ "Microsoft.Storage.BlobCreated", "Microsoft.Storage.BlobDeleted" ],

    "subjectBeginsWith": "blobServices/default/containers/mycontainer/log",

    [1]

    "isSubjectCaseSensitive ": "true"

    }

    }

    }

    Reference:

    https://docs.microsoft.com/en-us/azure/event-grid/subscription-creation-schema

Discussion
clarionprogrammer

Looks correct based on the provided reference. https://docs.microsoft.com/en-us/azure/event-grid/subscription-creation-schema

gmishra88

You mean to say that documentation link has eventType as "Webhook" as an example. But isn't that an example? Where is the reference to say it is a webhook? The question itself is not clear

1CY1

If an anomaly is detected, an Azure Function that emails administrators is called by using an HTTP WebHook.

1CY1

Also, what was your alternative?

coffecold

To prevent reading the cases multiple times: Please see the spots below where you can find the questions (page/topic/question/subject) Proseware, Inc. 53 19 1 ARM for Azure Event Grid subscription, enable + filter logging 53 19 2 use Application Insights for scaling 53 19 3 code : telemetry filter/ telemetry processor 53 19 4 code : telemetry initializer 55 25 1 code : if-then condition on properties of incomming event from GRID 56 25 2 code : class for login event, properties needed 56 25 3 code : programatically update application settings for blob 56 26 1 azure function delay : always on and tier

OPT_001122

Thanks again for this great help!!

ks321

Dude, you are awesome, Seems like you have provided this for all case study questions. Thanks a ton!

gfiorini

The question is really worded poorly. The subscription is for events that are inserted into the container and a webhook is invoked when a log file is created in the storage container. I assume that the webhook point to a function (?) that analyze the log with a machine learning model and THEN if there is an anomaly call an azure function to notify adminstrator via mail. Am I missing something ?

coffecold

It's in the text: "You develop and deploy a stateful ASP.NET Core 2.1 web application named Policy service to an Azure App Service Web App. The application reacts to events from Azure Event Grid and performs policy actions based on those events" The controller of "Policy service" is given in the code EventGridController.cs. So the subscription in Grid triggers a webhook to the Policy service and executes the 'Process' controller function there .

gmishra88

It looks correct purely based on options and there is no need to read the big scenario. But I wonder why it is reacting on logdrop container events. That's where the service itself is writing log files to. Won't it create an endless loop?

gmishra88

marvelous microsoftiness, probably this is for the subscription for the anomaly detection service and not the policy service where they expliclty mentioned event grid to confuse you. Once you pass this exam, the certification can be used when applying for a job at CSI new york. For finding clues where they do not exist.

acjdev514

hahaha gmishra88

coffecold

"All Azure App Service Web Apps must write logs to Azure Blob storage" -There are n (production) Web apps that write logs to a blob storage. -On that blob storage an event grid is put to trigger the event when blobs are written. -From that event a function is triggered, doing great thing with policies.

edengoforit

What is a webhook and how do you use it? Webhooks are automated messages sent from apps when something happens. They have a message—or payload—and are sent to a unique URL—essentially the app's phone number or address. Webhooks are almost always faster than polling, and require less work on your end. They're much like SMS notifications.

mc0re

> an Azure Function that emails administrators is called by using an HTTP WebHook The question is about the EventGrid subscription, not how another Function is called. How do they fit together?

MiraA

I am missing "properties" section within "destination" key to define either "endpointUrl" or "resourceId". https://docs.microsoft.com/en-us/azure/event-grid/subscription-creation-schema#example-subscription-schema https://docs.microsoft.com/en-us/azure/event-grid/handler-event-hubs#event-hub

MiraA

Endpoint properties based on the "destination" type: https://docs.microsoft.com/en-us/azure/templates/microsoft.eventgrid/eventsubscriptions?tabs=json#endpointproperties-object

UnknowMan

Correct !

UnknowMan

Correct !

bluetopp

By googling the case study i found more text that fits more appropriately: Policies Log policy All Azure App Service Web Apps must write logs to Azure Blob storage. All log files should be saved to a container named logdrop. Logs must remain in the container for 15 days.

bp_a_user

this text is already in...

jokergester

https://docs.microsoft.com/en-us/azure/templates/microsoft.eventgrid/eventsubscriptions?tabs=json#template-format