Search code examples
azuresnowflake-cloud-data-platformazure-data-factory

Index Out of Range Error When Creating SnowFlake Linked Service in Azure Data Factory


I am passing the credentials and parameters required but I get the error

The value of the property 'index' is invalid: 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Activity ID: 36a4265d-3607-4472-8641-332f5656661d.


Solution

  • Seems the UI doesn't generate the linked service correctly. Using Microsoft Docs Example JSON I received the same index error when attempting to create the linked service. If I remove the password from the connection string and add it as a separate property I am able to successfully generate the linked service.

    Microsoft Docs Example (Doesn't Work)

    {
        "name": "SnowflakeLinkedService",
        "properties": {
            "type": "Snowflake",
            "typeProperties": {
                "connectionString": "jdbc:snowflake://<accountname>.snowflakecomputing.com/?user=<username>&password=<password>&db=<database>&warehouse=<warehouse>&role=<myRole>"
            },
            "connectVia": {
                "referenceName": "<name of Integration Runtime>",
                "type": "IntegrationRuntimeReference"
            }
        }
    }
    

    Working Example

    {
        "name": "SnowflakeLinkedService",
        "properties": {
            "type": "Snowflake",
            "typeProperties": {
                "connectionString": "jdbc:snowflake://<accountname>.snowflakecomputing.com/?user=<username>&db=<database>&warehouse=<warehouse>",
                "password": {
                    "type": "SecureString",
                    "value": "<password>"
                }
            },
            "connectVia": {
                "referenceName": "<name of Integration Runtime>",
                "type": "IntegrationRuntimeReference"
            }
        }
    }