Commands › Power BI

Connect-PowerBIServiceAccount

Power BI MicrosoftPowerBIMgmt Connect-*

Log in to the Power BI service.

Quick start script

# Connect-PowerBIServiceAccount — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint $thumb -ApplicationId $appId -Tenant $tenantId

# 2. Run and inspect
Connect-PowerBIServiceAccount -ApplicationId <String> -CertificateThumbprint <String> -Credential <PSCredential> | Format-List

# 3. Export for evidence / drift tracking
Connect-PowerBIServiceAccount | Export-Clixml .\PowerBIServiceAccount-$(Get-Date -Format yyyyMMdd).xml

Syntax — 5 parameter sets

User (Default)

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

ServicePrincipal

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

UserAndCredential

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

ServicePrincipalCertificate

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

1 more parameter sets — see the parameter table below.

Parameters (9)

ParameterTypeRequiredWhat it controls
-ApplicationId String yes 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).
-CertificateThumbprint String yes 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...
-Credential PSCredential yes PSCredential representing the Azure Active Directory (AAD) application client ID (username) and application secret key (password) to authenticate with a service principal account (-ServicePrincipal).
-CustomEnvironment String The custom environment to use for the environments returned from the discovery url.
-DiscoveryUrl String The discovery url to get the backend services info from. Custom environment must also be supplied.
-Environment PowerBIEnvironmentType Cloud environment to connect against. Default is Public.
-ServicePrincipal SwitchParameter yes Indicates to use a service principal account, as opposed to a user account.
-Tenant String Tenant name or tenant ID containing the service principal account. If not specified, the 'COMMON' tenant is used.
-Token String yes 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.

Reference facts derived from Microsoft documentation, © Microsoft, licensed MIT; restructured with original guidance by serv365.ai.