Forum Discussion

SamInogic's avatar
SamInogic
Icon for Super User rankSuper User
1 year ago
Solved

Help with Editing Data Source Credentials in PowerShell for Power BI Embedded Dashboards in D365 CRM

Hello, We are currently migrating Power BI embedded dashboards from one Dynamics 365 CRM tenant to another. The process involves creating a new Power BI report within a workspace. Since the Dynamic...
  • SamInogic's avatar
    1 year ago

    Hi,

     

    Thanks so much for all your help and suggestions. After trying the different recommendations, we followed these steps, and it resolved the issue:

    $body = @{

        "credentialDetails" = @{

            "credentialType"         = "OAuth2"

            "encryptedConnection"    = "Encrypted"

            "encryptionAlgorithm"    = "None"

            "privacyLevel"           = "Organizational"

            "useCallerAADIdentity"   = $true

        }

    }

     

    # Convert the body to JSON format

    $jsonBody = $body | ConvertTo-Json -Depth 5

     

    Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/gateways/$($datasource.GatewayId)/datasources/$($datasource.DatasourceId)" -Method PATCH -Body $jsonBody

     

    I appreciate the time you all took to assist me.

     

    Thanks!