Forum Discussion

EHP's avatar
EHP
Icon for Advocate I rankAdvocate I
5 years ago
Solved

[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.

 
 

 

 

  • 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>

2 Replies

  • EHP's avatar
    EHP
    Icon for Advocate I rankAdvocate 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's avatar
      v-yingjl
      Icon for Community Support rankCommunity 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