Source code setup for Azure Functions and run

Krishnamohan Nadimpalli 406 Reputation points
2022-11-09T18:32:59.157+00:00

Hi

I have a function app which has two functions and they both work with Http Triggers. This was developed by someone in the past. I am new to the Azure Function App Technology.

I am unable to change any code through the Azure portal as it says "This function has been edited through an external editor. Portal editing is disabled." Following is the screenshot.

258856-image.png

Now I connected through Visual Studio Code and still I am unable to change anything and when I try to change it says "Cannot edit in read-only editor" . How do I edit this ?

258836-image.png

I do not have a source control setting for this function app. How do I enable source control through Azure Devops. I have a repo in Devops specifically for these functions.

Please guide me on this.

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

Accepted answer
  1. Roderick Bant 2,056 Reputation points
    2022-11-09T21:05:01.01+00:00

    I checked this in the Github project for the Azure functions extension for vscode. This issue indicates editing of published functions is not supported in visual studio code. So that is why it is only shown in read only mode.

    You can enable editing of the function in the Azure Portal by going to the Configuration blade under the Settings menu in your function app and add or edit a variable named FUNCTION_APP_EDIT_MODE and give it a value of readwrite to enable editing from the portal.

    If you want the published function app code it is available in the storage account tied to the App. TO find the name of the storage account, again on the Configuration blade, click the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING to find the connection string. In that string the AccountName indicates the name of the storage account holding the files.


1 additional answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-11-11T04:50:47.027+00:00

    Hi @Krishnamohan Nadimpalli ,

    Thanks for reaching out to Q&A forum.

    When an azure function is deployed from Visual studio/Visual code or any other deployment pipeline, it becomes pre-compiled code and it cannot be edited in the portal. Please note that you can only edit the code in portal when it is developed in portal. It appears that your python function was deployed from VS code so you are not able to edit in the portal. Only way to edit is to make changes to the VS code functions project and deploy again.

    Since you already have this repository in Azure devops, you can create a new build and release pipeline to deploy to Azure functions. Please follow any one of the below articles for deployment

    https://learn.microsoft.com/en-us/azure/devops-project/azure-devops-project-functions
    https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-function-app?view=azure-devops
    https://medium.com/bb-tutorials-and-thoughts/how-to-build-ci-cd-for-python-azure-functions-using-azure-devops-7087a76e535b

    Hope this helps! Feel free to reach out to me if you have any questions or concerns.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.