Wednesday, January 27, 2021

Add user to Azure Data lake using Powershell with Admin access role.

# Script to add the user to Azure Data Lake workspace with allow-cluster-create access

$url = "https://adb-5890072754.14.azuredatabricks.net/api/2.0/preview/scim/v2/Users"
$groupid= "736317399920" # Get the Admin ID from the other script
$bearer_token = "dapie53ab46ca47e3e3a69f12a75c6-2"

$headers = @{Authorization = "Bearer $bearer_token"}
$par = '{
  "schemas":[
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "userName":"databrickser-2@globeduc.onmicrosoft.com",
  "displayName":"User 2",
  "groups":[
    {
    "value":"$groupid"
    }
  ]
}'

Invoke-WebRequest $url -Method Post -Headers $headers -Body $par -ContentType 'application/json'

No comments:

Post a Comment

HTML

Script:

JS