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

無法從 Azure java SDK 列出圖像發(fā)布者

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

問題描述

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

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

這會產(chǎn)生以下請求:

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

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

你對我可能做錯(cuò)了什么有什么建議嗎?也許有我沒有的權(quán)限?

謝謝!

解決方案

根據(jù)我的經(jīng)驗(yàn),這個(gè)問題是由于 Azure AD 上注冊的應(yīng)用程序沒有 Reader 角色引起的.我重現(xiàn)了這個(gè)問題,并通過為 AzureAD 應(yīng)用分配讀者角色來解決它.

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

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

<塊引用>

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

通過搜索名稱添加用戶:

將 Reader 角色分配給 aad 應(yīng)用后,您可以根據(jù)需要列出圖片發(fā)布者.

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.

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

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

相關(guān)文檔推薦

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 存儲桶身份驗(yàn)證錯(cuò)誤)
admob 6.2.1 nullpointer exception(admob 6.2.1 空指針異常)
How to setup SDK in IntelliJ IDEA?(如何在 IntelliJ IDEA 中設(shè)置 SDK?)
My phone cannot be detected in eclipse to test run(eclipse 無法檢測到我的手機(jī)進(jìn)行試運(yùn)行)
platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目錄)
主站蜘蛛池模板: 天天搞天天干 | 啪啪网站免费 | 国产精品午夜视频 | 亚洲欧洲视频 | 国产激情久久 | 日韩欧美小视频 | 97精品国产 | 国产又粗又猛又爽又黄 | 麻豆成人免费视频 | 日产精品久久久一区二区 | 欧美日韩国产在线播放 | 国产在线天堂 | 午夜网站在线观看 | 99视频在线观看免费 | 亚洲亚洲人成综合网络 | 亚洲第一毛片 | 亚洲免费在线 | 可以看的毛片 | 国产女人高潮视频 | 精品国产一区二区三区四区 | 老女人丨91丨九色 | 91av在线免费观看 | 国产成人精品一区二区三区视频 | 三级福利视频 | 久草免费福利 | 欧美日韩小视频 | 美女毛片视频 | 日韩五十路 | 九九九久久久 | 天天色小说 | 一级欧美一级日韩 | 一区在线播放 | 久久国产精品99久久人人澡 | 国产成人aⅴ | 国产在线视频91 | 天天操操操 | 国产欧美一区二区精品性色超碰 | 精品免费在线观看 | 免费观看一区二区三区毛片 | 亚洲福利片| 免费av一区 |