Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom DataFactory linked service type "AzureSynapseArtifacts" gets sent as type "LinkedService" causing an error. #24763

Open
1 task done
weber-chris opened this issue Feb 2, 2024 · 1 comment

Comments

@weber-chris
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.4.0

AzureRM Provider Version

3.89.0

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_storage_account" "example" {
  name                     = "examplestorageacc"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
  account_kind             = "StorageV2"
  is_hns_enabled           = "true"
}

resource "azurerm_storage_data_lake_gen2_filesystem" "example" {
  name               = "example"
  storage_account_id = azurerm_storage_account.example.id
}

resource "azurerm_synapse_workspace" "example" {
  name                                 = "example"
  resource_group_name                  = azurerm_resource_group.example.name
  location                             = azurerm_resource_group.example.location
  storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.example.id
  sql_administrator_login              = "sqladminuser"
  sql_administrator_login_password     = "H@Sh1CoR3!"

  aad_admin {
    login     = "AzureAD Admin"
    object_id = "00000000-0000-0000-0000-000000000000"
    tenant_id = "00000000-0000-0000-0000-000000000000"
  }

  identity {
    type = "SystemAssigned"
  }

  tags = {
    Env = "production"
  }
}

resource "azurerm_data_factory_linked_custom_service" "example" {
  name                 = "example"
  data_factory_id      = azurerm_data_factory.example.id
  type                 = "AzureSynapseArtifacts"
  type_properties_json = <<JSON
{
  "endpoint": azurerm_synapse_workspace.example.connectivity_endpoints.dev,
  "authentication": "MSI",
  "workspaceResourceId": azurerm_synapse_workspace.example.id
}
JSON
}

Debug Output/Panic Output

2024-02-01T18:24:46.721Z [DEBUG] provider.terraform-provider-azurerm_v3.89.0_x5: AzureRM Request: 
PUT /subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.DataFactory/factories/xxx/linkedservices/xxx?api-version=2018-06-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.21.3 (amd64-linux) go-autorest/v14.2.1 Azure-SDK-For-Go/v66.0.0 datafactory/2018-06-01 HashiCorp Terraform/1.4.0 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/3.89.0 VSTS_xxx
Content-Length: 446
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: xxx
Accept-Encoding: gzip

{"properties":{"connectVia":{"parameters":{},"referenceName":"xxx","type":"IntegrationRuntimeReference"},"type":"LinkedService","typeProperties":{"authentication":"MSI","endpoint":"https://xxx.dev.azuresynapse.net","workspaceResourceId":"/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Synapse/workspaces/xxx"}}}: timestamp=2024-02-01T18:24:46.721Z
2024-02-01T18:24:47.208Z [DEBUG] provider.terraform-provider-azurerm_v3.89.0_x5: AzureRM Response for https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.DataFactory/factories/xxx/linkedservices/xxx?api-version=2018-06-01: 
HTTP/2.0 400 Bad Request
Content-Length: 1116
Cache-Control: no-cache
Content-Type: application/json; charset=UTF-8
Date: Thu, 01 Feb 2024 18:24:46 GMT
Expires: -1
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Cache: CONFIG_NOCACHE
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: xxx
X-Ms-Ratelimit-Remaining-Subscription-Writes: 1199
X-Ms-Request-Id: xxx
X-Ms-Routing-Request-Id: xxx
X-Msedge-Ref: Ref A: xxx Ref B: xxx Ref C: 2024-02-01T18:24:46Z

{"error":{"code":"BadRequest","message":"Failed to encrypt sub-resource payload {\r\n  \"Id\": \"/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.DataFactory/factories/xxx/linkedservices/xxx\",\r\n  \"Name\": \"xxx\",\r\n  \"Properties\": {\r\n    \"connectVia\": {\r\n      \"parameters\": {},\r\n      \"referenceName\": \"xxx\",\r\n      \"type\": \"IntegrationRuntimeReference\"\r\n    },\r\n    \"type\": \"LinkedService\",\r\n    \"typeProperties\": {\r\n      \"authentication\": \"********************\",\r\n      \"endpoint\": \"********************\",\r\n      \"workspaceResourceId\": \"********************\"\r\n    }\r\n  }\r\n} and error is: Invalid type 'LinkedService' is provided in 'linkedServices'. Please correct the type in payload and retry..","target":"/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.DataFactory/factories/xxx/linkedservices/xxx","details":null}}: timestamp=2024-02-01T18:24:47.208Z

Expected Behaviour

Linked service of type "AzureSynapseArtifacts" (Documentation)

{
    "name": "example",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "annotations": [],
        "type": "AzureSynapseArtifacts",
        "typeProperties": {
            "endpoint": "https:/xxx.dev.azuresynapse.net",
            "authentication": "MSI",
            "workspaceResourceId": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Synapse/workspaces/xxx"
        },
        "connectVia": {
            "referenceName": "example",
            "type": "IntegrationRuntimeReference"
        }
    }
}

Actual Behaviour

Linked service type "AzureSynapseArtifacts" is replaced by "LinkedService" in the payload. This type is not known to the Azure API and the error "Invalid type 'LinkedService' is provided in 'linkedServices'. Please correct the type in payload and retry.." is returned.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

@jwbeck97
Copy link

jwbeck97 commented Jun 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants