pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

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

問(wèn)題描述

我正在使用 Azure ARM API,并嘗試通過(guò) 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;@測(cè)試公共無(wú)效 testListPublishers() {ComputeManagementClient 客戶(hù)端 = 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());}

這會(huì)產(chǎn)生以下請(qǐng)求:

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

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

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

謝謝!

解決方案

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

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

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

<塊引用>

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

通過(guò)搜索名稱(chēng)添加用戶(hù):

將 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)于無(wú)法從 Azure java SDK 列出圖像發(fā)布者的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 存儲(chǔ)桶身份驗(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 無(wú)法檢測(cè)到我的手機(jī)進(jìn)行試運(yùn)行)
platform-toolsaapt.exe directory missing in android SDK(android SDK 中缺少 platform-toolsaapt.exe 目錄)
主站蜘蛛池模板: 长沙网站建设制作「网站优化推广」-网页设计公司-速马科技官网 | 阿米巴企业经营-阿米巴咨询管理-阿米巴企业培训-广东键锋企业管理咨询有限公司 | 企小优-企业数字化转型服务商_网络推广_网络推广公司 | 丝印油墨_水性油墨_环保油墨油漆厂家_37国际化工 | 定坤静电科技静电消除器厂家-除静电设备| 保定市泰宏机械制造厂-河北铸件厂-铸造厂-铸件加工-河北大件加工 | 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 污水处理设备,一体化泵站,一体化净水设备-「梦之洁环保设备厂家」 | 喷码机,激光喷码打码机,鸡蛋打码机,手持打码机,自动喷码机,一物一码防伪溯源-恒欣瑞达有限公司 | 高空重型升降平台_高空液压举升平台_高空作业平台_移动式升降机-河南华鹰机械设备有限公司 | 山东信蓝建设有限公司官网| 卫生纸复卷机|抽纸机|卫生纸加工设备|做卫生纸机器|小型卫生纸加工需要什么设备|卫生纸机器设备多少钱一台|许昌恒源纸品机械有限公司 | 仓储笼_仓储货架_南京货架_仓储货架厂家_南京货架价格低-南京一品仓储设备制造公司 | 郑州大巴车出租|中巴车租赁|旅游大巴租车|包车|郑州旅游大巴车租赁有限公司 | 电力电子产业网| YT保温材料_YT无机保温砂浆_外墙保温材料_南阳银通节能建材高新技术开发有限公司 | SMN-1/SMN-A ABB抽屉开关柜触头夹紧力检测仪-SMN-B/SMN-C-上海徐吉 | YAGEO国巨电容|贴片电阻|电容价格|三星代理商-深圳市巨优电子有限公司 | 拉伸膜,PE缠绕膜,打包带,封箱胶带,包装膜厂家-东莞宏展包装 | 土壤墒情监测站_土壤墒情监测仪_土壤墒情监测系统_管式土壤墒情站-山东风途物联网 | FFU_空气初效|中效|高效过滤器_空调过滤网-广州梓净净化设备有限公司 | 免费网站网址收录网_海企优网站推荐平台 | 消防设施操作员考试报名时间,报名入口,报考条件| 合肥网带炉_安徽箱式炉_钟罩炉-合肥品炙装备科技有限公司 | 单电机制砂机,BHS制砂机,制沙机设备,制砂机价格-正升制砂机厂家 单级/双级旋片式真空泵厂家,2xz旋片真空泵-浙江台州求精真空泵有限公司 | 碳化硅,氮化硅,冰晶石,绢云母,氟化铝,白刚玉,棕刚玉,石墨,铝粉,铁粉,金属硅粉,金属铝粉,氧化铝粉,硅微粉,蓝晶石,红柱石,莫来石,粉煤灰,三聚磷酸钠,六偏磷酸钠,硫酸镁-皓泉新材料 | 多米诺-多米诺世界纪录团队-多米诺世界-多米诺团队培训-多米诺公关活动-多米诺创意广告-多米诺大型表演-多米诺专业赛事 | 煤机配件厂家_刮板机配件_链轮轴组_河南双志机械设备有限公司 | 一体化隔油提升设备-餐饮油水分离器-餐厨垃圾处理设备-隔油池-盐城金球环保产业发展有限公司 | 颗粒机,颗粒机组,木屑颗粒机-济南劲能机械有限公司 | 彩信群发_群发彩信软件_视频短信营销平台-达信通 | 山东螺杆空压机,烟台空压机,烟台开山空压机-烟台开山机电设备有限公司 | 岩棉切条机厂家_玻璃棉裁条机_水泥基保温板设备-廊坊鹏恒机械 | 自动化生产线-自动化装配线-直流电机自动化生产线-东莞市慧百自动化有限公司 | MVE振动电机_MVE震动电机_MVE卧式振打电机-河南新乡德诚生产厂家 | 大巴租车平台承接包车,通勤班车,巴士租赁业务 - 鸿鸣巴士 | 餐饮小吃技术培训-火锅串串香培训「何小胖培训」_成都点石成金[官网] | 【北京写字楼出租_写字楼租赁_办公室出租网/出售】-远行地产官网 | 北京康百特科技有限公司-分子蒸馏-短程分子蒸馏设备-实验室分子蒸馏设备 | 超声波清洗机_大型超声波清洗机_工业超声波清洗设备-洁盟清洗设备 | 大白菜官网,大白菜winpe,大白菜U盘装系统, u盘启动盘制作工具 |