How do I upgrade from Microsoft.NET.Sdk.Functions 1.0.13 to 4.0.1?

Rick Krause 21 Reputation points Microsoft Employee
2022-01-27T20:31:24.187+00:00

I need to upgrade a function app to a newer version of Microsoft.NET.Sdk.Functions because of a vuln in a dependent package. I'm currently on 1.0.13, and when I try to upgrade to 4.0.1 I get a bunch of build errors. For example:

The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

This is in a file that is using Microsoft.Azure.WebJobs.Host. And in that same file:

The type or namespace name 'TraceWriter' could not be found (are you missing a using directive or an assembly reference?)

Which I guess came from the Microsoft.Azure.WebJobs.Host namespace.

Is there a guide somewhere about changes that are needed when upgrading from version 1x to version 4x?

Note that I see these same errors when trying to go to 3x, so I expect that's where the significant changes started.

Thanks,
Rick

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

Accepted answer
  1. Pramod Valavala 20,591 Reputation points Microsoft Employee
    2022-01-31T09:52:30.007+00:00

    @Rick Krause This package is versioned along with the Azure Functions runtime. Both V1 and V2 Functions use 1.x versions of this package. The newer versions of the package are required by V3 (3.x) and V4 (4.x) Functions.

    For vulnerabilities, you could just try updating to the latest 1.x version of the package - 1.0.38 - and see if they are resolved.


0 additional answers

Sort by: Most helpful