Skip to content

Commit

Permalink
more prints
Browse files Browse the repository at this point in the history
  • Loading branch information
weikanglim committed Nov 8, 2024
1 parent dc0642d commit 80e3a77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/azd/pkg/account/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func (s *SubscriptionsService) ListSubscriptions(
ctx context.Context,
tenantId string,
) ([]*armsubscriptions.Subscription, error) {
fmt.Printf("listSubscriptions: using tenantId: %s\n", tenantId)

client, err := s.createSubscriptionsClient(ctx, tenantId)
if err != nil {
return nil, err
Expand Down
7 changes: 7 additions & 0 deletions cli/azd/pkg/account/subscriptions_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (m *SubscriptionsManager) LookupTenant(ctx context.Context, subscriptionId
}

if principalTenantId != nil {
fmt.Printf("LookupTenant: GetLoggedInServicePrincipalTenantID returned tenantId: %s", *principalTenantId)
return *principalTenantId, nil
}

Expand Down Expand Up @@ -186,12 +187,18 @@ func (m *SubscriptionsManager) GetSubscription(ctx context.Context, subscription
log.Panicf("getSubscriptions: %v", err)
}

fmt.Printf("GetSubscription: loaded subscriptions from cache: %v\n", subscriptions)

for _, sub := range subscriptions {
fmt.Printf("GetSubscription: matching %v with cached value %v\n", subscriptionId, sub.Id)

if sub.Id == subscriptionId {
return &sub, nil
}
}

fmt.Printf("GetSubscription: could not find existing entry for %v\n", subscriptionId)

sub, err := m.getSubscription(ctx, subscriptionId)
if err != nil {
log.Panicf("getSubscription: %v", err)
Expand Down
1 change: 1 addition & 0 deletions cli/azd/pkg/auth/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ func (m *Manager) saveLoginForServicePrincipal(tenantId, clientId string, secret
return err
}

fmt.Printf("saveLoginForServicePrincipal: saved tenantID: %s, clientID: %s\n", tenantId, clientId)
if err := m.saveUserProperties(&userProperties{ClientID: &clientId, TenantID: &tenantId}); err != nil {
return err
}
Expand Down

0 comments on commit 80e3a77

Please sign in to comment.