I've stored my personal nuget feed url in nuget.config. nuget.config is used by azure build pipeline.
It is possible to hide the api key for other developers? Using azure service connections for example?
DevExpress NuGet - How to hide unique NuGet feed in Azure DevOps Build pipeline
Answers approved by DevExpress Support
Hi Manuel,
Use the recommendations from the Integrate NuGet to Popular Continuous Integration Systems - Azure DevOps - Feed Authorization Key help topic to configure the Azure DevOps pipeline with our NuGet Feed Authorization Key.
I've found the following configuration that allow you to hide our NuGet feed from other users:
- Create a secret variable for your Build pipeline and set its value to your unique feed URL:
- To use a secret variable, it's recommended to map it to an environment variable: Azure DevOps - Variables - Secrets.
Add the "Power Shell" or "Command Line" step to your Build and add a script that will do this task Azure DevOps - Setting and Using Variables in PowerShell Scripts:
Code#PowerShell
Write-Host "##vso[task.setvariable variable=DX_NUGET_PUB;]$(DX_NUGET)"
- Use the variable in your NuGet.config file:
XML <packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="DevEx" value="%DX_NUGET_PUB%"/>
</packageSources>
- Configure the NuGet restore task to use feeds from the NuGet.config file as it's described in the Azure DevOps article.
As a result, your NuGet feed is stored in a secret variable and not visible in NuGet.config and in build logs.
Thanks this worked to help get my Blazor project working in Azure DevOps CI.
I would recommend adding a link to this on the main NugGet page https://nuget.devexpress.com/ as it is hard to find!
Hello Marcel,
Would you please elaborate on your inquiry and clarify the development platform (WinForms, ASP.NET, WPF, DevExtreme, VCL, …) and DevExpress component you are referring to in your question? This will help me forward your question to a corresponding specialist.
Thanks in advance.
Using Reporting from Devexpres Universal Subscription.
Hi Marcel,
We don't provide any special tools for hiding the NuGet URL on Azure DevOps. In some CI/CD systems (jFrog Artifactory, Nexus OSS), an administrator can add a custom upstream source with NuGet packages. Then, the system generates a proxy URL available to other users.
However, Azure DevOps does not support custom upstream NuGet sources at the moment: Add public upstream sources to an existing feed.
Currently, we have not researched if it's possible to use Azure Service Connections to accomplish this task. I'll review how it works and let you know once I have any news.
I came up with this question not a long ago, and nugget supports environment vars in theirs nuget config.