Easy access to secure Environment Variables #263
Replies: 10 comments
|
@chumleesockson Hi, have you success in loading the full images with Web API? Could you please share your solution? |
|
@ASIEngineering @chumleesockson I cannot get this to work. I keep running into CSP error. |
It sounds like you need to allow access to the URL: https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/content-security-policy |
The solution is nothing special. You just need to call the right URL. It's unrelated to Code Apps; it's just a Dataverse Web API thing. This is what my URL looks like:
|
|
@chumleesockson I was able to get it to work locally but when published it doesn't work. |
|
I updated the CSP setting as per the guide from @chumleesockson, and it works fine now. https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/content-security-policy |
|
I think my problem is that I’m impatient. After about 30 minutes the CSP policy updated. |
|
Oh really, my policy is updated almost immediately. Good to know! |
|
Looks like environment variable access features are available now. |
|
Hey, I would recommend using the capability documented here (calling Dataverse Actions & Functions) and specifically the RetrieveEnvironmentVariableValue function |

Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I'm loving Code Apps. They're awesome.
How are we expected to utilise environment variables? We can't use a dot env file, and if we use the environment variables in Dataverse then we need to query them from Dataverse and also give the logged in user read access to them, which is obviously not ideal.
This issue arose for me when looking into displaying full images from Dataverse, which might be a separate issue. In order to display full images from Dataverse, my understanding is that you need to use the Dataverse Web API, but that org URL will of course change when the app is deployed, so it needs an environment variable.
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/image-column-data?tabs=webapi#url-to-download-full-sized-image
All reactions