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

HOTSPOT -

You are developing an Azure Durable Function based application that processes a list of input values. The application is monitored using a console application that retrieves JSON data from an Azure Function diagnostic endpoint.

During processing a single instance of invalid input does not cause the function to fail. Invalid input must be available to the monitoring application.

You need to implement the Azure Durable Function and the monitoring console application.

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

NOTE: Each correct selection is worth one point.

Hot Area:

    Correct Answer:

    Box 1: await context.CallEntityAsync(input[errindex],"error")

    Orchestration signals and calls an entity

    Orchestrator functions can access entities by using APIs on the orchestration trigger binding.

    Example:

    [FunctionName("CounterOrchestration")]

    public static async Task Run(

    [OrchestrationTrigger] IDurableOrchestrationContext context)

    {

    var entityId = new EntityId(nameof(Counter), "myCounter");

    // Two-way call to the entity which returns a value - awaits the response int currentValue = await context.CallEntityAsync(entityId, "Get");

    Box 2: Failed -

    During processing a single instance of invalid input does not cause the function to fail.

    Note: RuntimeStatus: One of the following values:

    Failed: The instance failed with an error.

    Completed: The instance has completed normally.

    Terminated: The instance was stopped abruptly.

    Pending: The instance has been scheduled but has not yet started running.

    Running: The instance has started running.

    ContinuedAsNew: The instance has restarted itself with a new history. This state is a transient state.

    Box 3: Input -

    Invalid input must be available to the monitoring application.

    Reference:

    https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-entities https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-instance-management

Discussion
RochaG2

I've not seen any of this stuff in Microsoft's Learning Path's for AZ-204

OPT_001122

yes. there are a few questions added in last month. not sure if all of them are of AZ-204

gmishra88

The learning path and the preparation videos are showing things you need not know for the exam.

130nk3r5

Got this today. Went with answer here. Score 927

Akiu

I'd say: SetOutput() == Completed result.output The function needs to return the one invalid input, so you could use either SetOutput or SetCustomStatus, but custom status is not available after the function completes. The one invalid input does not cause the function to fail, therefore Completed.

POOOJAAAAAAAAAA

is this correct ?

macobuzi

This one seems right!

regux

async functions needs an await part. SetOutput() won't qualify for that as function.

gebpt

you've got await in "var json = await response.Content.ReadAsStringAsync();"

bluetopp

This one looks more correct to me. await context.CallEntityAsync(input[errIndex] is to call entities to return a value, and it doesn't even do that in the example. I think some of the code is missing as well here, this doesn't look correct

uffuchsi

Received this in my exam today (22/02/2023). Selected context.Signal(input[errIndex], "error"), Completed, output. Score 927.

memobed890

De donde saco la información para decir que son esas respuestas?

MysticalSam

This question was in today's exam at 10-June-2023

NavinD

How much percent questions did you get from here? Do you have contributor access?

red0400

Answer - setOutput, completed, output

CarlosTheBoldest

I check it and setcustomstatus makes sense, cause they want to show the input that is causing errors (see link below). Apart of that, the ensuresuccessstatuscode will throw an exception if it fails, so I would go with "completed" and output https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-custom-orchestration-status?tabs=csharp https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage.ensuresuccessstatuscode?view=net-8.0

Ciupaz

Hope don't find this question in my exam.

[Removed]

Got this in exam today (5 April 2023)

manopeydakon

Nigros the answer is correct since we are after the failed input values.

Vukile

On exam 9 Nov 2023, went with given answer, socre 865. Case Study: Farmers and Distributors

longnguyendh

I think that the anwser is SetCustomStatus Failed result.customStatus

PP2015

Did my exam on 3/29/2023. This question was on it. Selected context.Signal(input[errIndex], "error"), Completed, output. Score 850

RealRaymond

Answer should be CustomStatus. Ref: https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-custom-orchestration-status?tabs=csharp#querying-custom-status-with-http

oskx2

The output of the function has to match the method return type. It cannot be SetOutput. You can use CustomStatus, since the other 2 do not make sense. And the output is available on completion since the function does not throw an exception. But because the function return type is List<string>, and it may be used for another purpose, we use the custom status to get the invalid input. Also, the custom status is available after the function completes. https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-http-api#get-instance-status

Vegetta95

1. SetCustomStatus. There is no point in calling context.CallEntityAsync with "error" as parameter before knowing if error occured or not 2. Failed (only negative status) 3. runTimeStatus ( This is the only property we are sure that dynamic object posess. We don't know the custom response from the url)

pkolodziej

For those who are wondering if it's a SignalEntity, it's not: SignalEntity(EntityId, DateTime, String, Object) Signals an operation to be performed by an entity at a specified time. Any result or exception is ignored (fire and forget). We're clearly waiting for completion here, so have to use CallEntity,

pkolodziej

I correct my mistake: it should be CustomStatus https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-custom-orchestration-status?tabs=csharp#querying-custom-status-with-http

dimsok

Seem s correct, but the code in the answer area is missing stuff