Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I am trying to script the creation of data sources as we are doing a tenant migration.
I have some questions about the following MS scripts but first some background into my environment...
My on-premises gateway was setup using a recovery key (as per https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/EncryptGatew...)
My connections are all SQL with a service principal as the auth
Script 1:
I added in a variable
$Key = "xxxxxxxxxxxxxxxxx"
And when running the script i get no errors
Script 2:
When running the script I am getting errors like
The term 'EncryptWindowsCredentials' is not recognized as a name of a cmdlet, function, script
I changed it to $encryptedCredentials = EncryptKeyCredentials but then all sorts of errors
Is someone able to point me in the right direction?
Thanks,
David
great questions. Make sure to be precise when you say "connections" - you seem to be working on gateway connections, not semantic model connections.
The recovery key has nothing to do with connections, it is only needed when you add or modify gateway cluster members.
You are saying all your SQL sources use Service Principals for authentication> Where are you migrating to?
My goal is to create managed connections. We are busy with a tenant migration (consolidation of multiple tenants into one).
According to script 2 i need to run script 1 first so that is why I am referencing data gateways. But my goal.is to create the managed connections which use the gateway to connect to data. In my case all connections are sql based. The MS documentation on creating datasources seems light on info so these scripts looked great but I am unable to get a result, likely either me misunderstanding the requirements or formatting the body of the REST call.
So looking for some help forming the script to achieve my goal
Personal, biased, subjective opinion: Don't waste your time. Set up the connections from scratch in the new environment. The entire connections API is half baked and very temperamental. A true time sink.
thanks @lbendlin ,
I am leaning towards the same conclusion. Thanks for having a look. Hopefully the API is improved eventually.
Hi, @daive
I'm sorry to hear that you've lost hope, and I can see that you've made numerous attempts to resolve the issue.
However, if you feel that performance improvements are needed, you can
submit an idea on https://ideas.fabric.microsoft.com/. This allows other users with the same needs to vote for your idea, helping to expedite its implementation. Many features of our existing products are designed and upgraded based on customer feedback. As demand increases, this issue is likely to be addressed in the future.
Additionally, if you find lbendlin 's response to be an effective alternative, you might consider accepting it as the solution. This not only acknowledges lbendlin's effort in assisting you but also helps other community members with similar issues find solutions more quickly.
Thank you in advance for your efforts and understanding. I hope these suggestions are helpful to you!
Best Regards,
Leroy Lu
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 |