Forum Discussion
Setting workspace domain via API
Where do you find domain info from the scan? I can't find anything 😞
- Thor892 years agoFrequent Visitor
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/workspace-info-post-workspace-info
I run the metadata scan with all argumets set to true and the domain id is then included in that result set.Not sure which one of them adds it or it's part of the default execution I at least get it from this call.
Example URL:
Note that this will only get you the domain id of the workspaces that a domain has been set for. It does not allow you to set the domain. I've still not found an API way to do that. I ended up writing a bot to do it via the UI so that I could set the domain on all my orginizations workspaces.
- bengtsson_peter2 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!
letSource = 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_peter2 years agoFrequent Visitor
I guess my next question is: "How do I get the domain names"?