Cannot list image publishers from Azure java SDK

后端 未结 1 400
遥遥无期
遥遥无期 2021-01-15 18:29

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         


        
相关标签:
1条回答
  • 2021-01-15 19:21

    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.

    1. Using Azure-CLI with arm mode, and command 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 no Service Principal (SP) for Azure AD, you can command azure ad sp create <clientId> to create it.

    1. Add the role and user via 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.

    0 讨论(0)
提交回复
热议问题