diff --git a/go.mod b/go.mod index 013149ce0e1e..42255a79cfcc 100644 --- a/go.mod +++ b/go.mod @@ -97,4 +97,4 @@ require ( go 1.21 -replace github.com/hashicorp/go-azure-sdk/sdk => github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618015335-3e20f041211b +replace github.com/hashicorp/go-azure-sdk/sdk => github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618024049-7ff1664b8426 diff --git a/go.sum b/go.sum index eda9252b1761..edafc31b0858 100644 --- a/go.sum +++ b/go.sum @@ -171,8 +171,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618015335-3e20f041211b h1:ONSSlymhDqnO1tuSBx+vaEkNZfAm2G5K6hPuqiNalbU= -github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618015335-3e20f041211b/go.mod h1:NAxKREj3nznyhRvKoxlp5y0Pk03fqvqOw/m+4XpAG4U= +github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618024049-7ff1664b8426 h1:5jajp5EaAb/VcKAUlFjdC4NhxJ6+D7HYc0nvElC3JQg= +github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618024049-7ff1664b8426/go.mod h1:NAxKREj3nznyhRvKoxlp5y0Pk03fqvqOw/m+4XpAG4U= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 h1:HHSqLmPZaa8U66U7N2Gtx3gYptSHrUB/rB5t+6fZTkQ= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8/go.mod h1:iMzpAzVr2v/NUVie/apAYtZlFZYFndPcp6/E0VLxgAM= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= diff --git a/vendor/github.com/hashicorp/go-azure-sdk/sdk/environments/azure_public.go b/vendor/github.com/hashicorp/go-azure-sdk/sdk/environments/azure_public.go index 737fbdb2684d..df4d9adae418 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/sdk/environments/azure_public.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/sdk/environments/azure_public.go @@ -3,18 +3,30 @@ package environments +import ( + "fmt" + "os" +) + const AzurePublicCloud = "Public" +const AzureRegionalAuthorityName = "AZURE_REGIONAL_AUTHORITY_NAME" +const AzurePublicLoginEndpointWithRegion = "https://%s.login.microsoft.com" func AzurePublic() *Environment { env := baseEnvironmentWithName(AzurePublicCloud) + loginEndpoint := "https://login.microsoftonline.com" + if authorityRegion := os.Getenv(AzureRegionalAuthorityName); authorityRegion != "" { + loginEndpoint = fmt.Sprintf(AzurePublicLoginEndpointWithRegion, authorityRegion) + } + env.Authorization = &Authorization{ Audiences: []string{ "https://management.core.windows.net", "https://management.azure.com", }, IdentityProvider: "AAD", - LoginEndpoint: "https://login.microsoftonline.com", + LoginEndpoint: loginEndpoint, Tenant: "common", } env.ResourceManager = ResourceManagerAPI("https://management.azure.com") diff --git a/vendor/modules.txt b/vendor/modules.txt index 51728f90c397..094d90822797 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1154,7 +1154,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/saplands github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/saprecommendations github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/sapsupportedsku github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/sapvirtualinstances -# github.com/hashicorp/go-azure-sdk/sdk v0.20240507.1095453 => github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618015335-3e20f041211b +# github.com/hashicorp/go-azure-sdk/sdk v0.20240507.1095453 => github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618024049-7ff1664b8426 ## explicit; go 1.21 github.com/hashicorp/go-azure-sdk/sdk/auth github.com/hashicorp/go-azure-sdk/sdk/auth/autorest @@ -1601,4 +1601,4 @@ google.golang.org/protobuf/types/known/timestamppb # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# github.com/hashicorp/go-azure-sdk/sdk => github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618015335-3e20f041211b +# github.com/hashicorp/go-azure-sdk/sdk => github.com/magodo/go-azure-sdk/sdk v0.0.0-20240618024049-7ff1664b8426