Courseiva
Develop Azure compute solutionsmediumMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

Your company uses Azure App Service to host a web application that requires periodic database maintenance. The maintenance tasks are time-consuming and must run outside of peak hours. You need to schedule these tasks to run automatically at 2:00 AM every Sunday. The tasks should be implemented as an Azure Function that runs in the same App Service plan to reduce costs. What should you do?

⚠ Common exam trap

Candidates might overlook the specific requirement to implement the task 'as an Azure Function' and instead choose a WebJob, which is a different technology for background tasks. Another trap is confusing the cost implications of deploying an Azure Function to a Consumption plan (which is a separate serverless billing model) versus deploying it to an existing dedicated App Service Plan (which shares resources and costs with other apps on that plan).

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

Create a separate Azure Function App in the same App Service plan and configure a timer trigger.

Creating a separate Azure Function App and hosting it on the *same existing dedicated App Service Plan* (e.g., Basic, Standard, Premium) allows the Azure Function to run using the existing compute resources. This directly meets the requirement to run in the 'same App Service plan to reduce costs' by leveraging existing infrastructure. A timer trigger is the appropriate mechanism to schedule the function to run automatically at 2:00 AM every Sunday. This option also fulfills the requirement that the tasks 'should be implemented as an Azure Function'. Option A is incorrect because deploying to a Consumption plan would create a *separate* Function App resource with a serverless billing model, which does not align with the 'in the same App Service plan' requirement for cost reduction in the context of an existing dedicated App Service plan. Option C is incorrect because, while WebJobs are suitable for background tasks and can share an App Service plan, they are not Azure Functions. The STEM explicitly requires the tasks to be implemented as an Azure Function. Option D is incorrect because Azure Logic Apps are a separate service, incurring separate costs, and do not fulfill the requirement to implement the task 'as an Azure Function' and run it 'in the same App Service plan' for cost reduction.

Answer analysis

Option-by-option breakdown

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

  • Deploy the maintenance code as an Azure Function in the Consumption plan and configure a timer trigger.

    Why it's wrong here

    Deploying an Azure Function in a Consumption plan introduces a distinct billing model separate from the existing App Service plan, incurring additional costs for function executions. Furthermore, Consumption plan functions are subject to cold start delays, which can impact the timely execution of scheduled maintenance tasks, especially if they need to run frequently or with low latency. This approach creates a separate logical resource, adding management overhead.

  • Create a separate Azure Function App in the same App Service plan and configure a timer trigger.

    Why this is correct

    Creating a separate Azure Function App, even within the same App Service plan, introduces an additional logical application resource. While sharing the App Service plan reduces infrastructure costs, this approach creates a distinct management and deployment unit for the function. The scenario requires implementing *an* Azure Function to run alongside an existing web application, implying integration or a single function within the existing application's context. This option is tempting because Azure Function Apps are the standard hosting unit for functions, and they can indeed share an App Service plan, making it the correct choice when a new, dedicated logical application for functions is desired.

  • Add a WebJob to the App Service that uses a scheduled trigger to run the maintenance code.

    Why it's wrong here

    WebJobs are designed to run background tasks directly within an existing App Service instance, utilizing the same underlying App Service plan resources. This approach is highly cost-effective as it incurs no additional hosting charges beyond the existing App Service plan. WebJobs can be easily scheduled using CRON expressions, making them an ideal and integrated solution for running recurring maintenance code alongside the web application without introducing new infrastructure costs or separate management units.

  • Use Azure Logic Apps with a recurrence trigger to call the web application's maintenance endpoint.

    Why it's wrong here

    Azure Logic Apps operate as a separate serverless workflow service, incurring distinct costs based on actions executed, which adds to the overall operational expenditure. This solution would also necessitate exposing a dedicated maintenance endpoint on the web application, potentially introducing security considerations and requiring additional development to handle external calls. While powerful for orchestration, Logic Apps are not the most integrated or cost-efficient solution for running simple background code directly within an existing App Service context.

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

One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.