@@ -11,7 +11,6 @@ import (
1111 "os"
1212 "slices"
1313 "strconv"
14- "strings"
1514
1615 "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
1716 "github.com/MakeNowJust/heredoc/v2"
@@ -22,6 +21,7 @@ import (
2221 "github.com/azure/azure-dev/cli/azd/pkg/cloud"
2322 "github.com/azure/azure-dev/cli/azd/pkg/environment"
2423 "github.com/azure/azure-dev/cli/azd/pkg/input"
24+ "github.com/azure/azure-dev/cli/azd/pkg/stringutil"
2525)
2626
2727type LocationFilterPredicate func (loc account.Location ) bool
@@ -157,7 +157,7 @@ func (p *DefaultPrompter) PromptResourceGroupFrom(
157157 }
158158
159159 slices .SortFunc (groups , func (a , b * azapi.Resource ) int {
160- return strings . Compare (a .Name , b .Name )
160+ return stringutil . CompareLower (a .Name , b .Name )
161161 })
162162
163163 canCreateNeResourceGroup := ! options .DisableCreateNew
@@ -226,6 +226,10 @@ func (p *DefaultPrompter) getSubscriptionOptions(ctx context.Context) ([]string,
226226 return nil , nil , nil , fmt .Errorf ("listing accounts: %w" , err )
227227 }
228228
229+ slices .SortFunc (subscriptionInfos , func (a , b account.Subscription ) int {
230+ return stringutil .CompareLower (a .Name , b .Name )
231+ })
232+
229233 // The default value is based on AZURE_SUBSCRIPTION_ID, falling back to whatever default subscription in
230234 // set in azd's config.
231235 defaultSubscriptionId := os .Getenv (environment .SubscriptionIdEnvVarName )
0 commit comments