Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Connect to PowerBi with using Service Connections from ADO

Hi All,

 

Could you please clarify how can I use ADO service connections in scope of powershell scrtip (function) for connectiong to Power BI,

Previously I use Connect-PowerBIServiceAccount with Credential in scope of function in powershell script. Now I need to connect to power bi using ADO service connection. 

I have pipline wich get service connection like a variable.

 

Thanks

3 Replies

  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi  Anonymous ,

    The following article describes how to create a Power BI workspace in an Azure DevOps Pipeline using Powershell,and it also includes how to connect to the Power BI service.

    $DeploymentPrincipalAppId = "Application ID of deployment principal"
    $DeploymentPrincipalAppSecret = "Authentication key for the deployment principal"
    $TenantId = "Azure Active Directory tenant ID"
    
    $credentials = New-Object System.Management.Automation.PSCredential ($DeploymentPrincipalAppId, (convertto-securestring $DeploymentPrincipalAppSecret -asplaintext -force))
    
    Connect-PowerBIServiceAccount -ServicePrincipal -Credential $credentials -Tenant $TenantId

    To learn more details ,refer:

    https://endjin.com/blog/2019/05/how-to-create-a-power-bi-workspace-in-an-azure-devops-pipeline-using-powershell 

    https://4bes.nl/2020/12/20/create-an-azure-devops-service-connection-to-azure-with-powershell/ 

     

     

     

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien

  • Anonymous's avatar
    Anonymous
    Not applicable

    Issue has been solved. 

    • v-luwang-msft's avatar
      v-luwang-msft
      Icon for Community Support rankCommunity Support

      Hi Anonymous ,

      This is good news!

      And could you pls   accept a helpful reply as the solution or share your own solution to help others find it.

       

      Best Regards
      Lucien