当我在Java中使用“ AppServiceMSICredentials
”连接到Azure Keyvault时。我正在
错误:
java.net.ConnectException:连接被拒绝:connect
代码段:
AppServiceMSICredentials appServiceMsiCredentials = new AppServiceMSICredentials(AzureEnvironment.AZURE,"XXXXXXXXXXXXXXXX","XXXXXXXXXXXXXXXXX"); appServiceMsiCredentials.withDefaultSubscriptionId(subscriptionId);
KeyVaultClient keyVaultClient = new KeyVaultClient(appServiceMsiCredentials);
PagedList list = keyVaultClient.listSecrets("X");
for (SecretItem listItem : list) { System.out.println(listItem.id()); }