Skip to content

Commit 3042f43

Browse files
Willem-J-anNoortisra-fel
authored
Fix bug causing Docker Password to be removed from appsettings in Set-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]>
1 parent 71e05a6 commit 3042f43

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/Websites/Websites/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
- New Cmdlets
2323
- New-AzWebAppCertificate
2424
- Remove-AzWebAppCertificate
25-
25+
* Fix bug that causes Docker Password to be removed from appsettings in `Set-AzWebApp` and `Set-AzWebAppSlot`
26+
2627
## Version 2.1.1
2728
* Prevent duplicate access restriction rules
2829

src/Websites/Websites/Cmdlets/DeploymentSlots/SetAzureWebAppSlot.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,13 @@ public override void ExecuteCmdlet()
234234
}
235235
}
236236

237-
appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);
238-
239237
if (ContainerRegistryPassword != null)
240238
{
241-
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
239+
appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);
240+
if (ContainerRegistryPassword.ConvertToString() != string.Empty)
241+
{
242+
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
243+
}
242244
}
243245

244246
if (parameters.Contains("EnableContainerContinuousDeployment"))

src/Websites/Websites/Cmdlets/WebApps/SetAzureWebApp.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,16 @@ public override void ExecuteCmdlet()
236236
if (ContainerRegistryUser != string.Empty)
237237
{
238238
appSettings[CmdletHelpers.DockerRegistryServerUserName] = ContainerRegistryUser;
239-
}
239+
}
240240
}
241241

242-
appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);
243-
244242
if (ContainerRegistryPassword != null)
245243
{
246-
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
244+
appSettings.Remove(CmdletHelpers.DockerRegistryServerPassword);
245+
if (ContainerRegistryPassword.ConvertToString() != string.Empty)
246+
{
247+
appSettings[CmdletHelpers.DockerRegistryServerPassword] = ContainerRegistryPassword.ConvertToString();
248+
}
247249
}
248250

249251
if (parameters.Contains("EnableContainerContinuousDeployment"))

0 commit comments

Comments
 (0)