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, ...
Suggested Answer

Dynamics AX 2012 :release pipeline

(0) ShareShare
ReportReport
Posted on by 5

Hi champs ,

I'm implementing CI\CD in AX2012 using Azure DevOps and my build succeeded and generated an Artifact file (which is .AX model)

however my release pipeline has following function to install the .AXmodel file which is a build artifact 


function Install-Model($folder, $file)
{
if($file -ne $null -and $folder -ne $null)
{

$newModel = $file.Replace('.axmodel','')

$file = join-path $folder $file
if((test-path $file) -eq $true)
{
$exp = ''

$modelName = Get-ModelName($file)
Write-Host $modelName
$instVer = Get-InstalledVersion($modelName)
$newVer = Get-FileVersion($file)

$extraArguments = ''
Write-InfoLog ("code reached before if and extraargs value here is {0}" -f $extraArguments)

if($importOverrideParams -ne $null)
{
if($importOverrideParams.Contains($modelName))
{
$extraArguments = $importOverrideParams.Get_Item($modelName)
Write-InfoLog ("code reached if and extarguments value here is {0}" -f $extraArguments)
}
}
if ($instVer -ne "")
{
if ($newVer -ne $instVer)
{
Write-InfoLog ("Replacing model {0}, old version {1} with new version {2} and extra args {3}." -f $newModel, $instVer, $newVer, $extraArguments)
$exp = 'Install-AXModel {0} -File "{1}" -replace "{4}" -NoPrompt -Server "{2}" -Database "{3}" ' -f $extraArguments, $file, $sqlServer, $sqlModelDatabase, $modelName
write-host $exp
}
else
{
Write-InfoLog ("Skipping model {0}, installed version is identical {1}" -f $newModel, $newVer)
}
}
else
{
Write-InfoLog ("Installing model {0}, version {1}, extra args {2}." -f $newModel, $newVer, $extraArguments)
$exp = 'Install-AXModel {0} -File "{1}" -NoPrompt -Server "{2}" -Database "{3}" ' -f $extraArguments, $file, $sqlServer, $sqlModelDatabase
}

if ($exp -ne '')
{
Invoke-Expression $exp
}
}
}
}

However I see the below error after running this script , can you please post your thoughts on the same .

2020-07-09T17:51:38.0026450Z U******e
2020-07-09T17:51:38.6588855Z 7/9/2020 7:51:38 PM - code reached before if and extraargs value here is  
2020-07-09T17:51:38.6588855Z 7/9/2020 7:51:38 PM - Replacing model U*****e, old version 6.3.20200604.2 with new version 6.3.20200629.1 and extra args . 
2020-07-09T17:51:38.6588855Z Install-AXModel  -File "C:\Vsts_Agent\_work\r2\a\LM Build.Stream1\drop\Application\Appl\U******e.axmodel" -replace "U******e" -NoPrompt -Server "SR60212\UATST10" -Database "UATST2_AxDB_model" 
2020-07-09T17:52:06.5192900Z ##[error]Install-AXModel : The pipeline has been stopped.
At line:1 char:1
+ Install-AXModel  -File "C:\Vsts_Agent\_work\r2\a\LM Build.Stream1\drop\Applicati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Install-AXModel], PipelineStoppedException
    + FullyQualifiedErrorId : One or more conflicting model elements already exists in an 
installed model.,Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.PowerShell.InstallAXModelCommand
For you info : there is a existing model with the same name however with a different version and there might be some conflicting elements however I'm assuming Replace flag should  replace it , let me know if -conflict push will work here 
Thanks and Regards,
Anirudh Parasaram

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    -Conflict flag would allow you to continue, but it would create a new problem. Your UAT environment would have an extra model with conflicting elements and I would have to resolve these conflicts, but that would turn your test environment to another development environment. It's not a good idea.

    You shouldn't get any conflicts when installing your model to UAT, therefore this seems to be a symptom of another larger problem (such as a bug in your deployment process or corruption of UAT). You should investigate how you got into this situation. Identifying conflicting objects and checking their history would be a good first step.

  • Anirudh Parasaram Profile Picture
    5 on at

    I don't think there is an issue with the deployment process since this is tested and successful in same environments however my script clearly states to replace the existing model with a new one in spite of using the replace flag I'm facing this error .  when I tried conflict push I found a conflicting model in CUP layer which is strange .

  • Suggested answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    -Replace won't solve conflicts - these are two different things.

    Creating a model with conflicting elements is exactly what -Conflict Push is supposed to do, but as I said, your deployment already failed if you run into conflicts in UAT. You'll really have investigate the conflicts and prevent them.

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 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans