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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
EHP
Advocate I
Advocate I

[Expression.Error] We couldn't find the file 'secrets.json'

Hi there,

 

I'm getting this error "[Expression.Error] We couldn't find the file 'secrets.json'" in VS in my custom connector.  It happens when I try to use values from my Azure environment secret file, 'secrets.json', to login to my OAuth2.  I've already amended the Project item properties' Build Action to Compile, but it's still not detecting it.  Any suggestions?

 

I've already tried File.Contents but that made me sign in with Windows credentials, plus the absolute path will change between users and deployment.  I've included a simplified example of what the secrets.json file looks like.

 
 

Capture.PNG

 

EHP_0-1601537149399.png

 

1 ACCEPTED SOLUTION
EHP
Advocate I
Advocate I

I found a solution - adding this section to the .mproj file worked.  A rebuild of the solution after changing the file property to Compile may also have worked too.

 

<Compile Include="secrets.json">
<SubType>Content</SubType>
</Compile>

View solution in original post

2 REPLIES 2
EHP
Advocate I
Advocate I

I found a solution - adding this section to the .mproj file worked.  A rebuild of the solution after changing the file property to Compile may also have worked too.

 

<Compile Include="secrets.json">
<SubType>Content</SubType>
</Compile>

v-yingjl
Community Support
Community Support

Hi @EHP ,

Glad to hear the issue is solved. You can accept your reply as solution, that way, other community members could easily find the answer when they get same issues.


Best Regards,
Yingjie Li

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors