0
0
Azurecloud~10 mins

Why serverless patterns matter in Azure - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an Azure Function app with the correct runtime.

Azure
az functionapp create --resource-group myResourceGroup --consumption-plan-location westus --runtime [1] --name myFunctionApp --storage-account mystorageaccount
Drag options to blanks, or click blank then click option'
Anode
Bpython
Cjava
Ddotnet
Attempts:
3 left
💡 Hint
Common Mistakes
Using a runtime that does not match the function code language.
Forgetting to specify the runtime parameter.
2fill in blank
medium

Complete the code to add a trigger to an Azure Function that responds to HTTP requests.

Azure
func new --name HttpTrigger --template [1] --authlevel anonymous
Drag options to blanks, or click blank then click option'
AHTTP trigger
BBlob trigger
CTimer trigger
DQueue trigger
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a trigger that responds to storage events instead of HTTP.
Confusing trigger names.
3fill in blank
hard

Fix the error in the Azure Function app settings to enable Application Insights for monitoring.

Azure
az functionapp update --name myFunctionApp --resource-group myResourceGroup --set [1]=true
Drag options to blanks, or click blank then click option'
AappInsights.enabled
BapplicationInsightsKey
CapplicationInsights.enabled
DappInsightsKey
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect setting names or casing.
Confusing the key with the enabled flag.
4fill in blank
hard

Fill both blanks to define a serverless function that triggers on a new blob upload and logs the blob name.

Azure
def main(myblob: func.InputStream):
    logging.info(f"Processing blob: [1]")
    blob_content = [2].read()
Drag options to blanks, or click blank then click option'
Amyblob.name
Bmyblob
Cmyblob.content
Dmyblob.get_blob()
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to call a non-existent method on the blob object.
Using incorrect property names.
5fill in blank
hard

Fill all three blanks to configure an Azure Durable Function orchestrator that calls two activity functions sequentially.

Azure
import azure.functions as func
import azure.durable_functions as df

async def orchestrator_function(context: df.DurableOrchestrationContext):
    output1 = await context.call_activity('[1]', None)
    output2 = await context.call_activity('[2]', output1)
    return [3]

main = df.Orchestrator.create(orchestrator_function)
Drag options to blanks, or click blank then click option'
AActivityFunctionA
BActivityFunctionB
C[output1, output2]
Doutput2
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of activity function calls.
Returning a list instead of the final output.