How to disable Read Only mode in Azure Function App?

后端 未结 2 530
青春惊慌失措
青春惊慌失措 2020-12-20 15:29

I create a new Function App (v2) from Azure portal. Then I initiate a new app on my local computer with help of Azure Functions Core Tools v2.3, and publish it to my new app

2条回答
  •  有刺的猬
    2020-12-20 15:51

    Part 1 - Disabling read-only mode

    You'll likely find if you're using the latest tools that your function app is in run-from-package mode, which means it's reading the files directly from the uploaded ZIP and so there's no way to edit it. You can turn that off by deleting the WEBSITE_RUN_FROM_ZIP or WEBSITE_RUN_FROM_PACKAGE application setting in the portal. Note this will clear your function app until the next time you publish.

    If your tools are a little older, or if you've deployed using the latest tools but with func azure functionapp publish my-app-name --nozip then you can use the App Service Editor in Platform Features in the portal to edit the function.json files and remove the "generatedBy" setting, which will stop them being read-only.

    Part 2 - Creating proxies

    You can add proxies to your local project by populating a proxies.json file in the app root (alongside host.json). More information is at https://docs.microsoft.com/en-us/azure/azure-functions/functions-proxies, and a few examples are at https://docs.microsoft.com/en-us/sandbox/functions-recipes/proxies. You can also create proxies in the portal (when not read-only!) and then use the advanced editor to get the source to add to your project.

提交回复
热议问题