AZ-204 · Question #355
Suppose your Azure Function has a blob trigger associated with it and you want it to execute only when images are uploaded. Which of the following blob trigger Path values should you use?
The correct answer is D. samples-workitems/{name}.png. To trigger an Azure Function only for image files in a blob container, the blob trigger path should include the specific file extension, such as '.png'.
Question
Options
- Asamples-workitems/{name}
- Bsamples-workitems/{name}/png
- Csamples-workitems/{name}?png
- Dsamples-workitems/{name}.png
How the community answered
(69 responses)- A14% (10)
- B6% (4)
- C4% (3)
- D75% (52)
Why each option
To trigger an Azure Function only for image files in a blob container, the blob trigger path should include the specific file extension, such as '.png'.
samples-workitems/{{name}} would trigger for any file uploaded to the 'samples-workitems' container, regardless of its extension.
samples-workitems/{{name}}/png implies a folder structure where 'png' is a subfolder, not a file extension filter for the blob name.
samples-workitems/{{name}}?png uses a question mark, which is not the correct syntax for filtering by file extension in a blob trigger path.
In an Azure Blob Storage trigger path, appending '.png' to {{name}} acts as a filter, ensuring the function only triggers when a blob matching the samples-workitems/{name}.png pattern is created or updated. This specifically targets files with the '.png' extension in the 'samples-workitems' container.
Concept tested: Azure Blob Storage trigger path filtering
Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp#usage
Topics
Community Discussion
No community discussion yet for this question.