5

I have a Function App and deployed functions using Visual Studio, so it became read only and unable to add proxies to read only function app. How can I add proxies to my Function App from Visual Studio?

hjavaher
  • 2,589
  • 3
  • 30
  • 52

2 Answers2

7

I had this exact problem but when I added the proxies.json file to the project, it would never be published. I discovered that I had to edit the project's csproj file and find the proxies.json file XML element:

    <None Update="proxies.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>

and change CopyToPublishDirectory to PreserveNewest with: <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>.

AshleyS
  • 2,191
  • 2
  • 20
  • 23
4

Add your proxies.json file in the root of your Visual Studio project and make sure to mark it as "include in output".

Alternatively, you can go to Function App Settings and toggle "read only" to "read/write" to allow the portal to be editable again. Just beware, your proxies.json file might get deleted when you deploy from VS again (if you select "remove files at destination" when you publish). Be sure you add it to your VS project.

Chris Anderson
  • 8,305
  • 2
  • 29
  • 37