Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add proxies.json to read only function app?

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?

like image 371
Nischala Reddy Avatar asked Nov 24 '17 06:11

Nischala Reddy


People also ask

What is proxies JSON?

Proxies.json is defined by a proxies object, which is composed of named proxies and their definitions. Optionally, if your editor supports it, you can reference a JSON schema for code completion. An example file might look like the following: JSON Copy.

What is AzureWebJobsStorage used for?

AzureWebJobsStorage. The Azure Functions runtime uses this storage account connection string for normal operation. Some uses of this storage account include key management, timer trigger management, and Event Hubs checkpoints. The storage account must be a general-purpose one that supports blobs, queues, and tables.

How do you call a function app from API?

In the Add a new API list, select Function App. Click Browse to select Functions for import. Click on the Function App section to choose from the list of available Function Apps. Find the Function App you want to import Functions from, click on it and press Select.


2 Answers

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

like image 132
AshleyS Avatar answered Oct 09 '22 05:10

AshleyS


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.

like image 42
Chris Anderson-AWS Avatar answered Oct 09 '22 04:10

Chris Anderson-AWS