How to configure Azure functions ?
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:
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
:
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
$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:
4.Hosting plan migration
From Consumption to Premium : first, create; secondly, update; finally, delete the first one.
From Premium to Consumption : first, create; secondly, update; finally, delete the first one.