Search code examples
azurepowershellconnectionazure-functionscommand-line-interface

Is it possible to create a connection string for an Azure function programmatically?


I wonder if anybody knows how to add a connection string to an Azure function using a Powershell script? Perhaps something similar to this:

az functionapp config appsettings set --name FunctionName --resource-group MyResourceGroup --settings "ConnectionStrings=connection_value_here"

This command does create an application setting. I haven't been able to find a similar for connections.

TIA


Solution

  • Actually, I found a simpler solution:

    az webapp config connection-string set -g "$ResourceGroup" -n "$FunctionAppName" -t custom --settings SchedulerServiceBusConnection="$FunctionConnectionString"

    Just need to replace the values in quotes.