Merge pull request #26463 from hashicorp/kt/azurerm-secret-backend-fix
AzureRM backend: correctly lookup environment from metadata host
This commit is contained in:
commit
5e13d57f4e
|
@ -33,8 +33,8 @@ type ArmClient struct {
|
||||||
sasToken string
|
sasToken string
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildArmClient(config BackendConfig) (*ArmClient, error) {
|
func buildArmClient(ctx context.Context, config BackendConfig) (*ArmClient, error) {
|
||||||
env, err := buildArmEnvironment(config)
|
env, err := authentication.AzureEnvironmentByNameFromEndpoint(ctx, config.MetadataHost, config.Environment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ func buildTestClient(t *testing.T, res resourceNames) *ArmClient {
|
||||||
// Endpoint is optional (only for Stack)
|
// Endpoint is optional (only for Stack)
|
||||||
endpoint := os.Getenv("ARM_ENDPOINT")
|
endpoint := os.Getenv("ARM_ENDPOINT")
|
||||||
|
|
||||||
armClient, err := buildArmClient(BackendConfig{
|
armClient, err := buildArmClient(context.TODO(), BackendConfig{
|
||||||
SubscriptionID: subscriptionID,
|
SubscriptionID: subscriptionID,
|
||||||
TenantID: tenantID,
|
TenantID: tenantID,
|
||||||
ClientID: clientID,
|
ClientID: clientID,
|
||||||
|
|
Loading…
Reference in New Issue