Compare commits

...

1 Commits

Author SHA1 Message Date
rekram1-node c16a186231 fix(core): skip unavailable Azure CLI at startup 2026-09-01 18:09:25 +00:00
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ export const AzurePlugin = define({
const credential = connection
? yield* ctx.integration.connection.resolve(connection).pipe(Effect.orElseSucceed(() => undefined))
: undefined
if (credential?.type !== "oauth" || credential.methodID !== methodID) {
if (!available || credential?.type !== "oauth" || credential.methodID !== methodID) {
loaded.resource = undefined
loaded.deployments = undefined
return
@@ -150,6 +150,25 @@ describe("AzurePlugin", () => {
),
)
it.effect("does not invoke Azure CLI at startup when it is no longer installed", () =>
withEnv({ PATH: "/nonexistent" }, () =>
Effect.gen(function* () {
yield* azureCredential
const processes = yield* AppProcess.Service
const commands: string[] = []
const fake = AppProcess.Service.of({
...processes,
run: (command) => {
if (command._tag === "StandardCommand") commands.push(command.args.join(" "))
return processes.run(command)
},
})
yield* addPlugin().pipe(Effect.provideService(AppProcess.Service, fake))
expect(commands).toEqual([])
}),
),
)
it.live("registers Azure CLI authentication alongside API keys", () =>
withEnv({ AZURE_RESOURCE_NAME: undefined, AZURE_COGNITIVE_SERVICES_RESOURCE_NAME: undefined }, () =>
withAzureCommands(