我在 azure 门户中部署了云服务。部署成功。我做了一些像下面这样的 azure java sdk 代码,
ComputeManagementClient cmclient = ComputeManagementService.create(config);
VirtualMachineOperations vmoperat = cmclient.getVirtualMachinesOperations();
VirtualMachineGetResponse vmresp = vmoperat.get("AzurecloudDNS", AzurecloudDNSStaging20160613193121","WorkerRole1_IN_0");
但它会引发以下异常,
Exception in thread "main" com.microsoft.windowsazure.exception.ServiceException: ResourceNotFound: Role WorkerRole1_IN_0 was not found in the currently deployed service.
at com.microsoft.windowsazure.exception.ServiceException.createFromXml(ServiceException.java:206)
at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsImpl.get(VirtualMachineOperationsImpl.java:6517)
at com.aaa.azure.JavaClient.main(JavaClient.java:81)
在 azure 门户中,我可以看到 WorkerRole1_IN_0 正在此云服务中工作。但它抛出异常。
任何想法?感谢先进。