본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)40k · #7298

msgraph-sdk

하는 일

이 도구는 개발자가 이메일, 캘린더, 파일 같은 Microsoft 365 데이터에 프로그램을 연결하도록 돕습니다. 인증과 Microsoft 기능 호출을 간단하게 만들어 줍니다.

사용하는 경우

  • ✓특정 계정의 이메일을 읽는 앱을 만들 때.
  • ✓캘린더에 회의를 예약하는 프로그램을 개발할 때.
  • ✓OneDrive나 SharePoint의 파일을 관리하는 시스템을 만들 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/msgraph-sdk/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/msgraph-sdk/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 Python 앱을 Microsoft 365의 사용자 데이터에 어떻게 연결하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

프로그램은 'SDK'라는 미리 만들어진 도구 모음을 사용해 Microsoft 서비스와 통신합니다. 보안(누가 무엇에 접근할 수 있는지)과 데이터를 조회하거나 바꾸는 요청을 처리합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Microsoft Graph SDK

Use this skill when integrating Microsoft Graph into an application to access Microsoft 365 data and services.

Always ground implementation in the current Microsoft Graph SDK documentation and SDK version for the target language rather than relying on memory alone.

Determine the target language first

  1. Use the .NET workflow when the project contains .cs, .csproj, or .sln files, or when the user asks for C# guidance. Follow references/dotnet.md.
  2. Use the TypeScript / JavaScript workflow when the project contains package.json, .ts, or .js files, or when the user asks for Node.js / browser guidance. Follow references/typescript.md.
  3. Use the Python workflow when the project contains .py, pyproject.toml, or requirements.txt, or when the user asks for Python guidance. Follow references/python.md.
  4. If multiple languages are present, match the language of the files being edited or ask the user.

Always consult live documentation

Authentication — choose the right pattern

Selecting the wrong auth flow is the most common Graph integration mistake. Apply this decision tree before writing any auth code:

Scenario Flow to use
Background service / daemon with no user Client credentials (app-only)
Agent or API acting on behalf of a signed-in user On-Behalf-Of (OBO)
App running in Azure (Function, Container App, VM) Managed Identity (preferred over secrets)
CLI tool or local dev script Device code or interactive browser
Single-page app (browser only) Authorization code + PKCE
  • Never use client credentials when a user context is required — Graph enforces this at the permission level (application vs. delegated).
  • Prefer DefaultAzureCredential in Azure-hosted apps; it tries managed identity first and falls back gracefully for local dev.
  • Never hardcode secrets. Use environment variables, Azure Key Vault, or the Secret Manager.

Core SDK usage patterns

Building the client

Always construct GraphServiceClient once and reuse it (it manages token caching internally).

Pass a credential from the Azure Identity library — never build raw HTTP clients manually.

Making calls

  • Use the fluent builder API: client.Users[userId].Messages.GetAsync(...).
  • Always await async calls.
  • Specify $select to limit returned fields — Graph returns large default payloads.
  • Use $filter server-side rather than filtering returned collections in memory.
  • Use $expand to fetch related resources in a single call when relationships are small.

Pagination

Graph paginates collections. Never assume all items arrive in one response:

  • Check for an @odata.nextLink on the response.
  • Use the SDK's PageIterator helper (available in all three SDKs) to walk pages automatically.
  • Set $top to control page size (max varies by resource, typically 999).

Advanced patterns

Batch requests

Combine up to 20 independent Graph calls into a single HTTP request using the $batch endpoint. Use batching when:

  • Initializing data for a dashboard or agent that needs multiple resources upfront.
  • Reducing latency in high-call-count operations.

Batch responses arrive out of order — match them by the id field you assigned each request.

Delta queries

Use delta queries to sync changes incrementally instead of polling full collections:

  • First call: GET /users/delta returns all items + a @odata.deltaLink.
  • Subsequent calls: use the deltaLink to receive only what changed since the last sync.
  • Supported on: users, groups, messages, calendar events, Teams channels, and more.
  • Store the deltaLink durably (database, blob) between sync runs.

Change notifications (webhooks)

Subscribe to resource changes with POST /subscriptions:

  • Graph delivers change events to your HTTPS notification URL.
  • Subscriptions expire — renew them before expirationDateTime (max varies by resource; typically 1–3 days for mail/calendar, up to 4230 minutes for users/groups).

…

자주 묻는 질문

Microsoft Graph는 무엇인가요?

사용자, 메일, 캘린더, 파일 등 Microsoft 365 데이터와 서비스에 접근하는 관문입니다.

SDK는 무엇인가요?

Software Development Kit의 약자로, 특정 서비스(이 경우 Microsoft Graph)와 상호작용하는 프로그램을 더 쉽게 만들도록 돕는 도구 모음입니다.

인증을 왜 신경 써야 하나요?

인증은 권한이 있는 사용자나 애플리케이션만 데이터에 접근하도록 보장해, 민감한 정보를 보호합니다.

상세 정보

작성자의 원본 설명

Integrate Microsoft Graph SDK into any project — .NET, TypeScript/JavaScript, or Python. Covers auth patterns (client credentials, OBO, managed identity), SDK setup, calling Graph APIs, batching, delta queries, change notifications, throttling, and permission scopes. Use when accessing Microsoft 365 data (users, mail, calendar, Teams, files, SharePoint) from any application type.

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7298
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬