WaelHamze / xrm-ci-framework

xRM CI Framework provides you with the tools automate the build and deployment of your CRM Solution. Using the framework to implement a fully automated DevOps pipeline will allow you to deploy more frequently with added consistency and quality.
MIT License
186 stars 116 forks source link

Enhancement - Add Import Job ID to the TFS logging when using Package Deployer Definition #20

Closed NightshadowZ closed 6 years ago

NightshadowZ commented 7 years ago

Product: TFS 2015 Marketplace extension, Package Deployer Definition I realize due to the 2016 CRM SDK that the TFS Extension doesn't work for Solution Import and Export, but it does work for the Package Deployer and a few others against a CRM 2015 on prem installation.

Could the Import Job ID be added to the logging generated in TFS by the Package Deployer definition? This would allow us to use the PowerShell scripts to retrieve the detailed import log of the solution import.

WaelHamze commented 7 years ago

Hi, How are you suggesting I get the Import Job ID from the PackageDeployer.exe? I tried running this in debug mode and don't seem to see it in the logs.

NightshadowZ commented 7 years ago

When I run it, and I open the packageDeployment log, I see records like this:

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose 16 Executed Command - RetrieveMultiple : GetEntityDataBySearchParms : duration: 00:00:00.2650265 PackageDeployment Information 8 Fetching Data for Project Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose 16 Executed Command - Retrieve : Trying to Read a Record. Entity = importjob , ID = 2e7e3ae3-j2f6-4dd4-7e03-dd78cd933dk4 : duration: 00:00:00.4340434 PackageDeployment Information 8 Import for Project, Progress is : 99.4444444444444 PackageDeployment Information 8 Solution Import Result = success

At least this is the case with the 2015 SDK. Maybe it's not the case with 2016/365. This ImportJobID was the basis of your Get-XrmSolutionImportLog command. I'd like to be able to execute this command to find out what happened in the event of a failure, and if I can't get the ID, then I'm not sure how I can troubleshoot or investigate afterwards. I'd use the basic solution import definitions, but they don't support CRM 2015.

WaelHamze commented 6 years ago

I am using the latest package deployer added the contents of the log file to the output but still no luck