Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Connect-PowerBIServiceAccount

Log in to the Power BI service.

Syntax

User (Default)

Connect-PowerBIServiceAccount
 [-Environment <PowerBIEnvironmentType>]
 [-CustomEnvironment <String>]
 [-DiscoveryUrl <String>]
 [<CommonParameters>]

ServicePrincipal

Connect-PowerBIServiceAccount
 -Credential <PSCredential>
 [-Environment <PowerBIEnvironmentType>]
 [-CustomEnvironment <String>]
 [-ServicePrincipal]
 [-Tenant <String>]
 [-DiscoveryUrl <String>]
 [<CommonParameters>]

UserAndCredential

Connect-PowerBIServiceAccount
 -Credential <PSCredential>
 [-Environment <PowerBIEnvironmentType>]
 [-CustomEnvironment <String>]
 [-DiscoveryUrl <String>]
 [<CommonParameters>]

ServicePrincipalCertificate

Connect-PowerBIServiceAccount
 -CertificateThumbprint <String>
 -ApplicationId <String>
 [-Environment <PowerBIEnvironmentType>]
 [-CustomEnvironment <String>]
 [-ServicePrincipal]
 [-Tenant <String>]
 [-DiscoveryUrl <String>]
 [<CommonParameters>]

BringYourOwnToken

Connect-PowerBIServiceAccount
 [-Token <String>]
 [-Environment <PowerBIEnvironmentType>]
 [-CustomEnvironment <String>]
 [-Tenant <String>]
 [-DiscoveryUrl <String>]
 [<CommonParameters>]

Description

Log in to Power BI service with either a user or service principal account (application key or certificate). For user accounts, an Azure Active Directory (AAD) First-Party application is leveraged for authentication. To log out call Disconnect-PowerBIServiceAccount.

Examples

Example 1

PS C:\> Connect-PowerBIServiceAccount

Logs in using user authentication against the Public cloud, a prompt will display to collect credentials.

Example 2

PS C:\> Connect-PowerBIServiceAccount -Environment China

Logs in using user authentication against the China cloud, a prompt will display to collect credentials.

Example 3

PS C:\> Connect-PowerBIServiceAccount -Tenant [TenantId] -ServicePrincipal -Credential (Get-Credential)

Logs in using a service principal against the Public cloud, a prompt will display from Get-Credential to enter your username (your AAD client ID) and password (your application secret key).

Example 4

PS C:\> Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint 38DA4BED389A014E69A6E6D8AE56761E85F0DFA4 -ApplicationId b5fde143-722c-4e8d-8113-5b33a9291468

Logs in using a service principal with an installed certificate to the Public cloud. The certificate must be installed in either CurrentUser or LocalMachine certificate store (LocalMachine requires administrator access) with a private key installed.

Use the provided Token (a raw OAuth 2.0 access token/JWT value, without the Bearer prefix) for authentication when calling the Power BI REST API. Treat this token as a secret and do not paste it into logs, scripts, or command-line history.

Example 5

PS C:\> Connect-PowerBIServiceAccount -Token eyJhbGciOiJIUzI1NiJ9.fake_payload_and_signature_redacted_for_example

Parameters

-ApplicationId

Azure Active Directory (AAD) application ID (also known as Client ID) to be used with a certificate thumbprint (-CertificateThumbprint) to authenticate with a service principal account (-ServicePrincipal).

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-CertificateThumbprint

Certificate thumbprint of an installed certificate associated to an Azure Active Directory (AAD) application. Certificate must be installed in either the CurrentUser or LocalMachine personal certificate stores (LocalMachine requires an administrator prompt to access) with a private key installed.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Credential

PSCredential representing the Azure Active Directory (AAD) application client ID (username) and application secret key (password) to authenticate with a service principal account (-ServicePrincipal).

Parameter properties

Type:PSCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-CustomEnvironment

The custom environment to use for the environments returned from the discovery url.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-DiscoveryUrl

The discovery url to get the backend services info from. Custom environment must also be supplied.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Environment

Cloud environment to connect against. Default is Public.

Parameter properties

Type:PowerBIEnvironmentType
Default value:None
Accepted values:Public, Germany, USGov, China, USGovHigh, USGovMil
Supports wildcards:False
DontShow:False

Parameter sets

-ServicePrincipal

Indicates to use a service principal account, as opposed to a user account.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Tenant

Tenant name or tenant ID containing the service principal account. If not specified, the 'COMMON' tenant is used.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:TenantId

Parameter sets

-Token

JWT access token to use for authentication; pass only the token value, which will be sent as the Authorization: Bearer <token> header for API calls.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

Microsoft.PowerBI.Common.Abstractions.Interfaces.IPowerBIProfile


Feedback

Was this page helpful?