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

DRAG DROP -

You need to add code at line EG15 in EventGridController.cs to ensure that the Log policy applies to all services.

How should you complete the code? 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.

Select and Place:

    Correct Answer:

    Scenario, Log policy: All Azure App Service Web Apps must write logs to Azure Blob storage.

    Box 1: Status -

    Box 2: Succeeded -

    Box 3: operationName -

    Microsoft.Web/sites/write is resource provider operation. It creates a new Web App or updates an existing one.

    Reference:

    https://docs.microsoft.com/en-us/azure/role-based-access-control/resource-provider-operations

Discussion
MrZoom

Answer seems to be correct. Once a new web app is created, an event is triggered from the resource group... https://docs.microsoft.com/en-us/azure/event-grid/event-schema-resource-groups?tabs=event-grid-event-schema That event contains the status, which must be Succeeded in order for it to make sense to apply the policy. The above site also mentions that the event["data"] contains an operationName property for resource group events, which in this case is an "Microsoft.web/sites/write" operation.

MiraA

operationName ... Name of the operation. status ... String describing the status of the operation. Some common values are: Started, In Progress, Succeeded, Failed, Active, Resolved. https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log-schema#administrative-category Microsoft.Web/sites/Write ... Create a new Web App or update an existing one https://docs.microsoft.com/en-us/azure/role-based-access-control/resource-provider-operations But why do we need to call EnsureLogging() upon creating/updating the Web App? I cannot find such requirement in the assignment. Or am I wrong?

OPT_001122

1: Status 2: Succeeded 3: operationName

ning

The given answer seems logical, but the wording is so confusing ... This operation is for when a new web site is created or updated, or a web log is generated ...

MiraA

Confusing is the opening brace - it should be "(" instead of "{" as it is a logical expression for the "if" statement. ;-)

1CY1

Alternative way of working it out... 1) topic : exlude this as it is part of the event data. 2) Find 2 remaining options that can be equal. Only 'status' and 'Succeeded' are a logical boolean test. Answer 1 : status Answer 2 : Succeeded 3) What could be a string that could match 'Microsoft.Web/site/write'. Only 2 could logically match this, eventType and operationName. operationName is the most likely. Answer 3 : operationName

Faizs

Correct