Skip to content

Commit

Permalink
Bug Fix - `azurerm_virtual_desktop_workspace_application_group_associ…
Browse files Browse the repository at this point in the history
…ation`- Association should not remove the tags (#19574)

* fix issue 18677, update should not remove the tags

* update test cases

Co-authored-by: xuzhang3 <Zhangxu894765>
  • Loading branch information
xuzhang3 committed Dec 6, 2022
1 parent 1c41fad commit c9645b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func resourceVirtualDesktopWorkspaceApplicationGroupAssociationCreate(d *plugins
Properties: &workspace.WorkspacePatchProperties{
ApplicationGroupReferences: &applicationGroupAssociations,
},
Tags: model.Tags,
}
if _, err = client.Update(ctx, *workspaceId, payload); err != nil {
return fmt.Errorf("creating association between %s and %s: %+v", *workspaceId, *applicationGroupId, err)
Expand Down Expand Up @@ -200,6 +201,7 @@ func resourceVirtualDesktopWorkspaceApplicationGroupAssociationDelete(d *plugins
Properties: &workspace.WorkspacePatchProperties{
ApplicationGroupReferences: &applicationGroupReferences,
},
Tags: model.Tags,
}
if _, err = client.Update(ctx, id.Workspace, payload); err != nil {
return fmt.Errorf("removing association between %s and %s: %+v", id.Workspace, id.ApplicationGroup, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ resource "azurerm_virtual_desktop_workspace" "test" {
name = "acctestWS%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
tags = {
environment = "test"
}
}
resource "azurerm_virtual_desktop_host_pool" "test" {
Expand Down Expand Up @@ -168,6 +171,9 @@ resource "azurerm_virtual_desktop_workspace" "test" {
name = "acctestWS%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
tags = {
environment = "test"
}
}
resource "azurerm_virtual_desktop_host_pool" "test" {
Expand Down

0 comments on commit c9645b8

Please sign in to comment.