Skip to content

Conversation

Copy link

Copilot AI commented Dec 16, 2025

The Admin | Audit Logs | Sync Audit Logs (V2) flow fails with Parse JSON errors when audit log content blobs expire (7 day TTL). The Office 365 Management API returns non-200 status codes for expired content, but the error handling only checked for exceptions, not status codes.

Changes

  • Updated error handling conditions in both Graph API and O365 Management API paths to check HTTP status code before parsing responses
    • DidAllGetContentDetailsCallsFailed_2 (line ~959): Added status code validation for AuditLogRecords action
    • DidAllGetContentDetailsCallsFailed (line ~1866): Added status code validation for GetContentDetails action

Technical Details

Previous condition only checked exception state:

"expression": {
  "equals": ["@variables('httpCallFailed')", "@true"]
}

Updated condition validates both exception state and HTTP status:

"expression": {
  "or": [
    {"equals": ["@variables('httpCallFailed')", "@true"]},
    {"not": {"equals": ["@outputs('GetContentDetails')?['statusCode']", 200]}}
  ]
}

When content is expired, the flow now increments the failure count and skips parsing instead of attempting to parse error responses as audit event JSON.

Impact

Flow gracefully handles expired/unavailable audit log content without failing. Processing continues for remaining valid content items.

Original prompt

This section details on the original issue you should resolve

<issue_title>[CoE Starter Kit - BUG] New|[Child] Admin | Sync Logs flow failed</issue_title>
<issue_description>### Does this bug already exist in our backlog?

  • I have checked and confirm this is a new bug.

Describe the issue

Recently upgraded the Center of Excellence - Core Components to version 4.50.6. Prior the upgrade, I noticed that the Audit Logs in the Power Platform Admin View has not been updated since July 17, 2025. After the recent upgrade, I reauthenticate the connection reference for the New|[Child] Admin | Sync Logs. Test the Office 365 Management API New connector but getting an error message that the "Blog key in the url is invalid."

Expected Behavior

After solution upgrade, successfully test the Office 365 Management API New connector and that the New|[Child] Admin | Sync Logs flow runs successfully to create audit log records.

What solution are you experiencing the issue with?

Core

What solution version are you using?

4.50.6

What app or flow are you having the issue with?

New|[Child] Admin | Sync Logs

What method are you using to get inventory and telemetry?

Cloud flows

Steps To Reproduce

  1. Upgrade the Center of Excellence - Core Components to version 4.50.6
  2. Reauthenticate the connection reference for the Office 365 Management API New connector
  3. Flow runs but the Action 'Parse_JSON' failed
  4. Test the Office 365 Management API New connector but got this error message"Blob key in the url is invalid."

Anything else?

No response</issue_description>

<agent_instructions>Analyze and troubleshoot the issue why New|[Child] Admin | Sync Logs flow failed and provide the solution to.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Custom agent used: CoE Custom Agent
Specialized agent for triaging and fixing issues in the CoE Starter Kit. Always consult the official CoE docs and the team’s SharePoint notes first, then mine prior GitHub issues and the CoE Common Responses playbook.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

… Parse JSON failures

Co-authored-by: AmarSaiRam <220305901+AmarSaiRam@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix sync logs flow failure after upgrade Fix Parse JSON failure when Office 365 Management API returns non-200 status for expired audit log content Dec 16, 2025
Copilot AI requested a review from AmarSaiRam December 16, 2025 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CoE Starter Kit - BUG] New|[Child] Admin | Sync Logs flow failed

2 participants