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 目錄)
主站蜘蛛池模板: [品牌官网]贵州遵义双宁口腔连锁_贵州遵义牙科医院哪家好_种植牙_牙齿矫正_原华美口腔 | 小小作文网_中小学优秀作文范文大全 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 西安展台设计搭建_西安活动策划公司_西安会议会场布置_西安展厅设计西安旭阳展览展示 | 地图标注-手机导航电子地图如何标注-房地产商场地图标记【DiTuBiaoZhu.net】 | 气力输送_输送机械_自动化配料系统_负压吸送_制造主力军江苏高达智能装备有限公司! | 兰州牛肉面加盟,兰州牛肉拉面加盟-京穆兰牛肉面 | 罗茨真空机组,立式无油往复真空泵,2BV水环真空泵-力侨真空科技 | 编织人生 - 权威手工编织网站,编织爱好者学习毛衣编织的门户网站,织毛衣就上编织人生网-编织人生 | 隧道烘箱_隧道烘箱生产厂家-上海冠顶专业生产烘道设备 | 英思科GTD-3000EX(美国英思科气体检测仪MX4MX6)百科-北京嘉华众信科技有限公司 | 量子管通环-自清洗过滤器-全自动反冲洗过滤器-北京罗伦过滤技术集团有限公司 | 石家庄装修设计_室内家装设计_别墅装饰装修公司-石家庄金舍装饰官网 | 专业生产动态配料系统_饲料配料系统_化肥配料系统等配料系统-郑州鑫晟重工机械有限公司 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 实验室装修_实验室设计_实验室规划设计- 上海广建净化工程公司 | 并网柜,汇流箱,电控设备,中高低压开关柜,电气电力成套设备,PLC控制设备订制厂家,江苏昌伟业新能源科技有限公司 | 无尘烘箱_洁净烤箱_真空无氧烤箱_半导体烤箱_电子防潮柜-深圳市怡和兴机电 | 恒温恒湿箱(药品/保健品/食品/半导体/细菌)-兰贝石(北京)科技有限公司 | 超声骨密度仪-动脉硬化检测仪器-人体成分分析仪厂家/品牌/价格_南京科力悦 | 日本SMC气缸接头-速度控制阀-日本三菱伺服电机-苏州禾力自动化科技有限公司 | 砍排机-锯骨机-冻肉切丁机-熟肉切片机-预制菜生产线一站式服务厂商 - 广州市祥九瑞盈机械设备有限公司 | 江苏皓越真空设备有限公司| 聚合氯化铝厂家-聚合氯化铝铁价格-河南洁康环保科技 | 橡胶膜片,夹布膜片,橡胶隔膜密封,泵阀设备密封膜片-衡水汉丰橡塑科技公司网站 | 广西资质代办_建筑资质代办_南宁资质代办理_新办、增项、升级-正明集团 | 杭州翻译公司_驾照翻译_专业人工翻译-杭州以琳翻译有限公司官网 组织研磨机-高通量组织研磨仪-实验室多样品组织研磨机-东方天净 | 电子巡更系统-巡检管理系统-智能巡检【金万码】 | 超声波乳化机-超声波分散机|仪-超声波萃取仪-超声波均质机-精浩机械|首页 | 彼得逊采泥器-定深式采泥器-电动土壤采样器-土壤样品风干机-常州索奥仪器制造有限公司 | 圆盘鞋底注塑机_连帮鞋底成型注塑机-温州天钢机械有限公司 | 台式恒温摇床价格_大容量恒温摇床厂家-上海量壹科学仪器有限公司 | 玻璃钢罐_玻璃钢储罐_盐酸罐厂家-河北华盛节能设备有限公司 | 进口便携式天平,外校_十万分之一分析天平,奥豪斯工业台秤,V2000防水秤-重庆珂偌德科技有限公司(www.crdkj.com) | 风淋室生产厂家报价_传递窗|送风口|臭氧机|FFU-山东盛之源净化设备 | LCD3D打印机|教育|桌面|光固化|FDM3D打印机|3D打印设备-广州造维科技有限公司 | 茶叶百科网-茶叶知识与茶文化探讨分享平台 | 蒸汽热收缩机_蒸汽发生器_塑封机_包膜机_封切收缩机_热收缩包装机_真空机_全自动打包机_捆扎机_封箱机-东莞市中堡智能科技有限公司 | 仓储笼_仓储货架_南京货架_仓储货架厂家_南京货架价格低-南京一品仓储设备制造公司 | b2b网站大全,b2b网站排名,找b2b网站就上地球网 | 连续密炼机_双转子连续密炼机_连续式密炼机-南京永睿机械制造有限公司 |