Cannot review the uploaded files after initial commit in VSCode

Ben Smith 0 Reputation points
2024-06-27T15:50:31.88+00:00

After initial function app deployment. I return to the Web Portal and cannot review the uploaded files. I am shown 'This function has been edited through an external editor. Portal editing is disabled.'

There is another issue for me is that I cannot clearly see how I can review the execution of the function.

Steps taken below

  • I have created a Function app (called ingestlog-app) in the Web Portal
  • I have configured all the relevant Environment Variables
  • I have configured my VSCode locally and signed into Azure
  • I can see my function in my local VSCode RESOURCES
  • I create a Function in my Local Project folder under WORKSPACE
  • I create my Python code, and Deploy to Azure...
  • I confirm my Deployment and the output shows Deploy to App "ingestlog-app" Succeeded

I return to the Web Portal and navigate to App files. The initial error at the top of this section is This function has been edited through an external editor. Portal editing is disabled. shortly followed by Unable to fetch file content.

I have searched in other posts such as this one https://video2.skills-academy.com/en-us/answers/questions/540309/azure-function-portal-editing-is-disabled and the solution does not work for me.

My ultimate goal is to ingest custom logs stored on blobs into Log Analytics and my script works perfectly on my local machine, but I want it to run using an Azure Function. There is another issue for me is that I cannot clearly see how I can review the execution of the function.

Please advise.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,543 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 6,496 Reputation points
    2024-06-28T12:54:13.31+00:00

    Hello Ben Smith,

    Welcome to the Microsoft Q&A and thank you for posting your questions here and thank you for detailed information.

    Problem

    I understand that you are having Azure Functions issues related to editing and reviewing code.

    Solution

    Regarding information and question, when you create a Python Function App in the Azure Portal, the option to "Download App Content" is disabled. This is because in-portal editing is disabled for Azure Python Functions.

    It is a known limitation and to work around it, you can create a new project locally and copy the necessary files from the Azure Portal:

    • Copy the host.json and requirements.txt files from the Azure Portal > Function App > App Files.
    • From the Azure Portal > Your Function App > Functions > Code+Test menu of the specific function, copy the init.py and function.json files.
    • Paste the contents of these files into your new local project or edit the already published project in Visual Studio Code (VS Code) and publish the changes.

    Secondly,

    To review the execution of your function, follow these steps:

    • In the Azure Portal, navigate to your Function App.
    • Click on the specific function you want to review.
    • Go to the "Code+Test" menu.
    • Here, you can test your function by providing input and observing the output.

    Lastly,

    Another workaround is to set up continuous deployment using GitHub as the source. This way, your project code will be available in GitHub, where you can edit it and push changes to Azure.

    References

    Source: How to edit a read-only Azure Function python code. Accessed, 6/28/2024.

    Source: Similar Answer: Azure function - Portal editing is disabled - Microsoft Q&A. Accessed, 6/28/2024.

    Accept Answer

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.

    Best Regards,

    Sina Salam