Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
parik
Frequent Visitor

PBIX file in CI/CD pipeline

Hi guys,

I'm trying to put our PBIX files into a CI/CD pipeline.

I found out how to upload PBIX files to the serivce via PowerShell, works fine. I found out how to change server name and database name (through API, either via parameters or directly).

What I struggle with is how to change credentials for the deployed dataset.

Any ideas?

Thanks!

7 REPLIES 7
SPR02
New Member

Hi,

     Can you please provide me deployment powershell script to deploy pbix files through azure devops.I tried but it is not recognizing the New-PowerBIReport cmdlet.While deploying i was getting the error New-PowerBIReport : Operation returned an invalid status code 'NotFound'.

 

Thanks

Jayendran
Solution Sage
Solution Sage

Hi @parik 

 

I just finshed my article, you can find the full details here.

 

https://social.technet.microsoft.com/wiki/contents/articles/53172.azuredevops-cicd-for-powerbi-repor...

 

Best of Luck !

Hi @parik ,

 

Do you have any update ? If my replay helps please accept it as answer/giving kudos which will help other community members

parik
Frequent Visitor

Hi, any ideas how to approach this are really appreciated. I hope we are not the only one who has a test environment and who wants to automate the deployment process 🙂 
Do you all really manually change the username/password when you are deploying to PROD?
I hope there must be some way to automatize that.

Thanks for any comments!

Anonymous
Not applicable

Hi,

 

I don't think that functionality is available directly within the Powershell Module. If you're using Azure DevOps then there's a plugin available to do what you're asking. Alternatively you could use the Invoke-PowerBIRestMethod method but you need to do some work to create the payload. Also check out Possible to update credentials via REST API? for more information. 

 

Tim

Hi Tim,

thanks a lot for the answer! We are on Azure DevOps. We tried the plugin, but it seems it can only change server and database names. That is also possible to do via API.

What I'm after is changing user name and password - if the Power BI Actions extension can do that, then please correct me - to me it seems it does not provide option for changing credentials of a deployed dataset.

Invoke-PowerBIRestMethod also does not seem to be useful, because AFAIK there is no API for changing user names/passwords.

Petr

Hi @parik ,

 

Unfortuantely the PowerBI Actions is not capable of updating the credentials. 

 

Already a seperate thread is open for your same query.As per that you can use the below 2 API to achieve your request

 

To get the Datasource and gateway id (Virtual Gateway NOT the typical on-premises/personal gateway) the user should use this API:

GET https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/Default.GetBoundGatewayDataSources

 

 

Response:

 

{
    "@odata.context": "http://wabi-europe-north-b-redirect.analysis.windows.net/v1.0/myorg/groups/xxxx-xxxf/$metadata#gatewayDatasources",
    "value": [
        {
            "id": "xxx-xx-xx-xx-xxx",
            "gatewayId": "xx-xxx-xx-xxx-xxx",
            "datasourceType": "Sql",
            "connectionDetails": "{\"server\":\"xxxx.database.windows.net\",\"database\":\"xxxx\"}"
       }
]
}

 

and then to use the set credentials API.

PATCH https://api.powerbi.com/v1.0/myorg/gateways/{gateway_id}/datasources/{datasource_id}

 

Body

{"CredentialType": "Basic", "basicCredentials":{"username":"xxxx","password":passs#1123"}}

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.