In a project lifecycle you are mostly dealing with a lot of servers, each representing a stage in your project cycle.
App services usually have app settings stored in Azure which makes it quite convenient for the admin to update them from Azure and not giving access to the values to a developer.
I always felt the pain of copying down appsettings from 1 App service to another on different servers so I wrote down this simple script which does the work for me.
$myResourceGroup = ‘RG-CRM-AE-PREPROD’
$mySite = ‘AT-CRM-UBIQUITY-AE-PP-01’
$webApp = Get-AzureRmWebApp -ResourceGroupName $myResourceGroup -Name $mySite
$appSettingList = $webApp.SiteConfig.AppSettings
$hash = @{}
ForEach ($kvp in $appSettingList) {
$hash[$kvp.Name] = $kvp.Value
}
$hash[‘NewKey’] = “NewValue”
$hash[‘ExistingKey’] = “NewValue”
Set-AzureRmWebApp -ResourceGroupName $myResourceGroup -Name $mySite -AppSettings $hash