diff --git a/.gitignore b/.gitignore index dfcfd56f..992c6c4e 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,9 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ +ProxyAgent-NodeJS/.localConfigs +ProxyAgent-NodeJS/appPackage/build/appPackage.dev.zip +ProxyAgent-NodeJS/appPackage/build/appPackage.local.zip +ProxyAgent-NodeJS/appPackage/build/manifest.dev.json +ProxyAgent-NodeJS/appPackage/build/manifest.local.json +ProxyAgent-NodeJS/env/.env.local diff --git a/ProxyAgent-CSharp/AzureAgentToM365ATK/Agents/AzureAgent.cs b/ProxyAgent-CSharp/AzureAgentToM365ATK/Agents/AzureAgent.cs index 880bc1e0..847555eb 100644 --- a/ProxyAgent-CSharp/AzureAgentToM365ATK/Agents/AzureAgent.cs +++ b/ProxyAgent-CSharp/AzureAgentToM365ATK/Agents/AzureAgent.cs @@ -17,6 +17,7 @@ using Microsoft.Agents.Core.Models; using System.Collections.Concurrent; using Microsoft.Agents.AI; +using Microsoft.Agents.AI.AzureAI; using System.Text.Json; using Microsoft.Agents.Core.Serialization; using Microsoft.Extensions.AI; @@ -132,8 +133,9 @@ protected async Task SendMessageToAzureAgent(ITurnContext turnContext, ITurnStat _agentModelCache.TryAdd(this._agentId, agentModel); } - // Create an instance of the AzureAIAgent with the agent model and client. - AIAgent _existingAgent = _aiProjectClient.GetAIAgent(agentModel); + // Create an instance of the AIAgent using the new GetAIAgentAsync extension method + // The new API accepts agentId (string) instead of the Response object + AIAgent _existingAgent = await _aiProjectClient.GetAIAgentAsync(this._agentId, cancellationToken: cancellationToken).ConfigureAwait(false); // Get or create thread: AgentThread _agentThread = GetConversationThread(_existingAgent, turnState); diff --git a/ProxyAgent-CSharp/AzureAgentToM365ATK/AzureAgentToM365ATK.csproj b/ProxyAgent-CSharp/AzureAgentToM365ATK/AzureAgentToM365ATK.csproj index 606b28f1..f0e8c014 100644 --- a/ProxyAgent-CSharp/AzureAgentToM365ATK/AzureAgentToM365ATK.csproj +++ b/ProxyAgent-CSharp/AzureAgentToM365ATK/AzureAgentToM365ATK.csproj @@ -18,15 +18,17 @@ - - - - - - - - - - + + + + + + + + + + + + diff --git a/ProxyAgent-CSharp/M365Agent/AZURE_DEPLOYMENT.md b/ProxyAgent-CSharp/M365Agent/AZURE_DEPLOYMENT.md index 1e429699..d99022c0 100644 --- a/ProxyAgent-CSharp/M365Agent/AZURE_DEPLOYMENT.md +++ b/ProxyAgent-CSharp/M365Agent/AZURE_DEPLOYMENT.md @@ -883,7 +883,7 @@ You've successfully deployed your M365 Agent to Azure! 🎉 5. ✅ Implement CI/CD for automated deployments **Resources:** -- [Microsoft 365 Agents Toolkit Documentation](https://aka.ms/teams-toolkit-docs) +- [Microsoft 365 Agents Toolkit Documentation](https://learn.microsoft.com/en-us/microsoft-365/developer/overview-m365-agents-toolkit) - [Azure Bot Service Documentation](https://learn.microsoft.com/azure/bot-service/) - [Bicep Documentation](https://learn.microsoft.com/azure/azure-resource-manager/bicep/) - [Microsoft 365 Agents SDK](https://github.com/microsoft/agents) diff --git a/ProxyAgent-CSharp/M365Agent/LOCAL_DEPLOYMENT.md b/ProxyAgent-CSharp/M365Agent/LOCAL_DEPLOYMENT.md index 72a51655..815e1be9 100644 --- a/ProxyAgent-CSharp/M365Agent/LOCAL_DEPLOYMENT.md +++ b/ProxyAgent-CSharp/M365Agent/LOCAL_DEPLOYMENT.md @@ -1223,7 +1223,7 @@ Production uses: ### Resources **Documentation:** -- [Microsoft 365 Agents Toolkit](https://aka.ms/teams-toolkit-docs) +- [Microsoft 365 Agents Toolkit](https://learn.microsoft.com/en-us/microsoft-365/developer/overview-m365-agents-toolkit) - [Microsoft 365 Agents SDK for .NET](https://github.com/microsoft/agents) - [Dev Tunnels Documentation](https://learn.microsoft.com/azure/developer/dev-tunnels/) - [Teams Platform](https://learn.microsoft.com/microsoftteams/platform/) diff --git a/ProxyAgent-CSharp/M365Agent/README.md b/ProxyAgent-CSharp/M365Agent/README.md index 6a69323c..26ad9034 100644 --- a/ProxyAgent-CSharp/M365Agent/README.md +++ b/ProxyAgent-CSharp/M365Agent/README.md @@ -117,4 +117,4 @@ New to Teams app development or Microsoft 365 Agents Toolkit? Explore Teams app **Questions:** - Microsoft Q&A: [Teams Development](https://learn.microsoft.com/answers/topics/microsoft-teams.html) -- Documentation: [Microsoft 365 Agents Toolkit](https://aka.ms/teams-toolkit-docs) +- Documentation: [Microsoft 365 Agents Toolkit](https://learn.microsoft.com/en-us/microsoft-365/developer/overview-m365-agents-toolkit) diff --git a/ProxyAgent-CSharp/M365Agent/appPackage/manifest.json b/ProxyAgent-CSharp/M365Agent/appPackage/manifest.json index 05f0dec9..5d6454ed 100644 --- a/ProxyAgent-CSharp/M365Agent/appPackage/manifest.json +++ b/ProxyAgent-CSharp/M365Agent/appPackage/manifest.json @@ -1,6 +1,6 @@ { - "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/vdevPreview/MicrosoftTeams.schema.json", - "manifestVersion": "devPreview", + "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.24/MicrosoftTeams.schema.json", + "manifestVersion": "1.24", "version": "1.0.0", "id": "${{TEAMS_APP_ID}}", "developer": { diff --git a/ProxyAgent-CSharp/M365Agent/scripts/get-teams-ips.ps1 b/ProxyAgent-CSharp/M365Agent/scripts/get-teams-ips.ps1 new file mode 100644 index 00000000..9fd40419 --- /dev/null +++ b/ProxyAgent-CSharp/M365Agent/scripts/get-teams-ips.ps1 @@ -0,0 +1,85 @@ +# Script to download Microsoft 365 endpoints and extract Teams IP ranges +# Filters by ServiceArea = "Skype" and tcpPorts = "80,443" + +param( + [string]$OutputFormat = "CommaList" # Options: CommaList, Array, Json +) + +# Data source URL +$endpointsUrl = "https://endpoints.office.com/endpoints/worldwide?clientrequestid=b10c5ed1-bad1-445f-b386-b919946339a7" + +Write-Host "Downloading Microsoft 365 endpoints..." -ForegroundColor Cyan + +try { + # Download JSON data + $endpoints = Invoke-RestMethod -Uri $endpointsUrl -Method Get -ErrorAction Stop + + Write-Host "Successfully downloaded $($endpoints.Count) endpoint definitions" -ForegroundColor Green + + # Filter for Microsoft Teams (Skype serviceArea with TCP ports 80,443 and has IPs property) + $teamsEndpoint = $endpoints | Where-Object { + $_.serviceArea -eq "Skype" -and $_.tcpPorts -eq "80,443" -and $_.ips + } + + if (-not $teamsEndpoint) { + Write-Host "ERROR: Could not find Microsoft Teams endpoint with serviceArea='Skype', tcpPorts='80,443', and IPs defined" -ForegroundColor Red + exit 1 + } + + Write-Host "`nFound Microsoft Teams endpoint (ID: $($teamsEndpoint.id))" -ForegroundColor Green + Write-Host "Service Area Display Name: $($teamsEndpoint.serviceAreaDisplayName)" -ForegroundColor Gray + + # Separate IPv4 and IPv6 addresses + $ipv4List = @() + $ipv6List = @() + + foreach ($ip in $teamsEndpoint.ips) { + if ($ip -match ":") { + # IPv6 (contains colons) + $ipv6List += $ip + } else { + # IPv4 + $ipv4List += $ip + } + } + + # Output results + Write-Host "`n================================" -ForegroundColor Cyan + Write-Host "RESULTS" -ForegroundColor Cyan + Write-Host "================================" -ForegroundColor Cyan + + Write-Host "`nIPv4 Ranges ($($ipv4List.Count) total):" -ForegroundColor Yellow + $ipv4String = $ipv4List -join "," + Write-Host $ipv4String -ForegroundColor White + + Write-Host "`nIPv6 Ranges ($($ipv6List.Count) total):" -ForegroundColor Yellow + $ipv6String = $ipv6List -join "," + Write-Host $ipv6String -ForegroundColor White + + # Export to variables for easy use + Write-Host "`n================================" -ForegroundColor Cyan + Write-Host "EXPORT VARIABLES" -ForegroundColor Cyan + Write-Host "================================" -ForegroundColor Cyan + + # Create output object + $result = [PSCustomObject]@{ + IPv4CommaList = $ipv4String + IPv6CommaList = $ipv6String + IPv4Array = $ipv4List + IPv6Array = $ipv6List + TotalIPv4 = $ipv4List.Count + TotalIPv6 = $ipv6List.Count + ServiceAreaDisplayName = $teamsEndpoint.serviceAreaDisplayName + EndpointId = $teamsEndpoint.id + LastUpdated = Get-Date + } + + + # Return the result object + return $result + +} catch { + Write-Host "ERROR: Failed to download or parse endpoints" -ForegroundColor Red + Write-Host $_.Exception.Message -ForegroundColor Red + exit 1 +} diff --git a/ProxyAgent-CSharp/README.md b/ProxyAgent-CSharp/README.md index f32bafa4..d804ca59 100644 --- a/ProxyAgent-CSharp/README.md +++ b/ProxyAgent-CSharp/README.md @@ -4,7 +4,7 @@ This solution demonstrates how to integrate a Microsoft Foundry agent with Microsoft Teams and Microsoft 365 Copilot, providing a seamless experience for users to interact with powerful AI capabilities directly within their productivity tools. -[![Video Tutorial](https://img.youtube.com/vi/U9Yv2vjKYbI/0.jpg)](https://www.youtube.com/watch?v=U9Yv2vjKYbI) +[![Video Tutorial](https://img.youtube.com/vi/nRuY_YI-Efk/0.jpg)](https://www.youtube.com/watch?v=nRuY_YI-Efk) ## This sample illustrates - How to connect an AI Foundry Agent to M365 Copilot @@ -39,11 +39,12 @@ sequenceDiagram %% Flow U->>M: User prompt (e.g., "Create a report") M->>B: Activity (Message) - B->>P: POST /api/messages (JWT) + B->>P: POST /api/messages (Message) + P->>B: 202 Accepted + P-->>M: Start Streaming Session with information P->>A: POST /process { prompt } A-->>P: { content } - P-->>B: sendActivity(content) - B-->>M: Response + P-->>M: Stream(content) M-->>U: Display result ``` @@ -96,7 +97,7 @@ atk deploy --env dev ### Required Tools - **.NET SDK 9.0** - [Download](https://dotnet.microsoft.com/download/dotnet/9.0) - **Azure CLI** - [Install Guide](https://learn.microsoft.com/cli/azure/install-azure-cli) -- **Microsoft 365 Agents Toolkit CLI** - [Install Guide](https://aka.ms/m365agentstoolkit-cli) +- **Microsoft 365 Agents Toolkit CLI** - [Install Guide](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/microsoft-365-agents-toolkit-cli) - **Visual Studio Code** with C# Dev Kit extension > **Important:** This solution currently supports **VS Code only**. Visual Studio support is planned for future releases. @@ -380,7 +381,7 @@ The bot uses **Azure Managed Identity** (production) or **Single Tenant + Client ## 📖 Additional Resources ### Microsoft 365 Agents Toolkit -- [Microsoft 365 Agents Toolkit Documentation](https://aka.ms/teams-toolkit-docs) +- [Microsoft 365 Agents Toolkit Documentation](https://learn.microsoft.com/en-us/microsoft-365/developer/overview-m365-agents-toolkit) - [Microsoft 365 Agents Toolkit GitHub](https://github.com/OfficeDev/TeamsFx) - [Teams App Development Guide](https://learn.microsoft.com/microsoftteams/platform/) @@ -725,9 +726,10 @@ Now that you have a working Stock Agent, you can: This project was built with contributions from: - **[@ericsche](https://github.com/ericsche)** - Project Lead & Development -- **[@DavidRoussel](https://github.com/DavidRoussel)** - Co-Author & Technical Contributions +- **[@davrous](https://github.com/davrous)** - Co-Author & Technical Contributions - **[@MattB-msft](https://github.com/MattB-msft)** - Co-Author & Guidance - **[@garrytrinder](https://github.com/garrytrinder)** - ATK Guidance & Review +- **[@andikrueger](https://github.com/andikrueger)** - Code Review & Testing Special thanks to everyone who contributed to making this solution possible!