Forum Discussion
PBIX file in CI/CD pipeline
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!
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
- parik7 years agoFrequent Visitor
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
- Jayendran7 years ago
Solution Sage
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"}}