1> ## Documentation Index
2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt
3> Use this file to discover all available pages before exploring further.
4
5# Claude Code auf Microsoft Foundry
6
7> Erfahren Sie, wie Sie Claude Code über Microsoft Foundry konfigurieren, einschließlich Setup, Konfiguration und Fehlerbehebung.
8
9export const ContactSalesCard = ({surface}) => {
10 const utm = content => `utm_source=claude_code&utm_medium=docs&utm_content=${surface}_${content}`;
11 const iconArrowRight = (size = 13) => <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
12 <line x1="5" y1="12" x2="19" y2="12" />
13 <polyline points="12 5 19 12 12 19" />
14 </svg>;
15 const STYLES = `
16.cc-cs {
17 --cs-slate: #141413;
18 --cs-clay: #d97757;
19 --cs-clay-deep: #c6613f;
20 --cs-gray-000: #ffffff;
21 --cs-gray-700: #3d3d3a;
22 --cs-border-default: rgba(31, 30, 29, 0.15);
23 font-family: inherit;
24}
25.dark .cc-cs {
26 --cs-slate: #f0eee6;
27 --cs-gray-000: #262624;
28 --cs-gray-700: #bfbdb4;
29 --cs-border-default: rgba(240, 238, 230, 0.14);
30}
31.cc-cs-card {
32 display: flex; align-items: center; justify-content: space-between;
33 gap: 16px; padding: 14px 16px; margin: 0;
34 background: var(--cs-gray-000); border: 0.5px solid var(--cs-border-default);
35 border-radius: 8px; flex-wrap: wrap;
36}
37.cc-cs-text { font-size: 13px; color: var(--cs-gray-700); line-height: 1.5; flex: 1; min-width: 240px; }
38.cc-cs-text strong { font-weight: 550; color: var(--cs-slate); }
39.cc-cs-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
40.cc-cs-btn-clay {
41 display: inline-flex; align-items: center; gap: 8px;
42 background: var(--cs-clay-deep); color: #fff; border: none;
43 border-radius: 8px; padding: 8px 14px;
44 font-size: 13px; font-weight: 500;
45 transition: background-color 0.15s; white-space: nowrap;
46}
47.cc-cs-btn-clay:hover { background: var(--cs-clay); }
48.cc-cs-btn-ghost {
49 display: inline-flex; align-items: center; gap: 8px;
50 background: transparent; color: var(--cs-gray-700);
51 border: 0.5px solid var(--cs-border-default);
52 border-radius: 8px; padding: 8px 14px;
53 font-size: 13px; font-weight: 500;
54}
55.cc-cs-btn-ghost:hover { background: rgba(0, 0, 0, 0.04); }
56.dark .cc-cs-btn-ghost:hover { background: rgba(255, 255, 255, 0.04); }
57@media (max-width: 720px) {
58 .cc-cs-actions { width: 100%; }
59}
60`;
61 return <div className="cc-cs not-prose">
62 <style>{STYLES}</style>
63 <div className="cc-cs-card">
64 <div className="cc-cs-text">
65 <strong>Deploying Claude Code across your organization?</strong> Talk to sales about enterprise plans, SSO, and centralized billing.
66 </div>
67 <div className="cc-cs-actions">
68 <a href={`https://claude.com/pricing?${utm('view_plans')}#plans-business`} className="cc-cs-btn-ghost">
69 View plans
70 </a>
71 <a href={`https://claude.com/contact-sales?${utm('contact_sales')}`} className="cc-cs-btn-clay">
72 Contact sales {iconArrowRight()}
73 </a>
74 </div>
75 </div>
76 </div>;
77};
78
79export const Experiment = ({flag, treatment, children}) => {
80 const VID_KEY = 'exp_vid';
81 const CONSENT_COUNTRIES = new Set(['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'RE', 'GP', 'MQ', 'GF', 'YT', 'BL', 'MF', 'PM', 'WF', 'PF', 'NC', 'AW', 'CW', 'SX', 'FO', 'GL', 'AX', 'GB', 'UK', 'AI', 'BM', 'IO', 'VG', 'KY', 'FK', 'GI', 'MS', 'PN', 'SH', 'TC', 'GG', 'JE', 'IM', 'CA', 'BR', 'IN']);
82 const fnv1a = s => {
83 let h = 0x811c9dc5;
84 for (let i = 0; i < s.length; i++) {
85 h ^= s.charCodeAt(i);
86 h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
87 }
88 return h >>> 0;
89 };
90 const bucket = (seed, vid) => fnv1a(fnv1a(seed + vid) + '') % 10000 < 5000 ? 'control' : 'treatment';
91 const [decision] = useState(() => {
92 const params = new URLSearchParams(location.search);
93 const preBucketed = document.documentElement.dataset['gb_' + flag.replace(/-/g, '_')];
94 const force = params.get('gb-force');
95 if (force) {
96 for (const p of force.split(',')) {
97 const [k, v] = p.split(':');
98 if (k === flag) return {
99 variant: v || 'treatment',
100 track: false
101 };
102 }
103 }
104 if (navigator.globalPrivacyControl) {
105 return {
106 variant: 'control',
107 track: false
108 };
109 }
110 const prefsMatch = document.cookie.match(/(?:^|; )anthropic-consent-preferences=([^;]+)/);
111 if (prefsMatch) {
112 try {
113 if (JSON.parse(decodeURIComponent(prefsMatch[1])).analytics !== true) {
114 return {
115 variant: 'control',
116 track: false
117 };
118 }
119 } catch {
120 return {
121 variant: 'control',
122 track: false
123 };
124 }
125 } else {
126 const country = params.get('country')?.toUpperCase() || (document.cookie.match(/(?:^|; )cf_geo=([A-Z]{2})/) || [])[1];
127 if (!country || CONSENT_COUNTRIES.has(country)) {
128 return {
129 variant: 'control',
130 track: false
131 };
132 }
133 }
134 let vid;
135 try {
136 const ajsMatch = document.cookie.match(/(?:^|; )ajs_anonymous_id=([^;]+)/);
137 if (ajsMatch) {
138 vid = decodeURIComponent(ajsMatch[1]).replace(/^"|"$/g, '');
139 } else {
140 vid = localStorage.getItem(VID_KEY);
141 if (!vid) {
142 vid = crypto.randomUUID();
143 }
144 document.cookie = `ajs_anonymous_id=${vid}; domain=.claude.com; path=/; Secure; SameSite=Lax; max-age=31536000`;
145 }
146 try {
147 localStorage.setItem(VID_KEY, vid);
148 } catch {}
149 } catch {
150 return {
151 variant: 'control',
152 track: false
153 };
154 }
155 const variant = preBucketed === '1' ? 'treatment' : preBucketed === '0' ? 'control' : bucket(flag, vid);
156 return {
157 variant,
158 track: true,
159 vid
160 };
161 });
162 useEffect(() => {
163 if (!decision.track) return;
164 fetch('https://api.anthropic.com/api/event_logging/v2/batch', {
165 method: 'POST',
166 headers: {
167 'Content-Type': 'application/json',
168 'x-service-name': 'claude_code_docs'
169 },
170 body: JSON.stringify({
171 events: [{
172 event_type: 'GrowthbookExperimentEvent',
173 event_data: {
174 device_id: decision.vid,
175 anonymous_id: decision.vid,
176 timestamp: new Date().toISOString(),
177 experiment_id: flag,
178 variation_id: decision.variant === 'treatment' ? 1 : 0,
179 environment: 'production'
180 }
181 }]
182 }),
183 keepalive: true
184 }).catch(() => {});
185 }, []);
186 return decision.variant === 'treatment' ? treatment : children;
187};
188
189<Experiment flag="docs-contact-sales-cta" treatment={<ContactSalesCard surface="foundry" />} />
190
191## Voraussetzungen
192
193Bevor Sie Claude Code mit Microsoft Foundry konfigurieren, stellen Sie sicher, dass Sie über Folgendes verfügen:
194
195* Ein Azure-Abonnement mit Zugriff auf Microsoft Foundry
196* RBAC-Berechtigungen zum Erstellen von Microsoft Foundry-Ressourcen und Bereitstellungen
197* Azure CLI installiert und konfiguriert (optional - nur erforderlich, wenn Sie keinen anderen Mechanismus zum Abrufen von Anmeldedaten haben)
198
199<Note>
200 Wenn Sie Claude Code für mehrere Benutzer bereitstellen, [fixieren Sie Ihre Modellversionen](#4-pin-model-versions), um Fehler zu vermeiden, wenn Anthropic neue Modelle veröffentlicht.
201</Note>
202
203## Setup
204
205### 1. Microsoft Foundry-Ressource bereitstellen
206
207Erstellen Sie zunächst eine Claude-Ressource in Azure:
208
2091. Navigieren Sie zum [Microsoft Foundry-Portal](https://ai.azure.com/)
2102. Erstellen Sie eine neue Ressource und notieren Sie sich Ihren Ressourcennamen
2113. Erstellen Sie Bereitstellungen für die Claude-Modelle:
212 * Claude Opus
213 * Claude Sonnet
214 * Claude Haiku
215
216### 2. Azure-Anmeldedaten konfigurieren
217
218Claude Code unterstützt zwei Authentifizierungsmethoden für Microsoft Foundry. Wählen Sie die Methode, die Ihren Sicherheitsanforderungen am besten entspricht.
219
220**Option A: API-Schlüssel-Authentifizierung**
221
2221. Navigieren Sie zu Ihrer Ressource im Microsoft Foundry-Portal
2232. Gehen Sie zum Abschnitt **Endpunkte und Schlüssel**
2243. Kopieren Sie **API-Schlüssel**
2254. Legen Sie die Umgebungsvariable fest:
226
227```bash theme={null}
228export ANTHROPIC_FOUNDRY_API_KEY=your-azure-api-key
229```
230
231**Option B: Microsoft Entra ID-Authentifizierung**
232
233Wenn `ANTHROPIC_FOUNDRY_API_KEY` nicht gesetzt ist, verwendet Claude Code automatisch die Azure SDK [Standard-Anmeldekette](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview).
234Dies unterstützt eine Vielzahl von Methoden zur Authentifizierung lokaler und Remote-Workloads.
235
236In lokalen Umgebungen können Sie häufig die Azure CLI verwenden:
237
238```bash theme={null}
239az login
240```
241
242<Note>
243 Bei Verwendung von Microsoft Foundry sind die Befehle `/login` und `/logout` deaktiviert, da die Authentifizierung über Azure-Anmeldedaten erfolgt.
244</Note>
245
246### 3. Claude Code konfigurieren
247
248Legen Sie die folgenden Umgebungsvariablen fest, um Microsoft Foundry zu aktivieren:
249
250```bash theme={null}
251# Microsoft Foundry-Integration aktivieren
252export CLAUDE_CODE_USE_FOUNDRY=1
253
254# Azure-Ressourcenname (ersetzen Sie {resource} durch Ihren Ressourcennamen)
255export ANTHROPIC_FOUNDRY_RESOURCE={resource}
256# Oder geben Sie die vollständige Basis-URL an:
257# export ANTHROPIC_FOUNDRY_BASE_URL=https://{resource}.services.ai.azure.com/anthropic
258```
259
260### 4. Modellversionen fixieren
261
262<Warning>
263 Fixieren Sie spezifische Modellversionen für jede Bereitstellung. Wenn Sie Modellaliase (`sonnet`, `opus`, `haiku`) ohne Fixierung verwenden, kann Claude Code versuchen, eine neuere Modellversion zu verwenden, die nicht in Ihrem Foundry-Konto verfügbar ist, was bestehende Benutzer bricht, wenn Anthropic Updates veröffentlicht. Wenn Sie Azure-Bereitstellungen erstellen, wählen Sie eine spezifische Modellversion anstelle von „automatisch auf die neueste Version aktualisieren".
264</Warning>
265
266Legen Sie die Modellvariablen so fest, dass sie den Bereitstellungsnamen entsprechen, die Sie in Schritt 1 erstellt haben.
267
268Ohne `ANTHROPIC_DEFAULT_OPUS_MODEL` wird der `opus`-Alias auf Foundry zu Opus 4.6 aufgelöst. Legen Sie ihn auf die Opus 4.7-ID fest, um das neueste Modell zu verwenden:
269
270```bash theme={null}
271export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-7'
272export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
273export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'
274```
275
276Aktuelle und ältere Modell-IDs finden Sie unter [Modellübersicht](https://platform.claude.com/docs/en/about-claude/models/overview). Siehe [Modellkonfiguration](/de/model-config#pin-models-for-third-party-deployments) für die vollständige Liste der Umgebungsvariablen.
277
278[Prompt Caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) ist automatisch aktiviert. Um stattdessen eine 1-Stunden-Cache-TTL anstelle des 5-Minuten-Standards anzufordern, legen Sie die folgende Variable fest; Cache-Schreibvorgänge mit einer 1-Stunden-TTL werden mit einem höheren Satz abgerechnet:
279
280```bash theme={null}
281export ENABLE_PROMPT_CACHING_1H=1
282```
283
284## Azure RBAC-Konfiguration
285
286Die Standardrollen `Azure AI User` und `Cognitive Services User` enthalten alle erforderlichen Berechtigungen zum Aufrufen von Claude-Modellen.
287
288Für restriktivere Berechtigungen erstellen Sie eine benutzerdefinierte Rolle mit Folgendem:
289
290```json theme={null}
291{
292 "permissions": [
293 {
294 "dataActions": [
295 "Microsoft.CognitiveServices/accounts/providers/*"
296 ]
297 }
298 ]
299}
300```
301
302Weitere Informationen finden Sie in der [Microsoft Foundry RBAC-Dokumentation](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/rbac-azure-ai-foundry).
303
304## Fehlerbehebung
305
306Wenn Sie einen Fehler erhalten „Failed to get token from azureADTokenProvider: ChainedTokenCredential authentication failed":
307
308* Konfigurieren Sie Entra ID in der Umgebung, oder legen Sie `ANTHROPIC_FOUNDRY_API_KEY` fest.
309
310## Zusätzliche Ressourcen
311
312* [Microsoft Foundry-Dokumentation](https://learn.microsoft.com/en-us/azure/ai-foundry/what-is-azure-ai-foundry)
313* [Microsoft Foundry-Modelle](https://ai.azure.com/explore/models)
314* [Microsoft Foundry-Preise](https://azure.microsoft.com/en-us/pricing/details/ai-foundry/)