author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|
ggailey777 |
azure-functions |
include |
10/18/2020 |
glenga |
Before you can deploy your function code to Azure, you need to create three resources:
- A resource group, which is a logical container for related resources.
- A Storage account, which maintains state and other information about your projects.
- A function app, which provides the environment for executing your function code. A function app maps to your local function project and lets you group functions as a logical unit for easier management, deployment, and sharing of resources.
Use the following commands to create these items. Both Azure CLI and PowerShell are supported.
-
If you haven't done so already, sign in to Azure:
az login
The az login command signs you into your Azure account.
Connect-AzAccount
The Connect-AzAccount cmdlet signs you into your Azure account.
-
Create a resource group named
AzureFunctionsQuickstart-rg
in thewesteurope
region:az group create --name AzureFunctionsQuickstart-rg --location westeurope
The az group create command creates a resource group. You generally create your resource group and resources in a region near you, using an available region returned from the
az account list-locations
command.New-AzResourceGroup -Name AzureFunctionsQuickstart-rg -Location westeurope
The New-AzResourceGroup command creates a resource group. You generally create your resource group and resources in a region near you, using an available region returned from the Get-AzLocation cmdlet.
-
Create a general-purpose storage account in your resource group and region:
az storage account create --name <STORAGE_NAME> --location westeurope --resource-group AzureFunctionsQuickstart-rg --sku Standard_LRS
The az storage account create command creates the storage account.
New-AzStorageAccount -ResourceGroupName AzureFunctionsQuickstart-rg -Name <STORAGE_NAME> -SkuName Standard_LRS -Location westeurope
The New-AzStorageAccount cmdlet creates the storage account.
In the previous example, replace
<STORAGE_NAME>
with a name that is appropriate to you and unique in Azure Storage. Names must contain three to 24 characters numbers and lowercase letters only.Standard_LRS
specifies a general-purpose account, which is supported by Functions.