0

I was trying to retrieve OS Data from the getVirtualMachineVMImagesOperations using the following way.

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

and I got the error - "ForbiddenError: This operation is not allowed for this subscription."

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)

Looks like it is some kind of permission error. Please share your ideas to overcome this error.

Harish Raj
  • 1,565
  • 3
  • 17
  • 27

1 Answers1

-1

I got the OperatingSystem from the following. But still it shows "ForbiddenError: This operation is not allowed for this subscription." while I'm trying to use VirtualMachineVMImageOperations Class.

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

any advice would be much appreciated.

Harish Raj
  • 1,565
  • 3
  • 17
  • 27