if you are using with Azure Apps then you might already know the importance of the Application Settings
in a short description These override those in web.config, the same as you would in IIS.
so ..if you’re using it why not back it up aside ?
Backup and Export this Application Settings might be helpful someday ,how would we do it ?
first choose the webapp you interested to backed up its settings
1 |
$GetWebSite = Get-AzureRmWebApp -Name $Site |
now lets map the Application Settings and the Connection Strings for this Site
1 2 |
$AppSettings = $GetWebSite.SiteConfig.AppSettings $ConnectionStrings = $GetWebSite.SiteConfig.ConnectionStrings |
the Application Settings and the Connection Strings are built as Hashtable so we will need to use the ‘GetEnumeretor()’ option for the hashtable and then we can export
them to a csv file as follows –
1 2 3 |
$AppSettings.GetEnumerator() | Sort-Object -Property Name -Descending | Select-Object -Property @{n='Key';e={$_.Name}},Value | Export-Csv -Path C:\WorkDir\SiteConfigurationSettings\$Site.csv -NoTypeInformation |
1 2 3 4 |
$ConnectionStrings.GetEnumerator() | Sort-Object -Property Name -Descending | Select-Object -Property @{n='Key';e={$_.Name}},Value | Export-Csv -Path C:\WorkDir\SiteConfigurationSettings\$Site.csv -NoTypeInformation -Append } |
Enjoy !
(Visited 6,689 times, 1 visits today)