久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

無法從 Azure java SDK 列出圖像發布者

Cannot list image publishers from Azure java SDK(無法從 Azure java SDK 列出圖像發布者)
本文介紹了無法從 Azure java SDK 列出圖像發布者的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用 Azure ARM API,并嘗試通過 Azure Java SDK 按位置列出所有發布者,方法是執行以下代碼:

import com.microsoft.azure.management.compute.ComputeManagementClient;導入 com.microsoft.azure.management.compute.ComputeManagementService;導入 com.microsoft.azure.management.compute.models.VirtualMachineImageListPublishersParameters;導入 com.microsoft.azure.management.compute.models.VirtualMachineImageResourceList;@測試公共無效 testListPublishers() {ComputeManagementClient 客戶端 = ComputeManagementService.create(createConfiguration());VirtualMachineImageListPublishersParameters params = new VirtualMachineImageListPublishersParameters();params.setLocation("westus");VirtualMachineImageResourceList 響應 = client.getVirtualMachineImagesOperations().listPublishers(params);ArrayList<VirtualMachineImageResource>資源 = response.getResources();System.out.println("找到的發布者:" + resources.size());}

這會產生以下請求:

GET/subscriptions/{some-subscription}/providers/Microsoft.Compute/locations/westus/publishers?api-version=2015-06-15

但是,無論我在發布者參數中放置的位置如何,我總是會得到并清空列表.我能夠列出具有相同客戶端的其他資源,因此創建客戶端不是問題.

你對我可能做錯了什么有什么建議嗎?也許有我沒有的權限?

謝謝!

解決方案

根據我的經驗,這個問題是由于 Azure AD 上注冊的應用程序沒有 Reader 角色引起的.我重現了這個問題,并通過為 AzureAD 應用分配讀者角色來解決它.

有兩種分配讀者角色的方法.

  1. 使用帶有 arm 模式的 Azure-CLI,命令 azure ad role assignment create --objectId ;-o 閱讀器 -c/subscriptions/<subscriptionId>/

<塊引用>

如果不知道 AzureAD 應用的 objectId,可以命令 azure ad sp show --search

通過搜索名稱添加用戶:

將 Reader 角色分配給 aad 應用后,您可以根據需要列出圖片發布者.

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.microsoft.azure.management.compute.ComputeManagementClient;
import com.microsoft.azure.management.compute.ComputeManagementService;
import com.microsoft.azure.management.compute.models.VirtualMachineImageListPublishersParameters;
import com.microsoft.azure.management.compute.models.VirtualMachineImageResourceList;

@Test
public void testListPublishers() {
    ComputeManagementClient client = ComputeManagementService.create(createConfiguration());
    VirtualMachineImageListPublishersParameters params = new VirtualMachineImageListPublishersParameters();
    params.setLocation("westus");
    VirtualMachineImageResourceList response = client.getVirtualMachineImagesOperations().listPublishers(params);
    ArrayList<VirtualMachineImageResource> resources = response.getResources();
    System.out.println("Found publishers: " + resources.size());
}

This results in the following request:

GET /subscriptions/{some-subscription}/providers/Microsoft.Compute/locations/westus/publishers?api-version=2015-06-15

However, I always get and empty list, no matter the location I put in the publisher parameters. I am able to list other resources with the same client, so it is not an issue in creating the client.

Do you have any suggestions of what I might be doing wrong? Perhaps there is a permission that I don't have?

Thanks!

解決方案

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.

這篇關于無法從 Azure java SDK 列出圖像發布者的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Why would you choose Android API over Google APIs in the SDK on Eclipse?(為什么在 Eclipse 的 SDK 中選擇 Android API 而不是 Google API?)
Couchbase Bucket authentication error(Couchbase 存儲桶身份驗證錯誤)
admob 6.2.1 nullpointer exception(admob 6.2.1 空指針異常)
How to setup SDK in IntelliJ IDEA?(如何在 IntelliJ IDEA 中設置 SDK?)
My phone cannot be detected in eclipse to test run(eclipse 無法檢測到我的手機進行試運行)
platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目錄)
主站蜘蛛池模板: 91av在线免费看 | 亚洲精品免费看 | 在线播放亚洲 | 亚洲视频一区在线观看 | 国产精品久久精品 | 亚洲一区二区三区高清 | 在线观看精品视频网站 | 91av视频在线观看 | 国产一级在线观看 | 精品一区二区三区在线观看国产 | 国产精品成av人在线视午夜片 | 欧美一区二区三区国产精品 | 日本一区二区在线视频 | 狠狠综合久久av一区二区小说 | 欧美一区二区三区久久精品视 | 日韩成人在线一区 | 一区二区在线不卡 | 欧美一区视频 | 女同av亚洲女人天堂 | 超碰一区二区 | 久久精品久久久久久 | 国产精品久久久亚洲 | 亚洲不卡视频 | 久久高清 | 男女羞羞的网站 | 国产精品一区二区久久 | 久久久久久久久久久蜜桃 | 99pao成人国产永久免费视频 | 亚洲激情网站 | 久久久欧洲 | 亚洲国产精品久久久 | 欧美一区二区在线观看 | 成人在线一级片 | 欧美日韩一二三区 | 日韩成人在线视频 | 欧美成人手机视频 | 亚洲激情在线视频 | 久久久av | 日韩视频在线一区 | 日韩免费在线 | 中文字幕欧美一区 |