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# Microsoft Foundry의 Claude Code
6
7> 설정, 구성 및 문제 해결을 포함하여 Microsoft Foundry를 통해 Claude Code를 구성하는 방법을 알아봅니다.
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## 필수 조건
192
193Microsoft Foundry로 Claude Code를 구성하기 전에 다음을 확인하세요:
194
195* Microsoft Foundry에 액세스할 수 있는 Azure 구독
196* Microsoft Foundry 리소스 및 배포를 만들 수 있는 RBAC 권한
197* Azure CLI 설치 및 구성(선택 사항 - 자격 증명을 얻을 다른 메커니즘이 없는 경우에만 필요)
198
199<Note>
200 Claude Code를 여러 사용자에게 배포하는 경우 Anthropic이 새 모델을 출시할 때 중단을 방지하기 위해 [모델 버전을 고정](#4-pin-model-versions)하세요.
201</Note>
202
203## 설정
204
205### 1. Microsoft Foundry 리소스 프로비저닝
206
207먼저 Azure에서 Claude 리소스를 만듭니다:
208
2091. [Microsoft Foundry 포털](https://ai.azure.com/)로 이동합니다
2102. 새 리소스를 만들고 리소스 이름을 기록합니다
2113. Claude 모델에 대한 배포를 만듭니다:
212 * Claude Opus
213 * Claude Sonnet
214 * Claude Haiku
215
216### 2. Azure 자격 증명 구성
217
218Claude Code는 Microsoft Foundry에 대해 두 가지 인증 방법을 지원합니다. 보안 요구 사항에 가장 적합한 방법을 선택하세요.
219
220**옵션 A: API 키 인증**
221
2221. Microsoft Foundry 포털에서 리소스로 이동합니다
2232. **엔드포인트 및 키** 섹션으로 이동합니다
2243. **API 키**를 복사합니다
2254. 환경 변수를 설정합니다:
226
227```bash theme={null}
228export ANTHROPIC_FOUNDRY_API_KEY=your-azure-api-key
229```
230
231**옵션 B: Microsoft Entra ID 인증**
232
233`ANTHROPIC_FOUNDRY_API_KEY`가 설정되지 않으면 Claude Code는 자동으로 Azure SDK [기본 자격 증명 체인](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview)을 사용합니다.
234이는 로컬 및 원격 워크로드를 인증하기 위한 다양한 방법을 지원합니다.
235
236로컬 환경에서는 일반적으로 Azure CLI를 사용할 수 있습니다:
237
238```bash theme={null}
239az login
240```
241
242<Note>
243 Microsoft Foundry를 사용할 때 `/login` 및 `/logout` 명령은 Azure 자격 증명을 통해 인증이 처리되므로 비활성화됩니다.
244</Note>
245
246### 3. Claude Code 구성
247
248Microsoft Foundry를 활성화하려면 다음 환경 변수를 설정합니다:
249
250```bash theme={null}
251# Microsoft Foundry 통합 활성화
252export CLAUDE_CODE_USE_FOUNDRY=1
253
254# Azure 리소스 이름 ({resource}를 리소스 이름으로 바꾸기)
255export ANTHROPIC_FOUNDRY_RESOURCE={resource}
256# 또는 전체 기본 URL 제공:
257# export ANTHROPIC_FOUNDRY_BASE_URL=https://{resource}.services.ai.azure.com/anthropic
258```
259
260### 4. 모델 버전 고정
261
262<Warning>
263 모든 배포에 대해 특정 모델 버전을 고정합니다. 고정하지 않고 모델 별칭(`sonnet`, `opus`, `haiku`)을 사용하면 Claude Code가 Foundry 계정에서 사용할 수 없는 최신 모델 버전을 사용하려고 시도하여 Anthropic이 업데이트를 출시할 때 기존 사용자가 중단될 수 있습니다. Azure 배포를 만들 때 "최신으로 자동 업데이트" 대신 특정 모델 버전을 선택합니다.
264</Warning>
265
266모델 변수를 1단계에서 만든 배포 이름과 일치하도록 설정합니다.
267
268`ANTHROPIC_DEFAULT_OPUS_MODEL`이 없으면 Foundry의 `opus` 별칭은 Opus 4.6으로 확인됩니다. 최신 모델을 사용하려면 Opus 4.7 ID로 설정합니다:
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
276현재 및 레거시 모델 ID는 [모델 개요](https://platform.claude.com/docs/en/about-claude/models/overview)를 참조하세요. 전체 환경 변수 목록은 [모델 구성](/ko/model-config#pin-models-for-third-party-deployments)을 참조하세요.
277
278[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)은 자동으로 활성화됩니다. 기본 5분 대신 1시간 캐시 TTL을 요청하려면 다음 변수를 설정합니다. 1시간 TTL로 캐시 쓰기는 더 높은 요금으로 청구됩니다:
279
280```bash theme={null}
281export ENABLE_PROMPT_CACHING_1H=1
282```
283
284## Azure RBAC 구성
285
286`Azure AI User` 및 `Cognitive Services User` 기본 역할에는 Claude 모델을 호출하는 데 필요한 모든 권한이 포함됩니다.
287
288더 제한적인 권한의 경우 다음을 포함하는 사용자 지정 역할을 만듭니다:
289
290```json theme={null}
291{
292 "permissions": [
293 {
294 "dataActions": [
295 "Microsoft.CognitiveServices/accounts/providers/*"
296 ]
297 }
298 ]
299}
300```
301
302자세한 내용은 [Microsoft Foundry RBAC 설명서](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/rbac-azure-ai-foundry)를 참조하세요.
303
304## 문제 해결
305
306"Failed to get token from azureADTokenProvider: ChainedTokenCredential authentication failed" 오류가 발생하면:
307
308* 환경에서 Entra ID를 구성하거나 `ANTHROPIC_FOUNDRY_API_KEY`를 설정합니다.
309
310## 추가 리소스
311
312* [Microsoft Foundry 설명서](https://learn.microsoft.com/en-us/azure/ai-foundry/what-is-azure-ai-foundry)
313* [Microsoft Foundry 모델](https://ai.azure.com/explore/models)
314* [Microsoft Foundry 가격](https://azure.microsoft.com/en-us/pricing/details/ai-foundry/)