Commands › Power BI

Set-PowerBICapacityEncryptionKey

Power BI MicrosoftPowerBIMgmt Set-*

Updates the encryption key for the Power BI capacity.

Quick start script

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

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-PowerBICapacityEncryptionKey
$before | Format-List

# 3. Make the change
Set-PowerBICapacityEncryptionKey -Capacity <Capacity> -CapacityId <Guid> -Key <EncryptionKey>

# 4. Verify and diff
$after = Get-PowerBICapacityEncryptionKey
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 3 parameter sets

KeyNameAndCapacityId (Default)

Set-PowerBICapacityEncryptionKey -KeyName <String> -CapacityId <Guid> [<CommonParameters>]

KeyNameAndCapacity

Set-PowerBICapacityEncryptionKey -KeyName <String> -Capacity <Capacity> [<CommonParameters>]

KeyAndCapacityId

Set-PowerBICapacityEncryptionKey -Key <EncryptionKey> -CapacityId <Guid> [<CommonParameters>]

Parameters (4)

ParameterTypeRequiredWhat it controls
-Capacity Capacity yes The capacity entity to update.
-CapacityId Guid yes ID of the capacity to update.
-Key EncryptionKey yes The encryption key entity to use.
-KeyName String yes Name of the encryption key to use.

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