Skip to content

Fixed order of the columns in resource#4

Merged
mbaiza27 merged 1 commit into
microsoft:mainfrom
Laskewitz:main
Apr 29, 2025
Merged

Fixed order of the columns in resource#4
mbaiza27 merged 1 commit into
microsoft:mainfrom
Laskewitz:main

Conversation

@Laskewitz
Copy link
Copy Markdown
Member

Fixed order of the columns in code resource and added language (typescript)

@mbaiza27 mbaiza27 merged commit 7ee8791 into microsoft:main Apr 29, 2025
1 check passed
hallipr added a commit that referenced this pull request Aug 20, 2025
- Publish platform packages first to prevent wrapper package deployment with unresolved dependencies
- Copy the repo licence and readme files into packages
- Move executables in packages to /dist/
- Move ESRP task into Release template
- Bump version to 0.0.9
g2vinay added a commit to g2vinay/mcp that referenced this pull request Mar 12, 2026
…atus

Two prompts were semantically ambiguous, causing the evaluator to rank
the wrong tool first:

- 'Show me the health status of the storage account <name>' pulled toward
  storage_blob_container_get (score 0.559 vs RH rank microsoft#4).
  Fixed: 'What is the Azure Resource Health availability status of the
  storage account <name>?'

- 'List availability status for all resources in my subscription' pulled
  toward group_list/redis_list (score 0.582 vs RH rank microsoft#3-4).
  Fixed: 'Get Azure Resource Health availability status for all resources
  in my subscription'

Result: resourcehealth area score 81.8% (9/11) -> 100% (11/11).
shrja-ms added a commit to shrja-ms/mcp that referenced this pull request Apr 16, 2026
- microsoft#2: Separate auth errors (401/403) from not-found (404) in
  ResolveVaultTypeAsync and AutoDetectAndExecuteAsync. Auth failures on
  DPP now throw UnauthorizedAccessException with RBAC guidance instead
  of being swallowed as KeyNotFoundException.

- microsoft#4: NormalizeImmutabilityState now throws ArgumentException on
  unrecognized values instead of silently passing them through.

- microsoft#5: Add RsvDatasourceRegistryTests with comprehensive coverage for
  Resolve, ResolveOrDefault, ResolveFromProtectedItemName, and profile
  properties. Add BindOptions_BindsOptionsCorrectly tests to all 15
  command test files. Add service tests for auth error separation and
  invalid immutability state.
shrja-ms added a commit that referenced this pull request Apr 17, 2026
* Add Azure Backup MCP toolset - Drop 1 (15 commands)

Implements the first subset of Azure Backup MCP tools with 15 commands:
- Vault: get (consolidated get+list), create, update
- Policy: get (consolidated get+list), create
- Protected Item: get (consolidated get+list), protect
- Protectable Item: list
- Backup: status
- Job: get (consolidated get+list)
- Recovery Point: get (consolidated get+list)
- Governance: find-unprotected, immutability, soft-delete
- DR: enablecrr

Key design decisions:
- Consolidated get+list into single 'get' commands with optional identifier
- Full service layer included for extensibility in future drops
- Dual vault architecture (RSV + Backup vault) with auto-detection
- 99 unit tests covering all 15 commands

Infrastructure changes:
- Added Azure.ResourceManager.RecoveryServices 1.1.1
- Added Azure.ResourceManager.RecoveryServicesBackup 1.3.0
- Added Azure.ResourceManager.DataProtectionBackup 1.7.0
- Registered AzureBackupSetup in Program.cs and both slnx files

* Fix CONTRIBUTING.md compliance gaps, add LiveTests project and test infrastructure

- Remove 227 code comments from 18 source files
- Add Azure Backup section to azmcp-commands.md
- Add 30 e2e test prompts to e2eTestPrompts.md
- Update README.md with Azure Backup service listing
- Add CODEOWNERS entry for Azure Backup toolset
- Add 7 consolidated tool groups to consolidated-tools.json
- Add changelog entry YAML
- Create test-resources.bicep and test-resources-post.ps1
- Create LiveTests project with 6 integration tests (vault, policy, governance, job)
- Add assets.json for test proxy recording support
- Update Microsoft.Mcp.slnx and Azure.Mcp.Server.slnx with LiveTests project
- All 99 unit tests pass, all 6 live tests pass (6/6)

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Address PR review comments: split model files, fix Bicep template

- Remove unused tenantId parameter from test-resources.bicep
- Interpolate testApplicationOid in role assignment description
- Split WorkflowResult.cs: move WorkflowStep to its own file
- Split HealthCheckResult.cs: move HealthCheckItemDetail to its own file

* Upgrade Azure Backup packages to AOT-compatible versions

- Azure.ResourceManager.RecoveryServicesBackup: 1.3.0 -> 1.3.1
- Azure.ResourceManager.RecoveryServices: 1.1.1 -> 1.2.0
- Azure.ResourceManager.DataProtectionBackup: 1.7.0 -> 1.7.1
- Azure.Core: 1.50.0 -> 1.51.1 (transitive dependency)
- Azure.ResourceManager: 1.13.2 -> 1.14.0 (transitive dependency)
- System.ClientModel: 1.8.0 -> 1.9.0 (transitive dependency)

Resolves CI trim/AOT failures (NETSDK1144/IL2026) caused by
non-AOT-compatible Azure.ResourceManager.RecoveryServicesBackup 1.3.0.

* Fix consolidated-tools.json: split backup entries by metadata to match command annotations

The consolidated mode validation requires all commands in a group to have
identical ToolMetadata. The backup entries were incorrectly grouping read-only
and write commands together, causing ConsolidatedModeTests to fail in Debug mode.

Restructured 6 backup entries into 3 entries grouped by matching metadata:
- get_azure_backup_details: 8 read-only commands (ReadOnly=true)
- create_azure_backup_resources: 3 create commands (Destructive=true, Idempotent=false)
- update_azure_backup_settings: 4 update commands (Destructive=true, Idempotent=true)

* Fix LiveTests namespace: use Microsoft.Mcp.Tests instead of Azure.Mcp.Tests

* Remove assets.json until test recordings are available

The CI runs recorded tests for LiveTests projects that have assets.json.
With an empty Tag (no recordings), the test proxy returns 404, causing
all 6 LiveTests to fail across 4 platforms (24 failures).

Remove assets.json so Test-Code.ps1 skips recorded tests for AzureBackup.
Will re-add after recording test sessions per docs/recorded-tests.md.

* Apply dotnet format to fix CI Analyze check

dotnet format --verify-no-changes was failing due to single-line if
statements that should use multi-line formatting per editorconfig.
Auto-fixed 19 files in AzureBackup toolset.

* Address Copilot PR review comments

- Fix argument order bug in GovernanceSoftDeleteCommand (vaultType and
  softDeleteRetentionDays were swapped in ConfigureSoftDeleteAsync call)
- Make ImmutabilityState, SoftDelete, and WorkloadType options required
  (fixes null-forgiving operator on optional fields)
- Fix test-resources.bicep baseName default to use take() for maxLength safety
- Update e2eTestPrompts.md governance prompts from 'Check' to 'Configure'
- Update unit tests to reflect required option changes

* Implement FindUnprotectedResourcesAsync with real Azure resource scanning

Replace the stub that returned an empty list with a real implementation that:
1. Lists all Recovery Services and Backup vaults across the subscription
2. Collects datasource ARM IDs from all protected items in every vault
3. Lists generic resources of protectable types (VMs, SQL, Storage, etc.)
4. Returns resources whose IDs are not in the protected set

Also supports optional filtering by resource type, resource group, and tags.

AzureBackupService now extends BaseAzureService (with ITenantService) to
obtain ARM client access for listing generic subscription resources.

* Align datasource types to supported list and fix broken DPP registry tests

- Remove MySQLFlexible from DPP registry (not a supported datasource type)

- Fix s_protectableResourceTypes: remove Microsoft.Sql (SQL-in-VM is a VM workload), remove MySQL, add ElasticSAN and CosmosDB

- Update WorkloadType and DatasourceType option descriptions

- Rewrite DppBackupOperationsHelperTests to DppDatasourceRegistryTests (fix pre-existing build errors from refactored static methods to registry pattern)

* Address Copilot review: validation, naming, docs fixes

- Rename DppBackupOperationsHelperTests.cs to DppDatasourceRegistryTests.cs to match class name

- VaultGetCommand: validate --resource-group is provided when --vault is specified (return 400)

- VaultCreateCommand: validate --vault-type is provided (return 400 with helpful message)

- Fix --redundancy description to use full names (GeoRedundant, LocallyRedundant, etc.)

- Fix e2eTestPrompts: replace invalid AzureStorage with AzureFileShare workload type

- Fix azmcp-commands.md: show --workload-type as required (not optional) for policy create

* Address latest Copilot review: docs alignment, VaultTypeResolver validation, e2e prompts

- Fix vault create docs: --vault-type shown as required (not optional)

- Fix governance docs: --immutability-state and --soft-delete shown as required

- Update README prompts: use 'configure' for destructive ops, include vault-type and location

- VaultTypeResolver.IsVaultTypeSpecified: throw ArgumentException on invalid non-empty vault type

- Fix backup_status e2e prompts: include required --location parameter

* PR standards compliance: fix broken markdown, add assets.json, remove dead code

- Fix azmcp-commands.md: add missing closing code fence after DR section (broke all subsequent markdown)

- Add assets.json for LiveTests (required for recorded test infrastructure)

- Fix e2eTestPrompts: governance find-unprotected use <resource_type> matching actual option name

- Remove 5 unused *ListOptions classes (VaultList, JobList, PolicyList, ProtectedItemList, RecoveryPointList)

* Remove empty assets.json to fix CI recorded test failures

The assets.json with empty Tag causes CI to run recorded tests in Playback mode with no recordings, resulting in 404 errors. Removing until recordings are pushed.

* Fix live test failures: add required governance params and recording sanitizers

- Add missing 'soft-delete' parameter to GovernanceSoftDelete test
- Add missing 'immutability-state' parameter to GovernanceImmutability test
- Add TestMatcher and BodyRegexSanitizers for recorded test infrastructure
- Remove assets.json (empty Tag causes CI Playback failures)

* Address active Copilot review comments: fix validation, IDs, command names, polling

- Remove unused using directives from AzureBackupCommandTests.cs
- Fix ProtectableItemListCommand Id to valid GUID format
- Replace manual BadRequest check with command validator for --vault-type in VaultCreateCommand
- Fix incorrect command name 'azurebackup protectable_item_list' to 'azurebackup protectableitem list' in RsvBackupOperations
- Replace hardcoded Task.Delay(30000) with polling loop for container visibility in VM protection

* Fix azmcp-commands.md section ordering and e2e vault_create prompts

- Move Azure Backup section from middle of App Service section to correct alphabetical position (after App Service, before Azure CLI)
- Add vault-type to e2e vault_create prompts ('rsv' and 'dpp')

* Address PR review comments: parallelize FindUnprotectedResources, use random GUIDs, update changelog

* Fix namespace renames after upstream/main merge: Azure.Mcp.Core.Extensions -> Microsoft.Mcp.Core.Extensions, Azure.Mcp.Core.Commands -> Microsoft.Mcp.Core.Commands

* Fix CI Build Analyze: correct import ordering and restore assets.json

* Fix e2eTestPrompts.md: correct alphabetical section ordering

* Merge upstream/main and fix namespace renames: Azure.Mcp.Core -> Microsoft.Mcp.Core, update tool metadata

* Fix CI Analyze: correct import ordering in all 15 unit test files (System -> Azure -> Microsoft -> NSubstitute -> Xunit)

* Fix LiveTests build: add missing using Microsoft.Mcp.Tests.Generated.Models for CustomDefaultMatcher

* Remove empty assets.json to skip recorded tests until recordings are available

* Add recorded test recordings with populated Tag, add DPP vault to test-resources.bicep

* Remove redundant JsonPropertyName attributes from all model records (camelCase handled by AzureBackupJsonContext)

* Address PR feedback: VaultUpdate validation, GetErrorMessage overrides, trim unused options, expand live+unit test coverage

* Update recorded test assets for expanded live test coverage (12/15 tools)

* Address PR review: remove stub BackupStatus command, replace Task.FromResult stubs with NotImplementedException, fix DrEnableCrr error message, parallelize vault listing

* Implement real BackupStatus command using Azure SDK

Replace the previously removed stub BackupStatus command with a real
implementation that calls the Azure Backup Management Status API via
Azure.ResourceManager.RecoveryServicesBackup SDK.

Changes:
- Implement GetBackupStatusAsync in AzureBackupService using BackupStatusContent
- Re-create BackupStatusCommand and BackupStatusOptions
- Re-register command in AzureBackupSetup, JsonContext, consolidated-tools
- Add comprehensive unit tests (BackupStatusCommandTests)
- Restore docs and e2e test prompts

* Fix DPP implementations, add DPP live tests, address review feedback

- Implement real Azure SDK calls for DPP ConfigureImmutabilityAsync,
  ConfigureSoftDeleteAsync, and ConfigureCrossRegionRestoreAsync
- Fix DPP UpdateVaultAsync to wire soft-delete, immutability, and tags
- Add ConfigureCrossRegionRestoreAsync to IDppBackupOperations
- Route CRR through DPP in AzureBackupService (was hardcoded RSV-only)
- Add 10 DPP live tests covering vault, policy, governance, jobs, DR
- Add GetErrorMessage override to GovernanceFindUnprotectedCommand
- Fix baseName maxLength in test-resources.bicep (24 -> 20)
- Remove development artifacts (PR-Body.md, ManualTestCases.md, etc.)
- Update recorded test assets for 22 live tests (RSV + DPP)

* Address PR review: constructor injection, remove unused interface surface, trim service files

* Address Jon PR review: fix comma-split resourceTypeFilter, TagFilter description, narrow InquireAsync catch, fix GenerateInstanceName duplication, update recordings

* Address Jon review: resilient Task.WhenAll for partial results, validate workload types in DPP/RSV registries, update recordings

* Address Jon review: explicit .AsRequired() for vault, policy, protectedItem, datasourceId, location option registrations

* Address Copilot review: add VM/SQL aliases, fix option descriptions, clarify VaultGet resource-group, fix naming mode comment, fix DatasourceId description

* Address alzimmermsft review: remove redundant JsonPropertyName, use terser new(), add governance/vault validators, fix CRR error message, move VaultGet validation to RegisterOptions

* AzureBackup: Fix tests, remove redundant options, add XML docs and datasource registry improvements

* Address PR review: remove unused usings, add --redundancy to VaultUpdateCommand

* Address PR review comments: vault-type auto-detect fixes, option warnings, service tests

- Fix ResolveVaultTypeAsync/AutoDetectAndExecuteAsync to catch 401/403 alongside 404
  so DPP-only users aren't blocked when RSV probe returns Forbidden/Unauthorized
- Add CollectUnsupportedPolicyOptionWarnings to return Warning in CreatePolicyAsync
  response when unimplemented options (schedule-frequency, weekly/monthly/yearly
  retention) are provided
- Fix OperationCanceledException swallowed in ListVaultsAsync and
  FindUnprotectedResourcesAsync catch-all blocks
- Reject --vault-type=dpp for ListProtectableItemsAsync (RSV-only operation)
- Update option descriptions to clearly state not-yet-applied status
- Update ProtectableItemListCommand description to note RSV-only
- Fix CS0649 build error for BaseAzureService.s_defaultPollInterval in Release builds
- Add AzureBackupServiceTests with 22 tests covering orchestration layer:
  auto-detect fallback (404/403/401), both-stacks-fail, partial ListVaults failure,
  cancellation propagation, unsupported option warnings, vault-type validation
- Re-record all 48 live test sessions with updated assets tag

* Address PR review: input validation, vault-type checks, sealed classes, OData sanitization

- Add vault-type validation ('rsv'/'dpp') in BaseAzureBackupCommand and VaultGetCommand
- Add ParseIdentityType validation in RSV/DPP, identity-type validator in VaultUpdateCommand
- Add soft-delete retention days range (14-180) validators in GovernanceSoftDeleteCommand and VaultUpdateCommand
- Throw NotSupportedException for unsupported policy options instead of silent warning
- Add per-vault try/catch isolation in FindUnprotectedResourcesAsync
- Add ValidateAndParseResourceTypeFilter with regex validation for OData safety
- Harden NormalizeWorkloadTypeForFilter with strict allowlist
- Add ConfigureStorageRedundancyAsync for RSV redundancy updates, throw for DPP
- Apply tags via patchData.Tags in RSV UpdateVaultAsync
- Seal AzureBackupService, RsvBackupOperations, DppBackupOperations, AzureBackupSetup
- Add 47 new unit tests (235 total pass)

* Address PR review: remove custom GetErrorMessage from GovernanceSoftDeleteCommand

- Remove custom GetErrorMessage override per alzimmermsft feedback (default handler provides richer RequestFailedException handling)
- Remove unused 'using System.Net' since HttpStatusCode is no longer referenced
- Update corresponding unit tests to match default error handler messages

* fixed unit tests and resolved other review comments

* Added missing option in azmcp-commands

* dotnet format

* Fix Azure Backup bugs, update unit tests, re-record live tests

Bug fixes (11):
- BackupVaultInfo: 14-field constructor with full detail extraction
- BackupPolicyInfo: 8-field constructor with full detail extraction
- AzureBackupService: RG filter, backup status mapping, immutability normalization
- RsvBackupOperations: BackupResourceVaultConfig for soft-delete, SoftDeleteFeatureState mapping, friendly name matching, container auto-discovery, 180s timeout
- DppBackupOperations: MapToVaultInfo/MapToPolicyInfo detail extraction, friendly name matching
- DppDatasourceRegistry: CosmosDB profile (PT4H/Incremental/BackupHourly)
- VaultGetCommand: Pass resourceGroup to ListVaultsAsync
- IAzureBackupService: Add resourceGroup param to ListVaultsAsync

Unit tests: 244 pass, 9 new tests added
Live tests: 43 pass (re-recorded with updated assertions)

* Address PR review comments #2, #4, #5

- #2: Separate auth errors (401/403) from not-found (404) in
  ResolveVaultTypeAsync and AutoDetectAndExecuteAsync. Auth failures on
  DPP now throw UnauthorizedAccessException with RBAC guidance instead
  of being swallowed as KeyNotFoundException.

- #4: NormalizeImmutabilityState now throws ArgumentException on
  unrecognized values instead of silently passing them through.

- #5: Add RsvDatasourceRegistryTests with comprehensive coverage for
  Resolve, ResolveOrDefault, ResolveFromProtectedItemName, and profile
  properties. Add BindOptions_BindsOptionsCorrectly tests to all 15
  command test files. Add service tests for auth error separation and
  invalid immutability state.

* Merge main and suppress NU1903 for unpatched System.Security.Cryptography.Xml CVEs

* Remove NuGetAuditSuppress for System.Security.Cryptography.Xml - package is pinned to patched 10.0.6

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: anannya03 <aaniee09@gmail.com>
Co-authored-by: Anannya Patra <40665106+anannya03@users.noreply.github.com>
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Apr 25, 2026
* Add Azure Backup MCP toolset - Drop 1 (15 commands)

Implements the first subset of Azure Backup MCP tools with 15 commands:
- Vault: get (consolidated get+list), create, update
- Policy: get (consolidated get+list), create
- Protected Item: get (consolidated get+list), protect
- Protectable Item: list
- Backup: status
- Job: get (consolidated get+list)
- Recovery Point: get (consolidated get+list)
- Governance: find-unprotected, immutability, soft-delete
- DR: enablecrr

Key design decisions:
- Consolidated get+list into single 'get' commands with optional identifier
- Full service layer included for extensibility in future drops
- Dual vault architecture (RSV + Backup vault) with auto-detection
- 99 unit tests covering all 15 commands

Infrastructure changes:
- Added Azure.ResourceManager.RecoveryServices 1.1.1
- Added Azure.ResourceManager.RecoveryServicesBackup 1.3.0
- Added Azure.ResourceManager.DataProtectionBackup 1.7.0
- Registered AzureBackupSetup in Program.cs and both slnx files

* Fix CONTRIBUTING.md compliance gaps, add LiveTests project and test infrastructure

- Remove 227 code comments from 18 source files
- Add Azure Backup section to azmcp-commands.md
- Add 30 e2e test prompts to e2eTestPrompts.md
- Update README.md with Azure Backup service listing
- Add CODEOWNERS entry for Azure Backup toolset
- Add 7 consolidated tool groups to consolidated-tools.json
- Add changelog entry YAML
- Create test-resources.bicep and test-resources-post.ps1
- Create LiveTests project with 6 integration tests (vault, policy, governance, job)
- Add assets.json for test proxy recording support
- Update Microsoft.Mcp.slnx and Azure.Mcp.Server.slnx with LiveTests project
- All 99 unit tests pass, all 6 live tests pass (6/6)

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Address PR review comments: split model files, fix Bicep template

- Remove unused tenantId parameter from test-resources.bicep
- Interpolate testApplicationOid in role assignment description
- Split WorkflowResult.cs: move WorkflowStep to its own file
- Split HealthCheckResult.cs: move HealthCheckItemDetail to its own file

* Upgrade Azure Backup packages to AOT-compatible versions

- Azure.ResourceManager.RecoveryServicesBackup: 1.3.0 -> 1.3.1
- Azure.ResourceManager.RecoveryServices: 1.1.1 -> 1.2.0
- Azure.ResourceManager.DataProtectionBackup: 1.7.0 -> 1.7.1
- Azure.Core: 1.50.0 -> 1.51.1 (transitive dependency)
- Azure.ResourceManager: 1.13.2 -> 1.14.0 (transitive dependency)
- System.ClientModel: 1.8.0 -> 1.9.0 (transitive dependency)

Resolves CI trim/AOT failures (NETSDK1144/IL2026) caused by
non-AOT-compatible Azure.ResourceManager.RecoveryServicesBackup 1.3.0.

* Fix consolidated-tools.json: split backup entries by metadata to match command annotations

The consolidated mode validation requires all commands in a group to have
identical ToolMetadata. The backup entries were incorrectly grouping read-only
and write commands together, causing ConsolidatedModeTests to fail in Debug mode.

Restructured 6 backup entries into 3 entries grouped by matching metadata:
- get_azure_backup_details: 8 read-only commands (ReadOnly=true)
- create_azure_backup_resources: 3 create commands (Destructive=true, Idempotent=false)
- update_azure_backup_settings: 4 update commands (Destructive=true, Idempotent=true)

* Fix LiveTests namespace: use Microsoft.Mcp.Tests instead of Azure.Mcp.Tests

* Remove assets.json until test recordings are available

The CI runs recorded tests for LiveTests projects that have assets.json.
With an empty Tag (no recordings), the test proxy returns 404, causing
all 6 LiveTests to fail across 4 platforms (24 failures).

Remove assets.json so Test-Code.ps1 skips recorded tests for AzureBackup.
Will re-add after recording test sessions per docs/recorded-tests.md.

* Apply dotnet format to fix CI Analyze check

dotnet format --verify-no-changes was failing due to single-line if
statements that should use multi-line formatting per editorconfig.
Auto-fixed 19 files in AzureBackup toolset.

* Address Copilot PR review comments

- Fix argument order bug in GovernanceSoftDeleteCommand (vaultType and
  softDeleteRetentionDays were swapped in ConfigureSoftDeleteAsync call)
- Make ImmutabilityState, SoftDelete, and WorkloadType options required
  (fixes null-forgiving operator on optional fields)
- Fix test-resources.bicep baseName default to use take() for maxLength safety
- Update e2eTestPrompts.md governance prompts from 'Check' to 'Configure'
- Update unit tests to reflect required option changes

* Implement FindUnprotectedResourcesAsync with real Azure resource scanning

Replace the stub that returned an empty list with a real implementation that:
1. Lists all Recovery Services and Backup vaults across the subscription
2. Collects datasource ARM IDs from all protected items in every vault
3. Lists generic resources of protectable types (VMs, SQL, Storage, etc.)
4. Returns resources whose IDs are not in the protected set

Also supports optional filtering by resource type, resource group, and tags.

AzureBackupService now extends BaseAzureService (with ITenantService) to
obtain ARM client access for listing generic subscription resources.

* Align datasource types to supported list and fix broken DPP registry tests

- Remove MySQLFlexible from DPP registry (not a supported datasource type)

- Fix s_protectableResourceTypes: remove Microsoft.Sql (SQL-in-VM is a VM workload), remove MySQL, add ElasticSAN and CosmosDB

- Update WorkloadType and DatasourceType option descriptions

- Rewrite DppBackupOperationsHelperTests to DppDatasourceRegistryTests (fix pre-existing build errors from refactored static methods to registry pattern)

* Address Copilot review: validation, naming, docs fixes

- Rename DppBackupOperationsHelperTests.cs to DppDatasourceRegistryTests.cs to match class name

- VaultGetCommand: validate --resource-group is provided when --vault is specified (return 400)

- VaultCreateCommand: validate --vault-type is provided (return 400 with helpful message)

- Fix --redundancy description to use full names (GeoRedundant, LocallyRedundant, etc.)

- Fix e2eTestPrompts: replace invalid AzureStorage with AzureFileShare workload type

- Fix azmcp-commands.md: show --workload-type as required (not optional) for policy create

* Address latest Copilot review: docs alignment, VaultTypeResolver validation, e2e prompts

- Fix vault create docs: --vault-type shown as required (not optional)

- Fix governance docs: --immutability-state and --soft-delete shown as required

- Update README prompts: use 'configure' for destructive ops, include vault-type and location

- VaultTypeResolver.IsVaultTypeSpecified: throw ArgumentException on invalid non-empty vault type

- Fix backup_status e2e prompts: include required --location parameter

* PR standards compliance: fix broken markdown, add assets.json, remove dead code

- Fix azmcp-commands.md: add missing closing code fence after DR section (broke all subsequent markdown)

- Add assets.json for LiveTests (required for recorded test infrastructure)

- Fix e2eTestPrompts: governance find-unprotected use <resource_type> matching actual option name

- Remove 5 unused *ListOptions classes (VaultList, JobList, PolicyList, ProtectedItemList, RecoveryPointList)

* Remove empty assets.json to fix CI recorded test failures

The assets.json with empty Tag causes CI to run recorded tests in Playback mode with no recordings, resulting in 404 errors. Removing until recordings are pushed.

* Fix live test failures: add required governance params and recording sanitizers

- Add missing 'soft-delete' parameter to GovernanceSoftDelete test
- Add missing 'immutability-state' parameter to GovernanceImmutability test
- Add TestMatcher and BodyRegexSanitizers for recorded test infrastructure
- Remove assets.json (empty Tag causes CI Playback failures)

* Address active Copilot review comments: fix validation, IDs, command names, polling

- Remove unused using directives from AzureBackupCommandTests.cs
- Fix ProtectableItemListCommand Id to valid GUID format
- Replace manual BadRequest check with command validator for --vault-type in VaultCreateCommand
- Fix incorrect command name 'azurebackup protectable_item_list' to 'azurebackup protectableitem list' in RsvBackupOperations
- Replace hardcoded Task.Delay(30000) with polling loop for container visibility in VM protection

* Fix azmcp-commands.md section ordering and e2e vault_create prompts

- Move Azure Backup section from middle of App Service section to correct alphabetical position (after App Service, before Azure CLI)
- Add vault-type to e2e vault_create prompts ('rsv' and 'dpp')

* Address PR review comments: parallelize FindUnprotectedResources, use random GUIDs, update changelog

* Fix namespace renames after upstream/main merge: Azure.Mcp.Core.Extensions -> Microsoft.Mcp.Core.Extensions, Azure.Mcp.Core.Commands -> Microsoft.Mcp.Core.Commands

* Fix CI Build Analyze: correct import ordering and restore assets.json

* Fix e2eTestPrompts.md: correct alphabetical section ordering

* Merge upstream/main and fix namespace renames: Azure.Mcp.Core -> Microsoft.Mcp.Core, update tool metadata

* Fix CI Analyze: correct import ordering in all 15 unit test files (System -> Azure -> Microsoft -> NSubstitute -> Xunit)

* Fix LiveTests build: add missing using Microsoft.Mcp.Tests.Generated.Models for CustomDefaultMatcher

* Remove empty assets.json to skip recorded tests until recordings are available

* Add recorded test recordings with populated Tag, add DPP vault to test-resources.bicep

* Remove redundant JsonPropertyName attributes from all model records (camelCase handled by AzureBackupJsonContext)

* Address PR feedback: VaultUpdate validation, GetErrorMessage overrides, trim unused options, expand live+unit test coverage

* Update recorded test assets for expanded live test coverage (12/15 tools)

* Address PR review: remove stub BackupStatus command, replace Task.FromResult stubs with NotImplementedException, fix DrEnableCrr error message, parallelize vault listing

* Implement real BackupStatus command using Azure SDK

Replace the previously removed stub BackupStatus command with a real
implementation that calls the Azure Backup Management Status API via
Azure.ResourceManager.RecoveryServicesBackup SDK.

Changes:
- Implement GetBackupStatusAsync in AzureBackupService using BackupStatusContent
- Re-create BackupStatusCommand and BackupStatusOptions
- Re-register command in AzureBackupSetup, JsonContext, consolidated-tools
- Add comprehensive unit tests (BackupStatusCommandTests)
- Restore docs and e2e test prompts

* Fix DPP implementations, add DPP live tests, address review feedback

- Implement real Azure SDK calls for DPP ConfigureImmutabilityAsync,
  ConfigureSoftDeleteAsync, and ConfigureCrossRegionRestoreAsync
- Fix DPP UpdateVaultAsync to wire soft-delete, immutability, and tags
- Add ConfigureCrossRegionRestoreAsync to IDppBackupOperations
- Route CRR through DPP in AzureBackupService (was hardcoded RSV-only)
- Add 10 DPP live tests covering vault, policy, governance, jobs, DR
- Add GetErrorMessage override to GovernanceFindUnprotectedCommand
- Fix baseName maxLength in test-resources.bicep (24 -> 20)
- Remove development artifacts (PR-Body.md, ManualTestCases.md, etc.)
- Update recorded test assets for 22 live tests (RSV + DPP)

* Address PR review: constructor injection, remove unused interface surface, trim service files

* Address Jon PR review: fix comma-split resourceTypeFilter, TagFilter description, narrow InquireAsync catch, fix GenerateInstanceName duplication, update recordings

* Address Jon review: resilient Task.WhenAll for partial results, validate workload types in DPP/RSV registries, update recordings

* Address Jon review: explicit .AsRequired() for vault, policy, protectedItem, datasourceId, location option registrations

* Address Copilot review: add VM/SQL aliases, fix option descriptions, clarify VaultGet resource-group, fix naming mode comment, fix DatasourceId description

* Address alzimmermsft review: remove redundant JsonPropertyName, use terser new(), add governance/vault validators, fix CRR error message, move VaultGet validation to RegisterOptions

* AzureBackup: Fix tests, remove redundant options, add XML docs and datasource registry improvements

* Address PR review: remove unused usings, add --redundancy to VaultUpdateCommand

* Address PR review comments: vault-type auto-detect fixes, option warnings, service tests

- Fix ResolveVaultTypeAsync/AutoDetectAndExecuteAsync to catch 401/403 alongside 404
  so DPP-only users aren't blocked when RSV probe returns Forbidden/Unauthorized
- Add CollectUnsupportedPolicyOptionWarnings to return Warning in CreatePolicyAsync
  response when unimplemented options (schedule-frequency, weekly/monthly/yearly
  retention) are provided
- Fix OperationCanceledException swallowed in ListVaultsAsync and
  FindUnprotectedResourcesAsync catch-all blocks
- Reject --vault-type=dpp for ListProtectableItemsAsync (RSV-only operation)
- Update option descriptions to clearly state not-yet-applied status
- Update ProtectableItemListCommand description to note RSV-only
- Fix CS0649 build error for BaseAzureService.s_defaultPollInterval in Release builds
- Add AzureBackupServiceTests with 22 tests covering orchestration layer:
  auto-detect fallback (404/403/401), both-stacks-fail, partial ListVaults failure,
  cancellation propagation, unsupported option warnings, vault-type validation
- Re-record all 48 live test sessions with updated assets tag

* Address PR review: input validation, vault-type checks, sealed classes, OData sanitization

- Add vault-type validation ('rsv'/'dpp') in BaseAzureBackupCommand and VaultGetCommand
- Add ParseIdentityType validation in RSV/DPP, identity-type validator in VaultUpdateCommand
- Add soft-delete retention days range (14-180) validators in GovernanceSoftDeleteCommand and VaultUpdateCommand
- Throw NotSupportedException for unsupported policy options instead of silent warning
- Add per-vault try/catch isolation in FindUnprotectedResourcesAsync
- Add ValidateAndParseResourceTypeFilter with regex validation for OData safety
- Harden NormalizeWorkloadTypeForFilter with strict allowlist
- Add ConfigureStorageRedundancyAsync for RSV redundancy updates, throw for DPP
- Apply tags via patchData.Tags in RSV UpdateVaultAsync
- Seal AzureBackupService, RsvBackupOperations, DppBackupOperations, AzureBackupSetup
- Add 47 new unit tests (235 total pass)

* Address PR review: remove custom GetErrorMessage from GovernanceSoftDeleteCommand

- Remove custom GetErrorMessage override per alzimmermsft feedback (default handler provides richer RequestFailedException handling)
- Remove unused 'using System.Net' since HttpStatusCode is no longer referenced
- Update corresponding unit tests to match default error handler messages

* fixed unit tests and resolved other review comments

* Added missing option in azmcp-commands

* dotnet format

* Fix Azure Backup bugs, update unit tests, re-record live tests

Bug fixes (11):
- BackupVaultInfo: 14-field constructor with full detail extraction
- BackupPolicyInfo: 8-field constructor with full detail extraction
- AzureBackupService: RG filter, backup status mapping, immutability normalization
- RsvBackupOperations: BackupResourceVaultConfig for soft-delete, SoftDeleteFeatureState mapping, friendly name matching, container auto-discovery, 180s timeout
- DppBackupOperations: MapToVaultInfo/MapToPolicyInfo detail extraction, friendly name matching
- DppDatasourceRegistry: CosmosDB profile (PT4H/Incremental/BackupHourly)
- VaultGetCommand: Pass resourceGroup to ListVaultsAsync
- IAzureBackupService: Add resourceGroup param to ListVaultsAsync

Unit tests: 244 pass, 9 new tests added
Live tests: 43 pass (re-recorded with updated assertions)

* Address PR review comments microsoft#2, microsoft#4, microsoft#5

- microsoft#2: Separate auth errors (401/403) from not-found (404) in
  ResolveVaultTypeAsync and AutoDetectAndExecuteAsync. Auth failures on
  DPP now throw UnauthorizedAccessException with RBAC guidance instead
  of being swallowed as KeyNotFoundException.

- microsoft#4: NormalizeImmutabilityState now throws ArgumentException on
  unrecognized values instead of silently passing them through.

- microsoft#5: Add RsvDatasourceRegistryTests with comprehensive coverage for
  Resolve, ResolveOrDefault, ResolveFromProtectedItemName, and profile
  properties. Add BindOptions_BindsOptionsCorrectly tests to all 15
  command test files. Add service tests for auth error separation and
  invalid immutability state.

* Merge main and suppress NU1903 for unpatched System.Security.Cryptography.Xml CVEs

* Remove NuGetAuditSuppress for System.Security.Cryptography.Xml - package is pinned to patched 10.0.6

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: anannya03 <aaniee09@gmail.com>
Co-authored-by: Anannya Patra <40665106+anannya03@users.noreply.github.com>
shrja-ms added a commit to shrja-ms/mcp that referenced this pull request May 4, 2026
Telemetry report skill (SKILL.md + kql-queries.md):
- Add case-sensitivity note for Kusto bag key access (microsoft#6)
- Fix week-over-week query range to include current partial week (microsoft#7)
- Add InvalidOperationException to MCP Tool Bug classification (microsoft#8)
- Add missing KQL queries 11-13 for WorkloadType, DatasourceType,
  OperationScope custom dimensions (microsoft#9)
- Fix live test count to use [Fact] only, avoiding double-count with
  [LiveTestOnly] on same method (microsoft#5)
- Update decision tree to include InvalidOperationException

Add-tool skill (SKILL.md):
- Fix broken relative link to new-command.md (5 levels up, not 3) (microsoft#1)
- Fix live test snippet to use [Fact] + CallToolAsync pattern, not
  non-existent [RecordedTest]/RunCommandAndAssert (microsoft#2, microsoft#11)
- Add missing Update-AzCommandsMetadata.ps1 step after docs update (microsoft#3)
- Add AOT/native build verification step (Build-Local.ps1 -BuildNative) (microsoft#4)
- Fix vault/vaultType to reference AzureBackupOptionDefinitions, not
  OptionDefinitions.Common (microsoft#10)
- Expand git add scope to include README.md and eng/vscode/README.md (microsoft#12)
- Add commands metadata regeneration and AOT build to PR checklist
shrja-ms added a commit that referenced this pull request May 8, 2026
…workflow (#2570)

* azurebackup: Add weekly telemetry report skill

Add a Copilot skill under tools/Azure.Mcp.Tools.AzureBackup/skills/ that
automates generation of weekly telemetry reports by:

- Running KQL queries against the ddazureclients Kusto cluster
- Classifying errors into Customer (4xx) / Azure Service / MCP Tool Bug
- Correlating with merged PRs, releases, and known bug IDs
- Producing an Outlook-compatible HTML report

Includes:
- SKILL.md with full procedure and error classification decision tree
- references/kql-queries.md with all 10 production KQL queries
- assets/report-template.html with Outlook-compatible HTML template

* azurebackup: Add 'add-tool' skill for new command workflow

Add a Copilot skill that guides the full lifecycle of adding a new
Azure Backup MCP command:

- Phase 1: Implementation (options, service, command, registration)
- Phase 2: Input validation checklist
- Phase 3: Unit tests with required test patterns
- Phase 4: Live tests with Record/Playback workflow
- Phase 5: CI validation (build, format, spell check)
- Phase 6: ToolDescriptionEvaluator scoring
- Phase 7: Documentation updates
- Phase 8: PR submission checklist

* azurebackup: Fix telemetry report skill - BUG-1 status and test count methodology

- BUG-1 (backup_status ArgumentNullException) is fixed in #2518 (code
  included in merged PR, though PR title only lists BUG-3,4,5,6,8)
- Fix unit test count methodology: count [Fact] + [InlineData] for
  runnable test cases, not [Fact] + [Theory] for method count
- Add Release column to bug tracker table
- Add note about verifying PR diff vs title for bug coverage

* azurebackup: Address all 12 PR review comments on skills

Telemetry report skill (SKILL.md + kql-queries.md):
- Add case-sensitivity note for Kusto bag key access (#6)
- Fix week-over-week query range to include current partial week (#7)
- Add InvalidOperationException to MCP Tool Bug classification (#8)
- Add missing KQL queries 11-13 for WorkloadType, DatasourceType,
  OperationScope custom dimensions (#9)
- Fix live test count to use [Fact] only, avoiding double-count with
  [LiveTestOnly] on same method (#5)
- Update decision tree to include InvalidOperationException

Add-tool skill (SKILL.md):
- Fix broken relative link to new-command.md (5 levels up, not 3) (#1)
- Fix live test snippet to use [Fact] + CallToolAsync pattern, not
  non-existent [RecordedTest]/RunCommandAndAssert (#2, #11)
- Add missing Update-AzCommandsMetadata.ps1 step after docs update (#3)
- Add AOT/native build verification step (Build-Local.ps1 -BuildNative) (#4)
- Fix vault/vaultType to reference AzureBackupOptionDefinitions, not
  OptionDefinitions.Common (#10)
- Expand git add scope to include README.md and eng/vscode/README.md (#12)
- Add commands metadata regeneration and AOT build to PR checklist

* azurebackup: Convert relative links to absolute paths for CI link checker

The link verification step requires absolute paths from repo root,
not relative paths. Convert all ./references/ and ../../../ links
to /tools/Azure.Mcp.Tools.AzureBackup/skills/... format.

* azurebackup: Use full GitHub URLs for CI link checker

Link checker requires https://github.com/microsoft/mcp/blob/main/... format,
not repo-root-relative paths.

* azurebackup: Add InvalidOperationException to Query 1, replace Power BI URLs with placeholder

- Query 1 (primary per-tool health) was missing InvalidOperationException
  in the McpToolBug case, causing inconsistency with Queries 2 and 4
- Replace hardcoded Power BI dashboard URLs in report template with
  {{POWERBI_DASHBOARD_URL}} placeholder (public repo, internal GUIDs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants