Forum Discussion
Configuring nuget azure artifacts source in MacOS
Greetings.
In my company, we are using Azure Artifacts in an Azure Devops Server 2019 on premise instance as an internal package source, and we are trying to work in a .net core project in a MacOS device. We are struggling to configure the internal source here, since in Windows is very easy and takes authentication and authorization from the Active Directory user logged in, but in Mac and Linux, this is obviously not possible.
We followed the instructions of the Azure Artifacts Credentials helper but this doesn't seems to work, even setting the VSS_NUGET_EXTERNAL_FEEDS variable, that usually solves the problem in linux, but in Mac it doesn't work. We also tried to authenticate using a PAT as ClearTextPassword.
Is there any solution for MacOS? Maybe something we're missing out like login in the AD in MacOS credentials provider if that is possible.
I've read of using Visual Studio for Mac but it's no longer an option since it's being discontinued in august 2024, so we are using vscode and dotnet cli from now on.
Regards.
- chamindacBrass Contributor
atlasfoo have you tried using a nuget.config in your project. That makes it work for all platforms. Windows, Linux and in MacOS.
Make sure to replace https://pkgs.dev.azure.com/chamindac/_packaging/ChFeed2/nuget/v3/index.json with your artifact feed and replace %System.AccessToken% with your PAT
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageRestore> <!-- Allow NuGet to download missing packages --> <add key="enabled" value="True" /> <!-- Automatically check for missing packages during build in Visual Studio --> <add key="automatic" value="True" /> </packageRestore> <packageSources> <clear /> <add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" /> <add key="my-devops-feed" value="https://pkgs.dev.azure.com/chamindac/_packaging/ChFeed2/nuget/v3/index.json" /> </packageSources> <activePackageSource> <!-- All non-disabled sources are active --> <add key="All" value="(Aggregate source)" /> </activePackageSource> <packageSourceCredentials> <my-devops-feed> <add key="Username" value="AzDOPAT" /> <add key="ClearTextPassword" value="%System.AccessToken%" /> </my-devops-feed> </packageSourceCredentials> </configuration>