Skip to content

Commit

Permalink
Fix bug causing Docker Password to be removed from appsettings in Set…
Browse files Browse the repository at this point in the history
…-AzWebApp(Slot) (#13866)

* Fix removal of docker password setting #13865

* minor adjustment to changelog

to make sure the versioning script will handle it correctly

Co-authored-by: Noort <[email protected]>
Co-authored-by: Yeming Liu <[email protected]>
  • Loading branch information
3 people authored Jan 7, 2021
1 parent 71e05a6 commit 3042f43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/Websites/Websites/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
- New Cmdlets
- New-AzWebAppCertificate
- Remove-AzWebAppCertificate

* Fix bug that causes Docker Password to be removed from appsettings in `Set-AzWebApp` and `Set-AzWebAppSlot`

## Version 2.1.1
* Prevent duplicate access restriction rules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ public override void ExecuteCmdlet()
}
}

appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);

if (ContainerRegistryPassword != null)
{
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);
if (ContainerRegistryPassword.ConvertToString() != string.Empty)
{
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
}
}

if (parameters.Contains("EnableContainerContinuousDeployment"))
Expand Down
10 changes: 6 additions & 4 deletions src/Websites/Websites/Cmdlets/WebApps/SetAzureWebApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,16 @@ public override void ExecuteCmdlet()
if (ContainerRegistryUser != string.Empty)
{
appSettings[CmdletHelpers.DockerRegistryServerUserName] = ContainerRegistryUser;
}
}
}

appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);

if (ContainerRegistryPassword != null)
{
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);
if (ContainerRegistryPassword.ConvertToString() != string.Empty)
{
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
}
}

if (parameters.Contains("EnableContainerContinuousDeployment"))
Expand Down

0 comments on commit 3042f43

Please sign in to comment.