Issue with VS Code Azure Functions Extension Deployment when WEBSITE_RUN_FROM_PACKAGE is set to 1

Miska Wu 0 Reputation points
2023-08-31T04:15:13.5533333+00:00

Hi Microsoft Support,

I am facing an issue with the deployment of my Azure Function app using the Azure Functions extension in Visual Studio Code. I have set the WEBSITE_RUN_FROM_PACKAGE configuration to 1 for my app.

When I use the Azure CLI to deploy the ZIP, everything works perfectly. However, when I attempt to deploy using the VS Code extension by right-clicking on the function app and selecting 'Deploy', the deployment seems to complete without any error messages. But, it's apparent that the app keeps running an older version and the new version doesn't seem to be uploaded to data/SitePackage.

Could you please help me understand what might be causing this discrepancy between the deployment methods and how I can resolve it?

Thank you for your assistance!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,978 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,758 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Konstantinos Passadis 19,166 Reputation points MVP
    2023-09-03T18:07:12.1966667+00:00

    Hello @Miska Wu !

    Welcome to Microsoft QnA!

    For the issue you are mentioning i think you must verify that the latest package-version is correctly uploaded into Azure Blob Storage

    If you have the WEBSITE_RUN_FROM_PACKAGE setting set to 1 for your function app, then the deployment process will do the following:

    1. Package your function app into a .zip file.
    2. Upload this .zip file to an Azure Blob storage associated with the Function App in the data/SitePackages directory.
    3. Update the WEBSITE_RUN_FROM_PACKAGE application setting with the URL of the uploaded .zip in the blob storage. This setting tells the Azure Functions runtime to run the app directly from the package file, without unzipping it.

    You can check Azure logs , through the portal that the latest version is uploaded and so on !

    Now what i am doing is

    Create a New Function APP

    Open a Folder from VSCode ,create my code

    Deploy to Azure Functions , version 3

    Make a change

    Deploy again , ( Dont forget the Pop up , Copy Settings also !)

    User's image

    Please make sure you have the latest azure funtions core tools installed

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-csharp#install-the-azure-functions-core-tools

    Kindly let us know your feedback!


    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards

    0 comments No comments

  2. SnehaAgrawal-MSFT 21,506 Reputation points
    2023-09-06T09:37:37.1333333+00:00

    @Miska Wu

    To add further-

    This issue could be caused by a number of factors, such as caching issues, incorrect configuration settings, or issues with the deployment process.

    To troubleshoot this issue, you can try the following steps:

    1. Check the configuration settings of your function app to ensure that the WEBSITE_RUN_FROM_PACKAGE configuration is set correctly. You can check this by going to the Configuration settings blade of your function app in the Azure portal.
    2. Check if there are any caching issues with your function app. You can try clearing the cache of your function app by going to the Advanced Tools blade of your function app in the Azure portal and clicking on the 'Go' button under the 'Kudu' section. Then, click on the 'Debug Console' button and select 'CMD' to open a command prompt. Navigate to the site directory and delete the wwwroot directory. This will clear the cache of your function app.
    3. Check if there are any issues with the deployment process. You can try deploying your function app using a different deployment method, such as Azure DevOps or GitHub Actions, to see if the issue persists. If the deployment succeeds using a different method, it may indicate an issue with the VS Code extension.
    4. Check if there are any issues with the version of the Azure Functions extension you are using. You can try updating the extension to the latest version to see if that resolves the issue.

    I hope these steps help you troubleshoot the issue. Let us know if you have any further questions.

    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.