Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoE Starter Kit - BUG] Admin | Audit Logs | Sync Audit Logs (V2) not working correctly with 401 error #6023

Closed
1 task done
jax-coe-admin opened this issue Jul 7, 2023 · 4 comments
Assignees
Labels
coe-starter-kit CoE Starter Kit issues duplicate This issue or pull request already exists question Further information is requested

Comments

@jax-coe-admin
Copy link

jax-coe-admin commented Jul 7, 2023

Does this bug already exist in our backlog?

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

Describe the issue

We are attempting to convert to the "Sync Audit Logs" flow within the Core solution from the deprecated "Audit Logs" solution. When we run the "Admin | Audit Logs | Office 365 Management API Subscription" flow with START we get a 401 error instead of a 400. When we attempt to run the new "Admin | Audit Logs | Sync Audit Logs (V2)" flow, we also get a 401 error.

Following the documentation here

Since we are coming from previous solution, App registrations is already complete:
image

API permissions:
image

Certificates & secrets
image

Environment Variables:
image

"Admin | Audit Logs | Office 365 Management API Subscription" results after being run with START:
image

OUTPUTS Body:
{
"error": {
"code": "AF10001",
"message": "The permission set () sent in the request does not include the expected permission."
}
}

image

OUTPUTS Body:
{
"operation": "START",
"response": "{"error":{"code":"AF10001","message":"The permission set () sent in the request does not include the expected permission."}}",
"statuscode": "401"
}

The flow completed with Success despite the error.

Assuming this was normal, tested the new "Admin | Audit Logs | Sync Audit Logs (V2)" and received a Failed status:
image

image

image

Expected Behavior

"Admin | Audit Logs | Office 365 Management API Subscription" should give 400 error and "Admin | Audit Logs | Sync Audit Logs (V2)" should complete sucessfully.

What solution are you experiencing the issue with?

Core

What solution version are you using?

4.11

What app or flow are you having the issue with?

Admin | Audit Logs | Sync Audit Logs (V2)

What method are you using to get inventory and telemetry?

Cloud flows

Steps To Reproduce

  1. Enable and run new Sync Audit Log flows

Anything else?

This the same registration information being used by the Custom Connector for the deprecated solution

@jax-coe-admin jax-coe-admin added bug Something isn't working coe-starter-kit CoE Starter Kit issues labels Jul 7, 2023
@CoEStarterKitBot CoEStarterKitBot moved this to Todo ✏️ in CoE Starter Kit Jul 7, 2023
@jax-coe-admin jax-coe-admin changed the title [CoE Starter Kit - BUG] ISSUE TITLE [CoE Starter Kit - BUG] Admin | Audit Logs | Sync Audit Logs (V2) not working correctly with 401 error Jul 7, 2023
@manuelap-msft
Copy link
Contributor

I think you've missed updating the App registration, see:

Update app registration

  1. Browse to your app registration.
  2. API Permissions > Remove the delegated permissions to Office 365 Management APIs ActivityFeed.Read

image

  1. Add instead Application permissions to Office 365 Management APIs ActivityFeed.Read and get it granted for the organization
    image

Here are the detailed steps on how to move from using the custom connector to the new HTTP method for collecting audit logs:
#6009

@manuelap-msft manuelap-msft added duplicate This issue or pull request already exists question Further information is requested and removed bug Something isn't working labels Jul 10, 2023
@jax-coe-admin
Copy link
Author

I overlooked the permission type on the registration and I'm working on getting the correct permission added.

I will update once I get this complete.

Thanks!

@jax-coe-admin
Copy link
Author

This is all set.

I can confirm that I missed the change in API permission from Delegation to Application.

Once the correct API permission was added and consented, the "Admin | Audit Logs | Office 365 Management API Subscription" flow completed with the expected 400 response.

Thank you, Manuela!

@github-project-automation github-project-automation bot moved this from Todo ✏️ to Done ✅ in CoE Starter Kit Jul 12, 2023
@Jenefer-Monroe
Copy link
Collaborator

Wonderful news, thank you for letting us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coe-starter-kit CoE Starter Kit issues duplicate This issue or pull request already exists question Further information is requested
Projects
Archived in project
Development

No branches or pull requests

3 participants