Skip to content

Commit

Permalink
Fixup after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
wbreza committed Sep 20, 2023
1 parent b8c969c commit 54bcf14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 0 additions & 6 deletions cli/azd/pkg/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"maps"

"github.com/azure/azure-dev/cli/azd/pkg/config"
"github.com/google/uuid"
"github.com/joho/godotenv"
)

Expand Down Expand Up @@ -161,11 +160,6 @@ func (e *Environment) DotenvSet(key string, value string) {
delete(e.deletedKeys, key)
}

if _, err := uuid.Parse(e.GetSubscriptionId()); err == nil {
tracing.SetGlobalAttributes(fields.SubscriptionIdKey.String(e.GetSubscriptionId()))
} else {
tracing.SetGlobalAttributes(fields.StringHashed(fields.SubscriptionIdKey, e.GetSubscriptionId()))
}
// GetEnvName is shorthand for Getenv(EnvNameEnvVarName)
func (e *Environment) GetEnvName() string {
return e.Getenv(EnvNameEnvVarName)
Expand Down
5 changes: 4 additions & 1 deletion cli/azd/pkg/environment/local_file_data_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/azure/azure-dev/cli/azd/pkg/config"
"github.com/azure/azure-dev/cli/azd/pkg/contracts"
"github.com/azure/azure-dev/cli/azd/pkg/environment/azdcontext"
"github.com/google/uuid"
"github.com/joho/godotenv"
"golang.org/x/exp/slices"
)
Expand Down Expand Up @@ -118,8 +119,10 @@ func (fs *LocalFileDataStore) Reload(ctx context.Context, env *Environment) erro
tracing.SetUsageAttributes(fields.StringHashed(fields.EnvNameKey, env.GetEnvName()))
}

if env.GetSubscriptionId() != "" {
if _, err := uuid.Parse(env.GetSubscriptionId()); err == nil {
tracing.SetGlobalAttributes(fields.SubscriptionIdKey.String(env.GetSubscriptionId()))
} else {
tracing.SetGlobalAttributes(fields.StringHashed(fields.SubscriptionIdKey, env.GetSubscriptionId()))
}

return nil
Expand Down
5 changes: 4 additions & 1 deletion cli/azd/pkg/environment/storage_blob_data_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/azure/azure-dev/cli/azd/pkg/azsdk/storage"
"github.com/azure/azure-dev/cli/azd/pkg/config"
"github.com/azure/azure-dev/cli/azd/pkg/contracts"
"github.com/google/uuid"
"github.com/joho/godotenv"
"golang.org/x/exp/slices"
)
Expand Down Expand Up @@ -172,8 +173,10 @@ func (sbd *StorageBlobDataStore) Reload(ctx context.Context, env *Environment) e
tracing.SetUsageAttributes(fields.StringHashed(fields.EnvNameKey, env.GetEnvName()))
}

if env.GetSubscriptionId() != "" {
if _, err := uuid.Parse(env.GetSubscriptionId()); err == nil {
tracing.SetGlobalAttributes(fields.SubscriptionIdKey.String(env.GetSubscriptionId()))
} else {
tracing.SetGlobalAttributes(fields.StringHashed(fields.SubscriptionIdKey, env.GetSubscriptionId()))
}

return nil
Expand Down

0 comments on commit 54bcf14

Please sign in to comment.