Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1.Configuration Settings

You can create any number of application settings required by your function code. There are also predefined application settings used by Functions. These settings are stored encrypted.

...

The Get-AzFunctionAppSetting cmdlet returns the existing application settings, as in the following example:

Code Block
languagepowershell
Get-AzFunctionAppSetting -Name <FUNCTION_APP_NAME> -ResourceGroupName <RESOURCE_GROUP_NAME>

The Update-AzFunctionAppSetting command adds or updates an application setting. The following example creates a setting with a key named CUSTOM_FUNCTION_APP_SETTING and a value of 12345 :

Code Block
languagepowershell
Update-AzFunctionAppSetting -Name <FUNCTION_APP_NAME> -ResourceGroupName <RESOURCE_GROUP_NAME> -AppSetting @{"CUSTOM_FUNCTION_APP_SETTING" = "12345"}

The function app settings values can also be read in your code as environment variables. When you develop a function app locally, you must maintain local copies of these values in the local.settings.json project file.

2.Deployment Settings

Azure Functions supports deploying project code to your function app by using FTPS. To securely transfer project files, always use FTPS and not FTP.

Method - Azure Portal

...

Method - Azure PowerShell

Code Block
languagepowershell
$profile = [xml](Get-AzWebAppPublishingProfile -ResourceGroupName "<GROUP_NAME>" -Name "<APP_NAME>" -Format "Ftp") 
$profile.publishData.publishProfile | Where-Object -Property publishMethod -eq Ftp | Select-Object -Property @{Name="URL"; Expression = {$_.publishUrl}}, 
@{Name="username"; Expression = {$_.userName}}, @{Name="password"; Expression = {$_.userPWD}} | Format-Table

3.Hosting plan type

un the following Azure PowerShell command to get your hosting plan type:

Code Block
languagepowershell
$FunctionApp = '<FUNCTION_APP_NAME>'
$ResourceGroup = '<RESOURCE_GROUP>'
$PlanID = (Get-AzFunctionApp -ResourceGroupName $ResourceGroup -Name $FunctionApp).AppServicePlan
(Get-AzFunctionAppPlan -Name $PlanID -ResourceGroupName $ResourceGroup).SkuTier

4.Hosting plan migration

From Consumption to Premium : first, create; secondly, update; finally, delete the first one.

Code Block
languagepowershell
az functionapp plan create --name <NEW_PREMIUM_PLAN_NAME> --resource-group <MY_RESOURCE_GROUP> --location <REGION> --sku EP1

az functionapp update --name <MY_APP_NAME> --resource-group <MY_RESOURCE_GROUP> --plan <NEW_PREMIUM_PLAN>

az functionapp plan list --resource-group <MY_RESOURCE_GROUP> --query "[?sku.family=='Y'].{PlanName:name,Sites:numberOfSites}" -o table

--We can safely delete the plan with zero sites, which is the one we migrated from.
az functionapp plan delete --name <CONSUMPTION_PLAN_NAME> --resource-group <MY_RESOURCE_GROUP>

From Premium to Consumption : first, create; secondly, update; finally, delete the first one.

Code Block
languagepowershell
az functionapp create --resource-group <MY_RESOURCE_GROUP> --name <NEW_CONSUMPTION_APP_NAME> --consumption-plan-location <REGION> --runtime dotnet --functions-version 3 --storage-account <STORAGE_NAME>

az functionapp update --name <MY_APP_NAME> --resource-group <MY_RESOURCE_GROUP> --plan <NEW_CONSUMPTION_PLAN> --force

az functionapp delete --name <NEW_CONSUMPTION_APP_NAME> --resource-group <MY_RESOURCE_GROUP>

az functionapp plan list --resource-group <MY_RESOURCE_GROUP> --query "[?sku.family=='EP'].{PlanName:name,Sites:numberOfSites}" -o table

Run the az functionapp plan delete command as follows to delete the Premium plan you migrated from.
az functionapp plan delete --name <PREMIUM_PLAN> --resource-group <MY_RESOURCE_GROUP>