Azure subscriptions list returns empty result with MS Graph SDK

Issue

For some reason sdk doesn’t return subscriptions although I have one. I have added Subscription.Read.All permission to my app registration.

client := msgraphsdk.NewGraphServiceClient(adapter)
res, err := client.Subscriptions().Get(nil)

I use the same code to get Organizations and it works fine. I use oauth2 token for sdk authentication.

Solution

Ok, these subscriptions from Graph SDK are a completely different thing. To get Azure subscriptions you must use Azure SDK.

P.S. and you can’t issue oauth2 token both for graph and azure sdk

Answered By – chingis

Answer Checked By – Clifford M. (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.