Skip to content

Instantly share code, notes, and snippets.

@JamesDLD
Created May 25, 2020 08:40
Show Gist options
  • Save JamesDLD/591fcf954f38150e0582ed4e2a42e896 to your computer and use it in GitHub Desktop.
Save JamesDLD/591fcf954f38150e0582ed4e2a42e896 to your computer and use it in GitHub Desktop.
Get a Databricks Service Principal
# 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