azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Set-AzureWebsite doesn't update ConnectionStrings

Open rickrain opened this issue 11 years ago • 11 comments

$website = Get-AzureWebsite $websiteName -slot $websiteSlot $connectionStrings = $website.ConnectionStrings

$result = $connectionStrings.Remove(($connectionStrings | Where-Object {$_.Name -eq $connectionStringName}))

Set-AzureWebsite $websiteName -slot $websiteSlot -ConnectionStrings $connectionStrings

Reference: http://stackoverflow.com/questions/29648327/cannot-delete-all-azure-website-connection-strings

rickrain avatar Apr 16 '15 02:04 rickrain

I will investigate

Thanks Naveen


From: Rick Raineymailto:[email protected] Sent: ‎4/‎15/‎2015 7:33 PM To: Azure/azure-powershellmailto:[email protected] Subject: [azure-powershell] Set-AzureWebsite doesn't update ConnectionStrings (#340)

$website = Get-AzureWebsite $websiteName -slot $websiteSlot $connectionStrings = $website.ConnectionStrings

$result = $connectionStrings.Remove(($connectionStrings | Where-Object {$_.Name -eq $connectionStringName}))

Set-AzureWebsite $websiteName -slot $websiteSlot -ConnectionStrings $connectionStrings

Reference: http://stackoverflow.com/questions/29648327/cannot-delete-all-azure-website-connection-strings


Reply to this email directly or view it on GitHub: https://github.com/Azure/azure-powershell/issues/340

NaveenGoli avatar Apr 16 '15 05:04 NaveenGoli

Any updates on whether this is definitely a bug?

martincostello avatar Apr 29 '15 13:04 martincostello

Sorry, I have been OOF and didn't get a chance to debug this.

Thanks Naveen


From: Martin Costellomailto:[email protected] Sent: ‎4/‎29/‎2015 6:28 AM To: Azure/azure-powershellmailto:[email protected] Cc: Naveen Golimailto:[email protected] Subject: Re: [azure-powershell] Set-AzureWebsite doesn't update ConnectionStrings (#340)

Any updates on whether this is definitely a bug?


Reply to this email directly or view it on GitHub: https://github.com/Azure/azure-powershell/issues/340#issuecomment-97426073

NaveenGoli avatar Apr 29 '15 15:04 NaveenGoli

Any updates on this?

winperec avatar Jul 14 '15 11:07 winperec

Any progress on this issue?

martincostello avatar Aug 27 '15 08:08 martincostello

Can we please have an update on this?

bspunie avatar Jan 02 '16 09:01 bspunie

$connStrings = @{ AzureWebJobsDashboard = @{ Type = "Custom"; Value = $AzureWebJobsDashboard }; AzureWebJobsStorage = @{ Type = "Custom"; Value = $AzureWebJobsStorage }};

Set-AzureRMWebApp -Name $webServiceName -ResourceGroupName $rgName -ConnectionStrings $connStrings

nallurisrinu avatar Nov 21 '16 12:11 nallurisrinu

@twitchax: "Azure PowerShell continues to maintain RDFE support on a legacy basis: new functionality and bug fixes are addressed sparingly. This issue does not meet the current threshold for consideration."

cormacpayne avatar Sep 02 '17 00:09 cormacpayne

Just for the sake of people who reach this thread via Google/Bing .. looks like nallurisrinu's suggestion is working out here...

$connStrings = @{ AzureWebJobsDashboard = @{ Type = "Custom"; Value = $AzureWebJobsDashboard }; AzureWebJobsStorage = @{ Type = "Custom"; Value = $AzureWebJobsStorage }}; Set-AzureRMWebApp -Name $webServiceName -ResourceGroupName $rgName -ConnectionStrings $connStrings

mganeshphani avatar Sep 10 '17 04:09 mganeshphani

Also for people searching for this error :

Cannot validate argument on parameter 'ConnectionStrings'. Connection string type must be specified.

The Type value in the HashTable must be the string, explicitly, with .ToString().

$connStringsList = $webApp.SiteConfig.ConnectionStrings
$hashItems = New-Object System.Collections.HashTable
ForEach ($keyValuePair in $connStringsList) {
    $setting =  @{Type=$keyValuePair.Type.ToString();Value=$keyValuePair.ConnectionString.ToString()}
    $hashItems.Add($keyValuePair.Name,$setting);
}
Set-AzureRmWebApp -ResourceGroupName $resourceGroupName -Name $appServiceName -ConnectionStrings $hashItems

ghost avatar Oct 16 '17 17:10 ghost

@umaknow-jeanluc thanks a lot for your brilliant comment, you saved my day \o/

xaviermignot avatar Feb 28 '18 13:02 xaviermignot