Download existing Azure Function to workin VSCode

Noel 25 Reputation points
2023-08-29T20:11:43.2566667+00:00

Some time ago I developed an Azure Function and uploaded it to Azure, everything via VSCode. Now some time has passed and when I log in my Azure account in VSCode, the function is not there anymore, so I want to download it from the Azure Portal.

I have seen that some people downloads it from the Azure Portal using the option "Download App Content", but as you can see it is not available in my case, I don't know why.

Captura de pantalla de 2023-08-29 22-01-12

Instead, I have tried to download it from the option "Download by SAS Url" in VSCode:

Captura de pantalla de 2023-08-29 21-50-03

and after dselecting a directory, it asks for an Azure Storage SAS Url, which I am not sure how to find. My attempt has been to download the content of "Get publish profile" and copy the Web Deploy publishUrl value. Then, for the token, I have navigated to the Function's Storage Account --> Shared Access Signature and I have generated a SAS Token. Lastly, I have concatenated these two values and that is what I fed to the VSCode. It looks something like:

functionName.scm.azurewebsites.net:token

VSCode accepts it as a valid SAS Url and starts to download the function, but it stays downloading forever.

Any help solving this issue? I dont really want to create a new function app just to make a minor change.

Thank you very much in advance.

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

Accepted answer
  1. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2023-08-30T08:01:36.8266667+00:00

    @Noel Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    If the function app exists in your subscription, then you can find that particular function app in vscode under resources section.

    User's image

    Upon testing by creating multiple functions apps in our internal subscription. We found that windows-based function app will support download app content from portal and for Linux based app this option is greyed out as shown below.

    Below is the reference image for Windows-Based Function App :

    User's image

    Below is the reference image for Linux-Based Function App :

    enter image description here

    We have tried downloading the function app content in VS using the Download by SAS URL option we are able to download the function app files but the downloaded files have only host.json it doesn't have any information related to project solution of the function.

    If you want to download the app content of your function app, you can use any of the below methods.

    1. By downloading publish profile of your function app and there by passing those credentials to any FTP client like FileZilla you will be able to access the content of the function app. Refer to this similar SO thread.
    2. Using this REST API (https://<function_app>.scm.azurewebsites.net/api/zip/site/wwwroot/) to download the content under the site/wwwroot as zip file.

    Feel free to reach back to me if you have any further questions on this.


0 additional answers

Sort by: Most helpful

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.