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
|
||||
}
|
||||
|
||||
func buildArmClient(config BackendConfig) (*ArmClient, error) {
|
||||
env, err := buildArmEnvironment(config)
|
||||
func buildArmClient(ctx context.Context, config BackendConfig) (*ArmClient, error) {
|
||||
env, err := authentication.AzureEnvironmentByNameFromEndpoint(ctx, config.MetadataHost, config.Environment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ func buildTestClient(t *testing.T, res resourceNames) *ArmClient {
|
|||
// Endpoint is optional (only for Stack)
|
||||
endpoint := os.Getenv("ARM_ENDPOINT")
|
||||
|
||||
armClient, err := buildArmClient(BackendConfig{
|
||||
armClient, err := buildArmClient(context.TODO(), BackendConfig{
|
||||
SubscriptionID: subscriptionID,
|
||||
TenantID: tenantID,
|
||||
ClientID: clientID,
|
||||
|
|
Loading…
Reference in New Issue