4

I'm trying to add a fix to a previously-uploaded Azure Function, and can't seem to get anywhere.

Here's what I have done so far:

  • Trying to make changes through the in-browser editor, a banner at the top of the page pops up:
    This function has been edited through an external editor. Portal editing is disabled.
    Unsurprisingly, trying to type inside shows a Cannot edit in read-only editor message.

  • Next I installed the Azure Functions extension for Visual Studio Code, following this tutorial. Logged in, opened the solution, and still read-only, unable to be edited.

  • I then found this StackOverflow post showing how to download the Function app content, make your changes, and reupload. Unfortunately, the button to download the app content is greyed out in the portal, so I am unable to download the app files.

  • I tried changing the Function app config json by adding the FUNCTION_APP_EDIT_MODE tag and setting it to 'readwrite', to no success.

  • I have also tried directly uploading the fixed file via Azure portal, only to be met with an error saying that it only supports to uploads up to 5MB, despite the fixed file being only 13KB.

Does anyone have experience with this kind of issue? Any insight or pointers would be much appreciated.

Thanks

Ben Townsend
  • 41
  • 1
  • 2

1 Answers1

0

When you create the Python Function App in Azure Portal, the option "Download App Content" will be disabled: enter image description here After publishing the project from VS Code to Azure Function App: enter image description here

It happens because In-Portal editing is disabled for Azure Python Functions. Refer this GitHub Announcement for more info.


One of the workarounds to edit/update your Azure Python Functions code is:

  1. Create a new project and copy these files from the Azure Portal > Function App > App Files:
    • host.json file
    • requirements.txt file

enter image description here

  1. From the Azure Portal > Your Function App > Functions > Code+Test Menu of the Function >
    • init.py file
    • function.json file

enter image description here

Copy the codes of these files and paste them in your new Project.

Or you can edit the already published project in VS Code if you have it and publish the changes.


Another workaround is to set-up the Continuous Deployment using GitHub Source, so your project code is available in GitHub where you have edit option to modify the code from the GitHub and Push Changes to Azure.

enter image description here

Refer to Azure Functions Configure Continuous deployment for more information.


  • Hari, Can you please update image? , as image show broken!! – microset Dec 28 '22 at 06:18
  • 1
    Hi @microset, I can see the images clearly. Check the Internet connection or refresh your browser and try again. – Pravallika KV Dec 28 '22 at 12:50
  • @PravallikaKothaveerannagari & Hari, Can you please see the image https://ibb.co/LgZp4NX. – microset Dec 29 '22 at 05:27
  • @microset, please see this screenshot https://i.imgur.com/ARrBew6.png - it's clearly visible to me and others. –  Dec 29 '22 at 05:33
  • It is unbelievable that this simply does not work in 2023... it seems that nobody uses it. Insufficient docs, insufficient discussions... In Azure we will discover that some features simply doesn't work after many hours struggling with this thing. – Tofani Mar 24 '23 at 12:14