From c7050757f5d9d7fa396a0b297202dcf3856c0a66 Mon Sep 17 00:00:00 2001 From: jims Date: Thu, 27 Jul 2017 13:04:39 -0700 Subject: [PATCH] Subscription ID wasn't being substituted, add default oauth.endpoint --- .../azurecompute/arm/AzureComputeProviderMetadata.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeProviderMetadata.java b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeProviderMetadata.java index a866ffba45..eb52746575 100644 --- a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeProviderMetadata.java +++ b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeProviderMetadata.java @@ -89,6 +89,8 @@ public class AzureComputeProviderMetadata extends BaseProviderMetadata { properties.put(PROPERTY_MAX_RATE_LIMIT_WAIT, 330000); properties.put(RESOURCE, "https://management.azure.com/"); properties.put(CREDENTIAL_TYPE, CLIENT_CREDENTIALS_SECRET.toString()); + // Set a default Oauth endpoint for Azure, fill in the tenantId based on the value supplied + properties.put("oauth.endpoint", "https://login.microsoft.com/${azurecompute-arm.tenantId}/oauth2/token"); properties.put(DEFAULT_VNET_ADDRESS_SPACE_PREFIX, "10.0.0.0/16"); properties.put(DEFAULT_SUBNET_ADDRESS_PREFIX, "10.0.0.0/24"); properties.put(RESOURCENAME_PREFIX, "jclouds"); @@ -135,7 +137,7 @@ public class AzureComputeProviderMetadata extends BaseProviderMetadata { id("azurecompute-arm") .name("Azure Resource Management") .apiMetadata(new AzureManagementApiMetadata()) - .endpoint("https://management.azure.com/subscriptions/SUBSCRIPTION_ID") + .endpoint("https://management.azure.com/subscriptions/${azurecompute-arm.subscriptionId}") .homepage(URI.create("https://www.windowsazure.com/")) .console(URI.create("https://windows.azure.com/default.aspx")) .linkedServices("azureblob")