Azure Functions App is Read Only after publishing

扶醉桌前 提交于 2020-12-12 11:17:07

问题


I have several Azure Functions Apps (c#, javascript and python) and after some time they were all randomly set to Read Only mode. The strange thing is that only one of these 3 function apps were updated before this happened. I know that this is not necessarily a problem, but I want to be able to make edits from the portal.

I can't open App Service Editor

I can't set the app to Read/Write from Function App Settings -> Function app edit mode I also tried using "func azure functionapp publish myAzFuncAppName --nozip", but with the same result


回答1:


Of course. Please notice that if the function is 'deployed' to Azure, what will be deployed is the compiled file.

For example, if you deploy C# function app, what will be deployed is the dll file. So this is why it is readonly.

Changes to the code should be done before compiling them into corresponding 'cannot be edited' files, which requires special attention.

But for the modification of the declarative part and the configuration part of the function, this is possible, the specific steps are as follows:

Declarative part:

Then click Debug Console > cmd:

Go to site\wwwroot[yourfunctionname], and there will be a function.json.

Click the 'pen' to edit and don't forget to save.

Configuration part:




回答2:


You can change the settings from Azure Portal or by editing the application settings. FUNCTION_APP_EDIT_MODE allows values readwrite and readonly, a




回答3:


Just deleted the Azure Function App, created a new one, transferred the code in the new one and deployed -> still read only, but now I was able to open "App Service Editor" and remove "generated by..." from function.json and then set "Read/Write" from Function App Settings -> Function app edit mode.

Still... I can't see/edit the code of the function, only of function.json and if I redeploy using Azure extensions of Visual Code or powershell with --nozip attribute, the "generated bla bla" appears again :(




回答4:


When the application runs from package, the files are loaded from that package. Hence those files are not editable.

You need to set WEBSITE_RUN_FROM_PACKAGE : 0 in app settings and redeploy the application again to make the function app editable.

refer https://social.msdn.microsoft.com/Forums/en-US/972d843c-8bdc-4cfc-9c6d-263df196d37c/azure-function-app-readonly-mode?forum=AzureFunctions

UPDATED:

You can deploy functionapp through command line from visual studio code. Try below command.

func azure functionapp publish --nozip

The nozip flag would set Run-From-Package mode off .

you can access other information regarding that command with func azure functionapp publish --help



来源:https://stackoverflow.com/questions/59813405/azure-functions-app-is-read-only-after-publishing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!