getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.07k stars 4.19k forks source link

VSTS Integration: No accounts found. Please check that you are an azure devops account owner #14357

Open AutumnEvans418 opened 5 years ago

AutumnEvans418 commented 5 years ago

Issue

I keep getting no accounts found. How do I fix this?

image

image

markstory commented 5 years ago

Did you make sure that you're the owner of at least one azure devops organization?

AutumnEvans418 commented 5 years ago

I have logged in as my devops organization owner. It doesn't let me add the integration still. We are using federation and it is a work email that comes from Azure Active Directory.

My devops organization owner

image

My sentry user

image

Still get the same error

image

markstory commented 5 years ago

Ok. We use the https://app.vssps.visualstudio.com/_apis/accounts?ownerId=<user_id>&api-version=4.1 API endpoint to get the accounts that your devops account is an owner of. From the screenshots you've posted that API is returning an empty list.

AutumnEvans418 commented 5 years ago

I think I figured out what's causing the issue but I'm not sure how to fix it. We have two peerlessit accounts. One is with Microsoft and the other is for active directory. I think it's getting confused between the two because when I logged in with the other account that is Microsoft and not single sign-on and created an organization it was able to find that:

image

I'm thinking maybe sentry is grabbing the Microsoft account rather than the azure active directory account?

markstory commented 5 years ago

I'm thinking maybe sentry is grabbing the Microsoft account rather than the azure active directory account?

We get what DevOps gives us. Is there another API endpoint we should be using instead of the accounts list endpoint?

paaland commented 5 years ago

I'm having the same issue and have reported it here https://github.com/getsentry/sentry/issues/13497 I have two accounts (Microsoft and Azure AD) on the same email address. Sentry won't let me choose which to use and thus does not find the right DevOps organization.

paaland commented 5 years ago

I finally got around this issue. I have several accounts/subscriptions in Azure and the Sentry Devops integration just takes the first and checks for organizations I'm owner of and finds none. But if I open another tab and go to https://aex.dev.azure.com and selects the correct subscription in the dropdown, and then go back to the Sentry tab I can add the right subscription.

Seems the Sentry integration should ask which subscription to use if you have multiple.

image

rkapoz-bgp commented 4 years ago

I finally got around this issue. I have several accounts/subscriptions in Azure and the Sentry Devops integration just takes the first and checks for organizations I'm owner of and finds none. But if I open another tab and go to https://aex.dev.azure.com and selects the correct subscription in the dropdown, and then go back to the Sentry tab I can add the right subscription.

Seems the Sentry integration should ask which subscription to use if you have multiple.

image

Thank you paaland, I was in the same situation and your workaround fixed the problem!

twogood commented 2 years ago

Thank you so much @paaland, I got same issue now in 2022 but by switching back and forth in the tenants dropdown on https://aex.dev.azure.com/me?mkt=sv-SE I could get to the next step.

Steven-Somer commented 2 months ago

I had the same, this worked for me. Thanks!