Ticket T818634
Visible to All Users

DevExpress NuGet - How to hide unique NuGet feed in Azure DevOps Build pipeline

created 5 years ago

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?

Show previous comments (1)
MS MS
Marcel Steinbach 5 years ago

    Using Reporting from Devexpres Universal Subscription.

    DevExpress Support Team 5 years ago

      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.

      MG MG
      Manuel Grundner 5 years ago

        I came up with this question not a long ago, and nugget supports environment vars in theirs nuget config.

        Answers approved by DevExpress Support

        created 5 years ago (modified 4 years ago)

        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.

        Alternative approach with NuGet feed URL

        I've found the following configuration that allow you to hide our NuGet feed from other users:

        1. Create a secret variable for your Build pipeline and set its value to your unique feed URL:
        2. 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)"
        1. 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>
        1. 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.
          Comments (1)
          SG SG
          Simon Geering (Compound Logic Limited) 5 years ago

            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!

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.