hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.45k stars 4.53k forks source link

SalesforceV2 being replaced with 'LinkedService' in data_factory_linked_custom_service #24610

Open PaulZaczkowski opened 5 months ago

PaulZaczkowski commented 5 months ago

Is there an existing issue for this?

Community Note

Terraform Version

2.231.1

AzureRM Provider Version

3.88

Affected Resource(s)/Data Source(s)

azurerm_data_factory_linked_custom_service

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_data_factory" "example" {
  name                = "example"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  identity {
    type = "SystemAssigned"
  }
}

resource "azurerm_data_factory_linked_custom_service" "example" {
  name                 = "example"
  data_factory_id      = azurerm_data_factory.example.id
  type                 = "SalesforceV2"
  description          = "test description"
  type_properties_json = <<JSON
{
  "environmentUrl": "https://test.salesforce.com/",
  "clientId": "foo",
  "clientSecret": {
    "type": "SecureString",
    "value": "bar"
  }
}
JSON

}

Debug Output/Panic Output

N/A

Expected Behaviour

Linked service should be created in data factory of type "SalesforceV2" supporting the client ID/client secret. JSON would look similar to the following:

{
    "id": "<id here>",
    "name": "example",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "description": "Link to salesforce account",
        "type": "SalesforceV2",
        "typeProperties": {
            "clientId": "foo",
            "clientSecret": {
                "type": "SecureString",
                "value": "bar"
            },
            "environmentUrl": "https://test.salesforce.com/"
        }
    },
    "etag": "<etag here>"
}

Actual Behaviour

Linked service type is set to "LinkedService", and looks similar to the following:

{
    "id": "<id here>",
    "name": "example",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "description": "Link to salesforce account",
        "type": "LinkedService", 
        "typeProperties": {
            "clientId": "foo",
            "clientSecret": {
                "type": "SecureString",
                "value": "bar"
            },
            "environmentUrl": "https://test.salesforce.com/"
        }
    },
    "etag": "<etag here>"
}

Steps to Reproduce

  1. terraform apply
  2. Compare JSON on linked service

Important Factoids

No response

References

See the documentation here that states the "type" should be set to SalesforceV2.

https://learn.microsoft.com/en-us/azure/data-factory/connector-salesforce?tabs=data-factory#linked-service-properties

NOTE: I believe this issue may also affect the type of SalesforceServiceCloudV2

PaulZaczkowski commented 5 months ago

After some digging, it looks like this might be a very recent change (~01/22/24) to include these V2 datasets/linked service connections. Instead of being a bug, this should probably be marked as a feature request. The old v1's should still work, but they show up as Legacy in ADF. For now I'm working around them by pushing with the v2 types, manually adjusting their types in the azure portal, then adding a lifecyle rule in the tf to ignore type changes.

dmanero commented 4 months ago

I have the same problem 8)

Bangal22 commented 4 months ago

me too

jwbeck97 commented 3 weeks ago

I had a similar issue with the SnowflakeV2 linked service. For me updating the version of the azurerm provider resolved this issue.