exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 31 question 2 discussion

Actual exam question from Microsoft's AZ-204
Question #: 2
Topic #: 31
[All AZ-204 Questions]

HOTSPOT -
You need to implement the bindings for the CheckUserContent function.
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.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MohmmadFayez
Highly Voted 3 years, 10 months ago
1- Queue Trigre[] 2- Blob[]
upvoted 45 times
Lucario95
3 years, 5 months ago
This is correct according to the data type of "content" for the first binding and "output" for the second.
upvoted 1 times
...
KingChuang
2 years, 4 months ago
On My Exam:2022-12-26 My Answer: Quere Trigger Blob
upvoted 2 times
...
warchoon
2 years, 1 month ago
agree This is the only one reason to transform a string to a stream in the binding function
upvoted 1 times
...
MiraA
3 years, 7 months ago
The "content" parameter is of type "string" so it must be QueueTrigger. For example BlobTrigger uses Stream type, CosmosDBTrigger uses IReadOnlyList<> type, it seems the Table Storage has no trigger binding. https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings?tabs=csharp#supported-bindings https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger https://docs.microsoft.com/cs-cz/azure/azure-functions/functions-bindings-storage-blob-trigger https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-trigger
upvoted 17 times
PhilLI
3 years, 4 months ago
Agree with Azure Queue Storage trigger indeed (see example on https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger?tabs=csharp#example)
upvoted 1 times
...
Mev4953
3 years, 3 months ago
BlobTrigge can also use string parameter [FunctionName("BlobTriggerCSharp")] public static void Run([BlobTrigger("samples-workitems/{name}")] Stream myBlob, string name, ILogger log) { https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=csharp
upvoted 4 times
...
...
...
gmishra88
Highly Voted 2 years, 7 months ago
Another CSI Miami question from Microsoft. Yes, detectives, the content has to be a Stream if it is Blob trigger. Microsoft (don't be evil) did not give any information on how the function is triggered, but stereotypically put the red-herring in the description: " website shows the content from azure storage blob". Of course that does not mean the function is triggered from it. Next my only clue is the type of this parameter. Microsoft says .Net knowledge is required and any SDK is enough. But how will a javascript person know this that it is Stream and not the content given as String?
upvoted 20 times
overhill
5 months, 3 weeks ago
LOOOOL True... Whatever
upvoted 1 times
...
...
oskx2
Most Recent 1 year, 1 month ago
I think it should be BlobTrigger/Blob because the output it has the Stream data type and from where the binding expression will come ({name}) if it's not specified in the trigger. Also, blob trigger also receives the content as string. Anyways, this is an awful question. Shame on Microsoft
upvoted 1 times
...
raymond_abcd
1 year, 3 months ago
Requirement/question is unclear. Think the idea is that the function reads the uploaded data by the user. So it should be triggered by the Blob trigger. After the check it updates the content in the blob storage. So blob storage is the output parameter.
upvoted 1 times
...
LSandro
1 year, 6 months ago
BlobTrigger + Blob Source: https://learn.microsoft.com/en-us/answers/questions/1186952/how-to-get-a-blobtrigger-with-a-stream-in-azure-fu
upvoted 1 times
...
Dianahu
1 year, 9 months ago
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-input?tabs=python-v2%2Cin-process&pivots=programming-language-csharp [FunctionName("BlobInput")] public static void Run( [QueueTrigger("myqueue-items")] string myQueueItem, [Blob("samples-workitems/{queueTrigger}", FileAccess.Read)] Stream myBlob, ILogger log) { log.LogInformation($"BlobInput processed blob\n Name:{myQueueItem} \n Size: {myBlob.Length} bytes"); }
upvoted 1 times
...
JH81
1 year, 11 months ago
Terrible requirements that leave us questioning the actual implementation. But I have to agree that QueueTrigger is the first answer because the requirements state "accepts user generated content as a string". That can only be the QueueTrigger. Blob for the output is not in question.
upvoted 3 times
...
le129
2 years, 8 months ago
Blob trigger seems correct. trigger binding can be string if the content is small. Binding to string, or Byte[] is only recommended when the blob size is small. This is recommended because the entire blob contents are loaded into memory. For most blobs, use a Stream or CloudBlockBlob type. For more information, see Concurrency and memory usage. https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp
upvoted 1 times
...
shawnz
3 years, 3 months ago
the question said accept user upload content as a string. and user upload to blob to trigger the content check. so blobtrigger and blob are correct.
upvoted 3 times
...
leonidn
3 years, 3 months ago
"content" is of type string. Then QueueTrigger is the only what that is applicable. Agree with "blob".
upvoted 3 times
...
gfiorini
3 years, 5 months ago
It is really annoying the way the question is worded. Where in the specs is written the source and the target of the Function ?!? It is true that we can infer it from the possible answers. But why dont ask then "which are valid input / output" for the function ?
upvoted 8 times
gmishra88
2 years, 7 months ago
It is Microsoft
upvoted 3 times
...
...
phvogel
3 years, 6 months ago
The question has nothing to do with the architecture or design. It's actually asking if you can recognize valid trigger and output bindings. The only valid bindings are Queue Trigger (string) and Blob output (File.Write supports writing to a stream).
upvoted 3 times
...
ning
3 years, 8 months ago
I believe this is blobtrigger --> user upload contents into blob storage ... Need send to a service ... So I am think send to a queue for processing ... Just from the given info ...
upvoted 2 times
ning
3 years, 8 months ago
Depends on your interpretation for what is final step for azure function, whether to send the contents to the service, or remove the contents from the blob storage ... The requirements are not clear ...
upvoted 2 times
...
mcanic
3 years, 4 months ago
Blob trigger recieves stream, Service Bus Queue trigger recieves string, therefore the first option is not blob trigger but a queue trigger
upvoted 2 times
...
...
j888
3 years, 9 months ago
This is tricky, storage will be my general choice, however this statement "Messages are sent to contentuploadservice" leading me to believe this is a service bus.
upvoted 1 times
j888
3 years, 9 months ago
I was wrong. The service bus trigger would be public static void Run([ServiceBusTrigger("CustomerQueue"....
upvoted 1 times
...
...
SuperPetey
4 years ago
I believe the answer is QueueTrigger and Queue. This is an architectural design issue -- the entire reason to do user content auditing is to prohibit bad content from being stored and used. Therefore, use a queue to store these messages until they are verified. No need to store content in a blob until then -- Azure Storage Queue perfect solution.
upvoted 6 times
Spooky7
3 years, 11 months ago
Well, based what information was given it seems that entire design looks little bit different. User post content and it is saved in BlobStorage and available immediately. After that check is done and if content is invalid then it is replaced. So given answer is correct.
upvoted 5 times
...
warchoon
2 years, 1 month ago
So why did you transform stream to string and then transform it to stream again?
upvoted 1 times
...
...
clarionprogrammer
4 years, 1 month ago
Correct. Ref: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-output?tabs=csharp https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-input?tabs=csharp
upvoted 14 times
...
kwaazaar
4 years, 1 month ago
Correct
upvoted 6 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago