Skip to content

Python 3.6 function app creates

Anirudh Garg edited this page Nov 27, 2019 · 11 revisions

Creating Python 3.6 function app with Az CLI (Recommended)

Pre-requisites:

You can use Cloud Shell to run the commands below. Click on the icon at the top right of portal to open Cloud Shell. (or goto shell.azure.com)

OR

Install the Azure CLI version 2.0.76 or a later version and run the commands from a cmd/terminal on your local machine.

Note: Function app and storage account names must be unique.

Create a resource group.

az group create --name <resource_group_name> --location westeurope

Create an Azure storage account in the resource group.

az storage account create --name <storage_name> --location westeurope --resource-group <resource_group_name> --sku Standard_LRS

Create a serverless function app in the resource group.

az functionapp create --name <function_app_name> --storage-account <storage_name> --consumption-plan-location westeurope --resource-group <resource_group_name> --os-type Linux --runtime python --runtime-version 3.6

Creating Python 3.6 function app with VSCode (Recommended if you already have VSCode installed locally)

Pre-requisites:

Sign into Azure

Once you've installed the Azure extension, sign into your Azure account by navigating to the Azure explorer, select Sign into Azure, and follow the prompts. (If you have multiple Azure extensions installed, select the one for the area in which you're working, such as App Service, Functions, etc.)

After signing in, verify that the email address of your Azure account (or "Signed In") appears in the Status Bar and your subscription(s) appears in the Azure explorer:

Create a Function App

Click on View in Menu bar and open the Command Palette (F1) and select the Azure Functions: Create Function App in Azure command. Again, the function app is where your Python project runs in Azure. Follow the prompts:

  1. Enter globally unique name for your function app
  2. Pick “Linux” OS
  3. Pick “Python 3.6.x” runtime
  4. Pick a location to deploy your function app

You can also use Azure Functions: Create Function App in Azure (Advanced) flow if you want to configure more parameters.