Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Prepare applications for Azure deployment by generating infrastructure code, Dockerfiles, and config files.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-identity-java.md
1# Authentication — Java SDK Quick Reference23> Condensed from **azure-identity-java**. Full patterns (workload identity,4> certificate auth, device code, sovereign clouds)5> in the **azure-identity-java** plugin skill if installed.67## Install8```xml9<dependency>10<groupId>com.azure</groupId>11<artifactId>azure-identity</artifactId>12<version>1.15.0</version>13</dependency>14```1516## Quick Start1718> **Auth:** `DefaultAzureCredential` is for local development. See [auth-best-practices.md](../auth-best-practices.md) for production patterns.1920```java21import com.azure.identity.DefaultAzureCredentialBuilder;22var credential = new DefaultAzureCredentialBuilder().build();23```2425## Best Practices26- Use DefaultAzureCredential for **local development only** (CLI, PowerShell, VS Code). In production, use ManagedIdentityCredential — see [auth-best-practices.md](../auth-best-practices.md)27- Managed identity in production — no secrets to manage, automatic rotation28- Azure CLI for local dev — run `az login` before running your app29- Least privilege — grant only required permissions to service principals30- Token caching — enabled by default, reduces auth round-trips31- Environment variables — use for CI/CD, not hardcoded secrets32