I\'m using the Azure ARM API and I\'m trying to list all publishers by location through the Azure Java SDK, by executing the following code:
import com.micro
Per my experience, the issue was caused by the application registed on Azure AD has no Reader role. I reproduced the issue, and resolved it via assign a Reader role to the AzureAD app.
There are two way for assigning a Reader role.
azure ad role assignment create --objectId <objectId of the aad app> -o Reader -c /subscriptions/<subscriptionId>/
If you don't know the objectId of the AzureAD app, you can command
azure ad sp show --search <the aad app name>
to review it. If you have noService Principal (SP)
for Azure AD, you can commandazure ad sp create <clientId>
to create it.
All settings -> RESOURCE MANAGEMENT -> Users
when the application shown on Azure new portal, please see the pics below.Select a role Reader
:
Add a user by searching name:
After assign the Reader role to the aad app, you can list the image publishers as your wish.