mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
* feat: add Azure AI Foundry provider support Add support for Azure AI Foundry as a fourth cloud provider option alongside Anthropic API, AWS Bedrock, and Google Vertex AI. Changes: - Add use_foundry input to enable Azure AI Foundry authentication - Add Azure environment variables (ANTHROPIC_FOUNDRY_RESOURCE, ANTHROPIC_FOUNDRY_API_KEY, ANTHROPIC_FOUNDRY_BASE_URL) - Support automatic base URL construction from resource name - Add validation logic with mutual exclusivity checks for all providers - Add comprehensive test coverage (7 Azure-specific tests, 3 mutual exclusivity tests) - Add complete Azure AI Foundry documentation with OIDC and API key authentication - Update README to reference Azure AI Foundry support Features: - Primary authentication via Microsoft Entra ID (OIDC) using azure/login action - Optional API key authentication fallback - Custom model deployment name support via ANTHROPIC_DEFAULT_*_MODEL variables - Clear validation error messages for missing configuration All tests pass (25 validation tests total). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: rename Azure AI Foundry to Microsoft Foundry and remove API key support - Rename all references from "Azure AI Foundry" to "Microsoft Foundry" - Remove ANTHROPIC_FOUNDRY_API_KEY support (OIDC only) - Update documentation to reflect OIDC-only authentication - Update tests to remove API key test case 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: simplify Microsoft Foundry setup and remove URL auto-construction - Link to official docs instead of duplicating setup instructions - Remove automatic base URL construction from resource name - Pass ANTHROPIC_FOUNDRY_BASE_URL as-is 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
3.9 KiB
3.9 KiB
Cloud Providers
You can authenticate with Claude using any of these four methods:
- Direct Anthropic API (default)
- Amazon Bedrock with OIDC authentication
- Google Vertex AI with OIDC authentication
- Microsoft Foundry with OIDC authentication
For detailed setup instructions for AWS Bedrock and Google Vertex AI, see the official documentation.
Note:
- Bedrock, Vertex, and Microsoft Foundry use OIDC authentication exclusively
- 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
Model Configuration
Use provider-specific model names based on your chosen provider:
# For direct Anthropic API (default)
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# ... other inputs
# For Amazon Bedrock with OIDC
- uses: anthropics/claude-code-action@v1
with:
use_bedrock: "true"
claude_args: |
--model anthropic.claude-4-0-sonnet-20250805-v1:0
# ... other inputs
# For Google Vertex AI with OIDC
- uses: anthropics/claude-code-action@v1
with:
use_vertex: "true"
claude_args: |
--model claude-4-0-sonnet@20250805
# ... other inputs
# For Microsoft Foundry with OIDC
- uses: anthropics/claude-code-action@v1
with:
use_foundry: "true"
claude_args: |
--model claude-sonnet-4-5
# ... other inputs
OIDC Authentication for Cloud Providers
AWS Bedrock, GCP Vertex AI, and Microsoft Foundry all support OIDC authentication.
# For AWS Bedrock with OIDC
- name: Configure AWS Credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-west-2
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: anthropics/claude-code-action@v1
with:
use_bedrock: "true"
claude_args: |
--model anthropic.claude-4-0-sonnet-20250805-v1:0
# ... other inputs
permissions:
id-token: write # Required for OIDC
# For GCP Vertex AI with OIDC
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: anthropics/claude-code-action@v1
with:
use_vertex: "true"
claude_args: |
--model claude-4-0-sonnet@20250805
# ... other inputs
permissions:
id-token: write # Required for OIDC
# For Microsoft Foundry with OIDC
- name: Authenticate to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: anthropics/claude-code-action@v1
with:
use_foundry: "true"
claude_args: |
--model claude-sonnet-4-5
# ... other inputs
env:
ANTHROPIC_FOUNDRY_BASE_URL: https://my-resource.services.ai.azure.com
permissions:
id-token: write # Required for OIDC
Microsoft Foundry Setup
For detailed setup instructions for Microsoft Foundry, see the official documentation.