Just like an Azure App Service, and Azure Function has an Application Settings tab where you can configure these through the Azure Portal. To access these you go to: Your function app > Overview > Configured Features> Configuration
, you can then add the settings that you need under the Application Settings
tab.
Alternatively, if you would prefer configuring these through a CLI then that option is also available. The main documentation is here.
Edit
For a solution as part of your CI/CD you have two options (examples will use Azure DevOps and perform the action in the CD step):
- PowerShell Task. You could add a Powershell (or any type of script that will talk to the Azure CLI for functions) script as part of your CD step. This post goes through the process step by step, the bit you are probably interested in is under "Deploying with Azure DevOps Release Pipeline". Essentially it is building up a collection of your appsetting keys and their values, then a call to
Set-AzureRmWebApp
the and pass in the collection to the -AppSettings
flag as per these docs
- Azure CLI task. Same as above but you could use the Azure CLI task along with the Inline script option to call the
az functionapp config appsettings set
command docs here. The --settings
flag takes:
Space-separated app settings in a format of =.
So
az functionapp config appsettings set --name MyFunctionApp --resource-group MyResourceGroup --settings "settings1Key=settings1Value settings2Key=settings2value"
The Azure Functions for .NET
template for CI (Build) and Deploy a function app to Azure Functions
template for CD (Release) inside Azure DevOps will come in handy.