azure-data-factoryazure-databricks

Azure Databricks Linked Services Creation via Powershell dataSecurityMode not append


I try to run this command to Create Azure Databricks Linked Services

Set-AzDataFactoryV2LinkedService -Force -ResourceGroupName MYDEVRESOURCEGROUP -DataFactoryName MYDEVADF -Name LS_ADB_JOB_01 -DefinitionFile ./LS_ADB_JOB_01.json

LS_ADB_JOB_01.json is containing content

        .
        .
        .
            "newClusterSparkEnvVars": {
                "PYSPARK_PYTHON": "/databricks/python3/bin/python3"
            },
            "newClusterVersion": "@linkedService().ClusterVersion",
            "newClusterDriverNodeType": "@linkedService().DriverNodeType",
            "clusterOption": "Autoscaling",
            "newClusterInitScripts": [
                "/Workspace/Ingestion/init_odbc_driver.sh"
            ],
            "dataSecurityMode": "SINGLE_USER"
        },
        .
        .
        .

Then this command is run successfully but "dataSecurityMode": "SINGLE_USER" is not appear on ADF

enter image description here

How can I fix this?


Solution

  • I have tried to create AzureDatabrick linked service in Azure Data Factory with latest PowerShell and Az module version. enter image description here When I checked it from Azure Datafactory UI "dataSecurityMode": "SINGLE_USER" and "clusterOption": "Autoscaling" these two parameters are missing. enter image description here This can be a bug to workaround this you can use Rest API to update the Linked service

    PUT https://management.azure.com/subscriptions/SubscriptionId/resourceGroups/pdstackdemo/providers/Microsoft.DataFactory/factories/pdstackadf/linkedservices/LS_ADB_JOB_01?api-version=2018-06-01
    
    body:
    {
        "properties": {
            "parameters": {
                "Cluster_version": {
                    "type": "String"
                },
                "Cluster_Node_Type": {
                    "type": "String"
                },
                "Driver_node_type": {
                    "type": "String"
                }
            },
            "annotations": [],
            "type": "AzureDatabricks",
            "typeProperties": {
                "domain": "https://adb-762.8.azuredatabricks.net",
                "newClusterNodeType": "@linkedService().Cluster_Node_Type",
                "newClusterNumOfWorker": "2:4",
                "newClusterSparkEnvVars": {
                    "PYSPARK_PYTHON": "/databricks/python3/bin/python3"
                },
                "newClusterVersion": "@linkedService().Cluster_version",
                "newClusterDriverNodeType": "@linkedService().Driver_node_type",
                "clusterOption": "Autoscaling",
                "newClusterInitScripts": [],
                "dataSecurityMode": "SINGLE_USER"
            }
        }
    }
    

    This will Update the linked service with all appropriate parameters:

    enter image description here