Azure服务管理 - " ForbiddenError:此订阅不允许此操作。"

时间:2015-10-31 05:45:42

标签: azure azure-java-sdk

我尝试使用以下方法从getVirtualMachineVMImagesOperations中检索操作系统数据。

ComputeManagementClient computeManagementClient = ComputeManagementService.create(config);
    System.out.println("OS Type"+computeManagementClient.getVirtualMachineVMImagesOperations().getDetails("WindowsRemoteServer").getOSDiskConfiguration().getOperatingSystem());

我收到了错误 - " ForbiddenError:此订阅不允许此操作。"

Exception in thread "main" com.microsoft.windowsazure.exception.ServiceException: ForbiddenError: This operation is not allowed for this subscription.
    at com.microsoft.windowsazure.exception.ServiceException.createFromXml(ServiceException.java:208)
    at com.microsoft.windowsazure.management.compute.VirtualMachineVMImageOperationsImpl.getDetails(VirtualMachineVMImageOperationsImpl.java:1115)
    at com.microsoft.azure.auth.Program.main(Program.java:63)

看起来是某种权限错误。请分享您的想法以克服此错误。

1 个答案:

答案 0 :(得分:0)

我从以下获得了OperatingSystem。但它仍然显示" ForbiddenError:此订阅不允许此操作。" ,而我正在尝试使用VirtualMachineVMImageOperations类。

System.out.println("OS Type"+computeManagementClient.getVirtualMachinesOperations().get("WindowsRemoteServer", "WindowsRemoteServer", "WindowsRemoteServer").getOSVirtualHardDisk().getOperatingSystem());

任何建议都会非常感激。