Azure-sdk-for-go: Databricks Workspace does not call Update(e.g. PATCH) when CreateOrUpdate function is called

Created on 21 Apr 2021  路  4Comments  路  Source: Azure/azure-sdk-for-go

Bug Report

  • import path of package: .../services/databricks/mgmt/2018-04-01/databricks
  • SDK version: 53.3.0
  • go version: 1.16

Description:
Currently in the API when you call the CreateOrUpdate function with a change only to the tags of the resource it will only update the tags for the workspace resource only and not the connected resources to the workspace. Ultimately this should be handled by the service teams API and not the end user. As a workaround to unblock current customers we had to implement extra code in the Terraform provider to correctly fix the propagation of tags to the connected resources.

Terraform PR to fix issue: https://github.com/terraform-providers/terraform-provider-azurerm/pull/11405

Expected:
When the end user updates a tag on the workspace the tag should flow to all of the connected resources that are associated with that workspace. This is facilitated by the PATCH call to the RP, which currently is an extra manual step that has to be done by the customer. The RP should handle this natively without the extra step of calling a separate UPDATE function.

Repro:
1) Using terraform use the below HCL configuration to provision a workspace resource.

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "rg" {
  name     = "testrg"
  location = "eastus2"
}
resource "azurerm_databricks_workspace" "workspace" {
  name                = "testws"
  resource_group_name = "testrg"
  location            = "eastus2"
  sku                 = "standard"

  tags = {
    Environment = "terraformtest"
  }
}

2) Once the workspace is has been provisioned, update the configuration file like the below HCL example, to add a new tag to the resource.

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "rg" {
  name     = "testrg"
  location = "eastus2"
}
resource "azurerm_databricks_workspace" "workspace" {
  name                = "testws"
  resource_group_name = "testrg"
  location            = "eastus2"
  sku                 = "standard"

  tags = {
    Environment    = "terraformtest"
    WorkspacePatch = "terraformtest"
  }
}

3) Using the Azure Portal or Resource Explorer to view the workspace resource. You will notice that the updated tag has been added to the workspace resource as expected. Now navigate to the Managed Resource Group and observe the tags of the connected resource. It will not have the added tag.

Data Bricks Service Attention bug customer-reported

All 4 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @yagupta.


Issue Details

Bug Report

  • import path of package: .../services/databricks/mgmt/2018-04-01/databricks
  • SDK version: 53.3.0
  • go version: 1.16

Description:
Currently in the API when you call the CreateOrUpdate function with a change only to the tags of the resource it will only update the tags for the workspace resource only and not the connected resources to the workspace. Ultimately this should be handled by the service teams API and not the end user. As a workaround to unblock current customers we had to implement extra code in the Terraform provider to correctly fix the propagation of tags to the connected resources.

Terraform PR to fix issue: https://github.com/terraform-providers/terraform-provider-azurerm/pull/11405

Expected:
When the end user updates a tag on the workspace the tag should flow to all of the connected resources that are associated with that workspace. This is facilitated by the PATCH call to the RP, which currently is an extra manual step that has to be done by the customer. The RP should handle this natively without the extra step of calling a separate UPDATE function.

Repro:
1) Using terraform use the below HCL configuration to provision a workspace resource.

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "rg" {
  name     = "testrg"
  location = "eastus2"
}
resource "azurerm_databricks_workspace" "workspace" {
  name                = "testws"
  resource_group_name = "testrg"
  location            = "eastus2"
  sku                 = "standard"

  tags = {
    Environment = "terraformtest"
  }
}

2) Once the workspace is has been provisioned, update the configuration file like the below HCL example, to add a new tag to the resource.

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "rg" {
  name     = "testrg"
  location = "eastus2"
}
resource "azurerm_databricks_workspace" "workspace" {
  name                = "testws"
  resource_group_name = "testrg"
  location            = "eastus2"
  sku                 = "standard"

  tags = {
    Environment    = "terraformtest"
    WorkspacePatch = "terraformtest"
  }
}

3) Using the Azure Portal or Resource Explorer to view the workspace resource. You will notice that the updated tag has been added to the workspace resource as expected. Now navigate to the Managed Resource Group and observe the tags of the connected resource. It will not have the added tag.

Author: WodansSon
Assignees: -
Labels: `Data Bricks`, `Service Attention`, `bug`, `customer-reported`
Milestone: -

Hi @WodansSon thanks for this issue!

I have tagged this issue so that the corresponding service team could come and have this a look.
In the meantime, I suppose if this client supports Update, maybe we need to use Update function to handle the update procedure in terraform? What do you think?

@ArcturusZhang, yep, totally agree... that is exactly what I did as a temporary workaround for this issue to unblock our customers, but this scenario really should be handled by the RP as stated above in the issue. 馃檪

@WodansSon Agreed that this definitely needs to be fixed. Let us wait for the service team's response on this issue...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakubigla picture jakubigla  路  3Comments

mcardosos picture mcardosos  路  5Comments

pmcatominey picture pmcatominey  路  3Comments

yannart picture yannart  路  3Comments

Tirke picture Tirke  路  3Comments