There are several options and it depends a bit how you are deploying your function to Azure.
Azure CLI
az functionapp config appsettings set [--ids]
[--name]
[--resource-group]
[--settings]
[--slot]
[--slot-settings]
[--subscription]
Where the -settings argument contains space separated name=value pairs.
More info: https://docs.microsoft.com/en-us/cli/azure/functionapp/config/appsettings?view=azure-cli-latest#az-functionapp-config-appsettings-set
Azure Function Core Tools
This publishes your function app including your local settings to the cloud:
func azure functionapp publish <FunctionAppName> --publish-local-settings
This publishes only your local settings to your function app in the cloud:
func azure functionapp publish <FunctionAppName> --publish-settings-only
See https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#project-file-deployment
Azure DevOps
If you're using Azure DevOps with Release Pipelines the Azure Function App task is convenient to use:
Supply the settings as space separated -key value pairs in the appSettings parameter in the task.
More info: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-function-app?view=azure-devops
The Azure Portal
As Matt described you could add/update using the Azure Portal as well via Configuration -> Application Settings but I recommend against that if you're doing automated deployments (which you should ;).