Microsoft 365 Agents SDK (Python)
Build Microsoft 365 AI Agents with Python
Organizations need AI agents that integrate seamlessly with Microsoft 365. This skill provides production-ready patterns for building Teams bots and Copilot Studio agents using the official Microsoft Agents SDK.
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "Microsoft 365 Agents SDK (Python)". Set up a basic Teams bot that echoes user messages
النتيجة المتوقعة:
- Agent application initialized with aiohttp CloudAdapter
- Message handler registered for activity type: message
- Conversation update handler registered for: membersAdded
- Server running on localhost:3978 with JWT authorization middleware
استخدام "Microsoft 365 Agents SDK (Python)". Add OAuth authentication for Microsoft Graph access
النتيجة المتوقعة:
- MsalConnectionManager configured with Azure AD settings
- Auth handler 'GRAPH' registered for protected routes
- Token acquisition flow ready for interactive or silent auth
- Protected endpoint /me returns user profile with Bearer token
التدقيق الأمني
آمنThis is a prompt-only instructional skill that provides code examples for building Microsoft 365 agents. Static analysis detected no security issues. The skill contains legitimate SDK usage patterns for aiohttp hosting, MSAL authentication, and Copilot Studio integration. Environment variable usage follows security best practices.
عوامل الخطر
🔑 متغيرات البيئة (1)
درجة الجودة
ماذا يمكنك بناءه
Enterprise Teams Bot Development
Build internal company bots for Teams that handle HR queries, IT support tickets, or onboarding workflows with Graph API integration.
Copilot Studio Agent Integration
Create custom AI agents that connect to Copilot Studio engines for specialized domain knowledge and enterprise data access.
Multi-Channel Agent Deployment
Deploy a single agent application that serves multiple channels including Teams, web chat, and custom clients through standardized routing.
جرّب هذه الموجهات
Create a Microsoft 365 agent with aiohttp hosting that responds to 'hello' and 'help' messages. Include basic conversation update handlers and error handling.
Add an auth-protected route that retrieves the user's Microsoft Graph profile and displays their name. Use MSAL connection manager for token acquisition.
Implement a streaming response handler that uses Azure OpenAI to generate creative content. Include sensitivity labels and feedback loop configuration.
Create a standalone script that connects to Copilot Studio using the client SDK. Include token acquisition and conversation management.
أفضل الممارسات
- Always use MemoryStorage only for development. Switch to BlobStorage or CosmosDB for production deployments to ensure data persistence.
- Keep all secrets in environment variables using dotenv. Never commit credentials to source control.
- Call end_stream() in finally blocks when implementing streaming responses to ensure proper connection cleanup.
تجنب
- Do not use the old microsoft.agents import syntax. Always use microsoft_agents with underscores for current SDK versions.
- Avoid hardcoding client IDs, secrets, or tenant IDs directly in source code. Use environment variables exclusively.
- Do not skip JWT authorization middleware in production. Always include jwt_authorization_middleware in aiohttp Application configuration.