Skip to content

Commit

Permalink
Fix removal of docker password setting #13865
Browse files Browse the repository at this point in the history
  • Loading branch information
Noort authored and Noort committed Jan 6, 2021
1 parent 4b578ee commit 4be56e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Websites/Websites/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- 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 4be56e3

Please sign in to comment.