All Function Apps turn to Read only mode after publishing Azure function project via Visual Studio 2017

Viewed 6329

I have a Function Apps created via Portal, another one created by visual studio. The latter one cause both apps to become read only, with message below:

Your app is currently in read-only mode because you have published a generated function.json. Changes made to function.json will not be honored by the Functions runtime

Is this feature correct?

VS: 15.8.5

1 Answers

Yes, this is by design. Function Apps you mentioned should be called functions in one same Function app.

You create a Function app and a function on portal, then in VS you actually also create a Function app instead of a separate function. After you publish this pre-compiled Function app to the one with some existing functions, Azure thinks you want to use the new published one, so it sets the app to be read-only as we can't modify pre-compiled assets on portal unless we republish our code.

This action is by design because one Function app(with functions inside) is handled as a complete unit. So apparently it's not recommended to mix online development with pre-complied one.

Two choices for you to refer.

  1. Remove existing functions in the app. Check Remove additional files at destination when publishing from VS.

    enter image description here

  2. Create another Function app.

There are risks that mixing online and pre-compiled code from VS, for example

  1. Name restriction. Functions created online will be overwritten if we publish functions with same names.

  2. We can't check Remove additional files at destination even though some pre-complied dlls published before have been useless.

If it's only for test or there's no worry about potential risks, just change Function app edit mode to readwrite in Function app settings or add FUNCTION_APP_EDIT_MODE readwrite in Application settings.

Related