My company is looking into reporting on Azure. We only want our customers to give us read only credentials for us to use. I did some research and it looks like Azure Active
I believe you're on the right track as to why you're running into this problem.
Here's what's happening:
Essentially permission to execute Service Management API
is a delegated permission and not an application permission
. In other words, the API is executed in context of the user for which the token is acquired. Now you are getting this token for your application (specified by client id/secret). However your application doesn't have access to your Azure Subscription because the user record created for this application in your Azure AD is of type Service Principal
. Since this Service Principal doesn't have access to your Azure Subscription, you're getting this Forbidden Error
(I must say that the error is misleading because you're not using certificate at all).
There are a few things you could do:
Co-Admin
in your Azure Subscription and will have full access to your Azure Subscription as with SM API there's no concept of Role-based access control
.