Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
96 stars 62 forks source link

v4 build error - Sdk Functions reference minimum version dependencies including Deprecated WindowsAzure.Storage v9.3.3 #603

Closed OzBob closed 1 year ago

OzBob commented 1 year ago

v4 of Microsoft.NET.Sdk.Functions 4.1.3 is used in Azure Functions v4 inprocess dotnet6, but default installed nuget packages installed in VS do not import the latest packages of dependencies.

Issue 1, old versions of dependencies A three deep deprecated package is referenced, i.e. (WindowsAzure.Storage)[https://www.nuget.org/packages/WindowsAzure.Storage/9.3.3]

Example, building an AzFn project with a common 'Services' project for other AzFn projects failed with Binding errors, and missing references, when looking at the definition of CloudQueue, VS would navigate to WindowsAzure.Storage(v9.3.3).

The tree of package dependencies can be seen in the screen shot from a New .net 6.0 Azure Function project template: image

Proposed solution:

  1. Change azure-webjobs-sdk-extensions nuspec from <dependency id="Microsoft.Azure.WebJobs.Extensions" version="3.0.6" to v4.1.3, and other references in samples to:
    <ItemGroup>
        <PackageReference Include="Azure.Storage.Queues" Version="12.2.0" />
        <PackageReference Include="Azure.Storage.Blobs" Version="12.3.0" />
        <PackageReference Include="Azure.Storage.Files.Shares" Version="12.1.0" />
        <PackageReference Include="Azure.Data.Tables" Version="12.7.1" />
        <PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.33" />
        <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.5" />
        <PackageReference Include="Microsoft.Extensions.Azure" Version="1.0.0" />
        <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />
    </ItemGroup>

There is an important reference to "v5", in a Note in the AzFn docs that library projects that wish to reference CloudTable etc. must import the latest packages from nuget.

This is similar to #562 and #110, which might get closed if this issue is addressed.

bhagyshricompany commented 1 year ago

Thanks for updating will check and update you soon

bhagyshricompany commented 1 year ago

One solution to this issue would be to update the WindowsAzure.Storage package to the latest version. You can do this by updating the package in your project's dependencies, either through the package manager in Visual Studio or by modifying your project's .csproj file. It is recommended to check the compatibility with other dependent packages and perform the update accordingly. Also make sure you have the latest version of .NET Core SDK installed and that Visual Studio is pointing to it, This would prevent potential issues with nuget package manager. if not getting resolved please share all the reprosteps

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

lugospod commented 9 months ago

@bhagyshricompany I am looking at your response from January regarding the WindowsAzure.Storage v9.3.3. dependency. This dependency has been deprecated : "Please note, this package was officially deprecated on 3/31/2023 and is no longer maintained or monitored."

Should I open a new issue or is there a known workaround how to avoid this dependancy?

Tnx! Luka