# NOTE: for the "HelperFunctions.ps1", please see David Ebbo's helper ps1 file:
# https://github.com/davidebbo/AzureWebsitesSamples/blob/master/PowerShell/HelperFunctions.ps1
# E.g. save this file, *and* the HelperFunctions.ps1 file to your C:\ drive
#
. "C:\HelperFunctions.ps1"
$ErrorActionPreference = "Stop"
$ResourceGroupName = "TestRG"
$Location = "North Europe"
$SiteName = "PSTest8000"
$PlanName = "MyPlan"
Write-Host "Creating Resource Group"
New-AzureResourceGroup -Name $ResourceGroupName -Location $Location -Force
Write-Host "Creating App Service Plan"
CreateAppServicePlan $ResourceGroupName $Location $PlanName
Write-Host "Creating Web App"
CreateWebApp $ResourceGroupName $Location $SiteName $PlanName
Write-Host "Getting Web App's AppSettings"
GetWebAppAppSettings $ResourceGroupName $SiteName
# This returns nothing (as expected)
Write-Host "Setting Web App's AppSettings"
SetWebAppAppSettings $ResourceGroupName $SiteName @{ "MyKeyOne" = "SomeValue"; "MyKeyTwo" = "OtherValue"; }
# Confirmed via NEW portal - these app settings are present
# Turn on debug trace:
$DebugPreference="Continue"
# This returns nothing (it should return the MyKeyOne and MyKeyTwo appsettings, as created above)
# This helper function does:
# $res = Invoke-AzureResourceAction -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/Config -Name $SiteName/appsettings -Action list -ApiVersion 2015-06-01 -Force
# $res.Properties
#
Write-Host "Getting Web App's AppSettings (after setting)"
GetWebAppAppSettings $ResourceGroupName $SiteName
I have included (please see below) the debug trace output obtained from the final call to GetWebAppAppSettings.
As you can see, the AppSettings ("properties") are actually returned in the HTTP response, yet they're
not returned by the GetWebAppAppSettings (Invoke-AzureResourceAction) call itself.
Could this be an issue with the JSON deserialisation?
This code is a repo for the issue:
I have included (please see below) the debug trace output obtained from the final call to GetWebAppAppSettings. As you can see, the AppSettings ("properties") are actually returned in the HTTP response, yet they're not returned by the GetWebAppAppSettings (Invoke-AzureResourceAction) call itself.
Could this be an issue with the JSON deserialisation?