-
-
Save justinyoo/9dd9744fa0996d3a6271ebb19c624ade to your computer and use it in GitHub Desktop.
Azure Function Proxies for Mocking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This adds/updates application settings blade to a given Azure Web App instance. | |
# | |
Param( | |
[string] [Parameter(Mandatory=$true)] $ResourceGroupName, | |
[string] [Parameter(Mandatory=$true)] $WebAppName, | |
[hashtable] [Parameter(Mandatory=$true)] $AppSettings, | |
[hashtable] [Parameter(Mandatory=$true)] $SqlConnectionStrings, | |
[hashtable] [Parameter(Mandatory=$false)] $CustomConnectionStrings = $null | |
) | |
$connectionStrings = @{} | |
foreach($key in $SqlConnectionStrings.Keys) | |
{ | |
$connectionStrings.Add($key, @{ Type = "SQLAzure"; Value = $SqlConnectionStrings[$key] }) | |
} | |
if ($CustomConnectionStrings -ne $null) | |
{ | |
foreach($key in $CustomConnectionStrings.Keys) | |
{ | |
$connectionStrings.Add($key, @{ Type = "Custom"; Value = $CustomConnectionStrings[$key] }) | |
} | |
} | |
Set-AzureRmWebApp ` | |
-ResourceGroupName $ResourceGroupName ` | |
-Name $WebAppName ` | |
-AppSettings $AppSettings ` | |
-ConnectionStrings $connectionStrings | |
Remove-Variable connectionStrings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment