AZ-200 Azure Functions & Serverless Computing โ Questions and Answers
Question 1: Which Azure Functions hosting plan automatically scales to zero when idle and charges only for execution time?
- Premium Plan
- Dedicated (App Service) Plan
- Consumption Plan (Correct answer)
- Isolated Plan
Correct answer: Consumption Plan
The Consumption Plan scales to zero between invocations and bills only per execution, making it the true serverless option.
Question 2: What is the maximum default timeout for an Azure Function running on the Consumption Plan?
- 5 minutes
- 10 minutes (Correct answer)
- 20 minutes
- 30 minutes
Correct answer: 10 minutes
On the Consumption Plan the default timeout is 5 minutes and the maximum allowed is 10 minutes.
Question 3: Which trigger type allows an Azure Function to respond to HTTP requests?
- Queue trigger
- Timer trigger
- HTTP trigger (Correct answer)
- Event Grid trigger
Correct answer: HTTP trigger
The HTTP trigger binds the function to an HTTP endpoint so it can respond to GET, POST, and other HTTP methods.
Question 4: In Azure Durable Functions, which function type orchestrates the execution of other functions?
- Activity function
- Orchestrator function (Correct answer)
- Entity function
- Client function
Correct answer: Orchestrator function
The Orchestrator function defines the workflow logic, calling Activity functions and managing their sequencing and state.
Question 5: Which binding direction is used when an Azure Function writes output to an Azure Queue?
- Input binding
- Trigger binding
- Output binding (Correct answer)
- Bidirectional binding
Correct answer: Output binding
Output bindings allow a function to write data to an external service such as Azure Queue Storage without writing SDK code.
Question 6: What file is used to configure triggers and bindings for an Azure Function when not using attribute-based programming?
- host.json
- local.settings.json
- function.json (Correct answer)
- appsettings.json
Correct answer: function.json
function.json declares the trigger, input bindings, and output bindings for a single function in non-.NET scripting languages.
Question 7: Which Durable Functions pattern is best suited for running multiple independent tasks in parallel and aggregating their results?
- Function chaining
- Fan-out/fan-in (Correct answer)
- Async HTTP APIs
- Monitor
Correct answer: Fan-out/fan-in
The fan-out/fan-in pattern starts multiple activity functions simultaneously and waits for all of them to complete before aggregating results.
Question 8: Which Azure Functions Premium Plan feature ensures at least one function instance is always warm to eliminate cold starts?
- Scale controller
- Pre-warmed instances (Correct answer)
- Elastic scale
- VNet integration
Correct answer: Pre-warmed instances
Pre-warmed instances on the Premium Plan keep at least one instance initialized so the first request does not incur a cold-start delay.
Question 9: When using the Timer trigger in Azure Functions, which expression format is used to define the schedule?
- ISO 8601 interval
- CRON expression (Correct answer)
- Quartz Scheduler format
- RFC 2822 date
Correct answer: CRON expression
Timer triggers use a CRON expression (with an optional sixth field for seconds) to define when the function should fire.
Question 10: In Azure Functions, what is the purpose of the host.json file?
- Define per-function bindings
- Store connection strings for local development
- Configure global settings for the function app host (Correct answer)
- List all functions in the app
Correct answer: Configure global settings for the function app host
host.json contains global configuration options that affect all functions in the app, such as logging levels, retry policies, and extension settings.
Question 11: Which Azure Functions trigger automatically scales based on the number of messages in a queue?
- HTTP trigger
- Blob trigger
- Queue Storage trigger (Correct answer)
- Timer trigger
Correct answer: Queue Storage trigger
The Azure Queue Storage trigger monitors queue depth and scales out function instances automatically when messages accumulate.
Question 12: What is the role of the Durable Functions 'Entity function'?
- Trigger the orchestration workflow
- Store and manage stateful objects identified by an entity ID (Correct answer)
- Send HTTP responses to clients
- Schedule timer-based callbacks
Correct answer: Store and manage stateful objects identified by an entity ID
Entity functions (Durable Entities) define operations that read and write small pieces of state, each identified by a unique entity ID.
Question 13: Which setting in local.settings.json is required to run Azure Functions locally?
- FUNCTIONS_WORKER_RUNTIME (Correct answer)
- WEBSITE_RUN_FROM_PACKAGE
- AzureWebJobsDashboard
- FUNCTIONS_EXTENSION_VERSION
Correct answer: FUNCTIONS_WORKER_RUNTIME
FUNCTIONS_WORKER_RUNTIME specifies the language worker (e.g., dotnet, node, python) and is required for the local runtime to load the correct worker process.
Question 14: Which Azure Functions output binding lets a function publish messages directly to an Azure Event Hub?
- Service Bus output binding
- Event Hub output binding (Correct answer)
- Event Grid output binding
- Notification Hub output binding
Correct answer: Event Hub output binding
The Event Hub output binding allows a function to send one or more events to an Event Hub without writing any Event Hubs SDK code.
Question 15: Which deployment method packages the function app into a ZIP file and mounts it read-only, improving startup performance?
- FTP deployment
- Run-from-package (WEBSITE_RUN_FROM_PACKAGE=1) (Correct answer)
- Git continuous deployment
- Docker container deployment
Correct answer: Run-from-package (WEBSITE_RUN_FROM_PACKAGE=1)
Setting WEBSITE_RUN_FROM_PACKAGE=1 causes the host to mount the deployment ZIP read-only, reducing I/O overhead and improving cold start times.
Question 16: In Azure Durable Functions, how does the orchestrator function maintain state across awaits without using a database?
- It writes state to Azure Blob Storage directly
- It uses the event sourcing pattern via a task hub in Azure Storage (Correct answer)
- It keeps an in-memory cache on a dedicated VM
- It stores state in Azure Redis Cache
Correct answer: It uses the event sourcing pattern via a task hub in Azure Storage
Durable Functions replays the orchestrator's history from Azure Storage (queues, tables, blobs) using event sourcing to reconstruct state after each await.
Question 17: Which HTTP authorization level requires callers to include a function-specific API key in the request?
- Anonymous
- User
- Function (Correct answer)
- Admin
Correct answer: Function
The Function authorization level requires a function key (or higher) to be passed with each request, limiting access to authorized callers.
Question 18: When deploying Azure Functions in a container, which environment variable must be set to instruct the host not to install extensions?
- FUNCTIONS_WORKER_RUNTIME_VERSION
- WEBSITE_ENABLE_SYNC_UPDATE_SITE
- FUNCTIONS_EXTENSION_VERSION (Correct answer)
- WEBSITE_USE_PLACEHOLDER
Correct answer: FUNCTIONS_EXTENSION_VERSION
FUNCTIONS_EXTENSION_VERSION should be set to ~4 (or the appropriate major version) in containerized deployments so the host uses the bundled extensions rather than downloading them.
Question 19: What is the maximum number of instances the Consumption Plan will scale a single function app to by default?
- 50 instances
- 100 instances
- 200 instances (Correct answer)
- 500 instances
Correct answer: 200 instances
On the Consumption Plan, Azure Functions scales out to a default maximum of 200 instances per function app.
Question 20: Which Azure service should you configure to reliably trigger an Azure Function when a new blob is uploaded, even if the function app was offline?
- Blob trigger with polling
- Event Grid trigger using Azure Blob Storage events (Correct answer)
- Timer trigger with blob listing
- Queue trigger with manual blob reference
Correct answer: Event Grid trigger using Azure Blob Storage events
Using an Event Grid trigger for Blob Storage events provides near-real-time, reliable delivery even if the function was unavailable, unlike the polling-based blob trigger.
Question 21: In Azure Functions, which interface should an orchestrator function use when awaiting an activity in C#?
- IDurableOrchestrationClient
- IDurableOrchestrationContext (Correct answer)
- IDurableEntityClient
- IDurableActivityContext
Correct answer: IDurableOrchestrationContext
IDurableOrchestrationContext provides the orchestrator with methods like CallActivityAsync to invoke activity functions and manage workflow state.