Skip to content

Add Cancellation Token Usage To Deploy Tool#1627

Merged
msalaman merged 14 commits intomainfrom
masalama/moreCancellationTokens
Feb 4, 2026
Merged

Add Cancellation Token Usage To Deploy Tool#1627
msalaman merged 14 commits intomainfrom
masalama/moreCancellationTokens

Conversation

@msalaman
Copy link
Copy Markdown
Contributor

@msalaman msalaman commented Feb 2, 2026

What does this PR do?

Add cancellation token usage to static methods used by the deploy tool

GitHub issue number?

#1583

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@msalaman msalaman changed the title Adding More Cancellation Token usage Add Cancellation Token Usage To Deploy Tool Feb 2, 2026
@msalaman msalaman marked this pull request as ready for review February 2, 2026 22:53
@msalaman msalaman requested review from a team and qianwens as code owners February 2, 2026 22:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the deploy tool's cancellation support by threading CancellationToken parameters through the static methods and async operations involved in retrieving Azure deployment logs.

Changes:

  • Added CancellationToken parameter to the GetAzdResourceLogsAsync method and propagated it through the call chain
  • Updated AzdAppLogRetriever methods to accept and use CancellationToken in all async Azure SDK operations
  • Ensured cancellation tokens are passed to Azure Resource Manager and Logs Query Client operations

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tools/Azure.Mcp.Tools.Deploy/src/Services/DeployService.cs Passes cancellation token to GetAzdResourceLogsAsync
tools/Azure.Mcp.Tools.Deploy/src/Services/Util/AzdResourceLogService.cs Adds cancellation token parameter and propagates it to initialization and query methods
tools/Azure.Mcp.Tools.Deploy/src/Services/Util/AzdAppLogRetriever.cs Updates all async methods to accept and use cancellation tokens in Azure SDK calls

Comment thread tools/Azure.Mcp.Tools.Deploy/src/Services/Util/AzdAppLogRetriever.cs Outdated
Copy link
Copy Markdown
Member

@vukelich vukelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestions for conventions.

Comment thread tools/Azure.Mcp.Tools.Deploy/src/Services/Util/AzdResourceLogService.cs Outdated
@github-project-automation github-project-automation Bot moved this from Untriaged to In Progress in Azure MCP Server Feb 3, 2026
@msalaman msalaman requested a review from vukelich February 3, 2026 21:05
Copy link
Copy Markdown
Member

@vukelich vukelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more cases of IAsyncEnumerable needing CancellationToken

Comment thread tools/Azure.Mcp.Tools.Deploy/src/Services/Util/AzdAppLogRetriever.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Deploy/src/Services/Util/AzdAppLogRetriever.cs Outdated
@msalaman msalaman requested a review from vukelich February 3, 2026 23:57
@msalaman msalaman enabled auto-merge (squash) February 3, 2026 23:58
@msalaman msalaman merged commit 3f5da17 into main Feb 4, 2026
15 checks passed
@msalaman msalaman deleted the masalama/moreCancellationTokens branch February 4, 2026 00:22
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Feb 4, 2026
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Apr 20, 2026
* add cancellation token parameters

* cleaned up some changes

* fixed more changes

* update cancellation token logic

* update to only apply cancellation tokens were needed

* removed default

* debugged changes

* merge with main

* removed extra file

* update parameter position

* update parameters

* use cancellation token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants