web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Build Automation Add NuGet Package to Azure Artifacts Feed

(0) ShareShare
ReportReport
Posted on by 1,214

Hi,

My goal is to setup Build Automation with Microsoft hosted agents and azure pipeline because we don't have build environment or Build VM. I was referring this article https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-tools/hosted-build-automation .

I downloaded the NuGet packages from LCS shared asset library, and now I need to add them to Azure Artifacts Feed.

In this article https://docs.microsoft.com/en-us/azure/devops/artifacts/get-started-nuget?view=azure-devops#publish-a-package , I got stuck here:

publish-nuget.PNG

For No 5, does it mean to create the nuget.config file for each project in Trunk/Main/Projects? If I have 10 projects, do I need to create nuget.config file for all 10 projects?

For No 6, we are supposed to run PowerShell in DEV environment, correct? But where exactly is nuget.exe file?

Since it's DEV environment, I assume that we already have the latest NuGet, am I right? How to verify whether NuGet already installed and which version?

Thank you.

I have the same question (0)
  • Verified answer
    Joris dG Profile Picture
    17,775 on at

    Although you have 10 projects, I assume (hope?) that you only really have 1 or 2 actual different packages. You only need one project per package you want to compile, which is likely not 10.

    That said, our build pipeline runs nuget restore ONCE for the whole pipeline, and does not restore the packages during each project's compile.

    Both things together, you truly only need 1 nuget.config and package.config . If you use the templates we have on GitHub, they have a variable that points to the 1 location for nuget.config and packages.config. By default, they're assumed inside the /metadata folder of your source code repository, but of course you can change it easily (that is why we made it a variable :-)

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Hi Joris,

    Sorry, but I'm not sure if I follow. These are my perspectives currently:

    In DEV environment, we created one Visual Studio project for each custom model, so that we can make the models as flexible as possible for deployment to UAT & Production. We didnt' use source control at all before.

    Now that  we have setup source control, the repository looks like this:

    afi-repos.png

    Article says to place the nuget.config file in same folder as .sln file. So I assume it's referring to Trunk/Main/Projects/Project1, Trunk/Main/Projects/Project2, Trunk/Main/Projects/Project3, etc... because these are the only place with .sln file that I can think of.

    Am I looking at the right place though?

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Joris has already mentioned  about projects  but just to clear your confusion let me iterate it again , you can have single solution and add your project to this solution for each separate model you have then you can put  nuget.config , packages.config file  and solution  which has all your projects you can put it in a same folder . Hope this clears your confusion.

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Hi Sukrut,

    I'm still confused.

    So where exactly should I put nuget.config and packages.config? Is it inside Trunk/Main/metadata? or Trunk/Main/Projects? or Trunk/Main? There's no sample screenshot how the folder content would look like, so I'm confused.

    By the way, we created one solution for each project in DEV. So we have multiple solutions.

    Do we need to rearrange the projects into one solution first? Is there any way to work with multiple solutions?

    Also, the three nuget packages from LCS, I need to publish them using this

    nuget.exe push -Source "AFI_Feed" -ApiKey az 

    am I right? I'm confused with these things as well. Please confirm if these are right & correct if I'm wrong:

    -Source

    dev.azure.com/<organization>

    -ApiKey

    where to find this api key?

    <packagepath>

    C:\NuGet\microsoft.dynamics.ax.application.devalm.buildxpp.nupkg

    C:\NuGet\microsoft.dynamics.ax.platform.compilerpackage.nupkg

    C:\NuGet\microsoft.dynamics.ax.platform.devalm.buildxpp.nupkg

    Thank you.

  • Verified answer
    Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    Joris already mentioned the location ("By default, they're assumed inside the /metadata folder of your source code repository, but of course you can change it easily").

    Trunk/Main/Projects contains projects you use for development. They're irrelevant for deployment; don't worry about them. You can have hundreds solutions and projects for development (we have), but you'll still create a single deployable package. The .csproj file for builds is something else than your .rnrproj files you use for F&O development.

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    Also, if you have one solution with multiple projects, msbuild will figure out the correct order in which to build them (assuming they have some references/dependencies on each other). If you have one solution per project and ask msbuild to build it, it will just build one-by-one regardless of dependencies. That will likely cause compile errors.

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    I see. So it doesn't matter in which folder as long as inside the DevOps project repository.

    So I created the nuget.config file in Trunk/Main folder.

    Then following the article, I try to publish the package using the NuGet.exe in DEV environment C:\DynamicsTools folder with PowerShell.

    But I get 'Request Entity Too Large' error:

    nuget-powershell.png

    What did I do wrong?

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Looks like the NuGet.exe in C:\DynamicsTools folder is only Version 2.8.50506.491.

    So I downloaded the latest version 5.7, then I run powershell script to install credential provider.

    And I try to push again, but it keeps asking for credentials:

    nuget-push-credentials.png

    What am I missing here?

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Didn't expect it to ask for credentials 4 times. But still, it failed with Unauthorized error:

    nuget-push-unauthorized.png

    Why is the administrator id unauthorized?

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    It's because the credentials provider was missing netfx.

    credprovider.png

    I made sure to install both netfx and netcore.

    The packages were pushed successfully.

    artifacts.png

    Thank you for all your help! :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans