Skip to content

Commit

Permalink
Revert parts of the refactor that aren't needed
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek committed Feb 15, 2024
1 parent 7265227 commit 6e0f788
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
19 changes: 0 additions & 19 deletions cli/azd/cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization"
"github.com/MakeNowJust/heredoc/v2"
"github.com/azure/azure-dev/cli/azd/cmd/actions"
"github.com/azure/azure-dev/cli/azd/cmd/middleware"
Expand Down Expand Up @@ -399,24 +398,6 @@ func registerCommonDependencies(container *ioc.NestedContainer) {
BuildArmClientOptions()
})

/////////////////////////////////////////////
container.MustRegisterSingleton(func(
credential account.TokenCredentialForSubscription,
clientOptionsBuilderFactory azsdk.ClientOptionsBuilderFactory,
userAgent httputil.UserAgent,
) (*armauthorization.RoleDefinitionsClient, error) {
// Custom options because this client does not have correlation policies
options := clientOptionsBuilderFactory.ClientOptionsBuilder().
WithPerCallPolicy(azsdk.NewUserAgentPolicy(string(userAgent))).
BuildArmClientOptions()
client, err := armauthorization.NewRoleDefinitionsClient(credential, options)
if err != nil {
return nil, fmt.Errorf("creating ARM Role Definitions client: %w", err)
}

return client, nil
})

container.MustRegisterSingleton(func(
httpClient httputil.HttpClient,
userAgent httputil.UserAgent,
Expand Down
2 changes: 0 additions & 2 deletions cli/azd/pkg/account/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"github.com/azure/azure-dev/cli/azd/pkg/auth"
)

type TokenCredentialForSubscription = azcore.TokenCredential

// SubscriptionCredentialProvider provides an [azcore.TokenCredential] configured
// to use the tenant id that corresponds to the tenant the given subscription
// is located in.
Expand Down

0 comments on commit 6e0f788

Please sign in to comment.