This is the code I am using. It works fine on live slots but not on staging slots.
$csv = "C:\WorkDir\web-app-settings.csv"
$appSettingsList = Import-Csv $csv
$resourcegroupname = "DevOp-Test-RG"
$name = "web-uks-staging"
$appSettingsHash = @{}
Write-Host "current app settings" -foreground yellow;
ForEach ($kvp in $appSettingsList) {
$appSettingsHash[$kvp.Key] = $kvp.Value
write-host $kvp.Key ": " $kvp.Value -foreground green;
Set-AzureRMWebApp -ResourceGroupName $resourcegroupname -Name $name -AppSettings $appSettingsHash
The error that pops up in powershell is "Set-AzureRMWebApp:The Resource 'Microsoft.Web/sites/web-uks-staging' under resource group 'DevOp-Test-RG' was not found."
I would appreciate the help a lot. Many thanks.
Set-AzureRmWebAppSlotto modify application settings. - Shui shengbao