Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
redec
Frequent Visitor

Mechanism for hidden/magic settings for a custom connector?

I'm writing a custom data source connector, and I'd like to have some hidden mechanism to do magic settings.  Specifically I would like to selectively override the remote URL my extension connects to.  By default my extension would connect to the main production environment, but I'd like a way to configure it (for dev/testing/demos/whatever) to point at one of my staging/preprod environments without needing to do a custom build of the extension for each environment.  A typical enduser should never see anything (I don't want to be outright prompting the user etc).  I was thinking I could just have a magic file on the harddrive which specifies the url, but it seems like any call to File.Contents results in an UnpermittedResourceAccessException, even when running as administrator....I don't really see anything in the framework which could allow for reading envvars or registry keys or anything like that....at this point I'm thinking I could have a sidecar application that opens a port on localhost which my extension will attempt to connect to get dev settings, but that kinda sucks and I'm thinking there must be a better option that I'm missing...anyone have any thoughts/ideas?

1 REPLY 1
redec
Frequent Visitor

Is there a way call an enternal query from an extension? (like the approach taken here https://stackoverflow.com/questions/52878319/load-data-into-power-bi-from-relative-path) ....cuz that would be perfect, except I can't get it to work.  I would have expected Expression.Evaluate("mySettingQuery") to do the trick, but I get "The name mySettingQuery does not exist in the current context".  Heck I can't even figure out how to make this work even if I was prompting the user for it directly - even if it's passed into my main datasource entry point, afaict there's no way to actually pass it through to my authentication StartLogin method, and I can't do anything with side-effects (like set a global var).  It seems like I must be missing something fairly fundamental (I'm very new to this)....is this not a thing people do?  Or do people just resort to having multiple builds for different environments/settings?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.