This repo contains a sample Python Azure Function that uses Asyncio. Gets a integer from the query stringcount
and and returns the square of the number. If count
is not passed, it defaults to 0
-
This demo, along with its instructions, scripts, and Bicep template, has been specifically designed to be executed in the
northeurope
region. However, with minimal modifications, you can also try running it in other regions of your choice (the specific steps for doing so are not covered in this context)- 🛠 Azure CLI Installed & Configured - Get help here
- 🛠 Azure Function Core Tools - Get help here
- 🛠 Bicep Installed & Configured - Get help here
- 🛠 [Optional] VS Code & Bicep Extenstions - Get help here
jq
- Get help herebash
or git bash - Get help here
-
-
Get the application code
git clone https://github.com/miztiik/azure-function-http-trigger-async-function.git cd azure-function-http-trigger-async-function
-
-
Ensure you have jq, Azure Cli and bicep working
jq --version func --version bicep --version bash --version az account show
-
Initiate the deployment with the following command,
# make deploy sh deployment_scripts/deploy.sh
After successfully deploying the stack, Check the
Resource Groups/Deployments
section for the resources. -
-
Trigger the function
FUNC_URL="https://async-fn-http-trigger-store-backend-fn-app-002.azurewebsites.net/api/HttpTrigger" curl ${FUNC_URL}?count=10
You should see an output like this,
{ "status": true, "recv_num": 100, "num_sqr": 10000, "processed_on": "2023-05-25 13:06:59" }
-
-
In this demonstration, we showcase how to setup azure function with async processing. This can be used to process large number of requests in a short period of time.
-
If you want to destroy all the resources created by the stack, Execute the below command to delete the stack, or you can delete the stack from console as well
- Resources created during Deploying The Solution
- Any other custom resources, you have created for this demo
# Delete from resource group az group delete --name Miztiik_Enterprises_xxx --yes # Follow any on-screen prompt
This is not an exhaustive list, please carry out other necessary steps as maybe applicable to your needs.
This repository aims to show how to Bicep to new developers, Solution Architects & Ops Engineers in Azure.
Thank you for your interest in contributing to our project. Whether it is a bug report, new feature, correction, or additional documentation or solutions, we greatly value feedback and contributions from our community. Start here
Buy me a coffee ☕.
Level: 200