My last two blog posts detailed some frustration that I ran into when working with Power Query. First the issue that I couldn’t trust folders, but got stuck trusting files, and then the issue where I overloaded my credentials area. I’ve actually got a solution, in a way, for both.
One thing to be aware of here… there are actually two distinct entities that show up in the Data Source Settings dialog: Security Credentials and Data Privacy Settings. You can see this in the following picture:
Notice how Exchange and the Database don’t show a privacy level on the right? Those are security credentials. Interestingly here, you can see two entries for the same thing (like a website), where one is the security credential, the other the privacy setting.
Okay, with that out of the way, let’s get on to the solutions…
Clearing out Security Credentials
In my last post I had over 700 security credential entries for ip-api.com that needed to be cleared. To clear them manually took clicking the item, clicking delete and clicking ok before moving on to the next item. Even if I could do one click per second (I find this UI slow and sometimes I missed the target), it would still take me 35 minutes. I really wanted a “remove all” feature. Sure I’ll lose Exchange, sure I’ll lose my database, but so what. Small pain vs spending 30-60 minutes clicking Delete.
So I coded something to do it. The download link is at the end of the post, but one of the features of the tool is to let you clear out your entire list of security credentials with on click:
And voila!
Now, are you going to use this every day? Hell no! But if you screw up like I did, you just may need a weapon like this in your arsenal. 🙂
“Trusted” Folders/Files and URLs
As I mentioned in my last post, Ehren, a developer on the Power Query team messaged me on Twitter to tell me of one solution to the “Trusted Folder” problem.
If you set the privacy level for the folder, it applies to everything within that folder, including files in subfolders
Now that sounded cool. So I set out to test it out. First thing I did was went to add a new Folder to my Data Source Settings dialog and… there’s no option to do that. Hmm… okay… so how?
Well, you could go and build a solution that references a folder, just so that you can get a folder in there, I suppose. But that’s awkward and contrived really. You have to waste a bunch of time concocting something you hope will work. And the worst part to me is that I don’t just have to do it on my system, I somehow have to deploy it to other people as well. Ugh.
Screw it, I’m building a tool. Here’s the features of what we’ve got:
Clear out all privacy levels
To be fair, this was probably more useful for me while testing, but I included it in case you run into the same issues. Basically you click this button:
And now all the Data Privacy Settings are gone too:
Add Folder
So this one is way more useful to solving my issues. I’m going to click “Add Folder” on the left. It will let me browse for a folder:
And prompt me for the Privacy Level:
And once I click OK, it sets it up as a folder in the Data Source Privacy settings. And yes, it really does trust all files in all subfolders:
Add Files
Same thing really, it just allows you to select a specific file. This is a bit redundant to just declaring them as you go along but hey, once I already wrote the code for the folder this was a snap to add:
Add URLs
I love this one. Easy to use, just provide the URL and the privacy level:
And boom! There you are:
And again, this trusts all sub-sites of the main domain. This was particularly key for me as I’m querying data from this site and have to provide a different URL for each year.
Now, again, on this one, the first time you query the site you’ll get another entry for each URL you touch:
This is because you have declared the privacy level, but not the security (unfortunately I can’t get in to modify the security files, for obvious reasons.) So here’s what I’m going to do to fix this:
- Select the first URL in the list
- Click Edit Credential
- Change the setting to apply to the root domain:
- Click Save
You’ll notice that the first one disappears now. What actually happened was that it merged the security credentials with the privacy level in one entry. Cool. So now I’ll just go back and delete the other two. And it never asks me again on refresh. 🙂
The “Big Red Button”
So when it all goes really wrong, and you want to reset Power Query to a default state, what then? That’s what this button is for. It will wipe out all of your security credentials, data privacy settings, reset your Power Query formula bar and more. It’s like a total factory reset of Power Query.
Some More Technical Stuff
I’ve now had this installed on Office 2010, Office 2013 Professional Plus and Office 365 Pro Plus versions of Excel, both 32 and 64 bit. In addition, it’s been installed on Windows 7 Pro and Windows 8.1 systems as well.
Interesting enough, despite being an .MSI installer file, in my tests it has NOT required admin privileges to install. (On one machine I installed this first without prompting, then got prompted for admin credentials when I went to update Power Query.)
Some Final Observations
I found this project pretty interesting, and it’s given me some ideas for some more useful tools to work with Power Query and other Power BI add-ins. While I can’t promise a timeline on delivery, I do plan on adding a bunch of new useful stuff to this add-in and releasing a Pro Tools version at some point.
Before you download and install this, I also want to make something very clear. THIS IS BETA SOFTWARE. I’m pretty sure it’s stable, and shouldn’t affect anything else, BUT YOU DOWNLOAD AND INSTALL AT YOUR OWN RISK.
The Installer
You can download the installer here.
7 thoughts on “Power Query “Trusted” Locations”
Clicking on the link takes me back to the main site.
Hi Sam,
Thanks for this. Not sure why that happened, but I've fixed the link. It should work for you now.
Doesn't work on Excel 2016.
Ah shoot. Something must have changed here. I'll have to cycle back and look at this again.
Hi I am unable to install anything on my company computer
Will you please give me way to do it without installing
I believe that there is an option to clear all the permissions right on the Data Source Settings dialog now.
Pingback: Workbook Privacy Settings