1

I am trying to leverage the Variable Group functionality in Azure DevOps.

I have created the variable group within the Release pipeline and I have associated. However, when I release the code to the Function App in Azure; when I go to the Configuration settings in the Function app, the custom settings are not there.

Is there a step I am missing here on getting these to show up?

enter image description here

enter image description here

enter image description here

enter image description here

UPDATE: To fix this; I needed to write the variables. This is the step I did it.

enter image description here

3
  • it's missing the part where you read them and update the function app Commented Feb 12, 2020 at 17:04
  • @ThiagoCustodio thanks--makes sense. Where is a step that I should add that? Commented Feb 12, 2020 at 17:05
  • You should be using an Azure keyvault for storing secured variables, not an Azure DevOps pipeline. Your application can retrieve secrets directly from the keyvault at runtime. You're adding several additional steps and making secret management opaque and difficult for no reason. Commented Feb 12, 2020 at 19:10

1 Answer 1

1

I usually do this using a powershell task after publishing the new code. So add a new powershell task and define it as inline:

$appname = "name of your function app"
$rg = "name of resource group"
$webApp = Get-AzureRmwebApp -ResourceGroupName $rg -Name $appname
$webAppSettings = $webApp.SiteConfig.AppSettings
$hash = @{}
foreach ($setting in $webAppSettings) {
    $hash[$setting.Name] = $setting.Value
}
$hash['New name'] = $("pipelineVariable")
Set-AzureRMWebAppSlot -ResourceGroupName $rg -Name $appname -AppSettings $hash -Slot production

PS: define the deployment slot as a variable too

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Thiago; although I didn't need to implement the powershell; your tip on needing to write the variable allowed me to fix it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.