Skip to content

Commit

Permalink
Fixes: #15005: Set-AzAppServicePlan to keep existing Tags when addi…
Browse files Browse the repository at this point in the history
…ng new Tags (#17650)

* Fix #17184 :  `Get-AzWebApp` to return SiteConfig details in the response when requested the WebApps under subscreption

* Revert "Fix #17184 :  `Get-AzWebApp` to return SiteConfig details in the response when requested the WebApps under subscreption"

This reverts commit 96a4d28.

* Fix #17184 :  `Get-AzWebApp` to return SiteConfig details in the response when requested the WebApps under subscreption

* Revert "Fix #17184 :  `Get-AzWebApp` to return SiteConfig details in the response when requested the WebApps under subscreption"

This reverts commit 96a4d28.

* Fixed Set-AzAppServicePlan to keep existing Tags when adding new Tags
  • Loading branch information
Kotasudhakarreddy authored Mar 29, 2022
1 parent 5725504 commit 39560c3
Show file tree
Hide file tree
Showing 4 changed files with 486 additions and 475 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Websites/Websites/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed `Set-AzAppServicePlan` to keep existing Tags when adding new Tags
* Fixed `Set-AzWebApp`,`Set-AzWebAppSlot`, `Get-AzWebApp` and `Get-AzWebAppSlot` to expose `VnetRouteAllEnabled` property in `SiteConfig` [#15663]
* Fixed `Set-AzWebApp`, `Set-AzWebAppSlot`, `Get-AzWebApp` and `Get-AzWebAppSlot` to expose `HealthCheckPath` property in `SiteConfig` [#16325]
* Fixed DateTime conversion issue caused by culture [#17253]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,20 @@ public override void ExecuteCmdlet()
int workerSizeAsNumber = 0;
int.TryParse(Regex.Match(AppServicePlan.Sku.Name, @"\d+").Value, out workerSizeAsNumber);
AppServicePlan.Sku.Name = string.IsNullOrWhiteSpace(WorkerSize) ? CmdletHelpers.GetSkuName(AppServicePlan.Sku.Tier, workerSizeAsNumber) : CmdletHelpers.GetSkuName(AppServicePlan.Sku.Tier, WorkerSize);
AppServicePlan.PerSiteScaling = PerSiteScaling;
if (Tag != null && AppServicePlan.Tags!=null)
CmdletHelpers.ConvertToStringDictionary(Tag).ForEach(item => AppServicePlan.Tags?.Add(item));
else
AppServicePlan.PerSiteScaling = PerSiteScaling;
if (Tag != null && AppServicePlan.Tags != null)
CmdletHelpers.ConvertToStringDictionary(Tag).ForEach(item =>
{
if (!AppServicePlan.Tags.ContainsKey(item.Key))
{
AppServicePlan.Tags.Add(item);
}
else
{
AppServicePlan.Tags[item.Key] = item.Value;
}
});
else if (Tag != null)
AppServicePlan.Tags = (IDictionary<string, string>)CmdletHelpers.ConvertToStringDictionary(Tag);
break;
}
Expand Down

0 comments on commit 39560c3

Please sign in to comment.