Update Azure MSI endpoint (#10624)

* Update Azure MSI endpoint

* Add changelog

---------

Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
Co-authored-by: Tom Chwojko-Frank <117938382+tomcf-hcp@users.noreply.github.com>
This commit is contained in:
Mike Brancato
2024-06-04 13:19:18 -04:00
committed by GitHub
parent 0d9e944e04
commit af47fc927e
2 changed files with 4 additions and 1 deletions

3
changelog/10624.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:improvement
storage/azure: Updated metadata endpoint to `GetMSIEndpoint`, which supports more than just the metadata service.
```

View File

@@ -344,7 +344,7 @@ func (a *AzureBackend) List(ctx context.Context, prefix string) ([]string, error
// getAuthTokenFromIMDS uses the Azure Instance Metadata Service to retrieve a short-lived credential using OAuth // getAuthTokenFromIMDS uses the Azure Instance Metadata Service to retrieve a short-lived credential using OAuth
// more info on this https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview // more info on this https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
func getAuthTokenFromIMDS(resource string) (*adal.ServicePrincipalToken, error) { func getAuthTokenFromIMDS(resource string) (*adal.ServicePrincipalToken, error) {
msiEndpoint, err := adal.GetMSIVMEndpoint() msiEndpoint, err := adal.GetMSIEndpoint()
if err != nil { if err != nil {
return nil, err return nil, err
} }