Created
May 25, 2020 08:40
-
-
Save JamesDLD/591fcf954f38150e0582ed4e2a42e896 to your computer and use it in GitHub Desktop.
Get a Databricks Service Principal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get service principal by ID | |
$headers = @{ | |
"Authorization"="Bearer $apiKey"; | |
"Content-Type" = "application/scim+json"; | |
"X-Databricks-Azure-SP-Management-Token"=$apiKeyManagement; | |
"X-Databricks-Azure-Workspace-Resource-Id"="/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Databricks/workspaces/$WorkspaceName" | |
} | |
$params = @{ | |
"applicationId"="$servicePrincipleNameId"; | |
} | |
$uri = "$uriroot/2.0/preview/scim/v2/ServicePrincipals" | |
Invoke-RestMethod -Method 'Get' -Uri $uri -Headers $headers -Body ( $params | ConvertTo-Json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment