I designed a CI/CD pipeline on Azure DevOps which enables a no touch deployment experience (DEV => TST => UAT => PRD). I am using Azure DevOps task PowerPlatformDeployPackage V2, which gives me maximum control and flexibility and enables me to easily add a few custom operations targeting the Power Platform (mainly Dataverse).
Occasionally the deployment appears to break in this task and the logging offers very little useful details regarding the context/cause, which makes it very hard to debug. E.g. this occurs when solution import is blocked due to missing dependencies. In those cases no details are logged. Up to now my only option in these cases is to attempt a manual import of the solution and download and analyse the error log. (Am I missing something here, anyone better ideas how to tackle this in a more efficient way?)
Another common cause for this task to break is when an Exception is raised somewhere in my custom code. The deploy package task seems to always break whenever een exception is thrown, even when it is fully handled! (try...catch does not help here.) Again no details are logged, so trouble shooting in these scenarios turns out to be hard.
The logging I get in Azure DevOps looks like this:
Beginning queueing up UpdateRibbonClientMetadata job.
Microsoft PowerPlatform CLI
Version: 1.21.13+g348c5e9
Error: The post-import process failed: {0}
Usage: pac package deploy [--logFile] [--logConsole] --package [--settings] [--verbose]
--logFile Log file path (alias: -lf)
--logConsole Output log to console (alias: -c)
--package path to a package dll or zip file with a package (alias: -p)
--settings Runtime Package Settings that are passed to the package that is being deployed. The format of the string must be `key=value|key=value`. (alias: -s)
--verbose Emit Verbose logs to the log outputs (alias: -vdbg)
or this:
[ 'Microsoft PowerPlatform CLI' ]
[ 'Version: 1.21.13+g348c5e9' ]
[ 'Error: \'D:\\a\\1\\CrmDeploymentArtifact\\CompanyName.Crm.PackageDeployment.dll\' - package dll or zip file name is invalid' ]
The package dll is valid, it is based on the most recent project template generated by the PAC CLI (using VS Code). When I attempt to execute my deployment package using the PAC CLI with the --verbose switch, I actually get a log with a stack trace of the original exception, but the steps I need to do not make me happy.
My questions for the community and - especially - the Microsoft Power Platform team are: am I missing something here? What is your experience regarding CI/CD pipelines for the Power Platform? (Is it really this poor?) Are there any options for getting better, more detailed error logging? Could it be an option to create my own custom ADO task and still use the Dataverse service connection?