diff --git a/action.yml b/action.yml index 431962a3e..2b2f09b1f 100644 --- a/action.yml +++ b/action.yml @@ -282,6 +282,7 @@ runs: # Microsoft Foundry configuration ANTHROPIC_FOUNDRY_RESOURCE: ${{ env.ANTHROPIC_FOUNDRY_RESOURCE }} ANTHROPIC_FOUNDRY_BASE_URL: ${{ env.ANTHROPIC_FOUNDRY_BASE_URL }} + ANTHROPIC_FOUNDRY_API_KEY: ${{ env.ANTHROPIC_FOUNDRY_API_KEY }} ANTHROPIC_DEFAULT_SONNET_MODEL: ${{ env.ANTHROPIC_DEFAULT_SONNET_MODEL }} ANTHROPIC_DEFAULT_HAIKU_MODEL: ${{ env.ANTHROPIC_DEFAULT_HAIKU_MODEL }} ANTHROPIC_DEFAULT_OPUS_MODEL: ${{ env.ANTHROPIC_DEFAULT_OPUS_MODEL }} diff --git a/base-action/action.yml b/base-action/action.yml index b0e866ef7..687dbfab6 100644 --- a/base-action/action.yml +++ b/base-action/action.yml @@ -198,6 +198,7 @@ runs: # Microsoft Foundry configuration ANTHROPIC_FOUNDRY_RESOURCE: ${{ env.ANTHROPIC_FOUNDRY_RESOURCE }} ANTHROPIC_FOUNDRY_BASE_URL: ${{ env.ANTHROPIC_FOUNDRY_BASE_URL }} + ANTHROPIC_FOUNDRY_API_KEY: ${{ env.ANTHROPIC_FOUNDRY_API_KEY }} ANTHROPIC_DEFAULT_SONNET_MODEL: ${{ env.ANTHROPIC_DEFAULT_SONNET_MODEL }} ANTHROPIC_DEFAULT_HAIKU_MODEL: ${{ env.ANTHROPIC_DEFAULT_HAIKU_MODEL }} ANTHROPIC_DEFAULT_OPUS_MODEL: ${{ env.ANTHROPIC_DEFAULT_OPUS_MODEL }} diff --git a/docs/cloud-providers.md b/docs/cloud-providers.md index a02846df0..ab0722c0e 100644 --- a/docs/cloud-providers.md +++ b/docs/cloud-providers.md @@ -3,15 +3,17 @@ You can authenticate with Claude using any of these four methods: 1. Direct Anthropic API (default) -2. Amazon Bedrock with OIDC authentication -3. Google Vertex AI with OIDC authentication -4. Microsoft Foundry with OIDC authentication +2. Amazon Bedrock +3. Google Vertex AI +4. Microsoft Foundry For detailed setup instructions for AWS Bedrock and Google Vertex AI, see the [official documentation](https://code.claude.com/docs/en/github-actions#for-aws-bedrock:). **Note**: -- Bedrock, Vertex, and Microsoft Foundry use OIDC authentication exclusively +- **AWS Bedrock** supports IAM access keys (`AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY`), temporary credentials via OIDC, or bearer token (`AWS_BEARER_TOKEN_BEDROCK`) +- **Google Vertex AI** supports service account key files (`GOOGLE_APPLICATION_CREDENTIALS`) or OIDC via Workload Identity Federation +- **Microsoft Foundry** supports API key (`ANTHROPIC_FOUNDRY_API_KEY`) or OIDC via Azure login - AWS Bedrock automatically uses cross-region inference profiles for certain models - For cross-region inference profile models, you need to request and be granted access to the Claude models in all regions that the inference profile uses @@ -138,4 +140,26 @@ permissions: ## Microsoft Foundry Setup -For detailed setup instructions for Microsoft Foundry, see the [official documentation](https://docs.anthropic.com/en/docs/claude-code/microsoft-foundry). +For detailed setup instructions for Microsoft Foundry, see the [official documentation](https://code.claude.com/docs/en/microsoft-foundry). + +### Using API Key Authentication (Simpler Setup) + +Microsoft Foundry also supports API key authentication, which is simpler than OIDC and doesn't require Azure login. + +```yaml +- uses: anthropics/claude-code-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} # Or set up your own GitHub App if you're using your own app like in previous examples + use_foundry: "true" + claude_args: | + --model claude-sonnet-4-5 + # ... other inputs + env: + ANTHROPIC_FOUNDRY_RESOURCE: ${{ secrets.ANTHROPIC_FOUNDRY_RESOURCE }} + ANTHROPIC_FOUNDRY_API_KEY: ${{ secrets.ANTHROPIC_FOUNDRY_API_KEY }} +``` + +**Required secrets:** + +- `ANTHROPIC_FOUNDRY_RESOURCE`: Your Azure Foundry resource name (e.g., `my-foundry-resource`) +- `ANTHROPIC_FOUNDRY_API_KEY`: Your Azure Foundry API key