AZ-204 – Question 4

0
1517

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You develop a software as a service (SaaS) offering to manage photographs. Users upload photos to a web service which then stores the photos in Azure Storage Blob storage. The storage account type is General-purpose V2.
When photos are uploaded, they must be processed to produce and save a mobile-friendly version of the image. The process to produce a mobile-friendly version of the image must start in less than one minute.
You need to design the process that starts the photo processing.

Q. 1: Solution: Trigger the photo processing from Blob storage events.
Does the solution meet the goal?

  • A. Yes
  • B. No 

Correct Answer:

Correct Answer: B
You need to catch the triggered event, so move the photo processing to an Azure Function triggered from the blob upload.
Note: Azure Storage events allow applications to react to events. Common Blob storage event scenarios include image or video processing, search indexing, or any file-oriented workflow.
Events are pushed using Azure Event Grid to subscribers such as Azure Functions, Azure Logic Apps, or even to your own http listener.
However, the processing must start in less than one minute.
Note: Only storage accounts of kind StorageV2 (general purpose v2) and BlobStorage support event integration. Storage (general purpose v1) does not support integration with Event Grid.
Reference: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-event-overview

Q. 2: Solution: Update the web.config file to include the applicationInitialization configuration element. Specify custom initialization actions to run the scripts. Does the solution meet the goal?

  • A. Yes
  • B. No
  •  
  • Correct Answer: A 
    Specify custom warm-up.
    Some apps might require custom warm-up actions before the swap. The applicationInitialization configuration element in web.config lets you specify custom initialization actions. The swap operation waits for this custom warm-up to finish before swapping with the target slot. Here’s a sample web.config fragment.
    <system.webServer>
    <applicationInitialization>
    <add initializationPage=”/” hostName=”[app hostname]” />
    <add initializationPage=”/Home/About” hostName=”[app hostname]” />
    </applicationInitialization>
    </system.webServer>
    Reference:
    https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#troubleshoot-swaps  

Q. 3: Solution: Enable auto swap for the Testing slot. Deploy the app to the Testing slot. Does the solution meet the goal?

  • A. Yes
  • B. No 

Q. 4: Solution: Move photo processing to an Azure Function triggered from the blob upload. Does the solution meet the goal?

  • A. Yes 
  • B. No

Correct Answer: A 
Azure Storage events allow applications to react to events. Common Blob storage event scenarios include image or video processing, search indexing, or any file- oriented workflow.
Events are pushed using Azure Event Grid to subscribers such as Azure Functions, Azure Logic Apps, or even to your own http listener.
Note: Only storage accounts of kind StorageV2 (general purpose v2) and BlobStorage support event integration. Storage (general purpose v1) does not support integration with Event Grid.
Reference: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-event-overview 

Q. 5: Solution: Create an Azure Function app that uses the Consumption hosting model and that is triggered from the blob upload. Does the solution meet the goal?

  • A. Yes
  • B. No 

Correct Answer: B
A consumption plan can take up to several minutes to trigger the function. See note from https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-storage-blob-triggered-function. “When your function app runs in the default Consumption plan, there may be a delay of up to several minutes between the blob being added or updated and the function being triggered. If you need low latency in your blob triggered functions, consider running your function app in an App Service plan.”
Reference: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-storage-blob-triggered-function 

Q. 6: Solution: Use the Azure Blob Storage change feed to trigger photo processing. Does the solution meet the goal?

  • A. Yes
  • B. No 

Correct Answer: B

The change feed is a log of changes that are organized into hourly segments but appended to and updated every few minutes. These segments are created only when there are blob change events that occur in that hour.
Instead catch the triggered event, so move the photo processing to an Azure Function triggered from the blob upload.

Reference:
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-change-feed  https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-event-overview