Forum Discussion
Thor89
3 years agoFrequent Visitor
Setting workspace domain via API
Does anyone know if there is a way to set the new domain feature via the API? I have more than 1300 workspaces to set and doing that by hand is not really an option. I've seen that the domain info ...
bengtsson_peter
2 years agoFrequent Visitor
Well, this is a bit wierd... I do the same thing. When I get to the step where I expand the column with the scan records, I only get these columns:
BUT - if I after the expansion manually add "domainId", I do in fact get the domains!
let
Source = Result,
workspaces = Source[workspaces],
#"Converted to Table" = Table.FromList(workspaces, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "name", "type", "state", "isOnDedicatedCapacity", "domainId", "reports", "dashboards", "datasets", "dataflows", "datamarts", "users"}, {"workspace_id", "workspaceName", "type", "state", "isOnDedicatedCapacity", "domain_id", "reports", "dashboards", "datasets", "dataflows", "datamarts", "users"}),
#"Changed column type" = Table.TransformColumnTypes(#"Expanded Column1", {{"workspace_id", type text}, {"workspaceName", type text}, {"type", type text}, {"state", type text}, {"isOnDedicatedCapacity", type logical}, {"domain_id", type text}, {"reports", type any}, {"dashboards", type any}, {"datasets", type any}, {"dataflows", type any}, {"datamarts", type any}, {"users", type any}})
in
#"Changed column type"
bengtsson_peter
2 years agoFrequent Visitor
I guess my next question is: "How do I get the domain names"?
- Thor892 years agoFrequent Visitor
That's a bit of manual work.
Go to the domain settings in the admin portal, there you'll have a list of all the domains by name.
Click a domain and the settings for that domain will open up, the url will be something like this https://app.powerbi.com/admin-portal/domains/{GUID}?experience=power-bi
You then have the Name of the domain as well as it's GUID in the URL, the GUID is the domain id in the metadata scan.