Skip to content

Commit d2e6fd3

Browse files
author
Kyle Rader
committed
keep existing env option
1 parent 38dcd91 commit d2e6fd3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ function createAuthenticator(type: string, tenantId?: string): () => Promise<str
7373
};
7474

7575
case "azcli":
76-
process.env.AZURE_TOKEN_CREDENTIALS = "dev";
76+
case "env":
77+
if (type !== "env") {
78+
process.env.AZURE_TOKEN_CREDENTIALS = "dev";
79+
}
7780
let credential: TokenCredential = new DefaultAzureCredential(); // CodeQL [SM05138] resolved by explicitly setting AZURE_TOKEN_CREDENTIALS
7881
if (tenantId) {
7982
// Use Azure CLI credential if tenantId is provided for multi-tenant scenarios

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const argv = yargs(hideBin(process.argv))
4646
alias: "a",
4747
describe: "Type of authentication to use",
4848
type: "string",
49-
choices: ["interactive", "azcli", "envvar"],
49+
choices: ["interactive", "azcli", "env", "envvar"],
5050
default: defaultAuthenticationType,
5151
})
5252
.option("tenant", {

0 commit comments

Comments
 (0)