Courseiva

AZ-204 Blob lease Practice Question

You are creating an Azure Functions app that uses a Blob Storage trigger to process new files. The function must process files only when they are completely written (i.e., no ongoing writes). You need to avoid processing partially written files. Which TWO configurations should you consider?

⚠ Common exam trap

Candidates often assume that the Blob trigger has built-in properties like 'LeaseBlob' or 'ScanBlob' to handle partial writes, but these are not valid. Instead, the proper patterns are to check the blob's timestamp or use a separate timer-triggered function to poll for stability.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Check the blob's 'LastModified' timestamp in the function code to verify no recent changes.

Option B is correct because inspecting the blob's LastModified timestamp (and comparing it against the current time or a prior poll) lets the function confirm the blob has not been modified recently, which is a standard way to detect that writing has finished before processing. Option C is correct because a timer-triggered function that lists blobs and only processes those whose size has remained stable across polls avoids the race condition inherent in BlobTrigger, which can fire while a blob is still being written. Options A, D, and E are not valid: BatchSize applies to batching/parallelism of trigger invocations and does not guarantee a blob is fully written; there is no LeaseBlob property on the BlobTrigger binding; and ScanBlob is not a real BlobTrigger binding property.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Increase the 'BatchSize' to reduce the frequency of trigger evaluations.

    Why it's wrong here

    Increasing BatchSize only affects how many blobs are fetched at once from the queue, but does not help with detecting partial writes. The trigger can still fire on a blob that is being written. Therefore, A is incorrect.

  • ✓

    Check the blob's 'LastModified' timestamp in the function code to verify no recent changes.

    Why this is correct

    Comparing the blob's LastModified timestamp lets the function detect whether writing has recently occurred, satisfying the requirement to avoid processing partially written files. If the timestamp is too recent, the function defers processing until the blob has settled, preventing reads of incomplete uploads.

  • ✓

    Use a timer-triggered function that lists blobs and processes those with a stable size.

    Why this is correct

    Polling blob metadata via a timer and comparing size across successive runs detects quiescence, so a blob is processed only once writes have ceased. This satisfies the stem's requirement to avoid partially written files, though it introduces latency and extra storage transactions versus an event-driven trigger.

  • ✗

    Use the 'BlobTrigger' with the 'LeaseBlob' property set to 'True'.

    Why it's wrong here

    'LeaseBlob' is not a valid property of the Azure Functions Blob trigger binding. While acquiring a lease is a recommended approach, it must be done manually in the function code, not as a trigger binding property. Therefore, D is incorrect.

  • ✗

    Set the 'ScanBlob' property to 'True' in the trigger binding.

    Why it's wrong here

    No such ScanBlob property exists in the Blob trigger binding, so setting it has no effect. The trigger fires on blob creation, which can occur before writes finish. The correct approach uses a blob receipt or an Event Grid trigger with a completion signal, ensuring processing starts only after the file is fully written.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

Go deeper

Related to this question

About these practice questions

This AZ-204 question is part of Courseiva's 883-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.