How azure/login works
Project type and purpose
• This is an open-source GitHub Action named “Azure Login Action.”
• It provides a Node.js/TypeScript implementation to authenticate a GitHub Actions workflow against Azure using CLI or PowerShell under various authentication mechanisms (OIDC, service principal secret, managed identity).
File structure
• action.yml: action metadata (inputs, outputs, pre/main/post hooks).
• src/
• main.ts – entry point; orchestrates login + cleanup
• cleanup.ts – implements pre/main and post cleanup steps
• common/ – LoginConfig.ts (input parsing), Utils.ts (shared helpers)
• Cli/ – AzureCliLogin.ts (encapsulates az login logic)
• PowerShell/ –
– AzPSLogin.ts (PowerShell login orchestration)
– AzPSScriptBuilder.ts (generates PS scripts for login)
– AzPSUtils.ts (PowerShell environment helpers)
• __tests__/ – Jest unit tests for config and PowerShell modules
• .github/workflows/ – CI pipelines (integration tests, canary, code scanning)
• package.json, tsconfig.json, jest.config.js, etc. for build/test
README for additional insights
• Describes all supported inputs (client-id, tenant-id, creds, auth-type, environment flags).
• Details usage scenarios (OIDC, SP secret, system/user-assigned managed identity).
• Explains cleanup toggles via environment variables for pre and post steps.
• References external services: GitHub OIDC token endpoint, Azure AD, Azure CLI, Azure PowerShell.