Skip to content

[Bug?] Adding azure-sdk feed breaks NuGet restore #5426

@alston-c

Description

@alston-c

Describe the issue or request
When generating a C# AutoRest client, the following public feed is included in the .csproj file in order to access the Microsoft.Azure.AutoRest.CSharp package.
<RestoreAdditionalProjectSources>https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json</RestoreAdditionalProjectSources>

Previously, when requesting packages not in this feed, it returned a 404, allowing NuGet restore to fall back to the other configured feeds. Some time since the end of September, the feed now returns the below error instead. It continues to be able to successfully retrieve Microsoft.Azure.AutoRest.CSharp.
Response status code does not indicate success: 401 (Unauthorized - No local versions of package '{package name}'; please provide authentication to access versions from upstream that have not yet been saved to your feed. (DevOps Activity ID: {guid})).

This prevents the NuGet restore from completing successfully when the project requires other packages.

Workaround: apply packageSourceMapping in NuGet.Config to restrict the azure-sdk feed to only be used for Microsoft.Azure.AutoRest.CSharp.
Workaround: replicate Microsoft.Azure.AutoRest.CSharp to another accessible feed without upstream sources and remove the azure-sdk feed from the project.

Describe your ideas for solutions
Revert or further alter the settings or configuration of the azure-sdk public feed, preventing it from attempting to replicate upstream packages when a package is not found (by an unauthenticated agent?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatv3Version 3 of AutoRest C# generator.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions