Skip to content

Commit 4771da3

Browse files
authored
azure-metrics-exporter: skip auth envvar (#124)
1 parent 10f5fc7 commit 4771da3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ func initArgparser() {
8989
func initAzureConnection() {
9090
var err error
9191

92+
if v := os.Getenv("SKIP_AZURE_AUTH"); v == "true" {
93+
logger.Info("SKIP_AZURE_AUTH set — skipping Azure authentication for test mode")
94+
return
95+
}
96+
9297
if Opts.Azure.Environment != nil {
9398
if err := os.Setenv(azidentity.EnvAzureEnvironment, *Opts.Azure.Environment); err != nil {
9499
logger.Warn(`unable to set environment variable`, slog.String("envVar", azidentity.EnvAzureEnvironment), slog.Any("error", err.Error()))

0 commit comments

Comments
 (0)