In this Azure tutorial, we will discuss Azure functions Python Example including the steps to Deploy Python Azure Function To Azure From Visual Studio Code and Create Python Azure Function In Azure Portal.
Subscribe to Our YouTube Channel for more videos
How To Create Azure Function In Python
Well, like we are creating the Azure Function using C#, JavaScript, etc. In the same way, you can also create an Azure Function using Python.
Prerequisites
Before starting the development, we should know what is needed to create Azure function in Python.
- Make sure to install the Visual Studio Code along with Azure Functions Extensions if you have not yet installed the Visual Studio Code. Install the Visual Studio Code now.
- The next thing you need is Python 3.7.x or 3.6.x or 3.8.x etc
- An Azure Free Account or Azure Subscription.
Now, Assuming we are ready with all the Prerequisites, Let’s start the actual development of the Python Azure Function.
To Create Azure Function In Python, follow the below steps
1. Open the Visual Studio Code, click on the Azure Button from the left side, and then click on the Create New Project button in the Functions Explorer as highlighted below.

2. Now is the time to choose the location to save your Azure Function project. You can click on the Browse button to navigate to the local path where you want to save your Azure Function project.

3. This step is very important. Select the language Python to create the Azure Function Project.

4. You need to select the Python interpreter. Make sure to select the correct version. Specify the location of your Python 3.6.x executable. Again, make sure you’re using a compatible version of Python.

5. The next step is to choose the trigger that will invoke your Azure Function, and it is very important to select the required trigger based on your requirements. Let’s select the Basic and simplest trigger option, the HTTP trigger.

6. Now, the next step is you need to provide a unique name for your Azure Function, like the one below

7. The next step is to choose the Authorization level for your Azure Function. Choose the Authorization level as Function here. You can choose any of the options based on your requirements.

8. Select the Open in the new window, or you can choose the Open in the current window based on your choice.

If you are trying to create the Azure Function in Python for the first time then it might ask you to install the below-recommended extensions, you can click on the install button as highlighted below.

Suppose you have not installed Python by now. In that case, It might prompt you to install Python, Click on the Open button as highlighted below, which will redirect to Python’s official website to download Python 3.6 or the latest version for your operating system.

You can download the Python 3.6.x version for the operating system that you are using and install the same on your machine.
Now you