Skip to content

Commit

Permalink
Merge pull request #4099 from terraform-providers/b/storage-auth-bug
Browse files Browse the repository at this point in the history
auth: dynamically requesting an authorizer for storage
  • Loading branch information
tombuildsstuff authored Aug 16, 2019
2 parents 1404d35 + 60edd2b commit dd4ffec
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,14 @@ func getArmClient(c *authentication.Config, skipProviderRegistration bool, partn
}

// Storage Endpoints
storageEndpoint := env.ResourceIdentifiers.Storage
storageAuth, err := c.GetAuthorizationToken(sender, oauthConfig, storageEndpoint)
if err != nil {
return nil, err
}
storageAuth := autorest.NewBearerAuthorizerCallback(sender, func(tenantID, resource string) (*autorest.BearerAuthorizer, error) {
storageSpt, err := c.GetAuthorizationToken(sender, oauthConfig, resource)
if err != nil {
return nil, err
}

return storageSpt, nil
})

// Key Vault Endpoints
keyVaultAuth := autorest.NewBearerAuthorizerCallback(sender, func(tenantID, resource string) (*autorest.BearerAuthorizer, error) {
Expand Down

0 comments on commit dd4ffec

Please sign in to comment.