< Back

Connect-Databricks

Sat Jan 11, 2020 9:52 am

NAME Connect-Databricks



SYNOPSIS

Connects your current PowerShell session to Azure Databricks.





SYNTAX

Connect-Databricks -BearerToken <String> -Region <String> [<CommonParameters>]



Connect-Databricks -Region <String> -ApplicationId <String> -Secret <String> -TenantId <String> -SubscriptionId

<String> -ResourceGroupName <String> -WorkspaceName <String> [-Force] [<CommonParameters>]



Connect-Databricks -Region <String> -ApplicationId <String> -Secret <String> -DatabricksOrgId <String> -TenantId

<String> [-Force] [<CommonParameters>]





DESCRIPTION

Connects your current PowerShell session to Azure Databricks.

Supports Service Princial AAD authenication or via Databricks Bearer Token





PARAMETERS

-BearerToken <String>

Your Databricks Bearer token to authenticate to your workspace (see User Settings in Databricks WebUI)



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Region <String>

Azure Region - must match the URL of your Databricks workspace, example northeurope



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ApplicationId <String>

Azure Active Directory Service Principal Client ID (also known as Application ID)



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Secret <String>

Secret for given Client ID



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DatabricksOrgId <String>

Databricks OrganisationID this is found in the URL of your Worksapce as the o parameters (example

o=123456789). Note the first time a service principal connects it must use the MANAGEMENT method (ie provide

the Resource GRoup Name and Workspace Name - as this provisions the user)



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TenantId <String>

Tenant Id (Directory ID) for the AAD owning the ApplicationId



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SubscriptionId <String>

Subscription ID for the Workspace



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceGroupName <String>

Resource Group Name for the Workspace



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WorkspaceName <String>

Workspace Name



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

Removes any cached credentials and reconnects



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Author: Simon D'Morias / Data Thirst Ltd



-------------------------- EXAMPLE 1 --------------------------



C:\\PS>Connect-Databricks -Region "westeurope" -ApplicationId "8a686772-0e5b-4cdb-ad19-bf1d1e7f89f3" -Secret

"myPrivateSecret" -DatabricksOrgId 1234567 -TenantId "8a686772-0e5b-4cdb-ad19-bf1d1e7f89f3"



This example of a DIRECT connection (using the Databricks organisation Id)









-------------------------- EXAMPLE 2 --------------------------



C:\\PS>Connect-Databricks -Region "westeurope" -ApplicationId "8a686772-0e5b-4cdb-ad19-bf1d1e7f89f3" -Secret

"myPrivateSecret" -ResourceGroupName "MyResourceGroup" -SubscriptionId "9a686882-0e5b-4edb-cd49-cf1f1e7f34d9"

-WorkspaceName "workspaceName" -TenantId "8a686772-0e5b-4cdb-ad19-bf1d1e7f89f3"



This example of a MANAGMENT connection (using the Azure resource identifiers to connect)









-------------------------- EXAMPLE 3 --------------------------



C:\\PS>Connect-Databricks -BearerToken "dapi1234567890" -Region "westeurope"



This example of a BEARER connection (using the Databricks Bearer token from the Web UI to login as a person)











RELATED LINKS