Tag: azure java sdk

Azure Java SDK:ServiceException:ForbiddenError:

尝试了基本位置检索器代码(如下所示) String uri = “https://management.core.windows.net/”; String subscriptionId = “XXXXXXXX-5fad-XXXXXX-9dfa-XXXXXX”; String keyStoreLocation = “D:\\test.jks”; String keyStorePassword = “123456”; Configuration config = ManagementConfiguration.configure( new URI(uri), subscriptionId, keyStoreLocation, // the file path to the JKS keyStorePassword, // the password for the JKS KeyStoreType.jks // flags that I’m using a JKS keystore ); ManagementClient client = ManagementService.create(config); // get […]

Azure从Azure Java SDK检索VirtualMachines的PublicIPAddress

由于答案是Page Not Found,我试图使用以下代码检索公共IP的大小 Configuration config = ManagementConfiguration.configure( new URI(uri), subscriptionId, keyStoreLocation, // the file path to the JKS keyStorePassword, // the password for the JKS KeyStoreType.jks // flags that I’m using a JKS keystore ); NetworkResourceProviderClient networkResourceProviderClient = NetworkResourceProviderService.create(config); PublicIpAddressListResponse PublicIpAddressListResponse =networkResourceProviderClient.getPublicIpAddressesOperations().listAll(); ArrayList PublicIpAddressList =PublicIpAddressListResponse.getPublicIpAddresses(); System.out.println(PublicIpAddressList.size()); 使用Azure AD ServicePrincipal身份validation,它返回 – 0 使用带有“ https://management.azure.com/”API的证书身份validation,它返回 – AuthenticationFailed: […]