LOST POWER BI GATEWAY RECOVERY KEY? NO PROBLEM
In this post, we will discuss how to restore a Gateway when you lost the Recovery Key, without manually recreating the Data sources for the new Gateway.
I have two Power BI Gateways, one of the Gateways with most of my data sources failed to come back online after an update. I installed a new Gateway to restore the old Gateway that failed to come back online, but I have lost the Recovery Key. For now, there is no way to recover a Gateway recovery key, you can only change Gateway recovery key if you have the existing one.
Let’s walk-through the steps on how to recreate/rebind data sources to a new Gateway using Power BI Rest API and PowerShell.
To run the script in PowerShell, install the following module:
- Install-Module -Name DataGateway
- Connect to the gateway service
- See steps in my previous blog post
These cmdlets require PowerShell 7 or higher.
Step 1. Install a new Gateway.
Note that if you’re restoring the gateway on the same computer with the old gateway installation, you have to uninstall the old gateway on that computer first.
Step 2. Get the old Gateway ID using Rest API or PowerShell, you just need to provide the gateway name or return all gateways to get the ID.
GET https://api.powerbi.com/v1.0/myorg/gateways
Step 3. Get the old Gateway data source Dump using the ID from step 2 above.
GET https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources
Step 4. Recreate/rebind the data sources for specified dataset to the new Gateway. Admin may have to temporarily take over the dataset ownership to complete this step, this use a POST method.
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/Default.BindToGateway
Body
{
“gatewayObjectId”: “1f69e798-5852-4fdd-ab01-33bb14b6e934”,
“datasourceObjectIds”: [
“dc2f2dac-e5e2-4c37-af76-2a0bc10f16cb”,
“3bfe5d33-ab7d-4d24-b0b5-e2bb8eb01cf5” ]
}
Happy Gateway administration 🙂
3 thoughts on “LOST POWER BI GATEWAY RECOVERY KEY? NO PROBLEM”
Great post, thanks for sharing
Awesome post Ruki, thanks for sharing.
This was really helpful for us, thanks so much for sharing.
Comments are closed.