Forum Discussion

KarimMomo's avatar
KarimMomo
Copper Contributor
Oct 02, 2023

Azure Function - Update NuGet packages

I recently upgraded Azure function app to V4. However, I'm encountering these error messages:

 

  • Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.Storage to 4.0.4 or later.
  • Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.ServiceBus to 4.2.1 or later.

Here's what I've done so far: 

1. I've downloaded the Function App content

 

2. I've unzip the file and opened it in Visual Studio Code.

3. I installed an extension called NuGet Extension Manager

4. I've installed the latest version of Microsoft.Azure.WebJobs.Extensions.Storage. This is what I see now in my project:

 

Am I doing this appropriately so far ? 
If yes, how do I update the Azure Function online after make these changes to reflect the NuGet updates ?

Thank you

 

 

2 Replies

  • govindagoud's avatar
    govindagoud
    Brass Contributor

    I would suggest finding the main branch of your source code, branch it out as upgrade and update the nugget packages then test it and publish using one of IDE or CI/CD.

     

    check out what are the breaking changes based on your current version of function app.  below links provide you details explaining of migrating function app.s

     

    https://learn.microsoft.com/en-us/azure/azure-functions/migrate-version-3-version-4?tabs=net6-isolated%2Cazure-cli%2Clinux&pivots=programming-language-csharp


    https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio

  • Mehdi-Alipour's avatar
    Mehdi-Alipour
    Copper Contributor

    KarimMomo 

    Hi, 

    by using "app content download" yo will get the compiled project and not the source code, you need either to push using source control or by using azure cli extention for your visual studio code to push new changes to the function app, if you download the compiled code then modify and push it to azure or either try to build and run it locally, might not work.

    if you have access to source code then probably it is possible to apply changes and push the code to function app -> using azure cli extention for VSCode and then it will be overwriten to the function app if you use the same name for deployment. any way the command for deployment is this : 

    you can run it from the project root -> 

     

    func azure functionapp publish <APP_NAME>

     

    you might try to run the func app before deployment and see if it compiles with no error and test it locally before deploying, by using this command :

     

    func start

     

     

    if you have the source code of project -> please let me know so i can help.

     

     

Resources