Skip to content

Accessing Execution Logs

These logs are stored in Azure Cosmos MongoDB. They can be accessed individually via the Azure Portal -> MongoDB -> Data Explorer.

However, this only allows access to one file at a record. If we need access to access the entire execution of a single process instance, we need to export these files. This is not possible natively from the Azure Portal.

Downloading Execution Logs

  1. Download and Extract Download MongoDB Command Line Database Tools | MongoDB
    1. This tool is a bit tempramental in PowerShell, so use the default Windows Command Prompt instead
  2. Open a command prompt in the directory above and browse to the bin sub-directory
  3. Create a new file called "query.json". Inside this file, paste the following, replacing the ID with your execution ID
    { "CorrelationId": "ID" }
    
  4. Find your MongoDB connection string from within Azure Portal and create a local variable called AZCOSMOS_URI. This is to remove issues with escape characters and quotes when running the query:
    set "AZCOSMOS_URI=YOUR_MONGODB_CONNECTIONSTRING"
    
  5. Run the following command to export the JSON records
mongoexport.exe --uri "%AZCOSMOS_URI%" --db npobpmastmdb001custexec --collection ExecutionQueueItem --jsonArray --queryFile query.json --out results.json