From 8d343c6ad2d935508766782d85cc218344957844 Mon Sep 17 00:00:00 2001 From: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> Date: Fri, 21 Aug 2026 19:37:25 -0400 Subject: [PATCH 1/2] Remove RetryPolicyOptions from tools --- .github/copilot-instructions.md | 1 + .github/skills/add-azure-mcp-tools/SKILL.md | 29 +- .github/workflows/doc-gap-detector.md | 2 +- .vscode/tasks.json | 2 +- AGENTS.md | 14 +- .../Areas/Group/Commands/GroupListCommand.cs | 1 - .../Group/Commands/ResourceListCommand.cs | 1 - .../Areas/Group/Options/BaseGroupOptions.cs | 2 - .../Group/Options/ResourceListOptions.cs | 2 - .../Commands/SubscriptionListCommand.cs | 2 +- .../Options/SubscriptionListOptions.cs | 2 - .../src/Services/Azure/AzureService.cs | 30 +- .../Azure/BaseAzureResourceService.cs | 2 +- .../src/Services/Azure/IAzureService.cs | 15 - .../Group/ResourceGroupListCommandTests.cs | 7 - .../Areas/Group/ResourceListCommandTests.cs | 7 - .../Subscription/SubscriptionCommandTests.cs | 6 - .../SubscriptionListCommandTests.cs | 16 +- docs/option-conversion.md | 19 +- .../copilot-remove-retry-policy-options.yml | 3 + .../Azure.Mcp.Server/docs/azmcp-commands.md | 5 - servers/Azure.Mcp.Server/docs/new-command.md | 64 ++--- .../CommandTypeInventoryTests.cs | 29 ++ .../Commands/Registry/RegistryListCommand.cs | 1 - .../Registry/RegistryRepositoryListCommand.cs | 1 - .../Options/Registry/RegistryListOptions.cs | 2 - .../Registry/RegistryRepositoryListOptions.cs | 2 - .../src/Services/AcrService.cs | 20 +- .../src/Services/IAcrService.cs | 3 - .../Registry/RegistryListCommandTests.cs | 11 +- .../RegistryRepositoryListCommandTests.cs | 4 - .../RecommendationListCommand.cs | 1 - .../RecommendationSummaryCommand.cs | 1 - .../RecommendationListOptions.cs | 4 +- .../src/Services/AdvisorService.cs | 7 +- .../src/Services/IAdvisorService.cs | 3 - .../RecommendationListCommandTests.cs | 12 +- .../RecommendationSummaryCommandTests.cs | 12 - .../src/Commands/Cluster/ClusterGetCommand.cs | 1 - .../Commands/Nodepool/NodepoolGetCommand.cs | 1 - .../src/Options/Cluster/ClusterGetOptions.cs | 2 - .../Options/Nodepool/NodepoolGetOptions.cs | 2 - .../src/Services/AksService.cs | 12 +- .../src/Services/IAksService.cs | 3 - .../Cluster/ClusterGetCommandTests.cs | 11 +- .../Nodepool/NodepoolGetCommandTests.cs | 10 +- .../Commands/Account/AccountListCommand.cs | 1 - .../KeyValue/KeyValueDeleteCommand.cs | 1 - .../Commands/KeyValue/KeyValueGetCommand.cs | 1 - .../Commands/KeyValue/KeyValueSetCommand.cs | 1 - .../KeyValue/Lock/KeyValueLockSetCommand.cs | 1 - .../src/Options/Account/AccountListOptions.cs | 2 - .../Options/KeyValue/KeyValueDeleteOptions.cs | 2 - .../Options/KeyValue/KeyValueGetOptions.cs | 2 - .../Options/KeyValue/KeyValueSetOptions.cs | 2 - .../KeyValue/Lock/KeyValueLockSetOptions.cs | 2 - .../src/Services/AppConfigService.cs | 28 +- .../src/Services/IAppConfigService.cs | 6 - .../Account/AccountListCommandTests.cs | 11 +- .../KeyValue/KeyValueDeleteCommandTests.cs | 10 +- .../KeyValue/KeyValueGetCommandTests.cs | 7 - .../KeyValue/KeyValueSetCommandTests.cs | 5 - .../Lock/KeyValueLockSetCommandTests.cs | 6 - .../Services/AppConfigServiceTests.cs | 29 -- .../Commands/Database/DatabaseAddCommand.cs | 1 - .../Webapp/Deployment/DeploymentGetCommand.cs | 1 - .../Diagnostic/DetectorDiagnoseCommand.cs | 1 - .../Webapp/Diagnostic/DetectorListCommand.cs | 1 - .../Webapp/Settings/AppSettingsGetCommand.cs | 1 - .../Settings/AppSettingsUpdateCommand.cs | 1 - .../Webapp/WebappChangeStateCommand.cs | 1 - .../src/Commands/Webapp/WebappGetCommand.cs | 1 - .../src/Options/BaseAppServiceOptions.cs | 2 - .../Options/Database/DatabaseAddOptions.cs | 2 - .../Webapp/Deployment/DeploymentGetOptions.cs | 2 - .../Diagnostic/DetectorDiagnoseOptions.cs | 2 - .../Settings/AppSettingsUpdateOptions.cs | 2 - .../Webapp/WebappChangeStateOptions.cs | 2 - .../src/Options/Webapp/WebappGetOptions.cs | 2 - .../src/Services/AppServiceService.cs | 29 +- .../src/Services/IAppServiceService.cs | 9 - .../Database/DatabaseAddCommandTests.cs | 23 +- .../Deployment/DeploymentGetCommandTests.cs | 12 +- .../DetectorDiagnoseCommandTests.cs | 10 +- .../Diagnostic/DetectorListCommandTests.cs | 13 +- .../Settings/AppSettingsGetCommandTests.cs | 14 +- .../Settings/AppSettingsUpdateCommandTests.cs | 11 +- .../Webapp/WebappChangeStateCommandTests.cs | 11 +- .../Commands/Webapp/WebappGetCommandTests.cs | 13 +- .../RecommendationListCommand.cs | 1 - .../src/Options/RecommendationListOptions.cs | 2 - .../Services/ApplicationInsightsService.cs | 15 +- .../Services/IApplicationInsightsService.cs | 2 - .../src/Services/ProfilerDataService.cs | 5 +- .../RecommendationListCommandTests.cs | 3 - .../src/Commands/RoleAssignmentListCommand.cs | 1 - .../src/Options/RoleAssignmentListOptions.cs | 2 - .../src/Services/AuthorizationService.cs | 4 +- .../src/Services/IAuthorizationService.cs | 3 - .../RoleAssignmentListCommandTests.cs | 6 +- .../Commands/Backup/BackupStatusCommand.cs | 1 - .../DisasterRecoveryEnableCrrCommand.cs | 1 - .../GovernanceFindUnprotectedCommand.cs | 1 - .../GovernanceImmutabilityCommand.cs | 1 - .../Governance/GovernanceSoftDeleteCommand.cs | 1 - .../src/Commands/Job/JobGetCommand.cs | 2 - .../Commands/Policy/PolicyCreateCommand.cs | 1 - .../src/Commands/Policy/PolicyGetCommand.cs | 2 - .../Commands/Policy/PolicyUpdateCommand.cs | 1 - .../ProtectableItemListCommand.cs | 1 - .../ProtectedItem/ProtectedItemGetCommand.cs | 2 - .../ProtectedItemProtectCommand.cs | 1 - .../ProtectedItemUndeleteCommand.cs | 1 - .../RecoveryPoint/RecoveryPointGetCommand.cs | 2 - .../SecurityConfigureEncryptionCommand.cs | 1 - .../Security/SecurityConfigureMuaCommand.cs | 2 - .../src/Commands/Vault/VaultCreateCommand.cs | 1 - .../src/Commands/Vault/VaultGetCommand.cs | 2 - .../src/Commands/Vault/VaultUpdateCommand.cs | 1 - .../src/Options/Backup/BackupStatusOptions.cs | 2 - .../src/Options/BaseAzureBackupOptions.cs | 2 - .../GovernanceFindUnprotectedOptions.cs | 2 - .../src/Options/Vault/VaultGetOptions.cs | 2 - .../src/Services/AzureBackupService.cs | 267 +++++++++--------- .../src/Services/DppBackupOperations.cs | 91 +++--- .../src/Services/IAzureBackupService.cs | 51 ++-- .../src/Services/IDppBackupOperations.cs | 22 -- .../src/Services/IRsvBackupOperations.cs | 25 -- .../src/Services/RsvBackupOperations.cs | 111 ++++---- .../Backup/BackupStatusCommandTests.cs | 10 - .../DisasterRecoveryEnableCrrCommandTests.cs | 13 +- .../GovernanceFindUnprotectedCommandTests.cs | 19 +- .../GovernanceImmutabilityCommandTests.cs | 7 +- .../GovernanceSoftDeleteCommandTests.cs | 17 +- .../Job/JobGetCommandTests.cs | 13 +- .../Policy/PolicyCreateCommandTests.cs | 11 +- .../Policy/PolicyGetCommandTests.cs | 12 +- .../Policy/PolicyUpdateCommandTests.cs | 25 +- .../ProtectableItemListCommandTests.cs | 13 +- .../ProtectedItemGetCommandTests.cs | 13 +- .../ProtectedItemProtectCommandTests.cs | 27 +- .../ProtectedItemUndeleteCommandTests.cs | 27 +- .../RecoveryPointGetCommandTests.cs | 13 +- ...SecurityConfigureEncryptionCommandTests.cs | 25 +- .../SecurityConfigureMuaCommandTests.cs | 33 ++- .../Services/AzureBackupServiceTests.cs | 179 ++++++------ .../Vault/VaultCreateCommandTests.cs | 7 +- .../Vault/VaultGetCommandTests.cs | 16 +- .../Vault/VaultUpdateCommandTests.cs | 13 +- .../PlatformLandingZone/RequestCommand.cs | 1 - .../src/Helpers/AzureMigrateProjectHelper.cs | 6 +- .../PlatformLandingZone/RequestOptions.cs | 6 - .../src/Commands/Email/EmailSendCommand.cs | 1 - .../src/Commands/Sms/SmsSendCommand.cs | 1 - .../src/Options/BaseCommunicationOptions.cs | 2 - .../src/Services/CommunicationService.cs | 7 +- .../src/Services/ICommunicationService.cs | 4 - .../Email/EmailSendCommandTests.cs | 5 - .../Services/CommunicationServiceTests.cs | 2 +- .../Sms/SmsSendCommandTests.cs | 5 +- .../src/Commands/Disk/DiskCreateCommand.cs | 1 - .../src/Commands/Disk/DiskDeleteCommand.cs | 1 - .../src/Commands/Disk/DiskGetCommand.cs | 2 - .../src/Commands/Disk/DiskUpdateCommand.cs | 2 - .../src/Commands/Vm/VmCreateCommand.cs | 1 - .../src/Commands/Vm/VmDeleteCommand.cs | 1 - .../src/Commands/Vm/VmGetCommand.cs | 3 - .../src/Commands/Vm/VmPowerStateCommand.cs | 1 - .../src/Commands/Vm/VmUpdateCommand.cs | 1 - .../src/Commands/Vmss/VmssCreateCommand.cs | 1 - .../src/Commands/Vmss/VmssDeleteCommand.cs | 1 - .../src/Commands/Vmss/VmssGetCommand.cs | 3 - .../src/Commands/Vmss/VmssUpdateCommand.cs | 1 - .../src/Options/Disk/DiskCreateOptions.cs | 2 - .../src/Options/Disk/DiskDeleteOptions.cs | 2 - .../src/Options/Disk/DiskGetOptions.cs | 2 - .../src/Options/Disk/DiskUpdateOptions.cs | 2 - .../src/Options/Vm/VmCreateOptions.cs | 2 - .../src/Options/Vm/VmDeleteOptions.cs | 2 - .../src/Options/Vm/VmGetOptions.cs | 2 - .../src/Options/Vm/VmPowerStateOptions.cs | 2 - .../src/Options/Vm/VmUpdateOptions.cs | 2 - .../src/Options/Vmss/VmssCreateOptions.cs | 2 - .../src/Options/Vmss/VmssDeleteOptions.cs | 2 - .../src/Options/Vmss/VmssGetOptions.cs | 2 - .../src/Options/Vmss/VmssUpdateOptions.cs | 2 - .../src/Services/ComputeService.cs | 61 ++-- .../src/Services/IComputeService.cs | 21 -- .../Disk/DiskCreateCommandTests.cs | 18 -- .../Disk/DiskDeleteCommandTests.cs | 6 - .../Disk/DiskGetCommandTests.cs | 8 - .../Disk/DiskUpdateCommandTests.cs | 16 -- .../Vm/VmCreateCommandTests.cs | 6 - .../Vm/VmDeleteCommandTests.cs | 9 - .../Vm/VmGetCommandTests.cs | 13 - .../Vm/VmPowerStateCommandTests.cs | 11 - .../Vm/VmUpdateCommandTests.cs | 13 - .../Vmss/VmssCreateCommandTests.cs | 5 - .../Vmss/VmssDeleteCommandTests.cs | 9 - .../Vmss/VmssGetCommandTests.cs | 14 - .../Vmss/VmssUpdateCommandTests.cs | 9 - .../ContainerApp/ContainerAppListCommand.cs | 1 - .../ContainerApp/ContainerAppListOptions.cs | 2 - .../src/Services/ContainerAppsService.cs | 4 +- .../src/Services/IContainerAppsService.cs | 2 - .../ContainerAppListCommandTests.cs | 17 +- .../Container/ContainerSchemaInferCommand.cs | 1 - .../src/Commands/CosmosListCommand.cs | 3 - .../src/Commands/Item/ItemGetCommand.cs | 1 - .../Commands/Item/ItemListRecentCommand.cs | 1 - .../Commands/Item/ItemTextSearchCommand.cs | 1 - .../Commands/Item/ItemVectorSearchCommand.cs | 1 - .../src/Commands/ItemQueryCommand.cs | 1 - .../Container/ContainerSchemaInferOptions.cs | 2 - .../src/Options/CosmosListOptions.cs | 2 - .../src/Options/Item/ItemGetOptions.cs | 2 - .../src/Options/Item/ItemListRecentOptions.cs | 2 - .../src/Options/Item/ItemTextSearchOptions.cs | 2 - .../Options/Item/ItemVectorSearchOptions.cs | 2 - .../src/Options/ItemQueryOptions.cs | 2 - .../src/Services/CosmosService.cs | 45 +-- .../src/Services/ICosmosService.cs | 10 - .../ContainerSchemaInferCommandTests.cs | 5 +- .../CosmosListCommandTests.cs | 16 -- .../CosmosServiceTests.cs | 9 +- .../Item/ItemGetCommandTests.cs | 7 +- .../Item/ItemListRecentCommandTests.cs | 4 +- .../Item/ItemQueryCommandTests.cs | 5 - .../Item/ItemTextSearchCommandTests.cs | 4 +- .../Item/ItemVectorSearchCommandTests.cs | 4 +- .../Namespace/NamespaceListCommand.cs | 1 - .../Options/Namespace/NamespaceListOptions.cs | 2 - .../src/Services/DeviceRegistryService.cs | 4 +- .../src/Services/IDeviceRegistryService.cs | 2 - .../Namespace/NamespaceListCommandTests.cs | 13 +- .../Commands/Events/EventsPublishCommand.cs | 1 - .../Subscription/SubscriptionListCommand.cs | 4 +- .../src/Commands/Topic/TopicListCommand.cs | 1 - .../Options/Events/EventsPublishOptions.cs | 2 - .../Subscription/SubscriptionListOptions.cs | 2 - .../src/Options/Topic/TopicListOptions.cs | 2 - .../src/Services/EventGridService.cs | 10 +- .../src/Services/IEventGridService.cs | 4 - .../Events/EventsPublishCommandTests.cs | 20 -- .../SubscriptionListCommandTests.cs | 15 +- .../Topic/TopicListCommandTests.cs | 9 +- .../ConsumerGroupDeleteCommand.cs | 1 - .../ConsumerGroup/ConsumerGroupGetCommand.cs | 2 - .../ConsumerGroupUpdateCommand.cs | 1 - .../EventHub/EventHubDeleteCommand.cs | 1 - .../Commands/EventHub/EventHubGetCommand.cs | 2 - .../EventHub/EventHubUpdateCommand.cs | 1 - .../Namespace/NamespaceDeleteCommand.cs | 1 - .../Commands/Namespace/NamespaceGetCommand.cs | 2 - .../Namespace/NamespaceUpdateCommand.cs | 1 - .../ConsumerGroupDeleteOptions.cs | 2 - .../ConsumerGroup/ConsumerGroupGetOptions.cs | 2 - .../ConsumerGroupUpdateOptions.cs | 2 - .../Options/EventHub/EventHubDeleteOptions.cs | 2 - .../Options/EventHub/EventHubGetOptions.cs | 2 - .../Options/EventHub/EventHubUpdateOptions.cs | 2 - .../Namespace/NamespaceDeleteOptions.cs | 2 - .../Options/Namespace/NamespaceGetOptions.cs | 2 - .../Namespace/NamespaceUpdateOptions.cs | 2 - .../src/Services/EventHubsService.cs | 44 +-- .../src/Services/IEventHubsService.cs | 13 - .../ConsumerGroupDeleteCommandTests.cs | 8 - .../ConsumerGroupGetCommandTests.cs | 10 - .../ConsumerGroupUpdateCommandTests.cs | 8 - .../EventHub/EventHubDeleteCommandTests.cs | 6 - .../EventHub/EventHubUpdateCommandTests.cs | 8 +- .../Namespace/NamespaceDeleteCommandTests.cs | 18 -- .../Namespace/NamespaceGetCommandTests.cs | 7 - .../Namespace/NamespaceUpdateCommandTests.cs | 12 - .../FileShareCheckNameAvailabilityCommand.cs | 1 - .../FileShare/FileShareCreateCommand.cs | 1 - .../FileShare/FileShareDeleteCommand.cs | 1 - .../Commands/FileShare/FileShareGetCommand.cs | 2 - .../FileShare/FileShareUpdateCommand.cs | 1 - .../FileShareGetLimitsCommand.cs | 1 - ...areGetProvisioningRecommendationCommand.cs | 1 - .../FileShareGetUsageDataCommand.cs | 1 - .../PrivateEndpointConnectionGetCommand.cs | 2 - .../PrivateEndpointConnectionUpdateCommand.cs | 1 - .../Snapshot/SnapshotCreateCommand.cs | 1 - .../Snapshot/SnapshotDeleteCommand.cs | 1 - .../Commands/Snapshot/SnapshotGetCommand.cs | 2 - .../Snapshot/SnapshotUpdateCommand.cs | 1 - .../FileShareCheckNameAvailabilityOptions.cs | 2 - .../FileShare/FileShareCreateOptions.cs | 2 - .../FileShare/FileShareDeleteOptions.cs | 2 - .../Options/FileShare/FileShareGetOptions.cs | 2 - .../FileShare/FileShareUpdateOptions.cs | 2 - .../FileShareGetLimitsOptions.cs | 2 - ...areGetProvisioningRecommendationOptions.cs | 2 - .../FileShareGetUsageDataOptions.cs | 2 - .../PrivateEndpointConnectionGetOptions.cs | 2 - .../PrivateEndpointConnectionUpdateOptions.cs | 2 - .../Options/Snapshot/SnapshotCreateOptions.cs | 2 - .../Options/Snapshot/SnapshotDeleteOptions.cs | 2 - .../Options/Snapshot/SnapshotGetOptions.cs | 2 - .../Options/Snapshot/SnapshotUpdateOptions.cs | 2 - .../src/Services/FileSharesService.cs | 53 ++-- .../src/Services/IFileSharesService.cs | 18 -- .../FileShare/FileShareCreateCommandTests.cs | 6 - .../FileShare/FileShareUpdateCommandTests.cs | 6 - .../src/Commands/KnowledgeIndexListCommand.cs | 1 - .../Commands/KnowledgeIndexSchemaCommand.cs | 1 - .../OpenAiChatCompletionsCreateCommand.cs | 1 - .../OpenAiCompletionsCreateCommand.cs | 1 - .../Commands/OpenAiEmbeddingsCreateCommand.cs | 1 - .../src/Commands/OpenAiModelsListCommand.cs | 1 - .../src/Commands/ResourceGetCommand.cs | 2 - .../Models/KnowledgeIndexListOptions.cs | 2 - .../Models/KnowledgeIndexSchemaOptions.cs | 2 - .../OpenAiChatCompletionsCreateOptions.cs | 2 - .../Models/OpenAiCompletionsCreateOptions.cs | 2 - .../Models/OpenAiEmbeddingsCreateOptions.cs | 2 - .../Options/Models/OpenAiModelsListOptions.cs | 2 - .../src/Options/Models/ResourceGetOptions.cs | 2 - .../src/Services/FoundryExtensionsService.cs | 21 +- .../src/Services/IFoundryExtensionsService.cs | 9 - .../KnowledgeIndexListCommandTests.cs | 7 +- .../KnowledgeIndexSchemaCommandTests.cs | 7 +- .../OpenAiCompletionsCreateCommandTests.cs | 5 - .../OpenAiEmbeddingsCreateCommandTests.cs | 5 - .../OpenAiModelsListCommandTests.cs | 8 - .../ResourceGetCommandTests.cs | 10 - .../FunctionApp/FunctionAppGetCommand.cs | 1 - .../FunctionApp/FunctionAppGetOptions.cs | 2 - .../src/Services/FunctionAppService.cs | 4 +- .../src/Services/IFunctionAppService.cs | 2 - .../FunctionApp/FunctionAppGetCommandTests.cs | 9 - .../Workspace/WorkspaceListCommand.cs | 1 - .../Options/Workspace/WorkspaceListOptions.cs | 2 - .../src/Services/GrafanaService.cs | 4 +- .../src/Services/IGrafanaService.cs | 3 - .../WorkspaceListCommandTests.cs | 13 +- .../src/Commands/InsightsGetCommand.cs | 4 +- .../src/Options/InsightsGetOptions.cs | 2 - .../src/Services/IInsightsService.cs | 3 - .../src/Services/InsightsService.cs | 7 +- .../InsightsGetCommandTests.cs | 42 ++- .../Device/IoTHubDeviceListCommand.cs | 1 - .../src/Commands/IoTHub/IoTHubGetCommand.cs | 1 - .../Options/Device/IoTHubDeviceListOptions.cs | 2 - .../src/Options/IoTHub/IoTHubGetOptions.cs | 2 - .../src/Services/IIoTHubDeviceService.cs | 2 - .../src/Services/IIoTHubHostnameResolver.cs | 3 - .../src/Services/IIoTHubService.cs | 2 - .../src/Services/IoTHubDeviceService.cs | 9 +- .../src/Services/IoTHubHostnameResolver.cs | 4 +- .../src/Services/IoTHubService.cs | 6 +- .../Device/IoTHubDeviceListCommandTests.cs | 5 - .../IoTHub/IoTHubGetCommandTests.cs | 5 - .../Commands/Admin/AdminSettingsGetCommand.cs | 2 +- .../Certificate/CertificateCreateCommand.cs | 1 - .../Certificate/CertificateGetCommand.cs | 2 - .../Certificate/CertificateImportCommand.cs | 1 - .../src/Commands/Key/KeyCreateCommand.cs | 1 - .../src/Commands/Key/KeyGetCommand.cs | 2 - .../Commands/Secret/SecretCreateCommand.cs | 1 - .../src/Commands/Secret/SecretGetCommand.cs | 2 - .../src/Options/BaseKeyVaultOptions.cs | 2 - .../src/Services/IKeyVaultService.cs | 23 -- .../src/Services/KeyVaultService.cs | 54 ++-- .../Admin/AdminSettingsGetCommandTests.cs | 4 - .../CertificateCreateCommandTests.cs | 4 - .../Certificate/CertificateGetCommandTests.cs | 6 - .../CertificateImportCommandTests.cs | 12 - .../Key/KeyCreateCommandTests.cs | 3 - .../Key/KeyGetCommandTests.cs | 7 - .../Secret/SecretCreateCommandTests.cs | 3 - .../Secret/SecretGetCommandTests.cs | 5 - .../src/Commands/ClusterGetCommand.cs | 1 - .../src/Commands/ClusterListCommand.cs | 1 - .../src/Commands/DatabaseListCommand.cs | 2 - .../src/Commands/QueryCommand.cs | 2 - .../src/Commands/SampleCommand.cs | 2 - .../src/Commands/TableListCommand.cs | 2 - .../src/Commands/TableSchemaCommand.cs | 2 - .../src/Options/ClusterGetOptions.cs | 2 - .../src/Options/ClusterListOptions.cs | 2 - .../src/Options/DatabaseListOptions.cs | 2 - .../src/Options/QueryOptions.cs | 2 - .../src/Options/SampleOptions.cs | 2 - .../src/Options/TableListOptions.cs | 2 - .../src/Options/TableSchemaOptions.cs | 2 - .../src/Services/IKustoService.cs | 11 - .../src/Services/KustoService.cs | 36 +-- .../ClusterGetCommandTests.cs | 7 +- .../ClusterListCommandTests.cs | 11 +- .../DatabaseListCommandTests.cs | 13 +- .../QueryCommandTests.cs | 13 +- .../SampleCommandTests.cs | 13 +- .../TableListCommandTests.cs | 13 +- .../TableSchemaCommandTests.cs | 13 +- .../Commands/LoadTest/TestCreateCommand.cs | 1 - .../src/Commands/LoadTest/TestGetCommand.cs | 1 - .../TestResourceCreateCommand.cs | 1 - .../TestResourceListCommand.cs | 1 - .../TestRunCreateOrUpdateCommand.cs | 1 - .../Commands/LoadTestRun/TestRunGetCommand.cs | 2 - .../Options/LoadTest/LoadTestCreateOptions.cs | 3 - .../Options/LoadTest/LoadTestGetOptions.cs | 3 - .../TestResourceCreateOptions.cs | 3 - .../TestResourceListOptions.cs | 3 - .../LoadTestRunCreateOrUpdateOptions.cs | 3 - .../LoadTestRun/LoadTestRunGetOptions.cs | 3 - .../src/Services/ILoadTestingService.cs | 8 - .../src/Services/LoadTestingService.cs | 50 ++-- .../TestCreateCommandTests.cs | 13 +- .../TestGetCommandTests.cs | 13 +- .../TestResourceCreateCommandTests.cs | 13 +- .../TestResourcesListCommandTests.cs | 17 +- .../TestRunCreateOrUpdateCommandTests.cs | 21 +- .../TestRunGetCommandTests.cs | 21 +- .../AutoexportJobCancelCommand.cs | 1 - .../AutoexportJobCreateCommand.cs | 1 - .../AutoexportJobDeleteCommand.cs | 1 - .../AutoexportJob/AutoexportJobGetCommand.cs | 2 - .../AutoimportJobCancelCommand.cs | 1 - .../AutoimportJobCreateCommand.cs | 1 - .../AutoimportJobDeleteCommand.cs | 1 - .../AutoimportJob/AutoimportJobGetCommand.cs | 2 - .../FileSystem/FileSystemCreateCommand.cs | 1 - .../FileSystem/FileSystemListCommand.cs | 1 - .../FileSystem/FileSystemUpdateCommand.cs | 1 - .../ImportJob/ImportJobCancelCommand.cs | 1 - .../ImportJob/ImportJobCreateCommand.cs | 1 - .../ImportJob/ImportJobDeleteCommand.cs | 1 - .../ImportJob/ImportJobGetCommand.cs | 2 - .../Commands/FileSystem/Sku/SkuGetCommand.cs | 2 +- .../SubnetSize/SubnetSizeAskCommand.cs | 1 - .../SubnetSize/SubnetSizeValidateCommand.cs | 1 - .../AutoexportJobCancelOptions.cs | 3 - .../AutoexportJobCreateOptions.cs | 3 - .../AutoexportJobDeleteOptions.cs | 3 - .../AutoexportJob/AutoexportJobGetOptions.cs | 3 - .../AutoimportJobCancelOptions.cs | 3 - .../AutoimportJobCreateOptions.cs | 3 - .../AutoimportJobDeleteOptions.cs | 3 - .../AutoimportJob/AutoimportJobGetOptions.cs | 3 - .../FileSystem/FileSystemCreateOptions.cs | 3 - .../FileSystem/FileSystemListOptions.cs | 3 - .../FileSystem/FileSystemUpdateOptions.cs | 3 - .../ImportJob/ImportJobCancelOptions.cs | 3 - .../ImportJob/ImportJobCreateOptions.cs | 3 - .../ImportJob/ImportJobDeleteOptions.cs | 3 - .../ImportJob/ImportJobGetOptions.cs | 3 - .../Options/FileSystem/Sku/SkuGetOptions.cs | 3 - .../SubnetSize/SubnetSizeAskOptions.cs | 3 - .../SubnetSize/SubnetSizeValidateOptions.cs | 3 - .../src/Services/IManagedLustreService.cs | 22 -- .../src/Services/ManagedLustreService.cs | 68 ++--- .../AutoexportJobCancelCommandTests.cs | 17 +- .../AutoexportJobCreateCommandTests.cs | 57 +--- .../AutoexportJobDeleteCommandTests.cs | 17 +- .../AutoexportJobGetCommandTests.cs | 27 +- .../AutoimportJobCancelCommandTests.cs | 25 +- .../AutoimportJobCreateCommandTests.cs | 41 +-- .../AutoimportJobDeleteCommandTests.cs | 25 +- .../AutoimportJobGetCommandTests.cs | 35 +-- .../FileSystemCreateCommandTests.cs | 33 +-- .../FileSystem/FileSystemListCommandTests.cs | 21 +- .../FileSystemUpdateCommandTests.cs | 37 +-- .../ImportJob/ImportJobCancelCommandTests.cs | 11 +- .../ImportJob/ImportJobCreateCommandTests.cs | 17 +- .../ImportJob/ImportJobDeleteCommandTests.cs | 11 +- .../ImportJob/ImportJobGetCommandTests.cs | 18 +- .../FileSystem/Sku/SkuGetCommandTests.cs | 9 +- .../SubnetSize/SubnetSizeAskCommandTests.cs | 17 +- .../SubnetSizeValidateCommandTests.cs | 9 +- .../src/Commands/Product/ProductGetCommand.cs | 1 - .../Commands/Product/ProductListCommand.cs | 1 - .../src/Options/Product/ProductGetOptions.cs | 2 - .../src/Options/Product/ProductListOptions.cs | 4 +- .../src/Services/IMarketplaceService.cs | 3 - .../src/Services/MarketplaceService.cs | 16 +- .../Product/ProductGetCommandTests.cs | 3 - .../Product/ProductListCommandTests.cs | 9 - .../ActivityLog/ActivityLogListCommand.cs | 1 - .../HealthModels/HealthModelGetCommand.cs | 1 - .../HealthModels/HealthModelListCommand.cs | 1 - .../Commands/Log/ResourceLogQueryCommand.cs | 1 - .../Commands/Log/WorkspaceLogQueryCommand.cs | 1 - .../Metrics/MetricsDefinitionsCommand.cs | 1 - .../Commands/Metrics/MetricsQueryCommand.cs | 1 - .../src/Commands/Table/TableListCommand.cs | 1 - .../TableType/TableTypeListCommand.cs | 1 - .../WebTests/WebTestsCreateOrUpdateCommand.cs | 3 - .../Commands/WebTests/WebTestsGetCommand.cs | 5 +- .../Workspace/WorkspaceListCommand.cs | 1 - .../ActivityLog/ActivityLogListOptions.cs | 2 - .../HealthModels/HealthModelGetOptions.cs | 2 - .../HealthModels/HealthModelListOptions.cs | 2 - .../src/Options/Metrics/BaseMetricsOptions.cs | 2 - .../src/Options/ResourceLogQueryOptions.cs | 2 - .../src/Options/TableListOptions.cs | 2 - .../Options/TableType/TableTypeListOptions.cs | 2 - .../WebTests/WebTestsCreateOrUpdateOptions.cs | 2 - .../Options/WebTests/WebTestsGetOptions.cs | 2 - .../src/Options/WorkspaceListOptions.cs | 2 - .../src/Options/WorkspaceLogQueryOptions.cs | 2 - .../Services/IMonitorHealthModelService.cs | 5 - .../src/Services/IMonitorMetricsService.cs | 7 - .../src/Services/IMonitorService.cs | 8 - .../src/Services/IMonitorWebTestService.cs | 6 - .../src/Services/IResourceResolverService.cs | 3 - .../src/Services/MonitorHealthModelService.cs | 7 +- .../src/Services/MonitorMetricsService.cs | 16 +- .../src/Services/MonitorService.cs | 37 +-- .../src/Services/MonitorWebTestService.cs | 16 +- .../src/Services/ResourceResolverService.cs | 4 +- .../ActivityLogListCommandTests.cs | 7 - .../HealthModelGetCommandTests.cs | 3 +- .../HealthModelListCommandTests.cs | 7 +- .../Log/ResourceLogQueryCommandTests.cs | 11 - .../Log/WorkspaceLogQueryCommandTests.cs | 9 - .../LogAnalyticsHelper.cs | 2 +- .../Metrics/MetricsDefinitionsCommandTests.cs | 27 +- .../Metrics/MetricsQueryCommandTests.cs | 20 -- .../Metrics/MonitorMetricsServiceTests.cs | 3 - .../Metrics/ResourceResolverServiceTests.cs | 9 +- .../Table/TableListCommandTests.cs | 8 - .../TableType/TableTypeListCommandTests.cs | 8 - .../WebTestsCreateOrUpdateCommandTests.cs | 9 +- .../WebTests/WebTestsGetCommandTests.cs | 22 +- .../Workspace/WorkspaceListCommandTests.cs | 15 +- .../src/Services/MySqlService.cs | 8 +- .../Services/MySqlServiceTests.cs | 13 +- .../Assignment/PolicyAssignmentListCommand.cs | 1 - .../Assignment/PolicyAssignmentListOptions.cs | 2 - .../src/Services/IPolicyService.cs | 5 - .../src/Services/PolicyService.cs | 14 +- .../PolicyAssignmentListCommandTests.cs | 9 - .../Commands/Server/ServerConfigGetCommand.cs | 2 +- .../Commands/Server/ServerParamGetCommand.cs | 2 +- .../Commands/Server/ServerParamSetCommand.cs | 2 +- .../src/Options/Server/BaseServerOptions.cs | 2 - .../src/Services/IPostgresService.cs | 5 - .../src/Services/PostgresService.cs | 10 +- .../Server/ServerConfigGetCommandTests.cs | 13 +- .../Server/ServerParamGetCommandTests.cs | 13 +- .../Server/ServerParamSetCommandTests.cs | 21 +- .../Services/PostgresServiceTests.cs | 27 +- .../src/Commands/ResourceCreateCommand.cs | 1 - .../src/Commands/ResourceListCommand.cs | 1 - .../src/Options/ResourceCreateOptions.cs | 2 - .../src/Options/ResourceListOptions.cs | 4 +- .../src/Services/IRedisService.cs | 5 - .../src/Services/RedisService.cs | 7 +- .../RedisCommandTests.cs | 15 - .../RedisServiceTests.cs | 5 +- .../ResourceCreateCommandTests.cs | 15 - .../ResourceListCommandTests.cs | 20 +- .../src/Commands/Drills/DrillGetCommand.cs | 2 - .../Resources/DrillResourceGetCommand.cs | 2 - .../Assignments/GoalAssignmentGetCommand.cs | 2 - .../Goals/Resources/GoalResourceGetCommand.cs | 2 - .../Goals/Templates/GoalTemplateGetCommand.cs | 2 - .../Recovery/Jobs/RecoveryJobGetCommand.cs | 2 - .../RecoveryJobResourceGetCommand.cs | 2 - .../Plans/RecoveryPlanCreateCommand.cs | 1 - .../Plans/RecoveryPlanDeleteCommand.cs | 1 - .../Recovery/Plans/RecoveryPlanGetCommand.cs | 2 - .../RecoveryPlanUpdateResourcesCommand.cs | 1 - .../Resources/RecoveryResourceGetCommand.cs | 2 - .../UsagePlanEnrollmentCreateCommand.cs | 1 - .../UsagePlanEnrollmentGetCommand.cs | 2 - .../UsagePlans/UsagePlanCreateCommand.cs | 1 - .../UsagePlans/UsagePlanGetCommand.cs | 3 - .../src/Options/Drills/DrillGetOption.cs | 2 - .../Resources/DrillResourceGetOption.cs | 2 - .../Assignments/GoalAssignmentGetOption.cs | 2 - .../Goals/Resources/GoalResourceGetOption.cs | 2 - .../Goals/Templates/GoalTemplateGetOption.cs | 2 - .../Recovery/Jobs/RecoveryJobGetOption.cs | 2 - .../Resources/RecoveryJobResourceGetOption.cs | 2 - .../Plans/RecoveryPlanCreateOption.cs | 2 - .../Plans/RecoveryPlanDeleteOption.cs | 2 - .../Recovery/Plans/RecoveryPlanGetOption.cs | 2 - .../RecoveryPlanUpdateResourcesOption.cs | 2 - .../Resources/RecoveryResourceGetOption.cs | 2 - .../UsagePlanEnrollmentCreateOption.cs | 2 - .../UsagePlanEnrollmentGetOption.cs | 2 - .../UsagePlans/UsagePlanCreateOption.cs | 2 - .../Options/UsagePlans/UsagePlanGetOption.cs | 2 - .../Services/IResilienceManagementService.cs | 57 ++-- .../Services/ResilienceManagementService.cs | 127 +++++---- .../Drills/DrillGetCommandTests.cs | 11 +- .../Resources/DrillResourceGetCommandTests.cs | 9 +- .../GoalAssignmentGetCommandTests.cs | 7 +- .../Resources/GoalResourceGetCommandTests.cs | 7 +- .../Templates/GoalTemplateGetCommandTests.cs | 7 +- .../Jobs/RecoveryJobGetCommandTests.cs | 7 +- .../RecoveryJobResourceGetCommandTests.cs | 7 +- .../Plans/RecoveryPlanCreateCommandTests.cs | 20 -- .../Plans/RecoveryPlanDeleteCommandTests.cs | 7 - .../Plans/RecoveryPlanGetCommandTests.cs | 7 +- ...RecoveryPlanUpdateResourcesCommandTests.cs | 8 - .../RecoveryResourceGetCommandTests.cs | 7 +- .../UsagePlanEnrollmentCreateCommandTests.cs | 6 - .../UsagePlanEnrollmentGetCommandTests.cs | 7 +- .../UsagePlans/UsagePlanCreateCommandTests.cs | 7 - .../UsagePlans/UsagePlanGetCommandTests.cs | 9 +- .../AvailabilityStatusGetCommand.cs | 2 - .../ServiceHealthEventsListCommand.cs | 1 - .../AvailabilityStatusGetOptions.cs | 2 - .../ServiceHealthEventsListOptions.cs | 2 - .../src/Services/IResourceHealthService.cs | 7 - .../src/Services/ResourceHealthService.cs | 8 +- .../AvailabilityStatusGetCommandTests.cs | 19 +- .../ServiceHealthEventsListCommandTests.cs | 6 - ...esourceHealthServiceSsrfValidationTests.cs | 2 +- .../src/Commands/Index/IndexGetCommand.cs | 1 - .../src/Commands/Index/IndexQueryCommand.cs | 1 - .../Knowledge/KnowledgeBaseGetCommand.cs | 2 +- .../Knowledge/KnowledgeBaseRetrieveCommand.cs | 2 +- .../Knowledge/KnowledgeSourceGetCommand.cs | 2 +- .../Commands/Service/ServiceListCommand.cs | 1 - .../src/Options/Index/IndexGetOptions.cs | 2 - .../src/Options/Index/IndexQueryOptions.cs | 2 - .../Knowledge/KnowledgeBaseGetOptions.cs | 2 - .../Knowledge/KnowledgeBaseRetrieveOptions.cs | 2 - .../Knowledge/KnowledgeSourceGetOptions.cs | 2 - .../src/Options/Service/ServiceListOptions.cs | 2 - .../src/Services/ISearchService.cs | 7 - .../src/Services/SearchService.cs | 27 +- .../Index/IndexGetCommandTests.cs | 7 - .../Index/IndexQueryCommandTests.cs | 3 - .../Knowledge/KnowledgeBaseGetCommandTests.cs | 5 - .../KnowledgeBaseRetrieveCommandTests.cs | 4 - .../KnowledgeSourceGetCommandTests.cs | 5 - .../Service/SearchServiceTests.cs | 3 +- .../Service/ServiceListCommandTests.cs | 8 +- .../src/Commands/Queue/QueueDetailsCommand.cs | 1 - .../src/Commands/Queue/QueuePeekCommand.cs | 1 - .../Topic/SubscriptionDetailsCommand.cs | 1 - .../Commands/Topic/SubscriptionPeekCommand.cs | 1 - .../src/Commands/Topic/TopicDetailsCommand.cs | 1 - .../src/Options/Queue/BaseQueueOptions.cs | 2 - .../src/Options/Topic/BaseTopicOptions.cs | 2 - .../src/Services/IServiceBusService.cs | 11 - .../src/Services/ServiceBusService.cs | 15 +- .../Queue/QueueDetailsCommandTests.cs | 5 - .../Topic/SubscriptionDetailsCommandTests.cs | 5 - .../Topic/TopicDetailsCommandTests.cs | 5 - .../ManagedClusterNodeGetCommand.cs | 2 - .../ManagedClusterNodeTypeRestartCommand.cs | 1 - .../ManagedClusterNodeGetOptions.cs | 2 - .../ManagedClusterNodeTypeRestartOptions.cs | 2 - .../src/Services/IServiceFabricService.cs | 4 - .../src/Services/ServiceFabricService.cs | 10 +- .../ManagedClusterNodeGetCommandTests.cs | 12 - ...nagedClusterNodeTypeRestartCommandTests.cs | 11 - .../src/Commands/Runtime/RuntimeGetCommand.cs | 1 - .../src/Options/Runtime/RuntimeGetOptions.cs | 2 - .../src/Services/ISignalRService.cs | 2 - .../src/Services/SignalRService.cs | 4 +- .../Runtime/RuntimeGetCommandTest.cs | 6 - .../src/Commands/Stt/SttRecognizeCommand.cs | 1 - .../src/Commands/Tts/TtsSynthesizeCommand.cs | 1 - .../src/Options/BaseSpeechOptions.cs | 2 - .../src/Services/ISpeechService.cs | 3 - .../FastTranscriptionRecognizer.cs | 17 +- .../IFastTranscriptionRecognizer.cs | 3 - .../IRealtimeTranscriptionRecognizer.cs | 3 - .../RealtimeTranscriptionRecognizer.cs | 17 +- .../src/Services/SpeechService.cs | 10 +- .../Synthesizers/IRealtimeTtsSynthesizer.cs | 3 - .../Synthesizers/RealtimeTtsSynthesizer.cs | 2 - .../SpeechCommandTests.cs | 38 --- .../Stt/SttRecognizeCommandTests.cs | 55 +--- .../Tts/TtsSynthesizeCommandTests.cs | 7 - .../Database/DatabaseCreateCommand.cs | 1 - .../Database/DatabaseDeleteCommand.cs | 1 - .../Commands/Database/DatabaseGetCommand.cs | 2 - .../Database/DatabaseRenameCommand.cs | 1 - .../Database/DatabaseUpdateCommand.cs | 1 - .../ElasticPool/ElasticPoolListCommand.cs | 1 - .../EntraAdmin/EntraAdminListCommand.cs | 1 - .../FirewallRule/FirewallRuleCreateCommand.cs | 1 - .../FirewallRule/FirewallRuleDeleteCommand.cs | 1 - .../FirewallRule/FirewallRuleListCommand.cs | 1 - .../Commands/Server/ServerCreateCommand.cs | 1 - .../Commands/Server/ServerDeleteCommand.cs | 1 - .../src/Commands/Server/ServerGetCommand.cs | 2 - .../src/Options/BaseSqlOptions.cs | 2 - .../src/Services/ISqlService.cs | 31 -- .../src/Services/SqlService.cs | 76 ++--- .../Database/DatabaseCreateCommandTests.cs | 17 -- .../Database/DatabaseDeleteCommandTests.cs | 42 --- .../Database/DatabaseGetCommandTests.cs | 18 +- .../Database/DatabaseRenameCommandTests.cs | 9 - .../Database/DatabaseUpdateCommandTests.cs | 18 -- .../ElasticPoolListCommandTests.cs | 7 - .../EntraAdmin/EntraAdminListCommandTests.cs | 7 - .../FirewallRuleCreateCommandTests.cs | 63 +---- .../FirewallRuleDeleteCommandTests.cs | 48 ---- .../FirewallRuleListCommandTests.cs | 46 --- .../Server/ServerCreateCommandTests.cs | 11 - .../Server/ServerDeleteCommandTests.cs | 9 +- .../Server/ServerGetCommandTests.cs | 18 +- .../Services/SqlServiceTests.cs | 45 ++- .../src/Commands/Agents/AgentsGetCommand.cs | 1 - .../src/Commands/Agents/AgentsListCommand.cs | 1 - .../src/Commands/SreAgentCommandHelpers.cs | 5 - .../src/Options/Agents/AgentsListOptions.cs | 2 - .../src/Options/BaseSreAgentOptions.cs | 2 - .../src/Services/ISreAgentService.cs | 4 - .../src/Services/SreAgentService.cs | 10 +- .../Agents/AgentsCreateCommandTests.cs | 9 +- .../Agents/AgentsDeleteCommandTests.cs | 9 +- .../Agents/AgentsGetCommandTests.cs | 10 +- .../Agents/AgentsListCommandTests.cs | 9 +- .../Agents/AgentsToolsCreateCommandTests.cs | 9 +- .../Agents/AgentsToolsGetCommandTests.cs | 9 +- .../CommonPromptsCreateCommandTests.cs | 4 - .../CommonPromptsDeleteCommandTests.cs | 5 - .../CommonPromptsGetCommandTests.cs | 4 - .../CommonPromptsListCommandTests.cs | 4 - .../ConnectorsCreateKustoCommandTests.cs | 5 - .../ConnectorsCreateMcpCommandTests.cs | 5 - .../ConnectorsDeleteCommandTests.cs | 5 - .../Connectors/ConnectorsGetCommandTests.cs | 5 - .../Connectors/ConnectorsListCommandTests.cs | 5 - .../Connectors/ConnectorsTestCommandTests.cs | 4 - .../Docs/MemoriesAddCommandTests.cs | 4 - .../Docs/MemoriesDeleteCommandTests.cs | 5 - .../Docs/MemoriesListCommandTests.cs | 4 - .../Docs/MemoriesReindexCommandTests.cs | 4 - .../Docs/MemoriesSearchCommandTests.cs | 4 - .../Hooks/HooksDeleteCommandTests.cs | 4 - .../Hooks/HooksGetCommandTests.cs | 4 - .../Hooks/HooksListCommandTests.cs | 4 - .../Hooks/HooksThreadActivateCommandTests.cs | 4 - .../HooksThreadDeactivateCommandTests.cs | 4 - .../Hooks/HooksThreadListCommandTests.cs | 4 - .../IncidentsActiveListCommandTests.cs | 5 - .../Incidents/IncidentsCreateCommandTests.cs | 5 - .../IncidentsPlansCreateCommandTests.cs | 5 - .../IncidentsPlansListCommandTests.cs | 5 - .../IncidentsSetupPagerdutyCommandTests.cs | 13 +- .../IncidentsSetupServicenowCommandTests.cs | 13 +- .../ScheduledTasksCreateCommandTests.cs | 5 - .../ScheduledTasksDeleteCommandTests.cs | 5 - .../ScheduledTasksGetCommandTests.cs | 5 - .../ScheduledTasksListCommandTests.cs | 5 - .../ScheduledTasksPauseCommandTests.cs | 5 - .../ScheduledTasksResumeCommandTests.cs | 5 - .../Skills/SkillsCreateCommandTests.cs | 9 +- .../Skills/SkillsDeleteCommandTests.cs | 9 +- .../Skills/SkillsListCommandTests.cs | 9 +- .../Threads/ThreadsCreateCommandTests.cs | 5 - .../Threads/ThreadsDeleteCommandTests.cs | 5 - .../Threads/ThreadsGetCommandTests.cs | 5 - .../Threads/ThreadsInvestigateCommandTests.cs | 5 - .../ThreadsInvestigateYoloCommandTests.cs | 5 - .../Threads/ThreadsListCommandTests.cs | 5 - .../Threads/ThreadsSendMessageCommandTests.cs | 5 - .../Workflows/WorkflowsApplyCommandTests.cs | 5 - .../Commands/Account/AccountCreateCommand.cs | 1 - .../src/Commands/Account/AccountGetCommand.cs | 1 - .../src/Commands/Blob/BlobGetCommand.cs | 1 - .../src/Commands/Blob/BlobUploadCommand.cs | 1 - .../Blob/Container/ContainerCreateCommand.cs | 1 - .../Blob/Container/ContainerGetCommand.cs | 1 - .../src/Commands/Table/TableListCommand.cs | 1 - .../Options/Account/AccountCreateOptions.cs | 2 - .../src/Options/Account/AccountGetOptions.cs | 2 - .../src/Options/Blob/BlobGetOptions.cs | 2 - .../src/Options/Blob/BlobUploadOptions.cs | 2 - .../Blob/Container/ContainerCreateOptions.cs | 2 - .../Blob/Container/ContainerGetOptions.cs | 2 - .../src/Options/Table/TableListOptions.cs | 2 - .../src/Services/IStorageService.cs | 8 - .../src/Services/StorageService.cs | 31 +- .../Account/AccountCreateCommandTests.cs | 8 - .../Account/AccountGetCommandTests.cs | 16 +- .../Blob/BlobGetCommandTests.cs | 9 - .../Blob/BlobUploadCommandTests.cs | 4 - .../Container/ContainerCreateCommandTests.cs | 8 - .../Container/ContainerGetCommandTests.cs | 9 - .../StorageCommandTests.cs | 6 +- .../Table/TableListCommandTests.cs | 4 - .../CloudEndpointCreateCommand.cs | 1 - .../CloudEndpointDeleteCommand.cs | 1 - .../CloudEndpoint/CloudEndpointGetCommand.cs | 2 - ...udEndpointTriggerChangeDetectionCommand.cs | 1 - .../RegisteredServerGetCommand.cs | 2 - .../RegisteredServerUnregisterCommand.cs | 1 - .../RegisteredServerUpdateCommand.cs | 1 - .../ServerEndpointCreateCommand.cs | 1 - .../ServerEndpointDeleteCommand.cs | 1 - .../ServerEndpointGetCommand.cs | 2 - .../ServerEndpointUpdateCommand.cs | 1 - .../StorageSyncServiceCreateCommand.cs | 1 - .../StorageSyncServiceDeleteCommand.cs | 1 - .../StorageSyncServiceGetCommand.cs | 2 - .../StorageSyncServiceUpdateCommand.cs | 1 - .../SyncGroup/SyncGroupCreateCommand.cs | 1 - .../SyncGroup/SyncGroupDeleteCommand.cs | 1 - .../Commands/SyncGroup/SyncGroupGetCommand.cs | 2 - .../CloudEndpointCreateOptions.cs | 2 - .../CloudEndpointDeleteOptions.cs | 2 - .../CloudEndpoint/CloudEndpointGetOptions.cs | 2 - ...udEndpointTriggerChangeDetectionOptions.cs | 2 - .../RegisteredServerGetOptions.cs | 2 - .../RegisteredServerUnregisterOptions.cs | 2 - .../RegisteredServerUpdateOptions.cs | 2 - .../ServerEndpointCreateOptions.cs | 2 - .../ServerEndpointDeleteOptions.cs | 2 - .../ServerEndpointGetOptions.cs | 2 - .../ServerEndpointUpdateOptions.cs | 2 - .../StorageSyncServiceCreateOptions.cs | 2 - .../StorageSyncServiceDeleteOptions.cs | 2 - .../StorageSyncServiceGetOptions.cs | 2 - .../StorageSyncServiceUpdateOptions.cs | 2 - .../SyncGroup/SyncGroupCreateOptions.cs | 2 - .../SyncGroup/SyncGroupDeleteOptions.cs | 2 - .../Options/SyncGroup/SyncGroupGetOptions.cs | 2 - .../src/Services/IStorageSyncService.cs | 25 -- .../src/Services/StorageSyncService.cs | 73 ++--- .../Commands/Hostpool/HostpoolListCommand.cs | 2 - .../SessionHost/SessionHostListCommand.cs | 3 - .../SessionHostUserSessionListCommand.cs | 3 - .../Options/Hostpool/BaseHostPoolOptions.cs | 2 - .../Options/Hostpool/HostpoolListOptions.cs | 2 - .../src/Services/IVirtualDesktopService.cs | 9 - .../src/Services/VirtualDesktopService.cs | 25 +- .../Hostpool/HostpoolListCommandTests.cs | 29 +- .../SessionHostListCommandTests.cs | 15 - .../SessionHostUserSessionListCommandTests.cs | 24 -- .../Workbooks/CreateWorkbooksCommand.cs | 1 - .../Workbooks/DeleteWorkbooksCommand.cs | 1 - .../Workbooks/ListWorkbooksCommand.cs | 1 - .../Workbooks/ShowWorkbooksCommand.cs | 1 - .../Workbooks/UpdateWorkbooksCommand.cs | 1 - .../Options/Workbook/CreateWorkbookOptions.cs | 2 - .../Options/Workbook/DeleteWorkbookOptions.cs | 2 - .../Options/Workbook/ListWorkbooksOptions.cs | 2 - .../Options/Workbook/ShowWorkbooksOptions.cs | 2 - .../Workbook/UpdateWorkbooksOptions.cs | 2 - .../src/Services/IWorkbooksService.cs | 6 - .../src/Services/WorkbooksService.cs | 27 +- .../CreateWorkbooksCommandTests.cs | 56 ---- .../DeleteWorkbooksCommandTests.cs | 39 --- .../ListWorkbooksCommandTests.cs | 51 ---- .../ShowWorkbooksCommandTests.cs | 10 - .../UpdateWorkbooksCommandTests.cs | 59 ---- 851 files changed, 1554 insertions(+), 5213 deletions(-) create mode 100644 servers/Azure.Mcp.Server/changelog-entries/copilot-remove-retry-policy-options.yml diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 473d71ba6e..5a5bc4957f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -6,6 +6,7 @@ - Always put new classes and interfaces in separate files - Always make members static if they can be - All generated code needs to be AOT safe +- Never expose `RetryPolicyOptions` through tool options or service contracts; use Azure SDK retry defaults - Always review your own code for consistency, maintainability, and testability - Always ask for clarifications if the request is ambiguous or lacks sufficient context. diff --git a/.github/skills/add-azure-mcp-tools/SKILL.md b/.github/skills/add-azure-mcp-tools/SKILL.md index 16d7c7a22d..125a812b48 100644 --- a/.github/skills/add-azure-mcp-tools/SKILL.md +++ b/.github/skills/add-azure-mcp-tools/SKILL.md @@ -181,9 +181,6 @@ public class {Resource}{Operation}Options : ISubscriptionOption [Option(OptionDescriptions.Tenant)] public string? Tenant { get; set; } - - [Option(Name = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -222,7 +219,6 @@ public interface I{Toolset}Service string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // Data plane operation (returns simple List) @@ -230,7 +226,6 @@ public interface I{Toolset}Service string resourceName, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } ``` @@ -254,14 +249,13 @@ public class {Toolset}Service(IAzureService azureService) string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { return await ExecuteResourceQueryAsync( "Microsoft.{Provider}/{resourceType}", resourceGroup, subscription, - retryPolicy, + null, ConvertToModel, tenant: tenant, cancellationToken: cancellationToken); @@ -290,10 +284,9 @@ public class {Toolset}Service(IAzureService azureService) string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); // CRITICAL: Use GetResourceGroupAsync with await var rgResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -319,11 +312,10 @@ public class MyService(IAzureService azureService) private async Task CreateDataPlaneClientAsync( string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var endpoint = GetResourceEndpoint(resourceName); - var options = ConfigureRetryPolicy(AddDefaultPolicies(new MyClientOptions()), retryPolicy); + var options = AddDefaultPolicies(new MyClientOptions()); options.Transport = new HttpClientTransport(AzureService.GetClient()); return new MyDataPlaneClient( new Uri(endpoint), @@ -411,7 +403,7 @@ public sealed class {Resource}{Operation}Command( options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, + null, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -1402,10 +1394,10 @@ var vms = await vmssResource.Value ```csharp // ✅ Correct: use IAzureService -var subscriptionResource = await _azureService.GetSubscription(subscription, tenant, retryPolicy); +var subscriptionResource = await _azureService.GetSubscription(subscription, tenant, cancellationToken); // ❌ Wrong: manual ARM client creation -var armClient = await CreateArmClientAsync(tenant, retryPolicy); +var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{subscription}")); ``` @@ -1733,17 +1725,15 @@ catch (Exception ex) Task> GetStorageAccounts( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // ❌ Incorrect: all on single line -Task> GetStorageAccounts(string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null); +Task> GetStorageAccounts(string subscription, string? tenant = null, CancellationToken cancellationToken = default); // ❌ Incorrect: missing CancellationToken Task> GetStorageAccounts( string subscription, - string? tenant = null, - RetryPolicyOptions? retryPolicy = null); + string? tenant = null); ``` Rules: @@ -2003,7 +1993,8 @@ private MyOptions? _currentOptions; // Race condition! ```csharp public async Task> GetResourcesAsync( - string subscription, string? tenant, RetryPolicyOptions? retryPolicy, + string subscription, + string? tenant, CancellationToken cancellationToken) { // IAzureService handles tenant resolution for all modes: diff --git a/.github/workflows/doc-gap-detector.md b/.github/workflows/doc-gap-detector.md index ff66f249a8..0e056570da 100644 --- a/.github/workflows/doc-gap-detector.md +++ b/.github/workflows/doc-gap-detector.md @@ -160,7 +160,7 @@ For each file that needs changes, provide: Depending on the gap, verify the relevant doc file follows the expected format: **`servers/Azure.Mcp.Server/docs/azmcp-commands.md`** — must include: -- A global options table at the top (subscription, resource-group, tenant, retry-max-retries, retry-delay) +- A global options table at the top (subscription, resource-group, tenant) - One `## azmcp ` section per command, containing a description, parameters table, and example usage block **`servers/Azure.Mcp.Server/docs/e2eTestPrompts.md`** — must include: diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2d73807d93..c419bfed80 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -26,4 +26,4 @@ "problemMatcher": "$msCompile" } ] -} +} \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 65d1f619b6..8ea0ad0291 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -386,8 +386,6 @@ public class AccountGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } // Commands use two-generic base: SubscriptionCommand @@ -446,7 +444,7 @@ protected override int GetStatusCode(Exception ex) => ex switch try { // Command execution logic - var results = await service.GetResourcesAsync(options.Subscription!, options.RetryPolicy); + var results = await service.GetResourcesAsync(options.Subscription!, null); context.Response.Results = ResponseResult.Create(new(results ?? []), ServiceJsonContext.Default.CommandResult); } catch (Exception ex) @@ -468,13 +466,13 @@ Choose the appropriate base class based on operations: public class StorageService(IAzureService azureService) : BaseAzureResourceService(azureService), IStorageService { - public async Task> ListAccountsAsync(string subscription, string? resourceGroup, RetryPolicyOptions? retryPolicy) + public async Task> ListAccountsAsync(string subscription, string? resourceGroup, CancellationToken cancellationToken) { return await ExecuteResourceQueryAsync( "Microsoft.Storage/storageAccounts", resourceGroup, subscription, - retryPolicy, + null, ConvertToStorageAccountModel, cancellationToken: cancellationToken); } @@ -495,9 +493,9 @@ public class StorageService(IAzureService azureService) string? accessTier = null, bool? enableHierarchicalNamespace = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null) + CancellationToken cancellationToken = default) { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); // Use subscriptionResource for write operations } } @@ -633,7 +631,7 @@ All new toolsets must be AOT-compatible or excluded from native builds: ### Caching and Performance - Use `ICacheService` for expensive Azure operations - Implement `BaseAzureResourceService` for efficient Resource Graph queries -- Follow retry policy patterns with `RetryPolicyOptions` +- Use Azure SDK retry defaults; do not expose retry policy through tool or service contracts ## Remote MCP Server Architecture diff --git a/core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupListCommand.cs b/core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupListCommand.cs index 286870d0fc..6606758ecd 100644 --- a/core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupListCommand.cs +++ b/core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupListCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, var groups = await _azureService.GetResourceGroups( options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(groups ?? []), GroupJsonContext.Default.Result); diff --git a/core/Azure.Mcp.Core/src/Areas/Group/Commands/ResourceListCommand.cs b/core/Azure.Mcp.Core/src/Areas/Group/Commands/ResourceListCommand.cs index 7ba07c911e..e57cf1bc59 100644 --- a/core/Azure.Mcp.Core/src/Areas/Group/Commands/ResourceListCommand.cs +++ b/core/Azure.Mcp.Core/src/Areas/Group/Commands/ResourceListCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken).ToListAsync(cancellationToken); context.Response.Results = ResponseResult.Create(new(resources), GroupJsonContext.Default.ResourceListCommandResult); diff --git a/core/Azure.Mcp.Core/src/Areas/Group/Options/BaseGroupOptions.cs b/core/Azure.Mcp.Core/src/Areas/Group/Options/BaseGroupOptions.cs index 3fdd1e30b0..5f7b9343f1 100644 --- a/core/Azure.Mcp.Core/src/Areas/Group/Options/BaseGroupOptions.cs +++ b/core/Azure.Mcp.Core/src/Areas/Group/Options/BaseGroupOptions.cs @@ -14,6 +14,4 @@ public sealed class BaseGroupOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/core/Azure.Mcp.Core/src/Areas/Group/Options/ResourceListOptions.cs b/core/Azure.Mcp.Core/src/Areas/Group/Options/ResourceListOptions.cs index 68ceabee27..ab999e11cf 100644 --- a/core/Azure.Mcp.Core/src/Areas/Group/Options/ResourceListOptions.cs +++ b/core/Azure.Mcp.Core/src/Areas/Group/Options/ResourceListOptions.cs @@ -17,6 +17,4 @@ public sealed class ResourceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/core/Azure.Mcp.Core/src/Areas/Subscription/Commands/SubscriptionListCommand.cs b/core/Azure.Mcp.Core/src/Areas/Subscription/Commands/SubscriptionListCommand.cs index 5b63ee64a1..b51fc16fcc 100644 --- a/core/Azure.Mcp.Core/src/Areas/Subscription/Commands/SubscriptionListCommand.cs +++ b/core/Azure.Mcp.Core/src/Areas/Subscription/Commands/SubscriptionListCommand.cs @@ -33,7 +33,7 @@ public override async Task ExecuteAsync(CommandContext context, { try { - var subscriptions = await _azureService.GetSubscriptions(options.Tenant, options.RetryPolicy, cancellationToken); + var subscriptions = await _azureService.GetSubscriptions(options.Tenant, cancellationToken); var defaultSubscriptionId = _azureService.GetDefaultSubscriptionId(); var subscriptionInfos = MapToSubscriptionInfos(subscriptions, defaultSubscriptionId); diff --git a/core/Azure.Mcp.Core/src/Areas/Subscription/Options/SubscriptionListOptions.cs b/core/Azure.Mcp.Core/src/Areas/Subscription/Options/SubscriptionListOptions.cs index 2622ef2428..2d3f154d9c 100644 --- a/core/Azure.Mcp.Core/src/Areas/Subscription/Options/SubscriptionListOptions.cs +++ b/core/Azure.Mcp.Core/src/Areas/Subscription/Options/SubscriptionListOptions.cs @@ -11,6 +11,4 @@ public sealed class SubscriptionListOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/core/Azure.Mcp.Core/src/Services/Azure/AzureService.cs b/core/Azure.Mcp.Core/src/Services/Azure/AzureService.cs index 1d5480f88c..ed239e5b4e 100644 --- a/core/Azure.Mcp.Core/src/Services/Azure/AzureService.cs +++ b/core/Azure.Mcp.Core/src/Services/Azure/AzureService.cs @@ -9,7 +9,6 @@ using Microsoft.Mcp.Core.Helpers; using Microsoft.Mcp.Core.Models.Resource; using Microsoft.Mcp.Core.Models.ResourceGroup; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; using Microsoft.Mcp.Core.Services.Caching; @@ -130,7 +129,6 @@ public async Task GetTenantIdByName(string tenantName, CancellationToken /// public async Task> GetSubscriptions( string? tenant, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { // Try to get from cache first @@ -142,7 +140,7 @@ public async Task> GetSubscriptions( } // If not in cache, fetch from Azure - var armClient = await AzureHelper.CreateArmClientAsync(this, tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await AzureHelper.CreateArmClientAsync(this, tenant, null, cancellationToken: cancellationToken); var subscriptions = armClient.GetSubscriptions(); var results = new List(); @@ -166,13 +164,12 @@ public async Task> GetSubscriptions( public async Task GetSubscription( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { AzureHelper.ValidateRequiredParameters((nameof(subscription), subscription)); // Get the subscription ID first, whether the input is a name or ID - var subscriptionId = await GetSubscriptionId(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionId = await GetSubscriptionId(subscription, tenant, cancellationToken); // Use subscription ID for cache key var cacheKey = string.IsNullOrEmpty(tenant) @@ -184,7 +181,7 @@ public async Task GetSubscription( return cachedSubscription; } - var armClient = await AzureHelper.CreateArmClientAsync(this, tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await AzureHelper.CreateArmClientAsync(this, tenant, null, cancellationToken: cancellationToken); var response = await armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscriptionId)).GetAsync(cancellationToken); if (response?.Value == null) { @@ -204,10 +201,9 @@ public async Task GetSubscription( public async Task GetSubscriptionIdByName( string subscriptionName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var subscriptions = await GetSubscriptions(tenant, retryPolicy, cancellationToken); + var subscriptions = await GetSubscriptions(tenant, cancellationToken); var matchingSubscriptions = subscriptions.Where(s => s.DisplayName.Equals(subscriptionName, StringComparisons.SubscriptionDisplayName)).ToList(); if (matchingSubscriptions.Count == 0) { @@ -227,7 +223,6 @@ public async Task GetSubscriptionIdByName( private async Task GetSubscriptionId( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { if (IsSubscriptionId(subscription)) @@ -235,18 +230,18 @@ private async Task GetSubscriptionId( return subscription; } - return await GetSubscriptionIdByName(subscription, tenant, retryPolicy, cancellationToken); + return await GetSubscriptionIdByName(subscription, tenant, cancellationToken); } #endregion Subscription #region Resource Group - public async Task> GetResourceGroups(string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> GetResourceGroups(string subscription, string? tenant = null, CancellationToken cancellationToken = default) { AzureHelper.ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await GetSubscription(subscription, tenant, cancellationToken); var subscriptionId = subscriptionResource.Data.SubscriptionId; // Try to get from cache first @@ -276,12 +271,11 @@ public async Task> GetResourceGroups(string subscription string subscription, string resourceGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { AzureHelper.ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroupName), resourceGroupName)); - var subscriptionResource = await GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await GetSubscription(subscription, tenant, cancellationToken); var subscriptionId = subscriptionResource.Data.SubscriptionId; // Try to get from cache first @@ -292,7 +286,7 @@ public async Task> GetResourceGroups(string subscription return cachedResults.FirstOrDefault(rg => rg.Name.Equals(resourceGroupName, StringComparisons.ResourceGroup)); } - var rg = await GetResourceGroupResource(subscription, resourceGroupName, tenant, retryPolicy, cancellationToken); + var rg = await GetResourceGroupResource(subscription, resourceGroupName, tenant, cancellationToken); if (rg == null) { return null; @@ -309,12 +303,11 @@ public async Task> GetResourceGroups(string subscription string subscription, string resourceGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { AzureHelper.ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroupName), resourceGroupName)); - var subscriptionResource = await GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await GetSubscription(subscription, tenant, cancellationToken); var resourceGroupResponse = await subscriptionResource.GetResourceGroups() .GetAsync(resourceGroupName, cancellationToken) .ConfigureAwait(false); @@ -326,12 +319,11 @@ public async IAsyncEnumerable GetGenericResources( string subscription, string resourceGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default) { AzureHelper.ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroupName), resourceGroupName)); - var resourceGroupResource = await GetResourceGroupResource(subscription, resourceGroupName, tenant, retryPolicy, cancellationToken) + var resourceGroupResource = await GetResourceGroupResource(subscription, resourceGroupName, tenant, cancellationToken) ?? throw new KeyNotFoundException($"Resource group '{resourceGroupName}' not found"); await foreach (var r in resourceGroupResource.GetGenericResourcesAsync(cancellationToken: cancellationToken)) diff --git a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs index c6e528868c..54e6f59792 100644 --- a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs +++ b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs @@ -101,7 +101,7 @@ protected async Task> ExecuteResourceQueryAsync( var results = new List(); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var tenantResource = await GetTenantResourceAsync(subscriptionResource!.Data.TenantId, cancellationToken); var queryFilter = $"{tableName} | where type =~ '{EscapeKqlString(resourceType)}'"; diff --git a/core/Azure.Mcp.Core/src/Services/Azure/IAzureService.cs b/core/Azure.Mcp.Core/src/Services/Azure/IAzureService.cs index 98969fd4f2..8ad09113a9 100644 --- a/core/Azure.Mcp.Core/src/Services/Azure/IAzureService.cs +++ b/core/Azure.Mcp.Core/src/Services/Azure/IAzureService.cs @@ -5,7 +5,6 @@ using Azure.ResourceManager.Resources; using Microsoft.Mcp.Core.Models.Resource; using Microsoft.Mcp.Core.Models.ResourceGroup; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Core.Services.Azure; @@ -136,12 +135,10 @@ Task GetTokenCredentialAsync( /// Gets the list of all available Azure subscriptions. /// /// An optional tenant to scope the search. - /// Retry options for the search. /// The token to monitor for cancellation requests. /// A list of subscription data representing the found subscriptions. Task> GetSubscriptions( string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -149,13 +146,11 @@ Task> GetSubscriptions( /// /// The subscription ID or name to get data for. /// An optional tenant to scope the search. - /// Retry options for the search. /// The token to monitor for cancellation requests. /// Subscription data representing the specific subscription. Task GetSubscription( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -173,7 +168,6 @@ Task GetSubscription( /// /// The subscription name to find the ID for. /// An optional tenant to scope the search. - /// Retry options for the search. /// The token to monitor for cancellation requests. /// The found subscription ID. /// Thrown when a subscription with the specified name is not found. @@ -181,7 +175,6 @@ Task GetSubscription( Task GetSubscriptionIdByName( string subscriptionName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -200,13 +193,11 @@ Task GetSubscriptionIdByName( /// /// The subscription ID to list resource groups. /// An optional tenant to scope the search. - /// Retry options for the search. /// The token to monitor for cancellation requests. /// A list of resource group information for the given subscription. Task> GetResourceGroups( string subscriptionId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -215,14 +206,12 @@ Task> GetResourceGroups( /// The subscription ID to get the resource group. /// The resource group name to get. /// An optional tenant to scope the search. - /// Retry options for the search. /// The token to monitor for cancellation requests. /// The resource group information for the specific resource group in the subscription. Task GetResourceGroup( string subscriptionId, string resourceGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #endregion Resource Group @@ -235,14 +224,12 @@ Task> GetResourceGroups( /// The subscription ID to get the resource. /// The resource group containing the resource. /// An optional tenant to scope the search. - /// Retry options for the search. /// The token to monitor for cancellation requests. /// The resource information. Task GetResourceGroupResource( string subscriptionId, string resourceGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -251,14 +238,12 @@ Task> GetResourceGroups( /// The subscription ID to get the resources. /// The resource group containing the resources. /// An optional tenant to scope the search. - /// Retry options for the search. /// The token to monitor for cancellation requests. /// IAsyncEnumerable GetGenericResources( string subscriptionId, string resourceGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #endregion Generic Resource diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceGroupListCommandTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceGroupListCommandTests.cs index 83f9a85be1..9c681aa54c 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceGroupListCommandTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceGroupListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tests.Helpers; using Microsoft.Mcp.Core.Models.ResourceGroup; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,7 +29,6 @@ public async Task ExecuteAsync_WithValidSubscription_ReturnsResourceGroups() Service.GetResourceGroups( Arg.Is(subscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedGroups); @@ -55,7 +53,6 @@ public async Task ExecuteAsync_WithValidSubscription_ReturnsResourceGroups() await Service.Received(1).GetResourceGroups( Arg.Is(subscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -73,7 +70,6 @@ public async Task ExecuteAsync_WithTenant_PassesTenantToService() Service.GetResourceGroups( Arg.Is(subscriptionId), Arg.Is(tenantId), - Arg.Any(), Arg.Any()) .Returns(expectedGroups); @@ -86,7 +82,6 @@ public async Task ExecuteAsync_WithTenant_PassesTenantToService() await Service.Received(1).GetResourceGroups( Arg.Is(subscriptionId), Arg.Is(tenantId), - Arg.Any(), Arg.Any()); } @@ -98,7 +93,6 @@ public async Task ExecuteAsync_EmptyResourceGroupList_ReturnsEmptyResults() Service.GetResourceGroups( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -119,7 +113,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorInResponse() Service.GetResourceGroups( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceListCommandTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceListCommandTests.cs index f2718b7e49..6259ec3d12 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceListCommandTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Group/ResourceListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tests.Commands; using Microsoft.Mcp.Core.Models.Resource; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,6 @@ public async Task ExecuteAsync_WithValidParameters_ReturnsResources() Arg.Is(subscriptionId), Arg.Is(resourceGroup), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResources.ToAsyncEnumerable()); @@ -54,7 +52,6 @@ public async Task ExecuteAsync_WithValidParameters_ReturnsResources() Arg.Is(subscriptionId), Arg.Is(resourceGroup), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -74,7 +71,6 @@ public async Task ExecuteAsync_WithTenant_PassesTenantToService() Arg.Is(subscriptionId), Arg.Is(resourceGroup), Arg.Is(tenantId), - Arg.Any(), Arg.Any()) .Returns(expectedResources.ToAsyncEnumerable()); @@ -91,7 +87,6 @@ public async Task ExecuteAsync_WithTenant_PassesTenantToService() Arg.Is(subscriptionId), Arg.Is(resourceGroup), Arg.Is(tenantId), - Arg.Any(), Arg.Any()); } @@ -105,7 +100,6 @@ public async Task ExecuteAsync_EmptyResourceList_ReturnsEmptyResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(AsyncEnumerable.Empty()); @@ -128,7 +122,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorInResponse() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Throws(new Exception(expectedError)); diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionCommandTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionCommandTests.cs index 4377065caf..859a56681d 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionCommandTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Storage.Commands.Account; using Azure.Mcp.Tools.Storage.Models; using Azure.Mcp.Tools.Storage.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_WithEnvironmentVariableOnly_CallsServiceWithCorre Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccounts); @@ -62,7 +60,6 @@ await Service.Received(1).GetAccountDetails( subscription, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -85,7 +82,6 @@ public async Task ExecuteAsync_WithBothOptionAndEnvironmentVariable_PrefersOptio Arg.Is(expectedSubscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccounts); @@ -101,14 +97,12 @@ await Service.Received(1).GetAccountDetails( expectedSubscription, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); await Service.DidNotReceive().GetAccountDetails( Arg.Is(s => string.IsNullOrEmpty(s)), ignoredSubscription, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionListCommandTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionListCommandTests.cs index d4d779dca4..2240f75e96 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionListCommandTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Subscription/SubscriptionListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tests.Commands; using Azure.ResourceManager.Resources; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -26,7 +25,7 @@ public async Task ExecuteAsync_NoParameters_ReturnsSubscriptions() SubscriptionTestHelpers.CreateSubscriptionData("sub2", "Subscription 2") }; - Service.GetSubscriptions(Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptions(Arg.Any(), Arg.Any()) .Returns(expectedSubscriptions); Service.GetDefaultSubscriptionId().Returns((string?)null); @@ -47,7 +46,7 @@ public async Task ExecuteAsync_NoParameters_ReturnsSubscriptions() Assert.Equal("Subscription 2", second.DisplayName); Assert.False(second.IsDefault); - await Service.Received(1).GetSubscriptions(Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).GetSubscriptions(Arg.Any(), Arg.Any()); } [Fact] @@ -56,7 +55,7 @@ public async Task ExecuteAsync_WithTenantId_PassesTenantToService() // Arrange var tenantId = "test-tenant-id"; - Service.GetSubscriptions(Arg.Is(tenantId), Arg.Any(), Arg.Any()) + Service.GetSubscriptions(Arg.Is(tenantId), Arg.Any()) .Returns([SubscriptionTestHelpers.CreateSubscriptionData("sub1", "Sub1")]); Service.GetDefaultSubscriptionId().Returns((string?)null); @@ -68,7 +67,6 @@ public async Task ExecuteAsync_WithTenantId_PassesTenantToService() Assert.Equal(HttpStatusCode.OK, result.Status); await Service.Received(1).GetSubscriptions( Arg.Is(tenantId), - Arg.Any(), Arg.Any()); } @@ -76,7 +74,7 @@ await Service.Received(1).GetSubscriptions( public async Task ExecuteAsync_EmptySubscriptionList_ReturnsNotNullResults() { // Arrange - Service.GetSubscriptions(Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptions(Arg.Any(), Arg.Any()) .Returns([]); Service.GetDefaultSubscriptionId().Returns((string?)null); @@ -94,7 +92,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorInResponse() { // Arrange var expectedError = "Test error message"; - Service.GetSubscriptions(Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptions(Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); // Act @@ -117,7 +115,7 @@ public async Task ExecuteAsync_WithDefaultSubscription_MarksDefaultSubscription( }; Service - .GetSubscriptions(Arg.Any(), Arg.Any(), Arg.Any()) + .GetSubscriptions(Arg.Any(), Arg.Any()) .Returns(expectedSubscriptions); Service.GetDefaultSubscriptionId().Returns("sub2"); @@ -154,7 +152,7 @@ public async Task ExecuteAsync_WithNoDefaultSubscription_AllSubscriptionsNotDefa SubscriptionTestHelpers.CreateSubscriptionData("sub2", "Subscription 2") }; - Service.GetSubscriptions(Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptions(Arg.Any(), Arg.Any()) .Returns(expectedSubscriptions); Service.GetDefaultSubscriptionId().Returns((string?)null); diff --git a/docs/option-conversion.md b/docs/option-conversion.md index cdd6bb3423..42ae5f9758 100644 --- a/docs/option-conversion.md +++ b/docs/option-conversion.md @@ -50,8 +50,6 @@ public class BlobUploadOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -112,7 +110,7 @@ Replace the options class hierarchy with a single flat POCO that implements `ISu - **Required**: Driven by the `required` keyword (`RequiredMemberAttribute`). Use `required` on required options; use nullable types (`?`) for optional options. - **Description**: Always required, passed using attribute properties: `[Option(Description = "description")]`. - **Shared descriptions**: Use constants from `OptionDescriptions` (e.g., `OptionDescriptions.Subscription`, `OptionDescriptions.Tenant`). -- **Nested objects**: Use `[OptionContainer(Prefix = "prefix")]` on a property of a complex type. Its child properties become `--prefix-child-name`. Example: `RetryPolicyOptions` with `[OptionContainer(Prefix = "retry")]` produces `--retry-delay`, `--retry-max-retries`, etc. +- **Nested objects**: Use `[OptionContainer(Prefix = "prefix")]` only when a command intentionally exposes a grouped complex input. Do not expose retry policy options; tools use Azure SDK retry defaults. - **Property ordering**: List command-specific options first, then sink common/infrastructure options to the bottom in this order: `ResourceGroup`, `Subscription`, `Tenant`, `AuthMethod`, `RetryPolicy`. This keeps the most relevant options visible at a glance. **Before (hierarchy of 6 classes):** @@ -147,8 +145,6 @@ public class BlobUploadOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -297,8 +293,6 @@ public class BlobUploadOptions : ISubscriptionOption, IBlobOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -354,17 +348,6 @@ dotnet run --project servers/Azure.Mcp.Server/src -- storage blob upload --help **Option names and required status must not change** — this is a public API. -#### Known pre-existing inconsistencies - -Some commands on `main` already have minor description differences due to older one-generic commands using locally instantiated `RetryPolicyOptions` with slightly different description text. These show up in before/after diffs but are **not** caused by conversion: - -| Option | Command | Description on `main` | -|---|---|---| -| `--retry-max-retries` | `appconfig kv lock set` | "Maximum number of retry attempts before giving up." | -| `--retry-max-retries` | All other commands (240+) | "Maximum number of retry attempts for failed operations before giving up." | - -If your diff flags only these known discrepancies, it's safe to proceed. The inconsistency lives in the unconverted command's own `RetryPolicyOptions` instance (not in shared infrastructure) and will be resolved when that command is converted to the two-generic pattern. - #### Distinguishing unused options from removable inherited properties During comparison you may find two categories of discrepancies: diff --git a/servers/Azure.Mcp.Server/changelog-entries/copilot-remove-retry-policy-options.yml b/servers/Azure.Mcp.Server/changelog-entries/copilot-remove-retry-policy-options.yml new file mode 100644 index 0000000000..30fb3f56ff --- /dev/null +++ b/servers/Azure.Mcp.Server/changelog-entries/copilot-remove-retry-policy-options.yml @@ -0,0 +1,3 @@ +changes: + - section: "Breaking Changes" + description: "Removed user-configurable retry policy options from Azure MCP tools and service contracts; Azure SDK retry defaults now apply." diff --git a/servers/Azure.Mcp.Server/docs/azmcp-commands.md b/servers/Azure.Mcp.Server/docs/azmcp-commands.md index 5b16a16e24..bd12530488 100644 --- a/servers/Azure.Mcp.Server/docs/azmcp-commands.md +++ b/servers/Azure.Mcp.Server/docs/azmcp-commands.md @@ -12,11 +12,6 @@ The following options are available for most commands: | `--subscription` | No | Environment variable `AZURE_SUBSCRIPTION_ID` | Azure subscription ID for target resources | | `--tenant-id` | No | - | Azure tenant ID for authentication | | `--auth-method` | No | 'credential' | Authentication method ('credential', 'key', 'connectionString') | -| `--retry-max-retries` | No | 3 | Maximum retry attempts for failed operations | -| `--retry-delay` | No | 2 | Delay between retry attempts (seconds) | -| `--retry-max-delay` | No | 10 | Maximum delay between retries (seconds) | -| `--retry-mode` | No | 'exponential' | Retry strategy ('fixed' or 'exponential') | -| `--retry-network-timeout` | No | 100 | Network operation timeout (seconds) | | `--learn` | No | false | Discover available sub-commands and their parameters without executing any Azure operation. Use on a command group to list commands in that group, or on a specific command to see its options. | ### Discovery with `--learn` diff --git a/servers/Azure.Mcp.Server/docs/new-command.md b/servers/Azure.Mcp.Server/docs/new-command.md index f76013d6f1..ff7500cb41 100644 --- a/servers/Azure.Mcp.Server/docs/new-command.md +++ b/servers/Azure.Mcp.Server/docs/new-command.md @@ -206,14 +206,13 @@ Choose the appropriate base class for your service based on the operations neede string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { return await ExecuteResourceQueryAsync( "Microsoft.MyService/resources", resourceGroup, subscription, - retryPolicy, + null, ConvertToMyResourceModel, tenant: tenant, cancellationToken: cancellationToken); @@ -224,14 +223,13 @@ Choose the appropriate base class for your service based on the operations neede string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { return await ExecuteSingleResourceQueryAsync( "Microsoft.MyService/resources", resourceGroup, subscription, - retryPolicy, + null, ConvertToMyResourceModel, additionalFilter: $"name =~ '{EscapeKqlString(resourceName)}'", tenant: tenant, @@ -261,10 +259,9 @@ Choose the appropriate base class for your service based on the operations neede public async Task CreateResourceAsync( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); // Use subscriptionResource for Azure Resource write operations } } @@ -315,7 +312,7 @@ var resources = await ExecuteResourceQueryAsync( "Microsoft.Sql/servers/databases", resourceGroup, subscription, - retryPolicy, + null, ConvertToSqlDatabaseModel, additionalFilter: $"name =~ '{EscapeKqlString(databaseName)}'", tenant: tenant, @@ -391,14 +388,13 @@ public class MyService(IAzureService azureService) string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { return await ExecuteResourceQueryAsync( "Microsoft.MyService/resources", resourceGroup, subscription, - retryPolicy, + null, ConvertToModel, tenant: tenant, cancellationToken: cancellationToken); @@ -420,11 +416,10 @@ public class MyService(IAzureService azureService) private async Task CreateDataPlaneClientAsync( string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var endpoint = GetResourceEndpoint(resourceName); - var options = ConfigureRetryPolicy(AddDefaultPolicies(new MyClientOptions()), retryPolicy); + var options = AddDefaultPolicies(new MyClientOptions()); options.Transport = new HttpClientTransport(AzureService.GetClient()); return new MyDataPlaneClient( new Uri(endpoint), @@ -493,8 +488,6 @@ public class {Resource}{Operation}Options : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -519,7 +512,7 @@ The `[Option]` attribute drives automatic option registration and binding via `O **Key Principles:** - Options classes are **flat POCOs** — no class inheritance. Each command has its own options class. -- `OptionBinder` discovers **all public writable properties** on the concrete class and handles both registration (adding to the CLI parser) and binding (populating from parse results) automatically. The `[Option]` attribute is only needed to override name, description, or hidden status — un-attributed properties are still discovered and bound. +- `OptionBinder` discovers public writable properties marked with `[Option]` or `[OptionContainer]` and handles both registration and binding automatically. Unattributed properties are ignored. - **Required vs optional** is determined entirely by nullability: non-nullable types = required; `?` = optional. The `required` keyword suppresses C# compiler warnings about uninitialized non-nullable reference properties but does **not** drive CLI validation — only nullability matters to `OptionBinder`. - **No shared state**: Each command gets its own options instance per request — thread-safe by design. - **Implement `ISubscriptionOption`** if the command needs optional `string? Subscription`. This enables post-processing by `SubscriptionCommand` and `ISubscriptionResolver`. Note: `ISubscriptionOption` only provides `Subscription` — add a separate `Tenant` property if the command accepts `--tenant`. @@ -528,12 +521,12 @@ The `[Option]` attribute drives automatic option registration and binding via `O - **No manual registration or binding**: Remove all `RegisterOptions`/`BindOptions` overrides. If you find yourself writing these, you're using the old pattern. **Conventions:** -- **Name**: Derived automatically from the property name in kebab-case (e.g., `LocalFilePath` → `--local-file-path`). Only use `[Option(Name = "...")]` when the convention doesn't produce the desired name (e.g., `RetryPolicy` → `--retry` instead of `--retry-policy`). **Do not** specify `Name =` when it matches the default. +- **Name**: Derived automatically from the property name in kebab-case (e.g., `LocalFilePath` → `--local-file-path`). Only use `[Option(Name = "...")]` when the convention doesn't produce the desired name. **Do not** specify `Name =` when it matches the default. - **Required**: Driven by the `required` keyword (`RequiredMemberAttribute`). Use `required` on required options; use nullable types (`?`) for optional options. - **Description**: Always required, passed using attribute properties: `[Option(Description = "description")]`. - **Shared descriptions**: Use constants from `OptionDescriptions` (e.g., `OptionDescriptions.Subscription`, `OptionDescriptions.Tenant`). -- **Nested objects**: Use `[OptionContainer(Prefix = "prefix")]` on a property of a complex type. Its child properties become `--prefix-child-name`. Example: `RetryPolicyOptions` with `[OptionContainer(Prefix = "retry")]` produces `--retry-delay`, `--retry-max-retries`, etc. -- **Property ordering**: List command-specific options first, then sink common/infrastructure options to the bottom in this order: `ResourceGroup`, `Subscription`, `Tenant`, `AuthMethod`, `RetryPolicy`. This keeps the most relevant options visible at a glance. +- **Nested objects**: Use `[OptionContainer(Prefix = "prefix")]` only when a command intentionally exposes a grouped complex input. Do not expose retry policy options; tools use Azure SDK retry defaults. +- **Property ordering**: List command-specific options first, then sink common/infrastructure options to the bottom in this order: `ResourceGroup`, `Subscription`, `Tenant`, `AuthMethod`. This keeps the most relevant options visible at a glance. ### Usage Patterns @@ -562,8 +555,6 @@ public class {Resource}{Operation}Options : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -586,8 +577,6 @@ public class MyCommandOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } // In the command class: @@ -626,8 +615,6 @@ public class MyCommandOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } // In the command class: @@ -681,8 +668,6 @@ public class BlobUploadOptions : ISubscriptionOption, IContainerOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -702,8 +687,6 @@ public class StorageAccountListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } ``` @@ -778,7 +761,7 @@ public sealed class {Resource}{Operation}Command( options.RequiredOption, // Required options are non-nullable (no ! needed) options.OptionalOption, // Optional options are nullable options.Subscription!, // From ISubscriptionOption (resolved by ISubscriptionResolver) - options.RetryPolicy, // From options POCO + null, // From options POCO cancellationToken); // Passed in ExecuteAsync // Set results if any were returned @@ -964,17 +947,15 @@ All interface methods should follow consistent formatting with proper line break Task> GetStorageAccounts( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // Incorrect formatting - all parameters on single line -Task> GetStorageAccounts(string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null); +Task> GetStorageAccounts(string subscription, string? tenant = null, CancellationToken cancellationToken = default); // Incorrect - missing CancellationToken parameter Task> GetStorageAccounts( string subscription, - string? tenant = null, - RetryPolicyOptions? retryPolicy = null); + string? tenant = null); ``` **Formatting Rules:** @@ -999,7 +980,6 @@ public interface IMyService string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } ``` @@ -1123,11 +1103,10 @@ public class {Toolset}Service(IAzureService azureService) string resourceGroup, string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { // Always use Azure service for resolution - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource .GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -1973,7 +1952,6 @@ Task> GetResources( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); ``` @@ -1982,7 +1960,7 @@ Task> GetResources( - **Pattern**: ```csharp // Correct pattern -var subscriptionResource = await _azureService.GetSubscription(subscription, tenant, retryPolicy); +var subscriptionResource = await _azureService.GetSubscription(subscription, tenant, cancellationToken); ``` ### Command Option Patterns @@ -2007,8 +1985,6 @@ public class MyOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } // Command uses two-generic base class — no RegisterOptions/BindOptions needed @@ -2249,10 +2225,10 @@ catch (Exception ex) - **Pattern**: ```csharp // Correct - use service -var subscriptionResource = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); +var subscriptionResource = await _azureService.GetSubscription(subscription, tenant, cancellationToken); // Wrong - manual creation -var armClient = await CreateArmClientAsync(tenant, retryPolicy); +var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{subscription}")); ``` @@ -2489,7 +2465,7 @@ public sealed class StorageAccountGetCommand( var accounts = await _storageService.GetStorageAccountsAsync( options.Subscription!, options.ResourceGroup, - options.RetryPolicy, + null, cancellationToken); // Standard response format works for all transports @@ -2540,11 +2516,10 @@ public class StorageService( string subscription, string? resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { // ✅ Use base class methods that handle authentication and ARM client creation - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); // ✅ CreateArmClientAsync automatically uses appropriate auth strategy: // - OBO flow in remote HTTP mode with --outgoing-auth-strategy UseOnBehalfOf @@ -2632,7 +2607,6 @@ Some commands need tenant ID for Azure calls. Handle this correctly for both mod public async Task> GetResourcesAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { // ✅ IAzureService handles tenant resolution for all modes diff --git a/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs b/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs index 4b242d9ab8..582e277f9c 100644 --- a/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs +++ b/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs @@ -88,6 +88,35 @@ public async Task GenerateToolConversionChecklist() Assert.True(commands.Count > 100, $"Expected 100+ commands, found {commands.Count}"); } + [Fact] + public async Task RegisteredCommands_DoNotExposeRetryPolicyOptions() + { + var serviceCollection = new ServiceCollection(); + Program.ConfigureServices(serviceCollection); + await using var services = serviceCollection.BuildServiceProvider(); + + var commands = serviceCollection + .Where(static descriptor => typeof(IBaseCommand).IsAssignableFrom(descriptor.ServiceType)) + .Select(descriptor => (IBaseCommand)services.GetRequiredService(descriptor.ServiceType)) + .Distinct() + .ToList(); + + var retryOptions = commands + .SelectMany(command => command.GetCommand().Options + .Where(static option => option.Name.TrimStart('-') is + "retry-delay" or + "retry-max-delay" or + "retry-max-retries" or + "retry-mode" or + "retry-network-timeout") + .Select(option => $"{command.Name}: {option.Name}")) + .Order() + .ToList(); + + Assert.True(retryOptions.Count == 0, + $"Registered commands expose retry options:{Environment.NewLine}{string.Join(Environment.NewLine, retryOptions)}"); + } + private static List GetTypeHierarchy(Type type) { var hierarchy = new List(); diff --git a/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryListCommand.cs b/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryListCommand.cs index 8d901b58f0..4542085642 100644 --- a/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryListCommand.cs +++ b/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryListCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(registries?.Results ?? [], registries?.AreResultsTruncated ?? false), AcrJsonContext.Default.RegistryListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryRepositoryListCommand.cs b/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryRepositoryListCommand.cs index f53ee3050d..22314eda75 100644 --- a/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryRepositoryListCommand.cs +++ b/tools/Azure.Mcp.Tools.Acr/src/Commands/Registry/RegistryRepositoryListCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Registry, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(map ?? []), AcrJsonContext.Default.RegistryRepositoryListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryListOptions.cs b/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryListOptions.cs index 1a1214777f..438ddb0a80 100644 --- a/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryListOptions.cs +++ b/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryListOptions.cs @@ -17,6 +17,4 @@ public class RegistryListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryRepositoryListOptions.cs b/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryRepositoryListOptions.cs index 134f113b30..7ab9e70664 100644 --- a/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryRepositoryListOptions.cs +++ b/tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryRepositoryListOptions.cs @@ -17,8 +17,6 @@ public class RegistryRepositoryListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = "The name of the Azure Container Registry.")] public string? Registry { get; set; } diff --git a/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs b/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs index 6d5867b078..6a787cfce6 100644 --- a/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs +++ b/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Acr.Models; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.Acr.Services; @@ -19,7 +18,6 @@ public async Task> ListRegistries( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -28,7 +26,7 @@ public async Task> ListRegistries( "Microsoft.ContainerRegistry/registries", resourceGroup, subscription, - retryPolicy, + retryPolicy: null, ConvertToAcrRegistryInfoModel, tenant: tenant, cancellationToken: cancellationToken); @@ -41,7 +39,6 @@ private async Task GetRegistry( string registry, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(registry), registry)); @@ -50,7 +47,7 @@ private async Task GetRegistry( "Microsoft.ContainerRegistry/registries", resourceGroup: resourceGroup, subscription: subscription, - retryPolicy: retryPolicy, + retryPolicy: null, converter: ConvertToAcrRegistryInfoModel, additionalFilter: $"name =~ '{EscapeKqlString(registry)}'", tenant: tenant, @@ -63,7 +60,7 @@ private async Task GetRegistry( return registries; } - private async Task> AddRepositoriesForRegistryAsync(AcrRegistryInfo reg, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + private async Task> AddRepositoriesForRegistryAsync(AcrRegistryInfo reg, string? tenant, CancellationToken cancellationToken) { if (!string.IsNullOrEmpty(reg.LoginServer)) { @@ -73,7 +70,7 @@ private async Task> AddRepositoriesForRegistryAsync(AcrRegistryInfo // Build data-plane client for this login server var credential = await GetCredential(tenant, cancellationToken); - var options = ConfigureRetryPolicy(AddDefaultPolicies(new ContainerRegistryClientOptions()), retryPolicy); + var options = AddDefaultPolicies(new ContainerRegistryClientOptions()); options.Transport = new HttpClientTransport(AzureService.GetClient()); options.Audience = GetAcrAudience(); var acrEndpoint = new Uri($"https://{reg.LoginServer}"); @@ -96,7 +93,6 @@ public async Task>> ListRegistryRepositories( string? resourceGroup = null, string? registry = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -105,21 +101,21 @@ public async Task>> ListRegistryRepositories( if (string.IsNullOrWhiteSpace(registry)) { - var registries = await ListRegistries(subscription, resourceGroup, tenant, retryPolicy, cancellationToken); + var registries = await ListRegistries(subscription, resourceGroup, tenant, cancellationToken); foreach (var reg in registries.Results) { if (!string.IsNullOrWhiteSpace(reg.Name) && !string.IsNullOrWhiteSpace(reg.LoginServer)) { - result[reg.Name] = await AddRepositoriesForRegistryAsync(reg, tenant, retryPolicy, cancellationToken); + result[reg.Name] = await AddRepositoriesForRegistryAsync(reg, tenant, cancellationToken); } } } else { - var reg = await GetRegistry(subscription, registry, resourceGroup, tenant, retryPolicy, cancellationToken); + var reg = await GetRegistry(subscription, registry, resourceGroup, tenant, cancellationToken); if (!string.IsNullOrWhiteSpace(reg.Name) && !string.IsNullOrWhiteSpace(reg.LoginServer)) { - result[reg.Name] = await AddRepositoriesForRegistryAsync(reg, tenant, retryPolicy, cancellationToken); + result[reg.Name] = await AddRepositoriesForRegistryAsync(reg, tenant, cancellationToken); } } diff --git a/tools/Azure.Mcp.Tools.Acr/src/Services/IAcrService.cs b/tools/Azure.Mcp.Tools.Acr/src/Services/IAcrService.cs index 5304df698b..bce1eeb5cf 100644 --- a/tools/Azure.Mcp.Tools.Acr/src/Services/IAcrService.cs +++ b/tools/Azure.Mcp.Tools.Acr/src/Services/IAcrService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Acr.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Acr.Services; public interface IAcrService @@ -12,7 +11,6 @@ Task> ListRegistries( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task>> ListRegistryRepositories( @@ -20,6 +18,5 @@ Task>> ListRegistryRepositories( string? resourceGroup = null, string? registry = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryListCommandTests.cs b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryListCommandTests.cs index eaf6a32870..6feeb9e6a6 100644 --- a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryListCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Acr.Commands.Registry; using Azure.Mcp.Tools.Acr.Models; using Azure.Mcp.Tools.Acr.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,7 +38,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults( [ @@ -71,7 +69,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -89,7 +86,7 @@ public async Task ExecuteAsync_FiltersById_ReturnsFilteredRegistries() { // Arrange var expectedRegistries = new ResourceQueryResults([new("registry1", null, null, null, null)], false); - Service.ListRegistries("sub", "rg", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRegistries("sub", "rg", Arg.Any(), Arg.Any()) .Returns(expectedRegistries); // Act @@ -98,14 +95,14 @@ public async Task ExecuteAsync_FiltersById_ReturnsFilteredRegistries() // Assert Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); - await Service.Received(1).ListRegistries("sub", "rg", Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListRegistries("sub", "rg", Arg.Any(), Arg.Any()); } [Fact] public async Task ExecuteAsync_EmptyList_ReturnsEmptyResults() { // Arrange - Service.ListRegistries("sub", null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRegistries("sub", null, Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -122,7 +119,7 @@ public async Task ExecuteAsync_ReturnsExpectedRegistryProperties() { // Arrange var registry = new AcrRegistryInfo("myregistry", "eastus", "myregistry.azurecr.io", "Basic", "Basic"); - Service.ListRegistries("sub", null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRegistries("sub", null, Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([registry], false)); // Act diff --git a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryRepositoryListCommandTests.cs b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryRepositoryListCommandTests.cs index 76764997fe..b2443939ff 100644 --- a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryRepositoryListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/Registry/RegistryRepositoryListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Acr.Commands; using Azure.Mcp.Tools.Acr.Commands.Registry; using Azure.Mcp.Tools.Acr.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,7 +29,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new Dictionary> { @@ -62,7 +60,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -84,7 +81,6 @@ public async Task ExecuteAsync_Empty_ReturnsEmptyResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs b/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs index 0883bf50b4..2ff47f724c 100644 --- a/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs +++ b/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs @@ -56,7 +56,6 @@ public override async Task ExecuteAsync(CommandContext context, var recommendations = await _advisorService.ListRecommendationsAsync( options.Subscription!, options.ResourceGroup, - options.RetryPolicy, filters, top, options.Tenant, diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationSummaryCommand.cs b/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationSummaryCommand.cs index 28d4d21d3b..bbc7c33a0f 100644 --- a/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationSummaryCommand.cs +++ b/tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationSummaryCommand.cs @@ -77,7 +77,6 @@ public override async Task ExecuteAsync(CommandContext context, var summary = await _advisorService.SummarizeRecommendationsAsync( options.Subscription!, options.ResourceGroup, - options.RetryPolicy, groupBy, filters, options.Tenant, diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationListOptions.cs b/tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationListOptions.cs index 74a55e75ae..fb5c05010b 100644 --- a/tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationListOptions.cs +++ b/tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationListOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Azure.Mcp.Core.Options; @@ -41,6 +41,4 @@ public class RecommendationListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs b/tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs index aacf604ea6..132e3aa25b 100644 --- a/tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs +++ b/tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs @@ -7,7 +7,6 @@ using Azure.ResourceManager.ResourceGraph; using Azure.ResourceManager.ResourceGraph.Models; using Azure.ResourceManager.Resources; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Advisor.Services; @@ -42,7 +41,6 @@ public class AdvisorService(IAzureService azureService) public async Task> ListRecommendationsAsync( string subscription, string? resourceGroup, - RetryPolicyOptions? retryPolicy, RecommendationFilters? filters = null, int top = 50, string? tenant = null, @@ -54,7 +52,7 @@ public async Task> ListRecommendationsAsync "Microsoft.Advisor/recommendations", resourceGroup, subscription, - retryPolicy, + null, ConvertToAdvisorRecommendationModel, tableName: "advisorresources", additionalFilter: additionalFilter, @@ -321,7 +319,6 @@ private async Task GetTenantResourceAsync(CancellationToken canc public async Task SummarizeRecommendationsAsync( string subscription, string? resourceGroup, - RetryPolicyOptions? retryPolicy, string groupBy, RecommendationFilters? filters = null, string? tenant = null, @@ -330,7 +327,7 @@ public async Task SummarizeRecommendationsAsync( ArgumentException.ThrowIfNullOrWhiteSpace(subscription); ArgumentException.ThrowIfNullOrWhiteSpace(groupBy); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var allTenants = await AzureService.GetTenants(cancellationToken); var tenantResource = allTenants.FirstOrDefault(t => t.Data.TenantId == subscriptionResource.Data.TenantId) ?? throw new InvalidOperationException($"No accessible tenant found for subscription '{subscription}'"); diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs b/tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs index c41ced6116..7b234891cf 100644 --- a/tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs +++ b/tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Advisor.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Advisor.Services; @@ -12,7 +11,6 @@ public interface IAdvisorService Task> ListRecommendationsAsync( string subscription, string? resourceGroup, - RetryPolicyOptions? retryPolicy, RecommendationFilters? filters = null, int top = 50, string? tenant = null, @@ -21,7 +19,6 @@ Task> ListRecommendationsAsync( Task SummarizeRecommendationsAsync( string subscription, string? resourceGroup, - RetryPolicyOptions? retryPolicy, string groupBy, RecommendationFilters? filters = null, string? tenant = null, diff --git a/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationListCommandTests.cs b/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationListCommandTests.cs index 67d715d99e..e02cda78e4 100644 --- a/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationListCommandTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Net; @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Advisor.Commands; using Azure.Mcp.Tools.Advisor.Commands.Recommendation; using Azure.Mcp.Tools.Advisor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -37,7 +36,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -74,7 +72,6 @@ public async Task ExecuteAsync_ReturnsRecommendationsList() Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -96,7 +93,6 @@ public async Task ExecuteAsync_ReturnsRecommendationsList() await Service.Received(1).ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -110,7 +106,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoRecommendations() Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -133,7 +128,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -157,7 +151,6 @@ public async Task ExecuteAsync_Handles403Forbidden() Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -180,7 +173,6 @@ public async Task ExecuteAsync_ForwardsFiltersToService() Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Do(f => captured = f), Arg.Any(), Arg.Any(), @@ -214,7 +206,6 @@ public async Task ExecuteAsync_OmittedFiltersAreNull() Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Do(f => captured = f), Arg.Any(), Arg.Any(), @@ -246,7 +237,6 @@ public async Task ExecuteAsync_ForwardsTopWithClamping(int? top, int expectedTop Service.ListRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Do(t => capturedTop = t), Arg.Any(), diff --git a/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationSummaryCommandTests.cs b/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationSummaryCommandTests.cs index 023adff64c..3c94614d50 100644 --- a/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationSummaryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.Tests/Recommendation/RecommendationSummaryCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Advisor.Commands.Recommendation; using Azure.Mcp.Tools.Advisor.Models; using Azure.Mcp.Tools.Advisor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -40,7 +39,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -64,7 +62,6 @@ public async Task ExecuteAsync_InvalidGroupBy_ReturnsBadRequest() await Service.DidNotReceive().SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -78,7 +75,6 @@ public async Task ExecuteAsync_GroupByOmitted_DefaultsToCategory() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Do(g => captured = g), Arg.Any(), Arg.Any(), @@ -101,7 +97,6 @@ public async Task ExecuteAsync_GroupBy_NormalizedToLowercaseTrimmed(string raw) Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Do(g => captured = g), Arg.Any(), Arg.Any(), @@ -121,7 +116,6 @@ public async Task ExecuteAsync_ForwardsFiltersToService() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Do(f => captured = f), Arg.Any(), @@ -152,7 +146,6 @@ public async Task ExecuteAsync_OmittedFilters_AreNull() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Do(f => captured = f), Arg.Any(), @@ -184,7 +177,6 @@ public async Task ExecuteAsync_ReturnsSummaryPayload() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -208,7 +200,6 @@ public async Task ExecuteAsync_ServiceThrows_ReturnsErrorResponse() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -238,7 +229,6 @@ public async Task ExecuteAsync_Top_SlicesGroupsButPreservesTotal() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -278,7 +268,6 @@ public async Task ExecuteAsync_Top_AlwaysIncludesUnknownAtTail() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), @@ -312,7 +301,6 @@ public async Task ExecuteAsync_Top_LargerThanGroups_ReturnsAll() Service.SummarizeRecommendationsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), diff --git a/tools/Azure.Mcp.Tools.Aks/src/Commands/Cluster/ClusterGetCommand.cs b/tools/Azure.Mcp.Tools.Aks/src/Commands/Cluster/ClusterGetCommand.cs index f160a117c7..9ed9375ca3 100644 --- a/tools/Azure.Mcp.Tools.Aks/src/Commands/Cluster/ClusterGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Aks/src/Commands/Cluster/ClusterGetCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Cluster, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(clusters ?? []), AksJsonContext.Default.ClusterGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.Aks/src/Commands/Nodepool/NodepoolGetCommand.cs b/tools/Azure.Mcp.Tools.Aks/src/Commands/Nodepool/NodepoolGetCommand.cs index 88b740646c..d43c9ee032 100644 --- a/tools/Azure.Mcp.Tools.Aks/src/Commands/Nodepool/NodepoolGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Aks/src/Commands/Nodepool/NodepoolGetCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Cluster!, options.Nodepool, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(nodePools ?? []), AksJsonContext.Default.NodepoolGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.Aks/src/Options/Cluster/ClusterGetOptions.cs b/tools/Azure.Mcp.Tools.Aks/src/Options/Cluster/ClusterGetOptions.cs index 052a360c66..eeedd7fd45 100644 --- a/tools/Azure.Mcp.Tools.Aks/src/Options/Cluster/ClusterGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Aks/src/Options/Cluster/ClusterGetOptions.cs @@ -17,8 +17,6 @@ public class ClusterGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = "AKS Cluster name.")] public string? Cluster { get; set; } diff --git a/tools/Azure.Mcp.Tools.Aks/src/Options/Nodepool/NodepoolGetOptions.cs b/tools/Azure.Mcp.Tools.Aks/src/Options/Nodepool/NodepoolGetOptions.cs index b6c3a3bb22..bc92969abc 100644 --- a/tools/Azure.Mcp.Tools.Aks/src/Options/Nodepool/NodepoolGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Aks/src/Options/Nodepool/NodepoolGetOptions.cs @@ -17,8 +17,6 @@ public class NodepoolGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = "AKS Cluster name.")] public required string Cluster { get; set; } diff --git a/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs b/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs index 28ff9e60c6..8a39728a86 100644 --- a/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs +++ b/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Aks.Models; using Azure.ResourceManager.ContainerService; using Azure.ResourceManager.ContainerService.Models; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Caching; namespace Azure.Mcp.Tools.Aks.Services; @@ -27,7 +26,6 @@ public async Task> GetClusters( string? clusterName, string? resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -54,7 +52,7 @@ public async Task> GetClusters( "Microsoft.ContainerService/managedClusters", resourceGroup, subscription, - retryPolicy, + null, ConvertToClusterFromJson, tenant: tenant, cancellationToken: cancellationToken); @@ -90,7 +88,7 @@ public async Task> GetClusters( "Microsoft.ContainerService/managedClusters", resourceGroup: resourceGroup, subscription: subscription, - retryPolicy: retryPolicy, + retryPolicy: null, converter: ConvertToClusterFromJson, additionalFilter: $"name =~ '{EscapeKqlString(clusterName!)}'", tenant: tenant, @@ -116,7 +114,7 @@ public async Task> GetNodePools( string clusterName, string? nodePoolName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default) { ValidateRequiredParameters( (nameof(subscription), subscription), @@ -137,7 +135,7 @@ public async Task> GetNodePools( return cachedNodePools; } - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var nodePools = new List(); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -184,7 +182,7 @@ public async Task> GetNodePools( return cachedNodePool; } - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) { diff --git a/tools/Azure.Mcp.Tools.Aks/src/Services/IAksService.cs b/tools/Azure.Mcp.Tools.Aks/src/Services/IAksService.cs index 867a43838e..8def66a7cb 100644 --- a/tools/Azure.Mcp.Tools.Aks/src/Services/IAksService.cs +++ b/tools/Azure.Mcp.Tools.Aks/src/Services/IAksService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Aks.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Aks.Services; @@ -13,7 +12,6 @@ Task> GetClusters( string? clusterName, string? resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetNodePools( @@ -22,6 +20,5 @@ Task> GetNodePools( string clusterName, string? nodePoolName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Cluster/ClusterGetCommandTests.cs b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Cluster/ClusterGetCommandTests.cs index 6b1efeddd2..aa5b68e48b 100644 --- a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Cluster/ClusterGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Cluster/ClusterGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Aks.Commands; using Azure.Mcp.Tools.Aks.Commands.Cluster; using Azure.Mcp.Tools.Aks.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,7 +38,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); } @@ -75,7 +73,6 @@ public async Task ExecuteAsync_ReturnsClustersList() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedClusters); @@ -96,7 +93,6 @@ await Service.Received(1).GetClusters( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -181,7 +177,6 @@ public async Task ExecuteAsync_EnrichedClusterFields_SerializeCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([enriched]); @@ -212,7 +207,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoClusters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -234,7 +228,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -270,7 +263,7 @@ public async Task ExecuteAsync_ReturnsClusterWhenFound() AgentPoolProfiles = [new() { Name = "systempool", Count = 3 }] }; - Service.GetClusters("test-subscription", "test-cluster", "test-rg", null, Arg.Any(), Arg.Any()) + Service.GetClusters("test-subscription", "test-cluster", "test-rg", null, Arg.Any()) .Returns([expectedCluster]); // Act @@ -295,7 +288,6 @@ public async Task ExecuteAsync_Handles404NotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -320,7 +312,6 @@ public async Task ExecuteAsync_Handles403Forbidden() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); diff --git a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Nodepool/NodepoolGetCommandTests.cs b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Nodepool/NodepoolGetCommandTests.cs index 813fd92554..7c2f7b91fc 100644 --- a/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Nodepool/NodepoolGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Nodepool/NodepoolGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Aks.Commands; using Azure.Mcp.Tools.Aks.Commands.Nodepool; using Azure.Mcp.Tools.Aks.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -42,7 +41,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); } @@ -147,7 +145,6 @@ public async Task ExecuteAsync_ReturnsNodePoolsList() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedNodePools); @@ -200,7 +197,6 @@ await Service.Received(1).GetNodePools( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -214,7 +210,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoNodePools() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -237,7 +232,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -297,7 +291,7 @@ public async Task ExecuteAsync_ReturnsNodePool() PodSubnetId = "/subscriptions/s/rg/r/providers/Microsoft.Network/virtualNetworks/vnet/subnets/podsubnet", VnetSubnetId = "/subscriptions/s/rg/r/providers/Microsoft.Network/virtualNetworks/vnet/subnets/nodesubnet" }; - Service.GetNodePools(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetNodePools(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([expectedNodePool]); // Act @@ -341,6 +335,6 @@ public async Task ExecuteAsync_ReturnsNodePool() Assert.Equal("/subscriptions/s/rg/r/providers/Microsoft.Network/virtualNetworks/vnet/subnets/podsubnet", result.NodePools[0].PodSubnetId); Assert.Equal("/subscriptions/s/rg/r/providers/Microsoft.Network/virtualNetworks/vnet/subnets/nodesubnet", result.NodePools[0].VnetSubnetId); - await Service.Received(1).GetNodePools(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).GetNodePools(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/Account/AccountListCommand.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/Account/AccountListCommand.cs index 4c3659d398..bbf2263ada 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/Account/AccountListCommand.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/Account/AccountListCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(accounts?.Results ?? [], accounts?.AreResultsTruncated ?? false), AppConfigJsonContext.Default.AccountListCommandResult); diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueDeleteCommand.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueDeleteCommand.cs index fe71e7d506..6be2485166 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueDeleteCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Key, options.Subscription!, options.Tenant, - options.RetryPolicy, options.Label, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueGetCommand.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueGetCommand.cs index 92358368fa..a28ea4508e 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueGetCommand.cs @@ -59,7 +59,6 @@ public override async Task ExecuteAsync(CommandContext context, options.KeyFilter, options.LabelFilter, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(settings ?? []), AppConfigJsonContext.Default.KeyValueGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueSetCommand.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueSetCommand.cs index 3836d7ce5e..38497a4edc 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueSetCommand.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/KeyValueSetCommand.cs @@ -43,7 +43,6 @@ await _appConfigService.SetKeyValue( options.Value, options.Subscription!, options.Tenant, - options.RetryPolicy, options.Label, options.ContentType, options.Tags, diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/Lock/KeyValueLockSetCommand.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/Lock/KeyValueLockSetCommand.cs index a4d8bade3a..691ea16e27 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/Lock/KeyValueLockSetCommand.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Commands/KeyValue/Lock/KeyValueLockSetCommand.cs @@ -44,7 +44,6 @@ await _appConfigService.SetKeyValueLockState( options.Lock ?? false, options.Subscription!, options.Tenant, - options.RetryPolicy, options.Label, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Options/Account/AccountListOptions.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Options/Account/AccountListOptions.cs index 1043b4b035..33444defa1 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Options/Account/AccountListOptions.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Options/Account/AccountListOptions.cs @@ -17,6 +17,4 @@ public sealed class AccountListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueDeleteOptions.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueDeleteOptions.cs index 0231ca6cb7..e5dd6c9053 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueDeleteOptions.cs @@ -23,6 +23,4 @@ public sealed class KeyValueDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueGetOptions.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueGetOptions.cs index de6ecc15d6..a23305aaa7 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueGetOptions.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueGetOptions.cs @@ -29,6 +29,4 @@ public class KeyValueGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueSetOptions.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueSetOptions.cs index 51fe5e1f97..66ee2d8cd0 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueSetOptions.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueSetOptions.cs @@ -32,6 +32,4 @@ public class KeyValueSetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/Lock/KeyValueLockSetOptions.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/Lock/KeyValueLockSetOptions.cs index 1105d92c29..66276f63bc 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/Lock/KeyValueLockSetOptions.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/Lock/KeyValueLockSetOptions.cs @@ -26,6 +26,4 @@ public class KeyValueLockSetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs index 99431c1705..a3d91cd976 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.AppConfig.Models; using Microsoft.Mcp.Core.Helpers; using Microsoft.Mcp.Core.Models.Identity; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.AppConfig.Services; @@ -22,7 +21,6 @@ public async Task> GetAppConfigAcc string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -31,7 +29,7 @@ public async Task> GetAppConfigAcc "Microsoft.AppConfiguration/configurationStores", resourceGroup: resourceGroup, subscription, - retryPolicy, + null, ConvertToAppConfigurationAccountModel, tenant: tenant, cancellationToken: cancellationToken); @@ -45,12 +43,11 @@ public async Task> GetKeyValues( string? keyFilter = null, string? labelFilter = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(subscription), subscription)); - var client = await GetConfigurationClient(accountName, subscription, tenant, retryPolicy, cancellationToken); + var client = await GetConfigurationClient(accountName, subscription, tenant, cancellationToken); var settings = new List(); if (!string.IsNullOrEmpty(key)) { @@ -94,12 +91,11 @@ public async Task SetKeyValueLockState( bool locked, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, string? label = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(key), key), (nameof(subscription), subscription)); - var client = await GetConfigurationClient(accountName, subscription, tenant, retryPolicy, cancellationToken); + var client = await GetConfigurationClient(accountName, subscription, tenant, cancellationToken); await client.SetReadOnlyAsync(key, label, locked, cancellationToken: cancellationToken); } @@ -109,14 +105,13 @@ public async Task SetKeyValue( string value, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, string? label = null, string? contentType = null, string[]? tags = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(key), key), (nameof(value), value), (nameof(subscription), subscription)); - var client = await GetConfigurationClient(accountName, subscription, tenant, retryPolicy, cancellationToken); + var client = await GetConfigurationClient(accountName, subscription, tenant, cancellationToken); // Create a ConfigurationSetting object to include contentType if provided var setting = new ConfigurationSetting(key, value, label) @@ -152,12 +147,11 @@ public async Task DeleteKeyValue( string key, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, string? label = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(key), key), (nameof(subscription), subscription)); - var client = await GetConfigurationClient(accountName, subscription, tenant, retryPolicy, cancellationToken); + var client = await GetConfigurationClient(accountName, subscription, tenant, cancellationToken); var response = await client.DeleteConfigurationSettingAsync(key, label, cancellationToken: cancellationToken); return KeyValueExistedFromDeleteStatus(response.Status); } @@ -167,9 +161,9 @@ internal static bool KeyValueExistedFromDeleteStatus(int status) return status == 200; } - private async Task GetConfigurationClient(string accountName, string subscription, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + private async Task GetConfigurationClient(string accountName, string subscription, string? tenant, CancellationToken cancellationToken) { - var configStore = await FindAppConfigStore(subscription, tenant, accountName, retryPolicy, cancellationToken); + var configStore = await FindAppConfigStore(subscription, tenant, accountName, cancellationToken); var endpoint = configStore.Endpoint; if (string.IsNullOrEmpty(endpoint)) { @@ -182,14 +176,13 @@ private async Task GetConfigurationClient(string accountNam var endpointUri = new Uri(endpoint); var httpClient = AzureService.GetClient(); - var options = CreateConfigurationClientOptions(GetAppConfigurationAudience(), retryPolicy, httpClient, endpointUri); + var options = CreateConfigurationClientOptions(GetAppConfigurationAudience(), httpClient, endpointUri); return new ConfigurationClient(endpointUri, credential, options); } internal static ConfigurationClientOptions CreateConfigurationClientOptions( AppConfigurationAudience audience, - RetryPolicyOptions? retryPolicy, HttpClient httpClient, Uri endpointUri) { @@ -200,7 +193,7 @@ internal static ConfigurationClientOptions CreateConfigurationClientOptions( httpClient.BaseAddress = endpointUri; options.Transport = new HttpClientTransport(httpClient); - ConfigureRetryPolicy(AddDefaultPolicies(options), retryPolicy); + ConfigureRetryPolicy(AddDefaultPolicies(options), null); return options; } @@ -209,14 +202,13 @@ private async Task FindAppConfigStore( string subscription, string? tenant, string accountName, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { return await ExecuteSingleResourceQueryAsync( "Microsoft.AppConfiguration/configurationStores", resourceGroup: null, // all resource groups subscription: subscription, - retryPolicy: retryPolicy, + retryPolicy: null, converter: ConvertToAppConfigurationAccountModel, additionalFilter: $"name =~ '{EscapeKqlString(accountName)}'", tenant: tenant, diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Services/IAppConfigService.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Services/IAppConfigService.cs index ab9806eab3..0efd077a5b 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/src/Services/IAppConfigService.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/src/Services/IAppConfigService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.AppConfig.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AppConfig.Services; @@ -13,7 +12,6 @@ Task> GetAppConfigAccounts( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetKeyValues( string accountName, @@ -23,7 +21,6 @@ Task> GetKeyValues( string? keyFilter = null, string? labelFilter = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task SetKeyValueLockState( string accountName, @@ -31,7 +28,6 @@ Task SetKeyValueLockState( bool locked, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, string? label = null, CancellationToken cancellationToken = default); Task SetKeyValue( @@ -40,7 +36,6 @@ Task SetKeyValue( string value, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, string? label = null, string? contentType = null, string[]? tags = null, @@ -50,7 +45,6 @@ Task DeleteKeyValue( string key, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, string? label = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Account/AccountListCommandTests.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Account/AccountListCommandTests.cs index 0fabdd8fea..c24ef282e3 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Account/AccountListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Account/AccountListCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.AppConfig.Commands.Account; using Azure.Mcp.Tools.AppConfig.Models; using Azure.Mcp.Tools.AppConfig.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,7 +29,6 @@ public async Task ExecuteAsync_ReturnsAccounts_WhenAccountsExist() "sub123", Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccounts); @@ -53,7 +51,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoAccountsExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); @@ -70,7 +67,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoAccountsExist() public async Task ExecuteAsync_Returns500_WhenServiceThrowsException() { // Arrange - Service.GetAppConfigAccounts(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAppConfigAccounts(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); // Act @@ -96,7 +93,7 @@ public async Task ExecuteAsync_Returns400_WhenSubscriptionIsMissing() public async Task ExecuteAsync_Returns503_WhenServiceIsUnavailable() { // Arrange - Service.GetAppConfigAccounts(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAppConfigAccounts(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new HttpRequestException("Service Unavailable", null, HttpStatusCode.ServiceUnavailable)); // Act @@ -112,7 +109,7 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( { // Arrange const string resourceGroup = "test-rg"; - Service.GetAppConfigAccounts(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAppConfigAccounts(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -120,6 +117,6 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( // Assert Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).GetAppConfigAccounts(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).GetAppConfigAccounts(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueDeleteCommandTests.cs index 73c94733ea..32709fc0f9 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueDeleteCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.AppConfig.Commands; using Azure.Mcp.Tools.AppConfig.Commands.KeyValue; using Azure.Mcp.Tools.AppConfig.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -20,7 +19,7 @@ public async Task ExecuteAsync_DeletesKeyValue_WhenValidParametersProvided() { // Arrange Service.DeleteKeyValue(Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(true); // Act @@ -35,7 +34,6 @@ await Service.Received(1).DeleteKeyValue( "my-key", "sub123", null, - Arg.Any(), null, Arg.Any()); @@ -51,7 +49,7 @@ public async Task ExecuteAsync_DeletesKeyValueWithLabel_WhenLabelProvided() { // Arrange Service.DeleteKeyValue(Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(true); // Act @@ -66,7 +64,6 @@ await Service.Received(1).DeleteKeyValue( "account1", "my-key", "sub123", null, - Arg.Any(), "prod", Arg.Any()); @@ -83,7 +80,7 @@ public async Task ExecuteAsync_ReturnsExistedFalse_WhenKeyWasAbsent() { // Arrange — service returns false indicating the key did not exist Service.DeleteKeyValue(Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(false); // Act @@ -109,7 +106,6 @@ public async Task ExecuteAsync_Returns500_WhenServiceThrowsException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Failed to delete key-value")); diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueGetCommandTests.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueGetCommandTests.cs index 7cc72c2ae6..94b83caea3 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AppConfig.Commands.KeyValue; using Azure.Mcp.Tools.AppConfig.Models; using Azure.Mcp.Tools.AppConfig.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,7 +32,6 @@ public async Task ExecuteAsync_ReturnsSettingsList_WhenSettingsExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedSettings); @@ -64,7 +62,6 @@ public async Task ExecuteAsync_ReturnsFilteredSettingsList_WhenKeyFilterProvided "key1", Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedSettings); @@ -100,7 +97,6 @@ public async Task ExecuteAsync_ReturnsFilteredSettingsList_WhenLabelFilterProvid Arg.Any(), "prod", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedSettings); @@ -139,7 +135,6 @@ public async Task ExecuteAsync_ReturnsSettingGet_WhenSettingExists() Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([expectedSetting]); @@ -179,7 +174,6 @@ public async Task ExecuteAsync_ReturnsSettingGet_WhenNoLabelProvided() Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([expectedSetting]); @@ -209,7 +203,6 @@ public async Task ExecuteAsync_Returns500_WhenServiceThrowsException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Setting not found")); diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueSetCommandTests.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueSetCommandTests.cs index 76d685a96b..d3e75b90ff 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueSetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/KeyValueSetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.AppConfig.Commands; using Azure.Mcp.Tools.AppConfig.Commands.KeyValue; using Azure.Mcp.Tools.AppConfig.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,7 +31,6 @@ await Service.Received(1).SetKeyValue( "my-value", "sub123", null, - Arg.Any(), null, Arg.Any(), Arg.Any(), @@ -62,7 +60,6 @@ await Service.Received(1).SetKeyValue( "my-value", "sub123", null, - Arg.Any(), "prod", Arg.Any(), Arg.Any(), @@ -94,7 +91,6 @@ await Service.Received(1).SetKeyValue( "my-value", "sub123", null, - Arg.Any(), null, "application/json", Arg.Is(tags => tags.Contains("environment=prod") && tags.Contains("team=backend")), @@ -120,7 +116,6 @@ public async Task ExecuteAsync_Returns500_WhenServiceThrowsException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/Lock/KeyValueLockSetCommandTests.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/Lock/KeyValueLockSetCommandTests.cs index dbc03d081d..b4bb62c87a 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/Lock/KeyValueLockSetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/KeyValue/Lock/KeyValueLockSetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.AppConfig.Commands; using Azure.Mcp.Tools.AppConfig.Commands.KeyValue.Lock; using Azure.Mcp.Tools.AppConfig.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,7 +32,6 @@ await Service.Received(1).SetKeyValueLockState( true, "sub123", null, - Arg.Any(), null, Arg.Any()); @@ -61,7 +59,6 @@ await Service.Received(1).SetKeyValueLockState( true, "sub123", null, - Arg.Any(), "prod", Arg.Any()); @@ -88,7 +85,6 @@ await Service.Received(1).SetKeyValueLockState( false, "sub123", null, - Arg.Any(), null, Arg.Any()); @@ -115,7 +111,6 @@ await Service.Received(1).SetKeyValueLockState( false, "sub123", null, - Arg.Any(), "prod", Arg.Any()); @@ -136,7 +131,6 @@ public async Task ExecuteAsync_Returns500_WhenServiceThrowsException(bool locked Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Failed to lock key-value")); diff --git a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Services/AppConfigServiceTests.cs b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Services/AppConfigServiceTests.cs index 4238dd5d88..df5d8fb980 100644 --- a/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Services/AppConfigServiceTests.cs +++ b/tools/Azure.Mcp.Tools.AppConfig/tests/Azure.Mcp.Tools.AppConfig.Tests/Services/AppConfigServiceTests.cs @@ -1,42 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using Azure.Core; -using Azure.Data.AppConfiguration; using Azure.Mcp.Tools.AppConfig.Services; -using Microsoft.Mcp.Core.Options; using Xunit; namespace Azure.Mcp.Tools.AppConfig.Tests.Services; public class AppConfigServiceTests { - [Fact] - public void CreateConfigurationClientOptions_AppliesRetrySettings() - { - var retryPolicy = new RetryPolicyOptions - { - DelaySeconds = 2, - MaxDelaySeconds = 10, - MaxRetries = 4, - Mode = RetryMode.Fixed, - NetworkTimeoutSeconds = 15 - }; - using var httpClient = new HttpClient(); - var options = AppConfigService.CreateConfigurationClientOptions( - AppConfigurationAudience.AzurePublicCloud, - retryPolicy, - httpClient, - new Uri("https://example.azconfig.io")); - - Assert.Equal(AppConfigurationAudience.AzurePublicCloud, options.Audience); - Assert.Equal(TimeSpan.FromSeconds(2), options.Retry.Delay); - Assert.Equal(TimeSpan.FromSeconds(10), options.Retry.MaxDelay); - Assert.Equal(4, options.Retry.MaxRetries); - Assert.Equal(RetryMode.Fixed, options.Retry.Mode); - Assert.Equal(TimeSpan.FromSeconds(15), options.Retry.NetworkTimeout); - } - [Theory] [InlineData(200, true)] [InlineData(204, false)] diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Database/DatabaseAddCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Database/DatabaseAddCommand.cs index 471a1713ae..d0b230aa55 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Database/DatabaseAddCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Database/DatabaseAddCommand.cs @@ -48,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ConnectionString ?? string.Empty, // connectionString - will be generated if not provided options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(connectionInfo), AppServiceJsonContext.Default.DatabaseAddResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Deployment/DeploymentGetCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Deployment/DeploymentGetCommand.cs index cdecf5d5fd..0bc4357712 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Deployment/DeploymentGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Deployment/DeploymentGetCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.App, options.DeploymentId, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(deployments), AppServiceJsonContext.Default.DeploymentGetResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorDiagnoseCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorDiagnoseCommand.cs index 0746636f90..95f356e43f 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorDiagnoseCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorDiagnoseCommand.cs @@ -62,7 +62,6 @@ public override async Task ExecuteAsync(CommandContext context, options.EndTime, options.Interval, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(diagnoses), AppServiceJsonContext.Default.DetectorDiagnoseResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorListCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorListCommand.cs index 957b3bbc78..baebc14b8b 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorListCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Diagnostic/DetectorListCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.App, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(detectors), AppServiceJsonContext.Default.DetectorListResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsGetCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsGetCommand.cs index 96a51fce17..c0d4881182 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsGetCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.App, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(appSettings), AppServiceJsonContext.Default.AppSettingsGetResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsUpdateCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsUpdateCommand.cs index c4f5293c7c..2a60165e8e 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/Settings/AppSettingsUpdateCommand.cs @@ -91,7 +91,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SettingUpdateType, options.SettingValue, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(updateResult), AppServiceJsonContext.Default.AppSettingsUpdateResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappChangeStateCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappChangeStateCommand.cs index 11c03d216e..cc3f710c1b 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappChangeStateCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappChangeStateCommand.cs @@ -96,7 +96,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SoftRestart, options.WaitForCompletion, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(stateChange), AppServiceJsonContext.Default.WebappChangeStateResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappGetCommand.cs b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappGetCommand.cs index a8112a18a3..929cb78c3e 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Commands/Webapp/WebappGetCommand.cs @@ -56,7 +56,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.App, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(webapps), AppServiceJsonContext.Default.WebappGetResult); diff --git a/tools/Azure.Mcp.Tools.AppService/src/Options/BaseAppServiceOptions.cs b/tools/Azure.Mcp.Tools.AppService/src/Options/BaseAppServiceOptions.cs index a050f7c991..41f621d3a3 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Options/BaseAppServiceOptions.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Options/BaseAppServiceOptions.cs @@ -20,6 +20,4 @@ public sealed class BaseAppServiceOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppService/src/Options/Database/DatabaseAddOptions.cs b/tools/Azure.Mcp.Tools.AppService/src/Options/Database/DatabaseAddOptions.cs index 5c221b185a..938898365b 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Options/Database/DatabaseAddOptions.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Options/Database/DatabaseAddOptions.cs @@ -32,6 +32,4 @@ public sealed class DatabaseAddOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Deployment/DeploymentGetOptions.cs b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Deployment/DeploymentGetOptions.cs index 9867f06297..8489f8fd2a 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Deployment/DeploymentGetOptions.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Deployment/DeploymentGetOptions.cs @@ -23,6 +23,4 @@ public sealed class DeploymentGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Diagnostic/DetectorDiagnoseOptions.cs b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Diagnostic/DetectorDiagnoseOptions.cs index f963cebfed..bb245367b7 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Diagnostic/DetectorDiagnoseOptions.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Diagnostic/DetectorDiagnoseOptions.cs @@ -32,6 +32,4 @@ public sealed class DetectorDiagnoseOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Settings/AppSettingsUpdateOptions.cs b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Settings/AppSettingsUpdateOptions.cs index 49fc7a0a62..ec8f3ce0e9 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Settings/AppSettingsUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Settings/AppSettingsUpdateOptions.cs @@ -29,6 +29,4 @@ public sealed class AppSettingsUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappChangeStateOptions.cs b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappChangeStateOptions.cs index 2a6e98aacd..4b54113e5c 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappChangeStateOptions.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappChangeStateOptions.cs @@ -29,6 +29,4 @@ public sealed class WebappChangeStateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappGetOptions.cs b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappGetOptions.cs index 8737bba3eb..ab015bf58d 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappGetOptions.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappGetOptions.cs @@ -20,6 +20,4 @@ public sealed class WebappGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AppService/src/Services/AppServiceService.cs b/tools/Azure.Mcp.Tools.AppService/src/Services/AppServiceService.cs index 5f13e0b4ca..d469b13f03 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Services/AppServiceService.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Services/AppServiceService.cs @@ -11,7 +11,6 @@ using Azure.ResourceManager.AppService; using Azure.ResourceManager.AppService.Models; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.AppService.Services; @@ -32,7 +31,6 @@ public async Task AddDatabaseAsync( string connectionString, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { _logger.LogInformation( @@ -49,7 +47,7 @@ public async Task AddDatabaseAsync( (nameof(subscription), subscription)); // Get Azure resources - var webApp = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, retryPolicy, cancellationToken); + var webApp = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, cancellationToken); // Prepare connection string var finalConnectionString = PrepareConnectionString(connectionString, databaseType, databaseServer, databaseName); @@ -66,9 +64,9 @@ public async Task AddDatabaseAsync( } private async Task GetWebAppResourceAsync(string subscription, string resourceGroup, - string appName, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string appName, string? tenant, CancellationToken cancellationToken) { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -191,12 +189,11 @@ public async Task> GetWebAppsAsync( string? resourceGroup = null, string? appName = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var results = new List(); @@ -250,12 +247,11 @@ public async Task> GetAppSettingsAsync( string resourceGroup, string appName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(appName), appName)); - var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, retryPolicy, cancellationToken); + var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, cancellationToken); var configResource = await webAppResource.GetApplicationSettingsAsync(cancellationToken: cancellationToken); return configResource.Value.Properties; @@ -269,7 +265,6 @@ public async Task UpdateAppSettingsAsync( string settingUpdateType, string? settingValue = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -289,7 +284,7 @@ public async Task UpdateAppSettingsAsync( throw new ArgumentException(errorMessage); } - var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, retryPolicy, cancellationToken); + var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, cancellationToken); var configResource = await webAppResource.GetApplicationSettingsAsync(cancellationToken: cancellationToken); // Don't worry about an else case here because validation should have already caught invalid update types @@ -329,12 +324,11 @@ public async Task> GetDeploymentsAsync( string appName, string? deploymentId = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(appName), appName)); - var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, retryPolicy, cancellationToken); + var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, cancellationToken); var results = new List(); @@ -363,7 +357,6 @@ public async Task> ListDetectorsAsync( string resourceGroup, string appName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(appName), appName)); @@ -371,7 +364,7 @@ public async Task> ListDetectorsAsync( // TODO (alzimmer): Once https://github.com/Azure/azure-sdk-for-net/issues/51444 is resolved, // use WebSiteResource.GetSiteDetectors().GetAllAsync instead of using a direct HttpClient. // var results = new List(); - // var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, retryPolicy, cancellationToken); + // var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, cancellationToken); // await foreach (var detector = await webAppResource.GetSiteDetectors().GetAllAsync(cancellationToken)) // { // results.Add(MapToDetectorDetails(detector.Data)); @@ -429,7 +422,6 @@ public async Task DiagnoseDetectorAsync( DateTimeOffset? endTime = null, string? interval = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -440,7 +432,7 @@ public async Task DiagnoseDetectorAsync( // TODO (alzimmer): Once https://github.com/Azure/azure-sdk-for-net/issues/51444 is resolved, // // use WebSiteResource.GetSiteDetectorAsync instead of using a direct HttpClient. - // var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, retryPolicy, cancellationToken); + // var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, cancellationToken); // var diagnoses = await webAppResource.GetSiteDetectorAsync(detectorName, startTime, endTime, interval, cancellationToken); // return new DiagnosesResults(diagnoses.Value.Data.Dataset, diagnoses.Value.Data.Metadata); @@ -552,7 +544,6 @@ public async Task ChangeWebAppStateAsync( bool softRestart, bool waitForCompletion, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -566,7 +557,7 @@ public async Task ChangeWebAppStateAsync( throw new ArgumentException(errorMessage); } - var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, retryPolicy, cancellationToken); + var webAppResource = await GetWebAppResourceAsync(subscription, resourceGroup, appName, tenant, cancellationToken); if (stateChange.Equals("start", StringComparison.OrdinalIgnoreCase)) { diff --git a/tools/Azure.Mcp.Tools.AppService/src/Services/IAppServiceService.cs b/tools/Azure.Mcp.Tools.AppService/src/Services/IAppServiceService.cs index c37ad79e80..20eaec0bc9 100644 --- a/tools/Azure.Mcp.Tools.AppService/src/Services/IAppServiceService.cs +++ b/tools/Azure.Mcp.Tools.AppService/src/Services/IAppServiceService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.AppService.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AppService.Services; @@ -17,7 +16,6 @@ Task AddDatabaseAsync( string connectionString, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetWebAppsAsync( @@ -25,7 +23,6 @@ Task> GetWebAppsAsync( string? resourceGroup = null, string? appName = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetAppSettingsAsync( @@ -33,7 +30,6 @@ Task> GetAppSettingsAsync( string resourceGroup, string appName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task UpdateAppSettingsAsync( @@ -44,7 +40,6 @@ Task UpdateAppSettingsAsync( string settingUpdateType, string? settingValue = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetDeploymentsAsync( @@ -53,7 +48,6 @@ Task> GetDeploymentsAsync( string appName, string? deploymentId = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListDetectorsAsync( @@ -61,7 +55,6 @@ Task> ListDetectorsAsync( string resourceGroup, string appName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DiagnoseDetectorAsync( @@ -73,7 +66,6 @@ Task DiagnoseDetectorAsync( DateTimeOffset? endTime = null, string? interval = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task ChangeWebAppStateAsync( @@ -84,6 +76,5 @@ Task ChangeWebAppStateAsync( bool softRestart, bool waitForCompletion, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Database/DatabaseAddCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Database/DatabaseAddCommandTests.cs index 1eff13c07d..b5367ee8a6 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Database/DatabaseAddCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Database/DatabaseAddCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.AppService.Commands.Database; using Azure.Mcp.Tools.AppService.Models; using Azure.Mcp.Tools.AppService.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -54,7 +53,6 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedConnection); @@ -68,7 +66,6 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume connectionString ?? string.Empty, subscription, tenant, - new RetryPolicyOptions(), TestContext.Current.CancellationToken); // Verify the service returns expected data @@ -87,7 +84,6 @@ await Service.Received(1).AddDatabaseAsync( Arg.Any(), Arg.Is(subscription), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -115,21 +111,17 @@ await Service.DidNotReceive().AddDatabaseAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } [Theory] - [InlineData("basic", null, null, null, null)] - [InlineData("custom-connection-string", "Server=custom;Database=custom;UserId=user;Password=pass;", null, null, null)] - [InlineData("tenant", null, "test-tenant-id", null, null)] - [InlineData("retry-policy", null, null, 3, 1.0)] + [InlineData("basic", null, null)] + [InlineData("custom-connection-string", "Server=custom;Database=custom;UserId=user;Password=pass;", null)] + [InlineData("tenant", null, "test-tenant-id")] public async Task ExecuteAsync_WithVariousParameters_AcceptsParameters( string scenario, string? connectionString, - string? tenant, - int? retryMaxRetries, - double? retryDelay) + string? tenant) { var subscription = "sub123"; var parameters = new Dictionary @@ -149,12 +141,6 @@ public async Task ExecuteAsync_WithVariousParameters_AcceptsParameters( if (tenant != null) parameters.Add("tenant", tenant); - if (retryMaxRetries.HasValue) - parameters.Add("retry-max-retries", retryMaxRetries.Value); - - if (retryDelay.HasValue) - parameters.Add("retry-delay", retryDelay.Value); - // Execute the command directly in unit tests rather than via the tool runner helper var argList = parameters.SelectMany(kvp => new[] { $"--{kvp.Key}", kvp.Value?.ToString() ?? string.Empty }).ToArray(); var response = await ExecuteCommandAsync(argList); @@ -211,7 +197,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Deployment/DeploymentGetCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Deployment/DeploymentGetCommandTests.cs index db696270db..90f0aec6cd 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Deployment/DeploymentGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Deployment/DeploymentGetCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.AppService.Commands.Webapp.Deployment; using Azure.Mcp.Tools.AppService.Models; using Azure.Mcp.Tools.AppService.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -29,8 +28,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume ]; // Set up the mock to return success for any arguments - Service.GetDeploymentsAsync("sub123", "rg1", "test-app", deploymentId, Arg.Any(), - Arg.Any(), Arg.Any()) + Service.GetDeploymentsAsync("sub123", "rg1", "test-app", deploymentId, Arg.Any(), Arg.Any()) .Returns(expectedDeployments); List unparsedArgs = ["--subscription", "sub123", "--resource-group", "rg1", "--app", "test-app"]; @@ -45,7 +43,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Assert // Verify that the mock was called with the expected parameters await Service.Received(1).GetDeploymentsAsync("sub123", "rg1", "test-app", deploymentId, - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, AppServiceJsonContext.Default.DeploymentGetResult); @@ -75,7 +73,6 @@ await Service.DidNotReceive().GetDeploymentsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -85,8 +82,7 @@ await Service.DidNotReceive().GetDeploymentsAsync( public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(string? deploymentId) { // Arrange - Service.GetDeploymentsAsync("sub123", "rg1", "test-app", deploymentId, Arg.Any(), - Arg.Any(), Arg.Any()) + Service.GetDeploymentsAsync("sub123", "rg1", "test-app", deploymentId, Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); List unparsedArgs = ["--subscription", "sub123", "--resource-group", "rg1", "--app", "test-app"]; @@ -103,6 +99,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(strin Assert.Equal(HttpStatusCode.UnprocessableEntity, response.Status); await Service.Received(1).GetDeploymentsAsync("sub123", "rg1", "test-app", deploymentId, - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorDiagnoseCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorDiagnoseCommandTests.cs index f07835cd7a..59f4441930 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorDiagnoseCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorDiagnoseCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.AppService.Models; using Azure.Mcp.Tools.AppService.Services; using Azure.ResourceManager.AppService.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -41,7 +40,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Set up the mock to return success for any arguments Service.DiagnoseDetectorAsync("sub123", "rg1", "test-app", "LinuxMemoryDrillDown", startTime, endTime, - interval, Arg.Any(), Arg.Any(), Arg.Any()) + interval, Arg.Any(), Arg.Any()) .Returns(expectedValue); List unparsedArgs = [ @@ -71,7 +70,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume await Service.Received(1).DiagnoseDetectorAsync("sub123", "rg1", "test-app", "LinuxMemoryDrillDown", - startTime, endTime, interval, Arg.Any(), Arg.Any(), + startTime, endTime, interval, Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, AppServiceJsonContext.Default.DetectorDiagnoseResult); @@ -121,7 +120,6 @@ await Service.DidNotReceive().DiagnoseDetectorAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -140,7 +138,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(strin // Arrange // Set up the mock to return success for any arguments Service.DiagnoseDetectorAsync("sub123", "rg1", "test-app", "LinuxMemoryDrillDown", startTime, endTime, - interval, Arg.Any(), Arg.Any(), Arg.Any()) + interval, Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); List unparsedArgs = [ @@ -170,7 +168,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(strin Assert.Equal(HttpStatusCode.UnprocessableEntity, response.Status); await Service.Received(1).DiagnoseDetectorAsync("sub123", "rg1", "test-app", "LinuxMemoryDrillDown", - startTime, endTime, interval, Arg.Any(), Arg.Any(), + startTime, endTime, interval, Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorListCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorListCommandTests.cs index bad57a0350..8e5ea7c4ae 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Diagnostic/DetectorListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AppService.Commands.Webapp.Diagnostic; using Azure.Mcp.Tools.AppService.Models; using Azure.Mcp.Tools.AppService.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -24,8 +23,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Arrange // Set up the mock to return success for any arguments - Service.ListDetectorsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()) + Service.ListDetectorsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()) .Returns(expectedValue); // Act @@ -33,8 +31,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Assert // Verify that the mock was called with the expected parameters - await Service.Received(1).ListDetectorsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()); + await Service.Received(1).ListDetectorsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, AppServiceJsonContext.Default.DetectorListResult); @@ -69,7 +66,6 @@ await Service.DidNotReceive().ListDetectorsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -78,8 +74,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() { // Arrange // Set up the mock to return success for any arguments - Service.ListDetectorsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()) + Service.ListDetectorsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); // Act @@ -90,6 +85,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() Assert.Equal(HttpStatusCode.UnprocessableEntity, response.Status); await Service.Received(1).ListDetectorsAsync("sub123", "rg1", "test-app", - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsGetCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsGetCommandTests.cs index 38d0448621..98856d901d 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AppService.Commands; using Azure.Mcp.Tools.AppService.Commands.Webapp.Settings; using Azure.Mcp.Tools.AppService.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -28,8 +27,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume }; // Set up the mock to return success for any arguments - Service.GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()) + Service.GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()) .Returns(expectedSettings); // Act @@ -37,8 +35,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Assert // Verify that the mock was called with the expected parameters - await Service.Received(1).GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()); + await Service.Received(1).GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, AppServiceJsonContext.Default.AppSettingsGetResult); @@ -67,7 +64,6 @@ await Service.DidNotReceive().GetAppSettingsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -75,8 +71,7 @@ await Service.DidNotReceive().GetAppSettingsAsync( public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() { // Arrange - Service.GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()) + Service.GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); // Act @@ -86,7 +81,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() Assert.NotNull(response); Assert.Equal(HttpStatusCode.UnprocessableEntity, response.Status); - await Service.Received(1).GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()); + await Service.Received(1).GetAppSettingsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsUpdateCommandTests.cs index e777f5915a..4dae5d414f 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/Settings/AppSettingsUpdateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.AppService.Commands; using Azure.Mcp.Tools.AppService.Commands.Webapp.Settings; using Azure.Mcp.Tools.AppService.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Arrange // Set up the mock to return success for any arguments Service.UpdateAppSettingsAsync("sub123", "rg1", "test-app", settingName, settingUpdateType, - settingValue, Arg.Any(), Arg.Any(), Arg.Any()) + settingValue, Arg.Any(), Arg.Any()) .Returns(expectedValue); List unparsedArgs = [ @@ -52,7 +51,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Assert // Verify that the mock was called with the expected parameters await Service.Received(1).UpdateAppSettingsAsync("sub123", "rg1", "test-app", settingName, - settingUpdateType, settingValue, Arg.Any(), Arg.Any(), + settingUpdateType, settingValue, Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, AppServiceJsonContext.Default.AppSettingsUpdateResult); @@ -92,7 +91,6 @@ await Service.DidNotReceive().UpdateAppSettingsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -118,7 +116,6 @@ await Service.DidNotReceive().UpdateAppSettingsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -130,7 +127,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(strin { // Arrange Service.UpdateAppSettingsAsync("sub123", "rg1", "test-app", settingName, settingUpdateType, - settingValue, Arg.Any(), Arg.Any(), Arg.Any()) + settingValue, Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); List unparsedArgs = [ @@ -153,7 +150,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(strin Assert.Equal(HttpStatusCode.UnprocessableEntity, response.Status); await Service.Received(1).UpdateAppSettingsAsync("sub123", "rg1", "test-app", settingName, - settingUpdateType, settingValue, Arg.Any(), Arg.Any(), + settingUpdateType, settingValue, Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappChangeStateCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappChangeStateCommandTests.cs index 5f328001bc..fe3996b49f 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappChangeStateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappChangeStateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.AppService.Commands; using Azure.Mcp.Tools.AppService.Commands.Webapp; using Azure.Mcp.Tools.AppService.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -28,7 +27,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Set up the mock to return success for any arguments Service.ChangeWebAppStateAsync("sub123", "rg1", "test-app", stateChange, softRestart, - waitForCompletion, Arg.Any(), Arg.Any(), Arg.Any()) + waitForCompletion, Arg.Any(), Arg.Any()) .Returns(expected); List unparsedArgs = ["--subscription", "sub123", "--resource-group", "rg1", "--app", "test-app", "--state-change", stateChange]; @@ -47,7 +46,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Assert // Verify that the mock was called with the expected parameters await Service.Received(1).ChangeWebAppStateAsync("sub123", "rg1", "test-app", stateChange, - softRestart, waitForCompletion, Arg.Any(), Arg.Any(), + softRestart, waitForCompletion, Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, AppServiceJsonContext.Default.WebappChangeStateResult); @@ -90,7 +89,6 @@ await Service.DidNotReceive().ChangeWebAppStateAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -116,7 +114,6 @@ await Service.DidNotReceive().ChangeWebAppStateAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -130,7 +127,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(strin { // Arrange Service.ChangeWebAppStateAsync("sub123", "rg1", "test-app", stateChange, softRestart, - waitForCompletion, Arg.Any(), Arg.Any(), Arg.Any()) + waitForCompletion, Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); List unparsedArgs = ["--subscription", "sub123", "--resource-group", "rg1", "--app", "test-app", "--state-change", stateChange]; @@ -148,7 +145,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse(strin // Assert await Service.Received(1).ChangeWebAppStateAsync("sub123", "rg1", "test-app", stateChange, - softRestart, waitForCompletion, Arg.Any(), Arg.Any(), + softRestart, waitForCompletion, Arg.Any(), Arg.Any()); Assert.NotNull(response); diff --git a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappGetCommandTests.cs b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappGetCommandTests.cs index 37ebad84cf..b4b056b32d 100644 --- a/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AppService/tests/Azure.Mcp.Tools.AppService.Tests/Commands/Webapp/WebappGetCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.AppService.Commands.Webapp; using Azure.Mcp.Tools.AppService.Models; using Azure.Mcp.Tools.AppService.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,8 +29,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume ]; // Set up the mock to return success for any arguments - Service.GetWebAppsAsync(subscription, resourceGroup, appName, Arg.Any(), - Arg.Any(), Arg.Any()) + Service.GetWebAppsAsync(subscription, resourceGroup, appName, Arg.Any(), Arg.Any()) .Returns(expectedWebappDetails); List unparsedArgs = ["--subscription", subscription]; @@ -49,8 +47,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceWithCorrectArgume // Assert // Verify that the mock was called with the expected parameters - await Service.Received(1).GetWebAppsAsync(subscription, resourceGroup, appName, Arg.Any(), - Arg.Any(), Arg.Any()); + await Service.Received(1).GetWebAppsAsync(subscription, resourceGroup, appName, Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, AppServiceJsonContext.Default.WebappGetResult); @@ -74,7 +71,6 @@ await Service.DidNotReceive().GetWebAppsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -82,8 +78,7 @@ await Service.DidNotReceive().GetWebAppsAsync( public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() { // Arrange - Service.GetWebAppsAsync("sub123", "rg1", "test-app", Arg.Any(), - Arg.Any(), Arg.Any()) + Service.GetWebAppsAsync("sub123", "rg1", "test-app", Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); // Act @@ -94,6 +89,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() Assert.Equal(HttpStatusCode.UnprocessableEntity, response.Status); await Service.Received(1).GetWebAppsAsync("sub123", "rg1", "test-app", - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/Recommendation/RecommendationListCommand.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/Recommendation/RecommendationListCommand.cs index dfaf5ffb40..2c13db5086 100644 --- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/Recommendation/RecommendationListCommand.cs +++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/Recommendation/RecommendationListCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = insights?.Count() > 0 ? diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Options/RecommendationListOptions.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Options/RecommendationListOptions.cs index 0f18266918..bc22b9ec0a 100644 --- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Options/RecommendationListOptions.cs +++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Options/RecommendationListOptions.cs @@ -17,6 +17,4 @@ public class RecommendationListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs index a9a9c0d448..a764268d2a 100644 --- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs +++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs @@ -4,7 +4,6 @@ using System.Text.Json.Nodes; using Azure.Mcp.Core.Services.Azure; using Azure.ResourceManager.ApplicationInsights; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ApplicationInsights.Services; @@ -18,11 +17,10 @@ public async Task> GetProfilerInsightsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - IEnumerable results = await GetProfilerInsightsImpAsync(subscription, resourceGroup, tenant, retryPolicy, cancellationToken).ConfigureAwait(false); + IEnumerable results = await GetProfilerInsightsImpAsync(subscription, resourceGroup, tenant, cancellationToken).ConfigureAwait(false); return results.Take(MaxRecommendations); } @@ -30,13 +28,12 @@ private async Task> GetProfilerInsightsImpAsync( string subscription, string? resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); List results = []; - var components = await GetApplicationInsightsComponentsAsync(subscription, resourceGroup, tenant, retryPolicy, cancellationToken).ConfigureAwait(false); + var components = await GetApplicationInsightsComponentsAsync(subscription, resourceGroup, tenant, cancellationToken).ConfigureAwait(false); var insights = await _profilerDataClient.GetInsightsAsync(resourceIds: components.Select(c => c.Id), cancellationToken: cancellationToken).ConfigureAwait(false); results.AddRange(insights); @@ -49,17 +46,16 @@ private async Task> GetApplicationIns string subscription, string? resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { if (string.IsNullOrEmpty(resourceGroup)) { // Query by subscription when resource group is not provided - return await GetApplicationInsightsComponentsAsync(subscription, tenant, retryPolicy, cancellationToken).ConfigureAwait(false); + return await GetApplicationInsightsComponentsAsync(subscription, tenant, cancellationToken).ConfigureAwait(false); } // Otherwise, query by resource group - var rgResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rgResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group {resourceGroup} not found in subscription {subscription}"); return await rgResource.GetApplicationInsightsComponents().GetAllAsync(cancellationToken).ToListAsync(cancellationToken).ConfigureAwait(false); } @@ -67,10 +63,9 @@ private async Task> GetApplicationIns private async Task> GetApplicationInsightsComponentsAsync( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var targetSubscription = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken).ConfigureAwait(false); + var targetSubscription = await AzureService.GetSubscription(subscription, tenant, cancellationToken).ConfigureAwait(false); return await targetSubscription.GetApplicationInsightsComponentsAsync(cancellationToken).ToListAsync(cancellationToken).ConfigureAwait(false); } } diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IApplicationInsightsService.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IApplicationInsightsService.cs index 5035c2b2fd..ee69dace4e 100644 --- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IApplicationInsightsService.cs +++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IApplicationInsightsService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System.Text.Json.Nodes; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ApplicationInsights.Services; @@ -12,6 +11,5 @@ Task> GetProfilerInsightsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs index 52f337a24e..4780db9ec8 100644 --- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs +++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs @@ -14,7 +14,6 @@ using Azure.ResourceManager; using Azure.ResourceManager.ApplicationInsights; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.ApplicationInsights.Services; @@ -160,9 +159,9 @@ internal async ValueTask PostAsync(string path, IDictionary return await client.SendAsync(request, cancellationToken).ConfigureAwait(false); } - private async Task ResolveAppIdAsync(ResourceIdentifier resourceId, CancellationToken cancellationToken, string? tenantId = null, RetryPolicyOptions? retryPolicy = null) + private async Task ResolveAppIdAsync(ResourceIdentifier resourceId, CancellationToken cancellationToken, string? tenantId = null) { - ArmClient armClient = await CreateArmClientAsync(tenantId, retryPolicy).ConfigureAwait(false); + ArmClient armClient = await CreateArmClientAsync(tenantId, null).ConfigureAwait(false); ApplicationInsightsComponentResource applicationInsightsComponentResource = armClient.GetApplicationInsightsComponentResource(resourceId); diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/tests/Azure.Mcp.Tools.ApplicationInsights.Tests/RecommendationListCommandTests.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/tests/Azure.Mcp.Tools.ApplicationInsights.Tests/RecommendationListCommandTests.cs index f972ceb323..6e6b4669ae 100644 --- a/tools/Azure.Mcp.Tools.ApplicationInsights/tests/Azure.Mcp.Tools.ApplicationInsights.Tests/RecommendationListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ApplicationInsights/tests/Azure.Mcp.Tools.ApplicationInsights.Tests/RecommendationListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ApplicationInsights.Commands; using Azure.Mcp.Tools.ApplicationInsights.Commands.Recommendation; using Azure.Mcp.Tools.ApplicationInsights.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -26,7 +25,6 @@ public async Task ExecuteAsync_WhenServiceReturnsInsights_SetsResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(insights); @@ -45,7 +43,6 @@ public async Task ExecuteAsync_WhenServiceReturnsNoInsights_NoResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); diff --git a/tools/Azure.Mcp.Tools.Authorization/src/Commands/RoleAssignmentListCommand.cs b/tools/Azure.Mcp.Tools.Authorization/src/Commands/RoleAssignmentListCommand.cs index ad64f62cfd..500bd08a24 100644 --- a/tools/Azure.Mcp.Tools.Authorization/src/Commands/RoleAssignmentListCommand.cs +++ b/tools/Azure.Mcp.Tools.Authorization/src/Commands/RoleAssignmentListCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Scope, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(assignments?.Results ?? [], assignments?.AreResultsTruncated ?? false), AuthorizationJsonContext.Default.RoleAssignmentListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Authorization/src/Options/RoleAssignmentListOptions.cs b/tools/Azure.Mcp.Tools.Authorization/src/Options/RoleAssignmentListOptions.cs index 2a4a7869dc..04b3ddabd9 100644 --- a/tools/Azure.Mcp.Tools.Authorization/src/Options/RoleAssignmentListOptions.cs +++ b/tools/Azure.Mcp.Tools.Authorization/src/Options/RoleAssignmentListOptions.cs @@ -17,6 +17,4 @@ public sealed class RoleAssignmentListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Authorization/src/Services/AuthorizationService.cs b/tools/Azure.Mcp.Tools.Authorization/src/Services/AuthorizationService.cs index 8e6ecaeb2b..89dec14bc9 100644 --- a/tools/Azure.Mcp.Tools.Authorization/src/Services/AuthorizationService.cs +++ b/tools/Azure.Mcp.Tools.Authorization/src/Services/AuthorizationService.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Authorization.Models; using Azure.Mcp.Tools.Authorization.Services.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Authorization.Services; @@ -17,7 +16,6 @@ public async Task> ListRoleAssignmentsAsync string subscription, string scope, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(scope), scope)); @@ -27,7 +25,7 @@ public async Task> ListRoleAssignmentsAsync "Microsoft.Authorization/roleAssignments", null, // all resource groups subscription, - retryPolicy, + null, ConvertToRoleAssignmentModel, "authorizationresources", additionalFilter: $"id contains '{EscapeKqlString(scope)}'", diff --git a/tools/Azure.Mcp.Tools.Authorization/src/Services/IAuthorizationService.cs b/tools/Azure.Mcp.Tools.Authorization/src/Services/IAuthorizationService.cs index 63a3b4cc18..bdaa8a3cad 100644 --- a/tools/Azure.Mcp.Tools.Authorization/src/Services/IAuthorizationService.cs +++ b/tools/Azure.Mcp.Tools.Authorization/src/Services/IAuthorizationService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Authorization.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Authorization.Services; @@ -15,13 +14,11 @@ public interface IAuthorizationService /// The subscription ID to query. /// The scope that the resource will apply against. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// Optional cancellation token for the operation. /// List of role assignments in the format "Role Definition ID: Principal ID" Task> ListRoleAssignmentsAsync( string subscription, string scope, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.Tests/RoleAssignmentListCommandTests.cs b/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.Tests/RoleAssignmentListCommandTests.cs index 5ab061ffdd..1d1d70d753 100644 --- a/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.Tests/RoleAssignmentListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Authorization/tests/Azure.Mcp.Tools.Authorization.Tests/RoleAssignmentListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Authorization.Commands; using Azure.Mcp.Tools.Authorization.Models; using Azure.Mcp.Tools.Authorization.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -53,7 +52,6 @@ public async Task ExecuteAsync_ReturnsRoleAssignments_WhenRoleAssignmentsExist() Arg.Is(subscriptionId), Arg.Is(scope), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedRoleAssignments); @@ -72,7 +70,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoRoleAssignments() // Arrange var subscriptionId = "00000000-0000-0000-0000-000000000001"; var scope = $"/subscriptions/{subscriptionId}/resourceGroups/rg1"; - Service.ListRoleAssignmentsAsync(subscriptionId, scope, null, null, TestContext.Current.CancellationToken) + Service.ListRoleAssignmentsAsync(subscriptionId, scope, null, TestContext.Current.CancellationToken) .Returns(new ResourceQueryResults([], false)); // Act @@ -92,7 +90,7 @@ public async Task ExecuteAsync_HandlesException() var subscriptionId = "00000000-0000-0000-0000-000000000001"; var scope = $"/subscriptions/{subscriptionId}/resourceGroups/rg1"; - Service.ListRoleAssignmentsAsync(subscriptionId, scope, null, null, TestContext.Current.CancellationToken) + Service.ListRoleAssignmentsAsync(subscriptionId, scope, null, TestContext.Current.CancellationToken) .ThrowsAsync(new Exception(expectedError)); // Act diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Backup/BackupStatusCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Backup/BackupStatusCommand.cs index 4353ec0a3a..dfe6a8ae80 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Backup/BackupStatusCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Backup/BackupStatusCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Location, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/DisasterRecovery/DisasterRecoveryEnableCrrCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/DisasterRecovery/DisasterRecoveryEnableCrrCommand.cs index a1e96f95bb..19fee7ccd8 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/DisasterRecovery/DisasterRecoveryEnableCrrCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/DisasterRecovery/DisasterRecoveryEnableCrrCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceFindUnprotectedCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceFindUnprotectedCommand.cs index 06226d23ff..cb930017c5 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceFindUnprotectedCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceFindUnprotectedCommand.cs @@ -67,7 +67,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.TagFilter, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceImmutabilityCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceImmutabilityCommand.cs index aada2ea21d..4db523ad65 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceImmutabilityCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceImmutabilityCommand.cs @@ -59,7 +59,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ImmutabilityState!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceSoftDeleteCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceSoftDeleteCommand.cs index 25e6ed795b..8d03a00ae1 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceSoftDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceSoftDeleteCommand.cs @@ -67,7 +67,6 @@ public override async Task ExecuteAsync(CommandContext context, options.VaultType, options.SoftDeleteRetentionDays, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Job/JobGetCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Job/JobGetCommand.cs index b38a5a0d63..2820d843aa 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Job/JobGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Job/JobGetCommand.cs @@ -54,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Job, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -69,7 +68,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyCreateCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyCreateCommand.cs index ca6651f8a6..f639e27453 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyCreateCommand.cs @@ -101,7 +101,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyGetCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyGetCommand.cs index 2d5e60a325..57e7b402e2 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyGetCommand.cs @@ -54,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Policy, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -69,7 +68,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyUpdateCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyUpdateCommand.cs index df5b5b1616..33db079ade 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyUpdateCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ScheduleTime, options.DailyRetentionDays, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectableItem/ProtectableItemListCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectableItem/ProtectableItemListCommand.cs index 7aeef9e61b..6777712dc8 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectableItem/ProtectableItemListCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectableItem/ProtectableItemListCommand.cs @@ -66,7 +66,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Container, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemGetCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemGetCommand.cs index b678a891cd..c8b6c90fe4 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemGetCommand.cs @@ -57,7 +57,6 @@ public override async Task ExecuteAsync(CommandContext context, options.VaultType, options.Container, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -72,7 +71,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemProtectCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemProtectCommand.cs index 1f5c6795a6..29e3df322e 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemProtectCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemProtectCommand.cs @@ -110,7 +110,6 @@ public override async Task ExecuteAsync(CommandContext context, options.AksIncludeClusterScopeResources ? "true" : null, options.AksSnapshotResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemUndeleteCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemUndeleteCommand.cs index cd9c973fd0..74c7135d7a 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemUndeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemUndeleteCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.VaultType, options.Container, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/RecoveryPoint/RecoveryPointGetCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/RecoveryPoint/RecoveryPointGetCommand.cs index bc52306bdb..7620b83efb 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/RecoveryPoint/RecoveryPointGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/RecoveryPoint/RecoveryPointGetCommand.cs @@ -56,7 +56,6 @@ public override async Task ExecuteAsync(CommandContext context, options.VaultType, options.Container, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -73,7 +72,6 @@ public override async Task ExecuteAsync(CommandContext context, options.VaultType, options.Container, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureEncryptionCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureEncryptionCommand.cs index 03d1a53a21..da6710ac9f 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureEncryptionCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureEncryptionCommand.cs @@ -99,7 +99,6 @@ public override async Task ExecuteAsync(CommandContext context, options.UserAssignedIdentityId, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureMuaCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureMuaCommand.cs index 1e3e32e97d..b9f186433d 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureMuaCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureMuaCommand.cs @@ -64,7 +64,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGuardId, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -75,7 +74,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultCreateCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultCreateCommand.cs index 26800d8742..e62b9773b9 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultCreateCommand.cs @@ -72,7 +72,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Sku, options.StorageType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultGetCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultGetCommand.cs index 370edaf0ff..6cfc9c35fc 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultGetCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultGetCommand.cs @@ -91,7 +91,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken, expand); @@ -106,7 +105,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.VaultType, options.Tenant, - options.RetryPolicy, cancellationToken, expand); diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultUpdateCommand.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultUpdateCommand.cs index cd28049bce..12378f902d 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultUpdateCommand.cs @@ -84,7 +84,6 @@ public override async Task ExecuteAsync(CommandContext context, options.IdentityType, options.Tags, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Backup/BackupStatusOptions.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Backup/BackupStatusOptions.cs index b015b79dc4..834f6aed1b 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Backup/BackupStatusOptions.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Backup/BackupStatusOptions.cs @@ -20,6 +20,4 @@ public sealed class BackupStatusOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseAzureBackupOptions.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseAzureBackupOptions.cs index c92720a563..fbac502b81 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseAzureBackupOptions.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseAzureBackupOptions.cs @@ -23,6 +23,4 @@ public class BaseAzureBackupOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceFindUnprotectedOptions.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceFindUnprotectedOptions.cs index 3c45c170cf..28a551f3a6 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceFindUnprotectedOptions.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceFindUnprotectedOptions.cs @@ -23,6 +23,4 @@ public sealed class GovernanceFindUnprotectedOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultGetOptions.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultGetOptions.cs index de05bf64c4..5a263d3fd1 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultGetOptions.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultGetOptions.cs @@ -26,6 +26,4 @@ public sealed class VaultGetOptions : ISubscriptionOption [Option(Description = AzureBackupOptionDefinitions.VaultExpand)] public string? Expand { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs index c360e55018..815cfed0f4 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs @@ -10,7 +10,6 @@ using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; using SdkBackupStatusResult = Azure.ResourceManager.RecoveryServicesBackup.Models.BackupStatusResult; @@ -27,14 +26,14 @@ public sealed partial class AzureBackupService(IRsvBackupOperations rsvOps, IDpp /// This preserves the documented contract that --subscription accepts both IDs and names. /// private async Task ResolveSubscriptionIdAsync( - string subscription, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string subscription, string? tenant, CancellationToken cancellationToken) { if (Guid.TryParse(subscription, out _)) { return subscription; } - var resource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var resource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); return resource.Data.SubscriptionId; } @@ -96,44 +95,44 @@ private static Exception BuildBothVaultListingsFailedException( public async Task CreateVaultAsync( string vaultName, string resourceGroup, string subscription, string vaultType, string location, string? sku, string? storageType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { // Perform validations that don't require a network call first so invalid input // fails fast without going through ResolveSubscriptionIdAsync (which may call ARM). VaultTypeResolver.ValidateVaultType(vaultType); - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); return VaultTypeResolver.IsRsv(vaultType) - ? await rsvOps.CreateVaultAsync(vaultName, resourceGroup, subscription, location, sku, storageType, tenant, retryPolicy, cancellationToken) - : await dppOps.CreateVaultAsync(vaultName, resourceGroup, subscription, location, sku, storageType, tenant, retryPolicy, cancellationToken); + ? await rsvOps.CreateVaultAsync(vaultName, resourceGroup, subscription, location, sku, storageType, tenant, cancellationToken) + : await dppOps.CreateVaultAsync(vaultName, resourceGroup, subscription, location, sku, storageType, tenant, cancellationToken); } public async Task GetVaultAsync( string vaultName, string resourceGroup, string subscription, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, + CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); if (VaultTypeResolver.IsVaultTypeSpecified(vaultType)) { return VaultTypeResolver.IsRsv(vaultType) - ? await rsvOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken, expand) - : await dppOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken, expand); + ? await rsvOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken, expand) + : await dppOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken, expand); } return await AutoDetectAndExecuteAsync( - () => rsvOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken, expand), - () => dppOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken, expand), + () => rsvOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken, expand), + () => dppOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken, expand), vaultName); } public async Task> ListVaultsAsync( string subscription, string? resourceGroup, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, + CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); List FilterByResourceGroup(List vaults) => string.IsNullOrEmpty(resourceGroup) ? vaults @@ -141,16 +140,16 @@ List FilterByResourceGroup(List vaults) => if (VaultTypeResolver.IsRsv(vaultType)) { - return FilterByResourceGroup(await rsvOps.ListVaultsAsync(subscription, tenant, retryPolicy, cancellationToken, expand)); + return FilterByResourceGroup(await rsvOps.ListVaultsAsync(subscription, tenant, cancellationToken, expand)); } if (VaultTypeResolver.IsDpp(vaultType)) { - return FilterByResourceGroup(await dppOps.ListVaultsAsync(subscription, tenant, retryPolicy, cancellationToken, expand)); + return FilterByResourceGroup(await dppOps.ListVaultsAsync(subscription, tenant, cancellationToken, expand)); } - var rsvTask = rsvOps.ListVaultsAsync(subscription, tenant, retryPolicy, cancellationToken, expand); - var dppTask = dppOps.ListVaultsAsync(subscription, tenant, retryPolicy, cancellationToken, expand); + var rsvTask = rsvOps.ListVaultsAsync(subscription, tenant, cancellationToken, expand); + var dppTask = dppOps.ListVaultsAsync(subscription, tenant, cancellationToken, expand); try { @@ -201,132 +200,132 @@ public async Task ProtectItemAsync( string? aksLabelSelectors, string? aksIncludeClusterScopeResources, string? aksSnapshotResourceGroup, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.ProtectItemAsync(vaultName, resourceGroup, subscription, datasourceId, policyName, containerName, datasourceType, tenant, retryPolicy, cancellationToken) - : await dppOps.ProtectItemAsync(vaultName, resourceGroup, subscription, datasourceId, policyName, datasourceType, aksIncludedNamespaces, aksExcludedNamespaces, aksLabelSelectors, aksIncludeClusterScopeResources, aksSnapshotResourceGroup, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ProtectItemAsync(vaultName, resourceGroup, subscription, datasourceId, policyName, containerName, datasourceType, tenant, cancellationToken) + : await dppOps.ProtectItemAsync(vaultName, resourceGroup, subscription, datasourceId, policyName, datasourceType, aksIncludedNamespaces, aksExcludedNamespaces, aksLabelSelectors, aksIncludeClusterScopeResources, aksSnapshotResourceGroup, tenant, cancellationToken); } public async Task GetProtectedItemAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string? vaultType, string? containerName, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.GetProtectedItemAsync(vaultName, resourceGroup, subscription, protectedItemName, containerName, tenant, retryPolicy, cancellationToken) - : await dppOps.GetProtectedItemAsync(vaultName, resourceGroup, subscription, protectedItemName, tenant, retryPolicy, cancellationToken); + ? await rsvOps.GetProtectedItemAsync(vaultName, resourceGroup, subscription, protectedItemName, containerName, tenant, cancellationToken) + : await dppOps.GetProtectedItemAsync(vaultName, resourceGroup, subscription, protectedItemName, tenant, cancellationToken); } public async Task> ListProtectedItemsAsync( string vaultName, string resourceGroup, string subscription, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken) - : await dppOps.ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken) + : await dppOps.ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); } public async Task UndeleteProtectedItemAsync( string vaultName, string resourceGroup, string subscription, string datasourceId, string? vaultType, string? containerName, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.UndeleteProtectedItemAsync(vaultName, resourceGroup, subscription, datasourceId, containerName, tenant, retryPolicy, cancellationToken) - : await dppOps.UndeleteProtectedItemAsync(vaultName, resourceGroup, subscription, datasourceId, tenant, retryPolicy, cancellationToken); + ? await rsvOps.UndeleteProtectedItemAsync(vaultName, resourceGroup, subscription, datasourceId, containerName, tenant, cancellationToken) + : await dppOps.UndeleteProtectedItemAsync(vaultName, resourceGroup, subscription, datasourceId, tenant, cancellationToken); } public async Task GetPolicyAsync( string vaultName, string resourceGroup, string subscription, string policyName, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.GetPolicyAsync(vaultName, resourceGroup, subscription, policyName, tenant, retryPolicy, cancellationToken) - : await dppOps.GetPolicyAsync(vaultName, resourceGroup, subscription, policyName, tenant, retryPolicy, cancellationToken); + ? await rsvOps.GetPolicyAsync(vaultName, resourceGroup, subscription, policyName, tenant, cancellationToken) + : await dppOps.GetPolicyAsync(vaultName, resourceGroup, subscription, policyName, tenant, cancellationToken); } public async Task> ListPoliciesAsync( string vaultName, string resourceGroup, string subscription, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.ListPoliciesAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken) - : await dppOps.ListPoliciesAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ListPoliciesAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken) + : await dppOps.ListPoliciesAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); } public async Task GetJobAsync( string vaultName, string resourceGroup, string subscription, string jobId, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.GetJobAsync(vaultName, resourceGroup, subscription, jobId, tenant, retryPolicy, cancellationToken) - : await dppOps.GetJobAsync(vaultName, resourceGroup, subscription, jobId, tenant, retryPolicy, cancellationToken); + ? await rsvOps.GetJobAsync(vaultName, resourceGroup, subscription, jobId, tenant, cancellationToken) + : await dppOps.GetJobAsync(vaultName, resourceGroup, subscription, jobId, tenant, cancellationToken); } public async Task> ListJobsAsync( string vaultName, string resourceGroup, string subscription, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.ListJobsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken) - : await dppOps.ListJobsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ListJobsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken) + : await dppOps.ListJobsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); } public async Task GetRecoveryPointAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string recoveryPointId, string? vaultType, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.GetRecoveryPointAsync(vaultName, resourceGroup, subscription, protectedItemName, recoveryPointId, containerName, tenant, retryPolicy, cancellationToken) - : await dppOps.GetRecoveryPointAsync(vaultName, resourceGroup, subscription, protectedItemName, recoveryPointId, tenant, retryPolicy, cancellationToken); + ? await rsvOps.GetRecoveryPointAsync(vaultName, resourceGroup, subscription, protectedItemName, recoveryPointId, containerName, tenant, cancellationToken) + : await dppOps.GetRecoveryPointAsync(vaultName, resourceGroup, subscription, protectedItemName, recoveryPointId, tenant, cancellationToken); } public async Task> ListRecoveryPointsAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string? vaultType, string? containerName, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolvedType = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolvedType) - ? await rsvOps.ListRecoveryPointsAsync(vaultName, resourceGroup, subscription, protectedItemName, containerName, tenant, retryPolicy, cancellationToken) - : await dppOps.ListRecoveryPointsAsync(vaultName, resourceGroup, subscription, protectedItemName, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ListRecoveryPointsAsync(vaultName, resourceGroup, subscription, protectedItemName, containerName, tenant, cancellationToken) + : await dppOps.ListRecoveryPointsAsync(vaultName, resourceGroup, subscription, protectedItemName, tenant, cancellationToken); } @@ -335,50 +334,50 @@ public async Task UpdateVaultAsync( string? vaultType, string? redundancy, string? softDelete, string? softDeleteRetentionDays, string? immutabilityState, string? identityType, string? tags, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolved) - ? await rsvOps.UpdateVaultAsync(vaultName, resourceGroup, subscription, redundancy, softDelete, softDeleteRetentionDays, immutabilityState, identityType, tags, tenant, retryPolicy, cancellationToken) - : await dppOps.UpdateVaultAsync(vaultName, resourceGroup, subscription, redundancy, softDelete, softDeleteRetentionDays, immutabilityState, identityType, tags, tenant, retryPolicy, cancellationToken); + ? await rsvOps.UpdateVaultAsync(vaultName, resourceGroup, subscription, redundancy, softDelete, softDeleteRetentionDays, immutabilityState, identityType, tags, tenant, cancellationToken) + : await dppOps.UpdateVaultAsync(vaultName, resourceGroup, subscription, redundancy, softDelete, softDeleteRetentionDays, immutabilityState, identityType, tags, tenant, cancellationToken); } public async Task CreatePolicyAsync( Policy.PolicyCreateRequest request, string vaultName, string resourceGroup, string subscription, string? vaultType, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolved) - ? await rsvOps.CreatePolicyAsync(request, vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken) - : await dppOps.CreatePolicyAsync(request, vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + ? await rsvOps.CreatePolicyAsync(request, vaultName, resourceGroup, subscription, tenant, cancellationToken) + : await dppOps.CreatePolicyAsync(request, vaultName, resourceGroup, subscription, tenant, cancellationToken); } public async Task UpdatePolicyAsync( string vaultName, string resourceGroup, string subscription, string policyName, string? vaultType, string? scheduleTime, string? dailyRetentionDays, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); if (!VaultTypeResolver.IsRsv(resolved)) { throw new ArgumentException("Update is only supported for RSV (Recovery Services vault) policies. DPP policies do not support update."); } - return await rsvOps.UpdatePolicyAsync(vaultName, resourceGroup, subscription, policyName, scheduleTime, dailyRetentionDays, tenant, retryPolicy, cancellationToken); + return await rsvOps.UpdatePolicyAsync(vaultName, resourceGroup, subscription, policyName, scheduleTime, dailyRetentionDays, tenant, cancellationToken); } public async Task> ListProtectableItemsAsync( string vaultName, string resourceGroup, string subscription, string? workloadType, string? containerName, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); if (VaultTypeResolver.IsDpp(vaultType)) { throw new ArgumentException("Protectable item discovery is only supported for Recovery Services (RSV) vaults. DPP datasources are protected by their ARM resource ID directly."); @@ -387,7 +386,7 @@ public async Task> ListProtectableItemsAsync( // Auto-detect vault type when not explicitly specified to avoid routing DPP vaults to RSV if (!VaultTypeResolver.IsVaultTypeSpecified(vaultType)) { - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); if (VaultTypeResolver.IsDpp(resolved)) { throw new ArgumentException( @@ -396,14 +395,14 @@ public async Task> ListProtectableItemsAsync( } } - return await rsvOps.ListProtectableItemsAsync(vaultName, resourceGroup, subscription, workloadType, containerName, tenant, retryPolicy, cancellationToken); + return await rsvOps.ListProtectableItemsAsync(vaultName, resourceGroup, subscription, workloadType, containerName, tenant, cancellationToken); } public async Task GetBackupStatusAsync( string datasourceId, string subscription, string location, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); ResourceIdentifier resourceId; try { @@ -433,7 +432,7 @@ public async Task> ListProtectableItemsAsync( if (datasourceType != null) { // RSV-supported resource types use the BackupStatus API - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subId = SubscriptionResource.CreateResourceIdentifier(subscription); var subResource = armClient.GetSubscriptionResource(subId); @@ -457,7 +456,7 @@ public async Task> ListProtectableItemsAsync( } // DPP-only resource types (disks, blobs, AKS, etc.) - search across DPP vaults - return await GetDppBackupStatusAsync(datasourceId, subscription, tenant, retryPolicy, cancellationToken); + return await GetDppBackupStatusAsync(datasourceId, subscription, tenant, cancellationToken); } /// @@ -466,15 +465,15 @@ public async Task> ListProtectableItemsAsync( /// private async Task GetDppBackupStatusAsync( string datasourceId, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - var dppVaults = await dppOps.ListVaultsAsync(subscription, tenant, retryPolicy, cancellationToken); + var dppVaults = await dppOps.ListVaultsAsync(subscription, tenant, cancellationToken); foreach (var vault in dppVaults.Where(v => v.Name is not null && v.ResourceGroup is not null)) { try { - var items = await dppOps.ListProtectedItemsAsync(vault.Name!, vault.ResourceGroup!, subscription, tenant, retryPolicy, cancellationToken); + var items = await dppOps.ListProtectedItemsAsync(vault.Name!, vault.ResourceGroup!, subscription, tenant, cancellationToken); var match = items.FirstOrDefault(i => string.Equals(i.DatasourceId, datasourceId, StringComparison.OrdinalIgnoreCase)); if (match != null) @@ -527,12 +526,12 @@ public async Task> ListProtectableItemsAsync( public async Task> FindUnprotectedResourcesAsync( string subscription, string? resourceTypeFilter, string? resourceGroup, string? tagFilter, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); // Step 1: List all vaults (RSV + DPP) in the subscription (parallelized) - var rsvVaultsTask = rsvOps.ListVaultsAsync(subscription, tenant, retryPolicy, cancellationToken); - var dppVaultsTask = dppOps.ListVaultsAsync(subscription, tenant, retryPolicy, cancellationToken); + var rsvVaultsTask = rsvOps.ListVaultsAsync(subscription, tenant, cancellationToken); + var dppVaultsTask = dppOps.ListVaultsAsync(subscription, tenant, cancellationToken); try { @@ -578,7 +577,7 @@ public async Task> FindUnprotectedResourcesAsync( try { return await rsvOps.ListProtectedItemsAsync( - v.Name!, v.ResourceGroup!, subscription, tenant, retryPolicy, cancellationToken); + v.Name!, v.ResourceGroup!, subscription, tenant, cancellationToken); } catch (OperationCanceledException) { @@ -610,7 +609,7 @@ public async Task> FindUnprotectedResourcesAsync( try { return await dppOps.ListProtectedItemsAsync( - v.Name!, v.ResourceGroup!, subscription, tenant, retryPolicy, cancellationToken); + v.Name!, v.ResourceGroup!, subscription, tenant, cancellationToken); } catch (OperationCanceledException) { @@ -636,7 +635,7 @@ public async Task> FindUnprotectedResourcesAsync( } // Step 3: List all resources of protectable types in the subscription - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subId = SubscriptionResource.CreateResourceIdentifier(subscription); var subResource = armClient.GetSubscriptionResource(subId); @@ -720,7 +719,7 @@ public async Task> FindUnprotectedResourcesAsync( try { return (Vault: v, Items: await rsvOps.ListDiscoveredProtectableItemsAsync( - v.Name!, v.ResourceGroup!, subscription, tenant, retryPolicy, cancellationToken)); + v.Name!, v.ResourceGroup!, subscription, tenant, cancellationToken)); } catch (OperationCanceledException) { @@ -783,16 +782,16 @@ public async Task> FindUnprotectedResourcesAsync( public async Task ConfigureImmutabilityAsync( string vaultName, string resourceGroup, string subscription, string immutabilityState, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); ArgumentException.ThrowIfNullOrWhiteSpace(immutabilityState, nameof(immutabilityState)); var normalizedState = NormalizeImmutabilityState(immutabilityState); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolved) - ? await rsvOps.ConfigureImmutabilityAsync(vaultName, resourceGroup, subscription, normalizedState, tenant, retryPolicy, cancellationToken) - : await dppOps.ConfigureImmutabilityAsync(vaultName, resourceGroup, subscription, normalizedState, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ConfigureImmutabilityAsync(vaultName, resourceGroup, subscription, normalizedState, tenant, cancellationToken) + : await dppOps.ConfigureImmutabilityAsync(vaultName, resourceGroup, subscription, normalizedState, tenant, cancellationToken); } /// @@ -815,51 +814,51 @@ private static string NormalizeImmutabilityState(string immutabilityState) => public async Task ConfigureSoftDeleteAsync( string vaultName, string resourceGroup, string subscription, string softDeleteState, string? vaultType, string? softDeleteRetentionDays, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolved) - ? await rsvOps.ConfigureSoftDeleteAsync(vaultName, resourceGroup, subscription, softDeleteState, softDeleteRetentionDays, tenant, retryPolicy, cancellationToken) - : await dppOps.ConfigureSoftDeleteAsync(vaultName, resourceGroup, subscription, softDeleteState, softDeleteRetentionDays, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ConfigureSoftDeleteAsync(vaultName, resourceGroup, subscription, softDeleteState, softDeleteRetentionDays, tenant, cancellationToken) + : await dppOps.ConfigureSoftDeleteAsync(vaultName, resourceGroup, subscription, softDeleteState, softDeleteRetentionDays, tenant, cancellationToken); } public async Task ConfigureCrossRegionRestoreAsync( string vaultName, string resourceGroup, string subscription, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); if (VaultTypeResolver.IsRsv(resolved)) { - return await rsvOps.ConfigureCrossRegionRestoreAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + return await rsvOps.ConfigureCrossRegionRestoreAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); } - return await dppOps.ConfigureCrossRegionRestoreAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + return await dppOps.ConfigureCrossRegionRestoreAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); } public async Task ConfigureMultiUserAuthorizationAsync( string vaultName, string resourceGroup, string subscription, string resourceGuardId, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolved) - ? await rsvOps.ConfigureMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, resourceGuardId, tenant, retryPolicy, cancellationToken) - : await dppOps.ConfigureMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, resourceGuardId, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ConfigureMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, resourceGuardId, tenant, cancellationToken) + : await dppOps.ConfigureMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, resourceGuardId, tenant, cancellationToken); } public async Task DisableMultiUserAuthorizationAsync( string vaultName, string resourceGroup, string subscription, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - subscription = await ResolveSubscriptionIdAsync(subscription, tenant, retryPolicy, cancellationToken); - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + subscription = await ResolveSubscriptionIdAsync(subscription, tenant, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolved) - ? await rsvOps.DisableMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken) - : await dppOps.DisableMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + ? await rsvOps.DisableMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken) + : await dppOps.DisableMultiUserAuthorizationAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); } public async Task ConfigureEncryptionAsync( @@ -867,19 +866,19 @@ public async Task ConfigureEncryptionAsync( string keyVaultUri, string keyName, string identityType, string? keyVersion, string? userAssignedIdentityId, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, retryPolicy, cancellationToken); + var resolved = await ResolveVaultTypeAsync(vaultName, resourceGroup, subscription, vaultType, tenant, cancellationToken); return VaultTypeResolver.IsRsv(resolved) - ? await rsvOps.ConfigureEncryptionAsync(vaultName, resourceGroup, subscription, keyVaultUri, keyName, identityType, keyVersion, userAssignedIdentityId, tenant, retryPolicy, cancellationToken) - : await dppOps.ConfigureEncryptionAsync(vaultName, resourceGroup, subscription, keyVaultUri, keyName, identityType, keyVersion, userAssignedIdentityId, tenant, retryPolicy, cancellationToken); + ? await rsvOps.ConfigureEncryptionAsync(vaultName, resourceGroup, subscription, keyVaultUri, keyName, identityType, keyVersion, userAssignedIdentityId, tenant, cancellationToken) + : await dppOps.ConfigureEncryptionAsync(vaultName, resourceGroup, subscription, keyVaultUri, keyName, identityType, keyVersion, userAssignedIdentityId, tenant, cancellationToken); } private async Task ResolveVaultTypeAsync( string vaultName, string resourceGroup, string subscription, string? vaultType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { if (VaultTypeResolver.IsVaultTypeSpecified(vaultType)) { @@ -888,7 +887,7 @@ private async Task ResolveVaultTypeAsync( try { - await rsvOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + await rsvOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); return VaultTypeResolver.Rsv; } catch (RequestFailedException ex) when (ex.Status is 401 or 403) @@ -902,7 +901,7 @@ private async Task ResolveVaultTypeAsync( try { - await dppOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + await dppOps.GetVaultAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); return VaultTypeResolver.Dpp; } catch (RequestFailedException ex) when (ex.Status is 401 or 403) diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppBackupOperations.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppBackupOperations.cs index cdb97c53ff..d692dcdcb1 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppBackupOperations.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppBackupOperations.cs @@ -8,7 +8,6 @@ using Azure.ResourceManager.DataProtectionBackup; using Azure.ResourceManager.DataProtectionBackup.Models; using Azure.ResourceManager.Resources; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AzureBackup.Services; @@ -35,7 +34,7 @@ internal static DppDatasourceProfile ResolveProfile(string datasourceTypeOrArm) public async Task CreateVaultAsync( string vaultName, string resourceGroup, string subscription, string location, string? sku, string? storageType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -43,7 +42,7 @@ public async Task CreateVaultAsync( (nameof(subscription), subscription), (nameof(location), location)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); var collection = rgResource.GetDataProtectionBackupVaults(); @@ -87,7 +86,7 @@ public async Task CreateVaultAsync( public async Task GetVaultAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, + string? tenant, CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None) { ValidateRequiredParameters( @@ -95,7 +94,7 @@ public async Task GetVaultAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -109,12 +108,12 @@ public async Task GetVaultAsync( public async Task> ListVaultsAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, + CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None) { ValidateRequiredParameters((nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subId = SubscriptionResource.CreateResourceIdentifier(subscription); var subResource = armClient.GetSubscriptionResource(subId); @@ -152,7 +151,7 @@ public async Task ProtectItemAsync( string? aksIncludedNamespaces, string? aksExcludedNamespaces, string? aksLabelSelectors, string? aksIncludeClusterScopeResources, string? aksSnapshotResourceGroup, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -161,7 +160,7 @@ public async Task ProtectItemAsync( (nameof(datasourceId), datasourceId), (nameof(policyName), policyName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var vaultData = await vaultResource.GetAsync(cancellationToken); @@ -357,7 +356,7 @@ public async Task ProtectItemAsync( public async Task GetProtectedItemAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -365,7 +364,7 @@ public async Task GetProtectedItemAsync( (nameof(subscription), subscription), (nameof(protectedItemName), protectedItemName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); // First try direct lookup by exact instance name try @@ -381,7 +380,7 @@ public async Task GetProtectedItemAsync( } // Fall back to listing all items and searching by friendly name - var items = await ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + var items = await ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); var found = items.FirstOrDefault(i => (!string.IsNullOrEmpty(i.Name) && i.Name.Equals(protectedItemName, StringComparison.OrdinalIgnoreCase)) || MatchesDppFriendlyName(i, protectedItemName)); @@ -411,14 +410,14 @@ private static bool MatchesDppFriendlyName(ProtectedItemInfo item, string friend public async Task> ListProtectedItemsAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var collection = vaultResource.GetDataProtectionBackupInstances(); @@ -435,7 +434,7 @@ public async Task> ListProtectedItemsAsync( public async Task GetPolicyAsync( string vaultName, string resourceGroup, string subscription, string policyName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -443,7 +442,7 @@ public async Task GetPolicyAsync( (nameof(subscription), subscription), (nameof(policyName), policyName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var policyId = DataProtectionBackupPolicyResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName, policyName); var policyResource = armClient.GetDataProtectionBackupPolicyResource(policyId); @@ -458,7 +457,7 @@ public async Task GetPolicyAsync( // retention/duration fields (XmlConvert.ToTimeSpan limitation in // DataProtectionBackupAbsoluteDeleteSetting). Fall back to listing all // policies and matching by name to work around this SDK limitation. - var policies = await ListPoliciesAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + var policies = await ListPoliciesAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); return policies.FirstOrDefault(p => p.Name == policyName) ?? throw new KeyNotFoundException( $"Policy '{policyName}' not found in vault '{vaultName}'. " + @@ -468,14 +467,14 @@ public async Task GetPolicyAsync( public async Task> ListPoliciesAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var collection = vaultResource.GetDataProtectionBackupPolicies(); @@ -525,7 +524,7 @@ public async Task> ListPoliciesAsync( public async Task UndeleteProtectedItemAsync( string vaultName, string resourceGroup, string subscription, string datasourceId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -533,7 +532,7 @@ public async Task UndeleteProtectedItemAsync( (nameof(subscription), subscription), (nameof(datasourceId), datasourceId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); @@ -571,7 +570,7 @@ public async Task UndeleteProtectedItemAsync( public async Task GetJobAsync( string vaultName, string resourceGroup, string subscription, string jobId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -579,7 +578,7 @@ public async Task GetJobAsync( (nameof(subscription), subscription), (nameof(jobId), jobId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var jobResourceId = DataProtectionBackupJobResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName, jobId); var jobResource = armClient.GetDataProtectionBackupJobResource(jobResourceId); @@ -598,7 +597,7 @@ public async Task GetJobAsync( // exist beyond the point where the enumerator broke. Re-throw FormatException // (not KeyNotFoundException) to preserve SDK-parse-failure semantics. // Tracked in azure-sdk-for-net#59306. - var jobs = await ListJobsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + var jobs = await ListJobsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); return jobs.FirstOrDefault(j => j.Name == jobId) ?? throw new FormatException($"Job '{jobId}' exists but the Azure SDK cannot parse its duration field (XmlConvert.ToTimeSpan limitation)."); } @@ -606,14 +605,14 @@ public async Task GetJobAsync( public async Task> ListJobsAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var collection = vaultResource.GetDataProtectionBackupJobs(); @@ -661,7 +660,7 @@ public async Task> ListJobsAsync( public async Task GetRecoveryPointAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string recoveryPointId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -670,7 +669,7 @@ public async Task GetRecoveryPointAsync( (nameof(protectedItemName), protectedItemName), (nameof(recoveryPointId), recoveryPointId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rpId = DataProtectionBackupRecoveryPointResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName, protectedItemName, recoveryPointId); var rpResource = armClient.GetDataProtectionBackupRecoveryPointResource(rpId); var rp = await rpResource.GetAsync(cancellationToken); @@ -681,7 +680,7 @@ public async Task GetRecoveryPointAsync( public async Task> ListRecoveryPointsAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -689,7 +688,7 @@ public async Task> ListRecoveryPointsAsync( (nameof(subscription), subscription), (nameof(protectedItemName), protectedItemName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var instanceId = DataProtectionBackupInstanceResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName, protectedItemName); var instanceResource = armClient.GetDataProtectionBackupInstanceResource(instanceId); var collection = instanceResource.GetDataProtectionBackupRecoveryPoints(); @@ -708,7 +707,7 @@ public async Task UpdateVaultAsync( string vaultName, string resourceGroup, string subscription, string? redundancy, string? softDelete, string? softDeleteRetentionDays, string? immutabilityState, string? identityType, string? tags, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -722,7 +721,7 @@ public async Task UpdateVaultAsync( "Set --storage-type during vault creation instead."); } - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -789,7 +788,7 @@ public async Task UpdateVaultAsync( public async Task CreatePolicyAsync( Policy.PolicyCreateRequest request, string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ArgumentNullException.ThrowIfNull(request); @@ -803,7 +802,7 @@ public async Task CreatePolicyAsync( (nameof(policyName), policyName), (nameof(workloadType), workloadType)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var collection = vaultResource.GetDataProtectionBackupPolicies(); @@ -829,14 +828,14 @@ public async Task CreatePolicyAsync( public async Task ConfigureCrossRegionRestoreAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); @@ -879,7 +878,7 @@ private static Azure.ResourceManager.Models.ManagedServiceIdentityType ParseIden public async Task ConfigureImmutabilityAsync( string vaultName, string resourceGroup, string subscription, - string immutabilityState, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string immutabilityState, string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -887,7 +886,7 @@ public async Task ConfigureImmutabilityAsync( (nameof(subscription), subscription), (nameof(immutabilityState), immutabilityState)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); @@ -910,7 +909,7 @@ public async Task ConfigureImmutabilityAsync( public async Task ConfigureSoftDeleteAsync( string vaultName, string resourceGroup, string subscription, string softDeleteState, string? softDeleteRetentionDays, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -918,7 +917,7 @@ public async Task ConfigureSoftDeleteAsync( (nameof(subscription), subscription), (nameof(softDeleteState), softDeleteState)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); @@ -950,7 +949,7 @@ public async Task ConfigureSoftDeleteAsync( public async Task ConfigureMultiUserAuthorizationAsync( string vaultName, string resourceGroup, string subscription, - string resourceGuardId, string? tenant, RetryPolicyOptions? retryPolicy, + string resourceGuardId, string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -959,7 +958,7 @@ public async Task ConfigureMultiUserAuthorizationAsync( (nameof(subscription), subscription), (nameof(resourceGuardId), resourceGuardId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); var proxyCollection = vaultResource.GetResourceGuardProxyBaseResources(); @@ -984,7 +983,7 @@ public async Task ConfigureMultiUserAuthorizationAsync( public async Task DisableMultiUserAuthorizationAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -992,7 +991,7 @@ public async Task DisableMultiUserAuthorizationAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); @@ -1007,7 +1006,7 @@ public async Task ConfigureEncryptionAsync( string vaultName, string resourceGroup, string subscription, string keyVaultUri, string keyName, string identityType, string? keyVersion, string? userAssignedIdentityId, - string? tenant, RetryPolicyOptions? retryPolicy, + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -1039,7 +1038,7 @@ public async Task ConfigureEncryptionAsync( ? $"{kvUri}/keys/{keyName}" : $"{kvUri}/keys/{keyName}/{keyVersion}"; - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = DataProtectionBackupVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId); diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs index 214b915910..6ced365c90 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs @@ -2,53 +2,52 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.AzureBackup.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AzureBackup.Services; public interface IAzureBackupService { // Vault operations - Task CreateVaultAsync(string vaultName, string resourceGroup, string subscription, string vaultType, string location, string? sku = null, string? storageType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task GetVaultAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default, VaultExpand expand = VaultExpand.None); - Task> ListVaultsAsync(string subscription, string? resourceGroup = null, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default, VaultExpand expand = VaultExpand.None); - Task UpdateVaultAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? redundancy = null, string? softDelete = null, string? softDeleteRetentionDays = null, string? immutabilityState = null, string? identityType = null, string? tags = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task CreateVaultAsync(string vaultName, string resourceGroup, string subscription, string vaultType, string location, string? sku = null, string? storageType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task GetVaultAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default, VaultExpand expand = VaultExpand.None); + Task> ListVaultsAsync(string subscription, string? resourceGroup = null, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default, VaultExpand expand = VaultExpand.None); + Task UpdateVaultAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? redundancy = null, string? softDelete = null, string? softDeleteRetentionDays = null, string? immutabilityState = null, string? identityType = null, string? tags = null, string? tenant = null, CancellationToken cancellationToken = default); // Policy operations - Task GetPolicyAsync(string vaultName, string resourceGroup, string subscription, string policyName, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task> ListPoliciesAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task CreatePolicyAsync(Policy.PolicyCreateRequest request, string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task UpdatePolicyAsync(string vaultName, string resourceGroup, string subscription, string policyName, string? vaultType = null, string? scheduleTime = null, string? dailyRetentionDays = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetPolicyAsync(string vaultName, string resourceGroup, string subscription, string policyName, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task> ListPoliciesAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task CreatePolicyAsync(Policy.PolicyCreateRequest request, string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task UpdatePolicyAsync(string vaultName, string resourceGroup, string subscription, string policyName, string? vaultType = null, string? scheduleTime = null, string? dailyRetentionDays = null, string? tenant = null, CancellationToken cancellationToken = default); // Protection operations - Task ProtectItemAsync(string vaultName, string resourceGroup, string subscription, string datasourceId, string policyName, string? vaultType = null, string? containerName = null, string? datasourceType = null, string? aksIncludedNamespaces = null, string? aksExcludedNamespaces = null, string? aksLabelSelectors = null, string? aksIncludeClusterScopeResources = null, string? aksSnapshotResourceGroup = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task GetProtectedItemAsync(string vaultName, string resourceGroup, string subscription, string protectedItemName, string? vaultType = null, string? containerName = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task> ListProtectedItemsAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task> ListProtectableItemsAsync(string vaultName, string resourceGroup, string subscription, string? workloadType = null, string? containerName = null, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task UndeleteProtectedItemAsync(string vaultName, string resourceGroup, string subscription, string datasourceId, string? vaultType = null, string? containerName = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task ProtectItemAsync(string vaultName, string resourceGroup, string subscription, string datasourceId, string policyName, string? vaultType = null, string? containerName = null, string? datasourceType = null, string? aksIncludedNamespaces = null, string? aksExcludedNamespaces = null, string? aksLabelSelectors = null, string? aksIncludeClusterScopeResources = null, string? aksSnapshotResourceGroup = null, string? tenant = null, CancellationToken cancellationToken = default); + Task GetProtectedItemAsync(string vaultName, string resourceGroup, string subscription, string protectedItemName, string? vaultType = null, string? containerName = null, string? tenant = null, CancellationToken cancellationToken = default); + Task> ListProtectedItemsAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task> ListProtectableItemsAsync(string vaultName, string resourceGroup, string subscription, string? workloadType = null, string? containerName = null, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task UndeleteProtectedItemAsync(string vaultName, string resourceGroup, string subscription, string datasourceId, string? vaultType = null, string? containerName = null, string? tenant = null, CancellationToken cancellationToken = default); // Job operations - Task GetJobAsync(string vaultName, string resourceGroup, string subscription, string jobId, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task> ListJobsAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetJobAsync(string vaultName, string resourceGroup, string subscription, string jobId, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task> ListJobsAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); // Recovery point operations - Task GetRecoveryPointAsync(string vaultName, string resourceGroup, string subscription, string protectedItemName, string recoveryPointId, string? vaultType = null, string? containerName = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task> ListRecoveryPointsAsync(string vaultName, string resourceGroup, string subscription, string protectedItemName, string? vaultType = null, string? containerName = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetRecoveryPointAsync(string vaultName, string resourceGroup, string subscription, string protectedItemName, string recoveryPointId, string? vaultType = null, string? containerName = null, string? tenant = null, CancellationToken cancellationToken = default); + Task> ListRecoveryPointsAsync(string vaultName, string resourceGroup, string subscription, string protectedItemName, string? vaultType = null, string? containerName = null, string? tenant = null, CancellationToken cancellationToken = default); // Backup status - Task GetBackupStatusAsync(string datasourceId, string subscription, string location, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetBackupStatusAsync(string datasourceId, string subscription, string location, string? tenant = null, CancellationToken cancellationToken = default); // Governance - Task> FindUnprotectedResourcesAsync(string subscription, string? resourceTypeFilter = null, string? resourceGroup = null, string? tagFilter = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task ConfigureImmutabilityAsync(string vaultName, string resourceGroup, string subscription, string immutabilityState, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task ConfigureSoftDeleteAsync(string vaultName, string resourceGroup, string subscription, string softDeleteState, string? vaultType = null, string? softDeleteRetentionDays = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> FindUnprotectedResourcesAsync(string subscription, string? resourceTypeFilter = null, string? resourceGroup = null, string? tagFilter = null, string? tenant = null, CancellationToken cancellationToken = default); + Task ConfigureImmutabilityAsync(string vaultName, string resourceGroup, string subscription, string immutabilityState, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task ConfigureSoftDeleteAsync(string vaultName, string resourceGroup, string subscription, string softDeleteState, string? vaultType = null, string? softDeleteRetentionDays = null, string? tenant = null, CancellationToken cancellationToken = default); // DR - Task ConfigureCrossRegionRestoreAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task ConfigureCrossRegionRestoreAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); // Security - Task ConfigureMultiUserAuthorizationAsync(string vaultName, string resourceGroup, string subscription, string resourceGuardId, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task DisableMultiUserAuthorizationAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); - Task ConfigureEncryptionAsync(string vaultName, string resourceGroup, string subscription, string keyVaultUri, string keyName, string identityType, string? keyVersion = null, string? userAssignedIdentityId = null, string? vaultType = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task ConfigureMultiUserAuthorizationAsync(string vaultName, string resourceGroup, string subscription, string resourceGuardId, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task DisableMultiUserAuthorizationAsync(string vaultName, string resourceGroup, string subscription, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); + Task ConfigureEncryptionAsync(string vaultName, string resourceGroup, string subscription, string keyVaultUri, string keyName, string identityType, string? keyVersion = null, string? userAssignedIdentityId = null, string? vaultType = null, string? tenant = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IDppBackupOperations.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IDppBackupOperations.cs index edb7b29e5b..a2653aea8c 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IDppBackupOperations.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IDppBackupOperations.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.AzureBackup.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AzureBackup.Services; @@ -16,7 +15,6 @@ Task CreateVaultAsync( string? sku, string? storageType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetVaultAsync( @@ -24,14 +22,12 @@ Task GetVaultAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None); Task> ListVaultsAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None); @@ -46,7 +42,6 @@ Task UpdateVaultAsync( string? identityType, string? tags, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetPolicyAsync( @@ -55,7 +50,6 @@ Task GetPolicyAsync( string subscription, string policyName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListPoliciesAsync( @@ -63,7 +57,6 @@ Task> ListPoliciesAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task CreatePolicyAsync( @@ -72,7 +65,6 @@ Task CreatePolicyAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ProtectItemAsync( @@ -88,7 +80,6 @@ Task ProtectItemAsync( string? aksIncludeClusterScopeResources, string? aksSnapshotResourceGroup, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetProtectedItemAsync( @@ -97,7 +88,6 @@ Task GetProtectedItemAsync( string subscription, string protectedItemName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListProtectedItemsAsync( @@ -105,7 +95,6 @@ Task> ListProtectedItemsAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task UndeleteProtectedItemAsync( @@ -114,7 +103,6 @@ Task UndeleteProtectedItemAsync( string subscription, string datasourceId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetJobAsync( @@ -123,7 +111,6 @@ Task GetJobAsync( string subscription, string jobId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListJobsAsync( @@ -131,7 +118,6 @@ Task> ListJobsAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetRecoveryPointAsync( @@ -141,7 +127,6 @@ Task GetRecoveryPointAsync( string protectedItemName, string recoveryPointId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListRecoveryPointsAsync( @@ -150,7 +135,6 @@ Task> ListRecoveryPointsAsync( string subscription, string protectedItemName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureImmutabilityAsync( @@ -159,7 +143,6 @@ Task ConfigureImmutabilityAsync( string subscription, string immutabilityState, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureSoftDeleteAsync( @@ -169,7 +152,6 @@ Task ConfigureSoftDeleteAsync( string softDeleteState, string? softDeleteRetentionDays, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureCrossRegionRestoreAsync( @@ -177,7 +159,6 @@ Task ConfigureCrossRegionRestoreAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureMultiUserAuthorizationAsync( @@ -186,7 +167,6 @@ Task ConfigureMultiUserAuthorizationAsync( string subscription, string resourceGuardId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task DisableMultiUserAuthorizationAsync( @@ -194,7 +174,6 @@ Task DisableMultiUserAuthorizationAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureEncryptionAsync( @@ -207,6 +186,5 @@ Task ConfigureEncryptionAsync( string? keyVersion, string? userAssignedIdentityId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IRsvBackupOperations.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IRsvBackupOperations.cs index 699c1c3a93..21819a2e98 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IRsvBackupOperations.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/IRsvBackupOperations.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.AzureBackup.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AzureBackup.Services; @@ -16,7 +15,6 @@ Task CreateVaultAsync( string? sku, string? storageType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetVaultAsync( @@ -24,14 +22,12 @@ Task GetVaultAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None); Task> ListVaultsAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None); @@ -46,7 +42,6 @@ Task UpdateVaultAsync( string? identityType, string? tags, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetPolicyAsync( @@ -55,7 +50,6 @@ Task GetPolicyAsync( string subscription, string policyName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListPoliciesAsync( @@ -63,7 +57,6 @@ Task> ListPoliciesAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task CreatePolicyAsync( @@ -72,7 +65,6 @@ Task CreatePolicyAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task UpdatePolicyAsync( @@ -83,7 +75,6 @@ Task UpdatePolicyAsync( string? scheduleTime, string? dailyRetentionDays, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ProtectItemAsync( @@ -95,7 +86,6 @@ Task ProtectItemAsync( string? containerName, string? datasourceType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetProtectedItemAsync( @@ -105,7 +95,6 @@ Task GetProtectedItemAsync( string protectedItemName, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListProtectedItemsAsync( @@ -113,7 +102,6 @@ Task> ListProtectedItemsAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListProtectableItemsAsync( @@ -123,7 +111,6 @@ Task> ListProtectableItemsAsync( string? workloadType, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task UndeleteProtectedItemAsync( @@ -133,7 +120,6 @@ Task UndeleteProtectedItemAsync( string datasourceId, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetJobAsync( @@ -142,7 +128,6 @@ Task GetJobAsync( string subscription, string jobId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListJobsAsync( @@ -150,7 +135,6 @@ Task> ListJobsAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task GetRecoveryPointAsync( @@ -161,7 +145,6 @@ Task GetRecoveryPointAsync( string recoveryPointId, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListRecoveryPointsAsync( @@ -171,7 +154,6 @@ Task> ListRecoveryPointsAsync( string protectedItemName, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureImmutabilityAsync( @@ -180,7 +162,6 @@ Task ConfigureImmutabilityAsync( string subscription, string immutabilityState, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureSoftDeleteAsync( @@ -190,7 +171,6 @@ Task ConfigureSoftDeleteAsync( string softDeleteState, string? softDeleteRetentionDays, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureCrossRegionRestoreAsync( @@ -198,7 +178,6 @@ Task ConfigureCrossRegionRestoreAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureMultiUserAuthorizationAsync( @@ -207,7 +186,6 @@ Task ConfigureMultiUserAuthorizationAsync( string subscription, string resourceGuardId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task DisableMultiUserAuthorizationAsync( @@ -215,7 +193,6 @@ Task DisableMultiUserAuthorizationAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task> ListDiscoveredProtectableItemsAsync( @@ -223,7 +200,6 @@ Task> ListDiscoveredProtectableItemsAsync( string resourceGroup, string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); Task ConfigureEncryptionAsync( @@ -236,6 +212,5 @@ Task ConfigureEncryptionAsync( string? keyVersion, string? userAssignedIdentityId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.cs index 522b5b033c..4d66f801cc 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.cs @@ -10,7 +10,6 @@ using Azure.ResourceManager.RecoveryServicesBackup; using Azure.ResourceManager.RecoveryServicesBackup.Models; using Azure.ResourceManager.Resources; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AzureBackup.Services; @@ -22,7 +21,7 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS public async Task CreateVaultAsync( string vaultName, string resourceGroup, string subscription, string location, string? sku, string? storageType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -30,7 +29,7 @@ public async Task CreateVaultAsync( (nameof(subscription), subscription), (nameof(location), location)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); var collection = rgResource.GetRecoveryServicesVaults(); @@ -58,7 +57,7 @@ public async Task CreateVaultAsync( public async Task GetVaultAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, + string? tenant, CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None) { ValidateRequiredParameters( @@ -66,7 +65,7 @@ public async Task GetVaultAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -80,12 +79,12 @@ public async Task GetVaultAsync( public async Task> ListVaultsAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, + CancellationToken cancellationToken, VaultExpand expand = VaultExpand.None) { ValidateRequiredParameters((nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subId = SubscriptionResource.CreateResourceIdentifier(subscription); var subResource = armClient.GetSubscriptionResource(subId); @@ -124,7 +123,7 @@ public async Task ProtectItemAsync( string vaultName, string resourceGroup, string subscription, string datasourceId, string policyName, string? containerName, string? datasourceType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -133,7 +132,7 @@ public async Task ProtectItemAsync( (nameof(datasourceId), datasourceId), (nameof(policyName), policyName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultId); @@ -262,7 +261,7 @@ public async Task ProtectItemAsync( public async Task GetProtectedItemAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -270,12 +269,12 @@ public async Task GetProtectedItemAsync( (nameof(subscription), subscription), (nameof(protectedItemName), protectedItemName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); if (string.IsNullOrEmpty(containerName)) { // Search by both internal RSV name and friendly/datasource name - var items = await ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + var items = await ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); var found = items.FirstOrDefault(i => (!string.IsNullOrEmpty(i.Name) && i.Name.Equals(protectedItemName, StringComparison.OrdinalIgnoreCase)) || MatchesFriendlyName(i, protectedItemName)); @@ -327,14 +326,14 @@ private static bool MatchesFriendlyName(ProtectedItemInfo item, string friendlyN public async Task> ListProtectedItemsAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); @@ -350,7 +349,7 @@ public async Task> ListProtectedItemsAsync( public async Task GetPolicyAsync( string vaultName, string resourceGroup, string subscription, string policyName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -358,7 +357,7 @@ public async Task GetPolicyAsync( (nameof(subscription), subscription), (nameof(policyName), policyName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var policyId = BackupProtectionPolicyResource.CreateResourceIdentifier( subscription, resourceGroup, vaultName, policyName); var policyResource = armClient.GetBackupProtectionPolicyResource(policyId); @@ -369,14 +368,14 @@ public async Task GetPolicyAsync( public async Task> ListPoliciesAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); @@ -392,7 +391,7 @@ public async Task> ListPoliciesAsync( public async Task GetJobAsync( string vaultName, string resourceGroup, string subscription, string jobId, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -400,7 +399,7 @@ public async Task GetJobAsync( (nameof(subscription), subscription), (nameof(jobId), jobId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var jobResourceId = BackupJobResource.CreateResourceIdentifier( subscription, resourceGroup, vaultName, jobId); var jobResource = armClient.GetBackupJobResource(jobResourceId); @@ -411,14 +410,14 @@ public async Task GetJobAsync( public async Task> ListJobsAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); @@ -434,7 +433,7 @@ public async Task> ListJobsAsync( public async Task GetRecoveryPointAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string recoveryPointId, string? containerName, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -447,12 +446,12 @@ public async Task GetRecoveryPointAsync( { // Auto-discover container from protected items list var resolvedItem = await ResolveProtectedItemContainerAsync( - vaultName, resourceGroup, subscription, protectedItemName, tenant, retryPolicy, cancellationToken); + vaultName, resourceGroup, subscription, protectedItemName, tenant, cancellationToken); containerName = resolvedItem.ContainerName; protectedItemName = resolvedItem.Name; } - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rpId = BackupRecoveryPointResource.CreateResourceIdentifier( subscription, resourceGroup, vaultName, FabricName, containerName!, protectedItemName, recoveryPointId); var rpResource = armClient.GetBackupRecoveryPointResource(rpId); @@ -464,7 +463,7 @@ public async Task GetRecoveryPointAsync( public async Task> ListRecoveryPointsAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string? containerName, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -476,12 +475,12 @@ public async Task> ListRecoveryPointsAsync( { // Auto-discover container from protected items list var resolvedItem = await ResolveProtectedItemContainerAsync( - vaultName, resourceGroup, subscription, protectedItemName, tenant, retryPolicy, cancellationToken); + vaultName, resourceGroup, subscription, protectedItemName, tenant, cancellationToken); containerName = resolvedItem.ContainerName; protectedItemName = resolvedItem.Name; } - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var itemId = BackupProtectedItemResource.CreateResourceIdentifier( subscription, resourceGroup, vaultName, FabricName, containerName!, protectedItemName); var itemResource = armClient.GetBackupProtectedItemResource(itemId); @@ -504,9 +503,9 @@ public async Task> ListRecoveryPointsAsync( private async Task ResolveProtectedItemContainerAsync( string vaultName, string resourceGroup, string subscription, string protectedItemName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { - var items = await ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, retryPolicy, cancellationToken); + var items = await ListProtectedItemsAsync(vaultName, resourceGroup, subscription, tenant, cancellationToken); var found = items.FirstOrDefault(i => (!string.IsNullOrEmpty(i.Name) && i.Name.Equals(protectedItemName, StringComparison.OrdinalIgnoreCase)) || MatchesFriendlyName(i, protectedItemName)); @@ -527,14 +526,14 @@ public async Task UpdateVaultAsync( string vaultName, string resourceGroup, string subscription, string? redundancy, string? softDelete, string? softDeleteRetentionDays, string? immutabilityState, string? identityType, string? tags, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -577,12 +576,12 @@ public async Task UpdateVaultAsync( // since RSV vault patch only supports identity and tag updates. if (!string.IsNullOrEmpty(softDelete)) { - await ConfigureSoftDeleteAsync(vaultName, resourceGroup, subscription, softDelete, softDeleteRetentionDays, tenant, retryPolicy, cancellationToken); + await ConfigureSoftDeleteAsync(vaultName, resourceGroup, subscription, softDelete, softDeleteRetentionDays, tenant, cancellationToken); } if (!string.IsNullOrEmpty(immutabilityState)) { - await ConfigureImmutabilityAsync(vaultName, resourceGroup, subscription, immutabilityState, tenant, retryPolicy, cancellationToken); + await ConfigureImmutabilityAsync(vaultName, resourceGroup, subscription, immutabilityState, tenant, cancellationToken); } return new OperationResult("Succeeded", null, $"Vault '{vaultName}' updated successfully."); @@ -609,7 +608,7 @@ private static async Task ConfigureStorageRedundancyAsync( public async Task CreatePolicyAsync( Policy.PolicyCreateRequest request, string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ArgumentNullException.ThrowIfNull(request); @@ -623,7 +622,7 @@ public async Task CreatePolicyAsync( (nameof(policyName), policyName), (nameof(workloadType), workloadType)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultResourceId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultResourceId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -677,7 +676,7 @@ public async Task UpdatePolicyAsync( string vaultName, string resourceGroup, string subscription, string policyName, string? scheduleTime, string? dailyRetentionDays, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -685,7 +684,7 @@ public async Task UpdatePolicyAsync( (nameof(subscription), subscription), (nameof(policyName), policyName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); var policyCollection = rgResource.GetBackupProtectionPolicies(vaultName); @@ -845,7 +844,7 @@ private static DateTimeOffset NormalizeScheduleTime(DateTimeOffset input) => public async Task ConfigureImmutabilityAsync( string vaultName, string resourceGroup, string subscription, - string immutabilityState, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string immutabilityState, string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -853,7 +852,7 @@ public async Task ConfigureImmutabilityAsync( (nameof(subscription), subscription), (nameof(immutabilityState), immutabilityState)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -877,7 +876,7 @@ public async Task ConfigureImmutabilityAsync( public async Task ConfigureSoftDeleteAsync( string vaultName, string resourceGroup, string subscription, string softDeleteState, string? softDeleteRetentionDays, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -885,7 +884,7 @@ public async Task ConfigureSoftDeleteAsync( (nameof(subscription), subscription), (nameof(softDeleteState), softDeleteState)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -927,14 +926,14 @@ public async Task ConfigureSoftDeleteAsync( public async Task ConfigureCrossRegionRestoreAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -992,7 +991,7 @@ public async Task ConfigureCrossRegionRestoreAsync( public async Task ConfigureMultiUserAuthorizationAsync( string vaultName, string resourceGroup, string subscription, - string resourceGuardId, string? tenant, RetryPolicyOptions? retryPolicy, + string resourceGuardId, string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -1001,7 +1000,7 @@ public async Task ConfigureMultiUserAuthorizationAsync( (nameof(subscription), subscription), (nameof(resourceGuardId), resourceGuardId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); @@ -1027,7 +1026,7 @@ public async Task ConfigureMultiUserAuthorizationAsync( public async Task DisableMultiUserAuthorizationAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -1035,7 +1034,7 @@ public async Task DisableMultiUserAuthorizationAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); @@ -1052,7 +1051,7 @@ public async Task ConfigureEncryptionAsync( string vaultName, string resourceGroup, string subscription, string keyVaultUri, string keyName, string identityType, string? keyVersion, string? userAssignedIdentityId, - string? tenant, RetryPolicyOptions? retryPolicy, + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -1082,7 +1081,7 @@ public async Task ConfigureEncryptionAsync( ? $"{kvUri}/keys/{keyName}" : $"{kvUri}/keys/{keyName}/{keyVersion}"; - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var vaultId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscription, resourceGroup, vaultName); var vaultResource = armClient.GetRecoveryServicesVaultResource(vaultId); var vault = await vaultResource.GetAsync(cancellationToken); @@ -1399,7 +1398,7 @@ private static RecoveryPointInfo MapToRecoveryPointInfo(BackupRecoveryPointData public async Task UndeleteProtectedItemAsync( string vaultName, string resourceGroup, string subscription, string datasourceId, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), @@ -1407,7 +1406,7 @@ public async Task UndeleteProtectedItemAsync( (nameof(subscription), subscription), (nameof(datasourceId), datasourceId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); // Find the soft-deleted protected item by datasource ID var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); @@ -1678,14 +1677,14 @@ private static async Task BuildRsvProtectResultAsync( public async Task> ListProtectableItemsAsync( string vaultName, string resourceGroup, string subscription, string? workloadType, string? containerName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); @@ -1712,14 +1711,14 @@ public async Task> ListProtectableItemsAsync( public async Task> ListDiscoveredProtectableItemsAsync( string vaultName, string resourceGroup, string subscription, - string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + string? tenant, CancellationToken cancellationToken) { ValidateRequiredParameters( (nameof(vaultName), vaultName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup); var rgResource = armClient.GetResourceGroupResource(rgId); diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Backup/BackupStatusCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Backup/BackupStatusCommandTests.cs index d1b08dec96..a03c9e2858 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Backup/BackupStatusCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Backup/BackupStatusCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Backup; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ReturnsProtectedStatus_WhenResourceIsProtected() Arg.Is("sub1"), Arg.Is("eastus"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expected); @@ -81,7 +79,6 @@ public async Task ExecuteAsync_ReturnsNotProtectedStatus_WhenResourceIsNotProtec Arg.Is("sub1"), Arg.Is("eastus"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expected); @@ -108,7 +105,6 @@ public async Task ExecuteAsync_HandlesGenericException() Arg.Is("sub1"), Arg.Is("eastus"), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -132,7 +128,6 @@ public async Task ExecuteAsync_HandlesNotFoundError() Arg.Is("sub1"), Arg.Is("eastus"), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); @@ -156,7 +151,6 @@ public async Task ExecuteAsync_HandlesForbiddenError() Arg.Is("sub1"), Arg.Is("eastus"), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); @@ -185,7 +179,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Is("sub1"), Arg.Is("eastus"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new BackupStatusResult("ds1", "Protected", "v1", "pol", null, null, null)); } @@ -223,7 +216,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Is("sub1"), Arg.Is("eastus"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expected); @@ -269,7 +261,6 @@ public async Task ExecuteAsync_PassesCorrectParametersToService() Arg.Is(expectedSubscription), Arg.Is(expectedLocation), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new BackupStatusResult(expectedDatasourceId, "Protected", null, null, null, null, null)); @@ -285,7 +276,6 @@ await Service.Received(1).GetBackupStatusAsync( expectedSubscription, expectedLocation, Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/DisasterRecovery/DisasterRecoveryEnableCrrCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/DisasterRecovery/DisasterRecoveryEnableCrrCommandTests.cs index 0d22fefa11..05f8260058 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/DisasterRecovery/DisasterRecoveryEnableCrrCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/DisasterRecovery/DisasterRecoveryEnableCrrCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.DisasterRecovery; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,6 @@ public async Task ExecuteAsync_EnablesCrr_Successfully() Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, "Cross-region restore enabled")); @@ -61,7 +59,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -86,7 +83,6 @@ public async Task ExecuteAsync_HandlesNotFoundError() Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); @@ -111,7 +107,6 @@ public async Task ExecuteAsync_HandlesBadRequestForNonGrsVault() Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(400, "CRR not supported")); @@ -132,7 +127,7 @@ public async Task ExecuteAsync_HandlesConflictWhenAlreadyEnabled() // Arrange Service.ConfigureCrossRegionRestoreAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(409, "Already enabled")); // Act @@ -171,7 +166,7 @@ public async Task ExecuteAsync_AcceptsValidVaultType(string vaultType) { Service.ConfigureCrossRegionRestoreAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(vaultType), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); var response = await ExecuteCommandAsync( @@ -191,7 +186,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.ConfigureCrossRegionRestoreAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } @@ -228,7 +223,7 @@ public async Task ExecuteAsync_DeserializationValidation() // Arrange Service.ConfigureCrossRegionRestoreAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, "Cross-region restore enabled")); // Act diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceFindUnprotectedCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceFindUnprotectedCommandTests.cs index dd5fbe38b1..a9448c9065 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceFindUnprotectedCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceFindUnprotectedCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Governance; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -37,7 +36,7 @@ public async Task ExecuteAsync_FindsUnprotectedResources_Successfully() Service.FindUnprotectedResourcesAsync( Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedResources); // Act @@ -56,7 +55,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenAllProtected() // Arrange Service.FindUnprotectedResourcesAsync( Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -74,7 +73,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.FindUnprotectedResourcesAsync( Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -93,7 +92,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.FindUnprotectedResourcesAsync( Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } @@ -136,7 +135,7 @@ public async Task ExecuteAsync_WithResourceGroup_PassesValueToService() // Arrange Service.FindUnprotectedResourcesAsync( Arg.Is("sub123"), Arg.Any(), Arg.Is("myRG"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -146,7 +145,7 @@ public async Task ExecuteAsync_WithResourceGroup_PassesValueToService() Assert.Equal(HttpStatusCode.OK, response.Status); await Service.Received(1).FindUnprotectedResourcesAsync( "sub123", Arg.Any(), "myRG", - Arg.Any(), Arg.Any(), Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any()); } @@ -161,7 +160,7 @@ public async Task ExecuteAsync_DeserializationValidation() Service.FindUnprotectedResourcesAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedResources); // Act @@ -192,7 +191,7 @@ public async Task ExecuteAsync_WithEnrichedVaultResources_ReturnsEnrichmentField Service.FindUnprotectedResourcesAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedResources); // Act @@ -234,7 +233,7 @@ public async Task ExecuteAsync_EnrichmentFieldsDefaultToNull_ForBackwardCompatib Service.FindUnprotectedResourcesAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedResources); // Act diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceImmutabilityCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceImmutabilityCommandTests.cs index aceadd3d77..f4e50111f1 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceImmutabilityCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceImmutabilityCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Governance; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,7 @@ public async Task ExecuteAsync_ConfiguresImmutability_Successfully() // Arrange Service.ConfigureImmutabilityAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("Enabled"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, "Immutability configured")); // Act @@ -53,7 +52,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.ConfigureImmutabilityAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("Enabled"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -78,7 +77,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.ConfigureImmutabilityAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("Enabled"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceSoftDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceSoftDeleteCommandTests.cs index dfd067c3ef..fbf8d7cc0c 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceSoftDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceSoftDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Governance; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -29,7 +28,7 @@ public async Task ExecuteAsync_ConfiguresSoftDelete_Successfully() // Arrange Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("AlwaysOn"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, "Soft delete configured")); // Act @@ -51,7 +50,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("On"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -76,7 +75,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("On"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } @@ -100,7 +99,7 @@ public async Task ExecuteAsync_HandlesNotFoundError() // Arrange Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("On"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); // Act @@ -121,7 +120,7 @@ public async Task ExecuteAsync_HandlesConflictError() // Arrange Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("On"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(409, "Cannot change")); // Act @@ -142,7 +141,7 @@ public async Task ExecuteAsync_HandlesForbiddenError() // Arrange Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("On"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act @@ -205,7 +204,7 @@ public async Task ExecuteAsync_AcceptsValidRetentionDays(string retentionDays) // Arrange Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("On"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); // Act @@ -226,7 +225,7 @@ public async Task ExecuteAsync_DeserializationValidation() // Arrange Service.ConfigureSoftDeleteAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("On"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, "Soft delete set to 'On'")); // Act diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Job/JobGetCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Job/JobGetCommandTests.cs index 01d0a5f460..2e24e1cd43 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Job/JobGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Job/JobGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Job; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -43,7 +42,6 @@ public async Task ExecuteAsync_ListsJobs_WhenNoJobSpecified() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedJobs); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_GetsSingleJob_WhenJobSpecified() Arg.Is(jobId), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedJob); @@ -100,7 +97,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoJobsExist() { // Arrange Service.ListJobsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -120,7 +117,7 @@ public async Task ExecuteAsync_HandlesException() { // Arrange Service.ListJobsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -139,7 +136,7 @@ public async Task ExecuteAsync_HandlesNotFound() { // Arrange Service.GetJobAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("nonexistent"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("nonexistent"), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Job not found")); // Act @@ -163,11 +160,11 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS if (shouldSucceed) { Service.ListJobsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); Service.GetJobAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("j1"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("j1"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new BackupJobInfo("id", "j1", "rsv", "Backup", "Completed", null, null, "VM", "vm1")); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyCreateCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyCreateCommandTests.cs index 051107c071..92896b8ec4 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyCreateCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; using Azure.Mcp.Tools.AzureBackup.Services.Policy; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,7 @@ public async Task ExecuteAsync_CreatesPolicy_Successfully() Arg.Is(r => r.Policy == "myPolicy" && r.WorkloadType == "AzureIaasVM"), Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.FromResult(expected)); // Act var response = await ExecuteCommandAsync( @@ -60,7 +59,7 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(r => r.Policy == "p" && r.WorkloadType == "AzureIaasVM"), Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act var response = await ExecuteCommandAsync( @@ -87,7 +86,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Is(r => r.Policy == "p" && r.WorkloadType == "VM"), Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } @@ -204,7 +203,7 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.FromResult(expected)); // Act var response = await ExecuteCommandAsync( @@ -230,7 +229,7 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Is(r => r.Policy == "p" && r.WorkloadType == "VM"), Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyGetCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyGetCommandTests.cs index 632354b136..b016ec0c46 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Policy; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -43,7 +42,6 @@ public async Task ExecuteAsync_ListsPolicies_WhenNoPolicySpecified() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedPolicies); @@ -76,7 +74,6 @@ public async Task ExecuteAsync_GetsSinglePolicy_WhenPolicySpecified() Arg.Is(policyName), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new BackupPolicyInfo("id1", policyName, "rsv", ["AzureIaasVM"], 5, null, null, null)); @@ -108,7 +105,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoPoliciesExist() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -133,7 +129,7 @@ public async Task ExecuteAsync_HandlesException() var resourceGroup = "myRg"; Service.ListPoliciesAsync( - Arg.Is(vault), Arg.Is(resourceGroup), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(vault), Arg.Is(resourceGroup), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -157,7 +153,7 @@ public async Task ExecuteAsync_HandlesNotFound() var policyName = "nonexistent"; Service.GetPolicyAsync( - Arg.Is(vault), Arg.Is(resourceGroup), Arg.Is(subscription), Arg.Is(policyName), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(vault), Arg.Is(resourceGroup), Arg.Is(subscription), Arg.Is(policyName), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Policy not found")); // Act @@ -181,11 +177,11 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS if (shouldSucceed) { Service.ListPoliciesAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); Service.GetPolicyAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub123"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub123"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new BackupPolicyInfo("id1", "p", "rsv", ["VM"], 1, null, null, null)); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyUpdateCommandTests.cs index b1b4db2721..d01a1316c8 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Policy; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,7 @@ public async Task ExecuteAsync_UpdatesPolicy_Successfully() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("myPolicy"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -60,7 +59,7 @@ public async Task ExecuteAsync_HandlesException() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -85,7 +84,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } @@ -139,7 +138,7 @@ public async Task ExecuteAsync_DeserializationValidation() Service.UpdatePolicyAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -164,7 +163,7 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act @@ -186,7 +185,7 @@ public async Task ExecuteAsync_HandlesNotFoundError() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not Found")); // Act @@ -208,7 +207,7 @@ public async Task ExecuteAsync_HandlesDppNotSupportedError() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Update is only supported for RSV (Recovery Services vault) policies. DPP policies do not support update.")); // Act @@ -230,7 +229,7 @@ public async Task ExecuteAsync_HandlesUnsupportedPolicyTypeError() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Unsupported policy type 'SomePolicy'.")); // Act @@ -252,7 +251,7 @@ public async Task ExecuteAsync_HandlesInvalidScheduleTime() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Is("not-a-time"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Invalid schedule time 'not-a-time'. Provide a valid time in UTC HH:mm format (e.g., '04:00').")); // Act @@ -275,7 +274,7 @@ public async Task ExecuteAsync_HandlesInvalidRetentionDays() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Is("-5"), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Invalid daily retention days '-5'. Provide a positive integer.")); // Act @@ -300,7 +299,7 @@ public async Task ExecuteAsync_UpdatesWithScheduleTimeOnly() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Is("04:00"), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -324,7 +323,7 @@ public async Task ExecuteAsync_UpdatesWithRetentionDaysOnly() Service.UpdatePolicyAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("p"), Arg.Any(), Arg.Any(), Arg.Is("60"), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectableItem/ProtectableItemListCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectableItem/ProtectableItemListCommandTests.cs index a02f34523d..2690f21d21 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectableItem/ProtectableItemListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectableItem/ProtectableItemListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.ProtectableItem; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -36,7 +35,7 @@ public async Task ExecuteAsync_ListsProtectableItems_Successfully() Service.ListProtectableItemsAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedItems); // Act @@ -57,7 +56,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoItemsExist() // Arrange Service.ListProtectableItemsAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -78,7 +77,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.ListProtectableItemsAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -101,7 +100,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.ListProtectableItemsAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); } @@ -163,7 +162,7 @@ public async Task ExecuteAsync_AcceptsKnownWorkloadType(string workloadType) // Arrange Service.ListProtectableItemsAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(workloadType), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -202,6 +201,6 @@ public async Task ExecuteAsync_RejectsUnknownWorkloadType_AsValidationError(stri await Service.DidNotReceive().ListProtectableItemsAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); + Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemGetCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemGetCommandTests.cs index f1f27c8d80..80e7aa874c 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.ProtectedItem; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -43,7 +42,6 @@ public async Task ExecuteAsync_ListsProtectedItems_WhenNoItemSpecified() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedItems); @@ -78,7 +76,6 @@ public async Task ExecuteAsync_GetsSingleItem_WhenItemSpecified() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedItem); @@ -105,7 +102,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoItemsExist() var resourceGroup = "myRg"; Service.ListProtectedItemsAsync( - Arg.Is(vault), Arg.Is(resourceGroup), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(vault), Arg.Is(resourceGroup), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -125,7 +122,7 @@ public async Task ExecuteAsync_HandlesException() { // Arrange Service.ListProtectedItemsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -144,7 +141,7 @@ public async Task ExecuteAsync_HandlesNotFound() { // Arrange Service.GetProtectedItemAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("nonexistent"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("nonexistent"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Item not found")); // Act @@ -168,11 +165,11 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS if (shouldSucceed) { Service.ListProtectedItemsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); Service.GetProtectedItemAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item1"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item1"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(Task.FromResult(new ProtectedItemInfo("id", "item1", "rsv", "Protected", "VM", "/sub/vm", "pol", null, null))); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemProtectCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemProtectCommandTests.cs index 14909f1506..fedfe3c5c3 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemProtectCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemProtectCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.ProtectedItem; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,7 +29,7 @@ public async Task ExecuteAsync_ProtectsItem_Successfully() // Arrange Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../vm1"), Arg.Is("DefaultPolicy"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult("Succeeded", "vm1-backup", "job123", "Protection enabled")); // Act @@ -53,7 +52,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../vm1"), Arg.Is("DefaultPolicy"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -78,7 +77,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), Arg.Is("pol1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult("Succeeded", "item1", "job1", null)); } @@ -102,7 +101,7 @@ public async Task ExecuteAsync_HandlesForbiddenError() // Arrange Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../vm1"), Arg.Is("DefaultPolicy"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act @@ -143,7 +142,7 @@ public async Task ExecuteAsync_DppResult_SurfacesProtectionStatusAndOmitsJobId() // (read back from the backup instance) and leave JobId null. Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../disks/d1"), Arg.Is("policy-disk"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult( Status: "Succeeded", ProtectedItemName: "rg-mydisk-abcd1234", @@ -174,7 +173,7 @@ public async Task ExecuteAsync_DppResult_SurfacesFailureWithErrorMessage() // carry Status="Failed" + ErrorMessage rather than a misleading "Accepted". Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../sa1"), Arg.Is("policy-blob"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult( Status: "Failed", ProtectedItemName: "rg-blob-xyz", @@ -205,7 +204,7 @@ public async Task ExecuteAsync_RsvResult_SurfacesTerminalJobStatus() // terminal status (Completed, CompletedWithWarnings, Failed) along with the job id. Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../vms/myvm"), Arg.Is("policy-vm"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult( Status: "Completed", ProtectedItemName: "vm;iaasvmcontainerv2;rg;myvm", @@ -233,7 +232,7 @@ public async Task ExecuteAsync_RsvResult_SurfacesFailedJobWithErrorMessage() // and ErrorMessage from the job rather than the previous "Accepted". Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../sa/fileServices/default/shares/share"), Arg.Is("policy-afs"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult( Status: "Failed", ProtectedItemName: "afsfileshare;sa;share", @@ -263,7 +262,7 @@ public async Task ExecuteAsync_RsvResult_SurfacesInProgressWhenPollingBudgetExpi // should return InProgress with the job id so the caller can keep monitoring. Service.ProtectItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/.../vms/slowvm"), Arg.Is("policy-vm"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult( Status: "InProgress", ProtectedItemName: "vm;iaasvmcontainerv2;rg;slowvm", @@ -306,7 +305,7 @@ public async Task ExecuteAsync_RejectsUnknownDatasourceType_AsValidationError(st await Service.DidNotReceive().ProtectItemAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Theory] @@ -324,7 +323,7 @@ public async Task ExecuteAsync_AcceptsValidDatasourceType(string datasourceType) // Arrange Service.ProtectItemAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ProtectResult("Succeeded", "item1", "job1", null)); // Act @@ -362,7 +361,7 @@ public async Task ExecuteAsync_RejectsDppDatasourceType_WhenVaultTypeIsRsv(strin await Service.DidNotReceive().ProtectItemAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Theory] @@ -387,6 +386,6 @@ public async Task ExecuteAsync_RejectsRsvDatasourceType_WhenVaultTypeIsDpp(strin await Service.DidNotReceive().ProtectItemAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemUndeleteCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemUndeleteCommandTests.cs index fd0758eabb..454be921e5 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemUndeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemUndeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.ProtectedItem; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,7 @@ public async Task ExecuteAsync_UndeletesItem_Successfully() Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/00000000/resourceGroups/rg-prod/providers/Microsoft.Compute/virtualMachines/my-vm"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Accepted", null, "Soft-deleted protected item restored")); // Act @@ -53,7 +52,7 @@ public async Task ExecuteAsync_DeserializationValidation() // Arrange Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Accepted", "job-456", "Item restored successfully")); // Act @@ -77,7 +76,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -101,7 +100,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Accepted", null, "Restored")); } @@ -125,7 +124,7 @@ public async Task ExecuteAsync_HandlesForbiddenError() // Arrange Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act @@ -147,7 +146,7 @@ public async Task ExecuteAsync_HandlesNotFoundError() // Arrange Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not Found")); // Act @@ -168,7 +167,7 @@ public async Task ExecuteAsync_HandlesConflictError() // Arrange Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(409, "Conflict")); // Act @@ -189,7 +188,7 @@ public async Task ExecuteAsync_HandlesKeyNotFoundException() // Arrange Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new KeyNotFoundException("Item not found")); // Act @@ -211,7 +210,7 @@ public async Task ExecuteAsync_UndeletesItem_DppVault_Successfully() Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("/subscriptions/00000000/resourceGroups/rg/providers/Microsoft.Compute/disks/my-disk"), - Arg.Is("dpp"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("dpp"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Accepted", null, "Soft-deleted backup instance restored")); // Act @@ -234,7 +233,7 @@ public async Task ExecuteAsync_HandlesArgumentException() // Arrange Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Invalid datasource ID format")); // Act @@ -269,8 +268,7 @@ public async Task ExecuteAsync_PassesContainerToService() // Arrange - verify --container flows through to UndeleteProtectedItemAsync Service.UndeleteProtectedItemAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("ds1"), - Arg.Any(), Arg.Is("IaasVMContainer;iaasvmcontainerv2;rg;myvm"), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Is("IaasVMContainer;iaasvmcontainerv2;rg;myvm"), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Accepted", null, "Restored")); // Act @@ -285,7 +283,6 @@ public async Task ExecuteAsync_PassesContainerToService() Assert.Equal(HttpStatusCode.OK, response.Status); await Service.Received(1).UndeleteProtectedItemAsync( "v", "rg", "sub", "ds1", - Arg.Any(), "IaasVMContainer;iaasvmcontainerv2;rg;myvm", Arg.Any(), - Arg.Any(), Arg.Any()); + Arg.Any(), "IaasVMContainer;iaasvmcontainerv2;rg;myvm", Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/RecoveryPoint/RecoveryPointGetCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/RecoveryPoint/RecoveryPointGetCommandTests.cs index 91bfd0afba..3bc9d15a5e 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/RecoveryPoint/RecoveryPointGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/RecoveryPoint/RecoveryPointGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.RecoveryPoint; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ListsRecoveryPoints_WhenNoRpSpecified() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedPoints); @@ -83,7 +81,6 @@ public async Task ExecuteAsync_GetsSingleRecoveryPoint_WhenRpSpecified() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new RecoveryPointInfo("rp1", rpId, "rsv", DateTimeOffset.UtcNow.AddDays(-1), "Full")); @@ -107,7 +104,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoRecoveryPointsExist() { // Arrange Service.ListRecoveryPointsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -128,7 +125,7 @@ public async Task ExecuteAsync_HandlesException() { // Arrange Service.ListRecoveryPointsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -148,7 +145,7 @@ public async Task ExecuteAsync_HandlesNotFound() { // Arrange Service.GetRecoveryPointAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Is("nonexistent"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Is("nonexistent"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Recovery point not found")); // Act @@ -173,11 +170,11 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS if (shouldSucceed) { Service.ListRecoveryPointsAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); Service.GetRecoveryPointAsync( - Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Is("rp1"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("item"), Arg.Is("rp1"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new RecoveryPointInfo("rp1", "rp1", "rsv", DateTimeOffset.UtcNow, "Full")); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureEncryptionCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureEncryptionCommandTests.cs index 5672b8fef5..7e290483bf 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureEncryptionCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureEncryptionCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Security; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -40,7 +39,7 @@ public async Task ExecuteAsync_SystemAssigned_ConfiguresEncryption() Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestKeyVaultUri), Arg.Is(TestKeyName), Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -68,7 +67,7 @@ public async Task ExecuteAsync_UserAssigned_ConfiguresEncryption() Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestKeyVaultUri), Arg.Is(TestKeyName), Arg.Is("UserAssigned"), Arg.Any(), Arg.Is(TestUserAssignedIdentityId), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -96,7 +95,7 @@ public async Task ExecuteAsync_WithKeyVersion_ConfiguresEncryption() Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestKeyVaultUri), Arg.Is(TestKeyName), Arg.Is("SystemAssigned"), Arg.Is(TestKeyVersion), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -121,7 +120,7 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -146,7 +145,7 @@ public async Task ExecuteAsync_HandlesNotFoundError() Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); // Act @@ -171,7 +170,7 @@ public async Task ExecuteAsync_HandlesForbiddenError() Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act @@ -196,7 +195,7 @@ public async Task ExecuteAsync_HandlesBadRequestError() Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(400, "Bad request")); // Act @@ -255,7 +254,7 @@ public async Task ExecuteAsync_AcceptsValidVaultType(string vaultType) Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Is(vaultType), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); var response = await ExecuteCommandAsync( @@ -317,7 +316,7 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -344,7 +343,7 @@ public async Task ExecuteAsync_CallsCorrectServiceMethod() Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); // Act @@ -361,7 +360,7 @@ await Service.Received(1).ConfigureEncryptionAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestKeyVaultUri), Arg.Is(TestKeyName), Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -375,7 +374,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureMuaCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureMuaCommandTests.cs index ca95e8779f..d73a5ac261 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureMuaCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureMuaCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Security; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,7 @@ public async Task ExecuteAsync_EnablesMua_WithResourceGuardId() Service.ConfigureMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestResourceGuardId), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -59,7 +58,7 @@ public async Task ExecuteAsync_DisablesMua_WithoutResourceGuardId() Service.DisableMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -80,7 +79,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.DisableMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -100,7 +99,7 @@ public async Task ExecuteAsync_HandlesNotFoundError() // Arrange Service.ConfigureMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestResourceGuardId), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); // Act @@ -121,7 +120,7 @@ public async Task ExecuteAsync_HandlesForbiddenError() // Arrange Service.ConfigureMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestResourceGuardId), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act @@ -142,7 +141,7 @@ public async Task ExecuteAsync_HandlesBadRequestError() // Arrange Service.ConfigureMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestResourceGuardId), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(400, "Region mismatch")); // Act @@ -163,7 +162,7 @@ public async Task ExecuteAsync_HandlesConflictError() // Arrange Service.ConfigureMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestResourceGuardId), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(409, "Already configured")); // Act @@ -204,7 +203,7 @@ public async Task ExecuteAsync_AcceptsValidVaultType(string vaultType) { Service.DisableMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(vaultType), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.FromResult(new OperationResult("Succeeded", null, null))); var response = await ExecuteCommandAsync( @@ -225,7 +224,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.DisableMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } @@ -266,7 +265,7 @@ public async Task ExecuteAsync_DeserializationValidation() Service.ConfigureMultiUserAuthorizationAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -289,7 +288,7 @@ public async Task ExecuteAsync_EnableMua_CallsCorrectServiceMethod() // Arrange Service.ConfigureMultiUserAuthorizationAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); // Act @@ -302,11 +301,11 @@ await ExecuteCommandAsync( // Assert - Enable was called, not Disable await Service.Received(1).ConfigureMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is(TestResourceGuardId), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); await Service.DidNotReceive().DisableMultiUserAuthorizationAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -315,7 +314,7 @@ public async Task ExecuteAsync_DisableMua_CallsCorrectServiceMethod() // Arrange Service.DisableMultiUserAuthorizationAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); // Act @@ -327,10 +326,10 @@ await ExecuteCommandAsync( // Assert - Disable was called, not Enable await Service.Received(1).DisableMultiUserAuthorizationAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); await Service.DidNotReceive().ConfigureMultiUserAuthorizationAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Services/AzureBackupServiceTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Services/AzureBackupServiceTests.cs index 1bd7b3680d..2ca2269f74 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Services/AzureBackupServiceTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Services/AzureBackupServiceTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.AzureBackup.Services; using Azure.Mcp.Tools.AzureBackup.Services.Policy; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -37,16 +36,16 @@ public async Task GetVaultAsync_RsvNotFound_FallsThroughToDpp() { // RSV returns 404 -> should try DPP var expectedVault = new BackupVaultInfo(null, "myVault", "DPP", "eastus", "rg", null, null, null, null, null, null, null, null, null); - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); - _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(expectedVault); - var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None); + var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, CancellationToken.None); Assert.Equal("DPP", result.VaultType); - await _rsvOps.Received(1).GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()); - await _dppOps.Received(1).GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()); + await _rsvOps.Received(1).GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()); + await _dppOps.Received(1).GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()); } [Fact] @@ -54,12 +53,12 @@ public async Task GetVaultAsync_RsvForbidden_FallsThroughToDpp() { // RSV returns 403 -> should try DPP (not propagate immediately) var expectedVault = new BackupVaultInfo(null, "myVault", "DPP", "eastus", "rg", null, null, null, null, null, null, null, null, null); - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); - _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(expectedVault); - var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None); + var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, CancellationToken.None); Assert.Equal("DPP", result.VaultType); } @@ -69,12 +68,12 @@ public async Task GetVaultAsync_RsvUnauthorized_FallsThroughToDpp() { // RSV returns 401 -> should try DPP var expectedVault = new BackupVaultInfo(null, "myVault", "DPP", "eastus", "rg", null, null, null, null, null, null, null, null, null); - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(401, "Unauthorized")); - _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(expectedVault); - var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None); + var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, CancellationToken.None); Assert.Equal("DPP", result.VaultType); } @@ -83,13 +82,13 @@ public async Task GetVaultAsync_RsvUnauthorized_FallsThroughToDpp() public async Task GetVaultAsync_BothStacksFail_ThrowsKeyNotFoundException() { // Both RSV and DPP return 404 - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); - _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); var ex = await Assert.ThrowsAsync(() => - _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None)); + _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, CancellationToken.None)); Assert.Contains("myVault", ex.Message); Assert.Contains("--vault-type", ex.Message); @@ -99,13 +98,13 @@ public async Task GetVaultAsync_BothStacksFail_ThrowsKeyNotFoundException() public async Task GetVaultAsync_BothStacksForbidden_ThrowsUnauthorizedAccessException() { // Both RSV and DPP return 403 -> should throw UnauthorizedAccessException (not KeyNotFoundException) - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); - _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); var ex = await Assert.ThrowsAsync(() => - _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None)); + _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, CancellationToken.None)); Assert.Contains("Authorization failed", ex.Message); Assert.Contains("RBAC permissions", ex.Message); @@ -115,13 +114,13 @@ public async Task GetVaultAsync_BothStacksForbidden_ThrowsUnauthorizedAccessExce public async Task GetVaultAsync_BothStacksUnauthorized_ThrowsUnauthorizedAccessException() { // Both RSV and DPP return 401 -> should throw UnauthorizedAccessException - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(401, "Unauthorized")); - _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(401, "Unauthorized")); var ex = await Assert.ThrowsAsync(() => - _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None)); + _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, CancellationToken.None)); Assert.Contains("Authorization failed", ex.Message); } @@ -130,39 +129,39 @@ public async Task GetVaultAsync_BothStacksUnauthorized_ThrowsUnauthorizedAccessE public async Task GetVaultAsync_RsvSucceeds_DoesNotCallDpp() { var expectedVault = new BackupVaultInfo(null, "myVault", "RSV", "eastus", "rg", null, null, null, null, null, null, null, null, null); - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(expectedVault); - var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None); + var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, CancellationToken.None); Assert.Equal("RSV", result.VaultType); - await _dppOps.DidNotReceive().GetVaultAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await _dppOps.DidNotReceive().GetVaultAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] public async Task GetVaultAsync_ExplicitRsvVaultType_CallsOnlyRsv() { var expectedVault = new BackupVaultInfo(null, "myVault", "RSV", "eastus", "rg", null, null, null, null, null, null, null, null, null); - _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(expectedVault); - var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", "rsv", null, null, CancellationToken.None); + var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", "rsv", null, CancellationToken.None); Assert.Equal("RSV", result.VaultType); - await _dppOps.DidNotReceive().GetVaultAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await _dppOps.DidNotReceive().GetVaultAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] public async Task GetVaultAsync_ExplicitDppVaultType_CallsOnlyDpp() { var expectedVault = new BackupVaultInfo(null, "myVault", "DPP", "eastus", "rg", null, null, null, null, null, null, null, null, null); - _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(expectedVault); - var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", "dpp", null, null, CancellationToken.None); + var result = await _service.GetVaultAsync("myVault", "rg", "22222222-2222-2222-2222-222222222222", "dpp", null, CancellationToken.None); Assert.Equal("DPP", result.VaultType); - await _rsvOps.DidNotReceive().GetVaultAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await _rsvOps.DidNotReceive().GetVaultAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } #endregion @@ -180,10 +179,10 @@ public async Task ListVaultsAsync_BothSucceed_ReturnsMergedResults() { new(null, "dppVault1", "DPP", "eastus", "rg", null, null, null, null, null, null, null, null, null) }; - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(rsvVaults); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(dppVaults); + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(rsvVaults); + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(dppVaults); - var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None); + var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None); Assert.Equal(2, result.Count); Assert.Contains(result, v => v.Name == "rsvVault1"); @@ -193,15 +192,15 @@ public async Task ListVaultsAsync_BothSucceed_ReturnsMergedResults() [Fact] public async Task ListVaultsAsync_RsvFails_ReturnsDppOnly() { - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); var dppVaults = new List { new(null, "dppVault1", "DPP", "eastus", "rg", null, null, null, null, null, null, null, null, null) }; - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(dppVaults); + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(dppVaults); - var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None); + var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None); Assert.Single(result); Assert.Equal("dppVault1", result[0].Name); @@ -214,11 +213,11 @@ public async Task ListVaultsAsync_DppFails_ReturnsRsvOnly() { new(null, "rsvVault1", "RSV", "eastus", "rg", null, null, null, null, null, null, null, null, null) }; - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(rsvVaults); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(rsvVaults); + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(500, "Internal error")); - var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None); + var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None); Assert.Single(result); Assert.Equal("rsvVault1", result[0].Name); @@ -232,13 +231,13 @@ public async Task ListVaultsAsync_BothFailWithRequestFailedException_ThrowsReque // RequestFailedException so the command-layer error mapper classifies the failure // as an Azure service error (with the original HTTP status code) rather than as // an MCP-side bug. - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "RSV error")); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "DPP error")); var ex = await Assert.ThrowsAsync(() => - _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None)); + _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None)); Assert.Equal(403, ex.Status); Assert.Contains("RSV error", ex.Message); @@ -252,13 +251,13 @@ public async Task ListVaultsAsync_BothFailWithRequestFailedException_PrefersNonZ // NEW-5: when the RSV RequestFailedException carries a 0 status (e.g. transport-level // failure with no HTTP status), prefer the DPP status so the user still sees a // useful HTTP code. - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(0, "RSV transport error")); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(503, "DPP throttled")); var ex = await Assert.ThrowsAsync(() => - _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None)); + _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None)); Assert.Equal(503, ex.Status); } @@ -270,13 +269,13 @@ public async Task ListVaultsAsync_BothFailWithRequestFailedException_StatusAndEr // never see a mismatched (Status, ErrorCode) pair. Here RSV has Status=0 with // its own ErrorCode; the wrapper should take both fields from DPP (the source // of the non-zero Status). - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(0, "RSV transport error", "RsvOnlyCode", null)); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(503, "DPP throttled", "DppThrottled", null)); var ex = await Assert.ThrowsAsync(() => - _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None)); + _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None)); Assert.Equal(503, ex.Status); Assert.Equal("DppThrottled", ex.ErrorCode); @@ -288,13 +287,13 @@ public async Task ListVaultsAsync_BothFailWithDifferentExceptions_ThrowsInvalidO // NEW-1: when the two backend failures are not directly comparable, wrap them // in a single InvalidOperationException whose Message mentions both inner // exception messages so the caller still has actionable context. - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "RSV forbidden")); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new InvalidOperationException("DPP network issue")); var ex = await Assert.ThrowsAsync(() => - _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None)); + _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, CancellationToken.None)); Assert.Contains("RSV forbidden", ex.Message); Assert.Contains("DPP network issue", ex.Message); @@ -306,13 +305,13 @@ public async Task ListVaultsAsync_CancellationRequested_ThrowsOperationCanceled( using var cts = new CancellationTokenSource(); await cts.CancelAsync(); - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new OperationCanceledException(cts.Token)); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new OperationCanceledException(cts.Token)); await Assert.ThrowsAsync(() => - _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, null, cts.Token)); + _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, null, cts.Token)); } #endregion @@ -323,7 +322,7 @@ await Assert.ThrowsAsync(() => public async Task ListProtectableItemsAsync_DppVaultType_ThrowsArgumentException() { var ex = await Assert.ThrowsAsync(() => - _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, "dpp", null, null, CancellationToken.None)); + _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, "dpp", null, CancellationToken.None)); Assert.Contains("RSV", ex.Message); } @@ -332,10 +331,10 @@ public async Task ListProtectableItemsAsync_DppVaultType_ThrowsArgumentException public async Task ListProtectableItemsAsync_RsvVaultType_DelegatesToRsv() { var expected = new List { new("item1", "SQL", null, null, null, null, null, null, null) }; - _rsvOps.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, null, Arg.Any()) + _rsvOps.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, Arg.Any()) .Returns(expected); - var result = await _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, "rsv", null, null, CancellationToken.None); + var result = await _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, "rsv", null, CancellationToken.None); Assert.Single(result); } @@ -344,14 +343,14 @@ public async Task ListProtectableItemsAsync_RsvVaultType_DelegatesToRsv() public async Task ListProtectableItemsAsync_NoVaultType_DelegatesToRsv() { // When no vault type specified, service auto-detects by probing RSV first - _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(new BackupVaultInfo(null, "vault", "RSV", "eastus", "rg", null, null, null, null, null, null, null, null, null)); var expected = new List { new("item1", "SQL", null, null, null, null, null, null, null) }; - _rsvOps.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, null, Arg.Any()) + _rsvOps.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, Arg.Any()) .Returns(expected); - var result = await _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, null, null, CancellationToken.None); + var result = await _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None); Assert.Single(result); } @@ -360,13 +359,13 @@ public async Task ListProtectableItemsAsync_NoVaultType_DelegatesToRsv() public async Task ListProtectableItemsAsync_NoVaultType_DppVault_ThrowsArgumentException() { // When no vault type specified and vault is DPP, service should throw helpful error - _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); - _dppOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _dppOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(new BackupVaultInfo(null, "vault", "DPP", "eastus", "rg", null, null, null, null, null, null, null, null, null)); var ex = await Assert.ThrowsAsync(() => - _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, null, null, CancellationToken.None)); + _service.ListProtectableItemsAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, null, null, CancellationToken.None)); Assert.Contains("DPP", ex.Message); Assert.Contains("Protectable item discovery is only supported", ex.Message); @@ -380,12 +379,12 @@ public async Task ListProtectableItemsAsync_NoVaultType_DppVault_ThrowsArgumentE public async Task CreatePolicyAsync_Succeeds() { var baseResult = new OperationResult("Succeeded", null, "Policy 'p' created in vault 'v'."); - _rsvOps.GetVaultAsync("v", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("v", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(new BackupVaultInfo(null, "v", "RSV", "eastus", "rg", null, null, null, null, null, null, null, null, null)); _rsvOps.CreatePolicyAsync( Arg.Is(r => r.Policy == "p" && r.WorkloadType == "VM" && r.DailyRetentionDays == "30"), "v", "rg", "22222222-2222-2222-2222-222222222222", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(baseResult); var request = new PolicyCreateRequest @@ -398,7 +397,7 @@ public async Task CreatePolicyAsync_Succeeds() var result = await _service.CreatePolicyAsync( request, "v", "rg", "22222222-2222-2222-2222-222222222222", null, - null, null, CancellationToken.None); + null, CancellationToken.None); Assert.Equal("Succeeded", result.Status); } @@ -453,15 +452,15 @@ public void VaultTypeResolver_IsDpp_ReturnsExpected(string vaultType, bool expec public async Task ConfigureImmutabilityAsync_NormalizesState(string inputState, string expectedNormalized) { // RSV vault probe succeeds - _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(new BackupVaultInfo(null, "vault", "RSV", null, "rg", null, null, null, null, null, null, null, null, null)); - _rsvOps.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", expectedNormalized, null, null, Arg.Any()) + _rsvOps.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", expectedNormalized, null, Arg.Any()) .Returns(new OperationResult("Succeeded", null, "Done")); - var result = await _service.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", inputState, null, null, null, CancellationToken.None); + var result = await _service.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", inputState, null, null, CancellationToken.None); Assert.Equal("Succeeded", result.Status); - await _rsvOps.Received(1).ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", expectedNormalized, null, null, Arg.Any()); + await _rsvOps.Received(1).ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", expectedNormalized, null, Arg.Any()); } [Theory] @@ -470,11 +469,11 @@ public async Task ConfigureImmutabilityAsync_NormalizesState(string inputState, public async Task ConfigureImmutabilityAsync_InvalidState_ThrowsArgumentException(string inputState) { // RSV vault probe succeeds - _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, null, Arg.Any()) + _rsvOps.GetVaultAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", null, Arg.Any()) .Returns(new BackupVaultInfo(null, "vault", "RSV", null, "rg", null, null, null, null, null, null, null, null, null)); var ex = await Assert.ThrowsAsync(() => - _service.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", inputState, null, null, null, CancellationToken.None)); + _service.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", inputState, null, null, CancellationToken.None)); Assert.Contains("Invalid immutability state", ex.Message); } @@ -485,7 +484,7 @@ public async Task ConfigureImmutabilityAsync_InvalidState_ThrowsArgumentExceptio public async Task ConfigureImmutabilityAsync_EmptyOrWhitespace_ThrowsArgumentException(string inputState) { var ex = await Assert.ThrowsAsync(() => - _service.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", inputState, null, null, null, CancellationToken.None)); + _service.ConfigureImmutabilityAsync("vault", "rg", "22222222-2222-2222-2222-222222222222", inputState, null, null, CancellationToken.None)); Assert.Contains("immutabilityState", ex.Message); } @@ -506,10 +505,10 @@ public async Task ListVaultsAsync_WithResourceGroup_FiltersResults() { new(null, "vault3", "DPP", "eastus", "rg1", null, null, null, null, null, null, null, null, null) }; - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(rsvVaults); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(dppVaults); + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(rsvVaults); + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(dppVaults); - var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", "rg1", null, null, null, CancellationToken.None); + var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", "rg1", null, null, CancellationToken.None); Assert.Equal(2, result.Count); Assert.All(result, v => Assert.Equal("rg1", v.ResourceGroup, ignoreCase: true)); @@ -522,10 +521,10 @@ public async Task ListVaultsAsync_WithResourceGroup_CaseInsensitive() { new(null, "vault1", "RSV", "eastus", "MyRG", null, null, null, null, null, null, null, null, null) }; - _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(rsvVaults); - _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, null, Arg.Any()).Returns(new List()); + _rsvOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(rsvVaults); + _dppOps.ListVaultsAsync("22222222-2222-2222-2222-222222222222", null, Arg.Any()).Returns(new List()); - var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", "myrg", null, null, null, CancellationToken.None); + var result = await _service.ListVaultsAsync("22222222-2222-2222-2222-222222222222", "myrg", null, null, CancellationToken.None); Assert.Single(result); Assert.Equal("vault1", result[0].Name); @@ -552,17 +551,17 @@ public async Task ListVaultsAsync_WhenSubscriptionIsName_ResolvesToGuidBeforeCal state: Azure.ResourceManager.Resources.Models.SubscriptionState.Enabled); var subResource = Substitute.For(); subResource.Data.Returns(subData); - _azureService.GetSubscription(name, null, null, Arg.Any()).Returns(subResource); + _azureService.GetSubscription(name, null, Arg.Any()).Returns(subResource); - _rsvOps.ListVaultsAsync(resolvedId, null, null, Arg.Any()).Returns([]); - _dppOps.ListVaultsAsync(resolvedId, null, null, Arg.Any()).Returns([]); + _rsvOps.ListVaultsAsync(resolvedId, null, Arg.Any()).Returns([]); + _dppOps.ListVaultsAsync(resolvedId, null, Arg.Any()).Returns([]); - await _service.ListVaultsAsync(name, null, null, null, null, CancellationToken.None); + await _service.ListVaultsAsync(name, null, null, null, CancellationToken.None); // Ops must have been called with the resolved GUID, NOT the original name. - await _rsvOps.Received(1).ListVaultsAsync(resolvedId, null, null, Arg.Any()); - await _dppOps.Received(1).ListVaultsAsync(resolvedId, null, null, Arg.Any()); - await _rsvOps.DidNotReceive().ListVaultsAsync(name, Arg.Any(), Arg.Any(), Arg.Any()); + await _rsvOps.Received(1).ListVaultsAsync(resolvedId, null, Arg.Any()); + await _dppOps.Received(1).ListVaultsAsync(resolvedId, null, Arg.Any()); + await _rsvOps.DidNotReceive().ListVaultsAsync(name, Arg.Any(), Arg.Any()); } [Fact] @@ -572,13 +571,13 @@ public async Task ListVaultsAsync_WhenSubscriptionIsGuid_DoesNotCallAzureService // to IAzureService when the value already parses as a Guid. const string guid = "44444444-4444-4444-4444-444444444444"; - _rsvOps.ListVaultsAsync(guid, null, null, Arg.Any()).Returns([]); - _dppOps.ListVaultsAsync(guid, null, null, Arg.Any()).Returns([]); + _rsvOps.ListVaultsAsync(guid, null, Arg.Any()).Returns([]); + _dppOps.ListVaultsAsync(guid, null, Arg.Any()).Returns([]); - await _service.ListVaultsAsync(guid, null, null, null, null, CancellationToken.None); + await _service.ListVaultsAsync(guid, null, null, null, CancellationToken.None); await _azureService.DidNotReceive().GetSubscription( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); } #endregion diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultCreateCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultCreateCommandTests.cs index 173df0df38..6f92de858d 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Vault; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,7 +29,7 @@ public async Task ExecuteAsync_CreatesVault_Successfully() // Arrange Service.CreateVaultAsync( Arg.Is("myVault"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("rsv"), Arg.Is("eastus"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new VaultCreateResult("id1", "myVault", "rsv", "eastus", "Succeeded")); // Act @@ -53,7 +52,7 @@ public async Task ExecuteAsync_HandlesException() // Arrange Service.CreateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("rsv"), Arg.Is("eastus"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -78,7 +77,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { Service.CreateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Is("rsv"), Arg.Is("eastus"), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new VaultCreateResult("id", "v", "rsv", "eastus", "Succeeded")); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultGetCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultGetCommandTests.cs index 23ea113d61..7fd599841c 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Vault; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -40,7 +39,6 @@ public async Task ExecuteAsync_ListsVaults_WhenNoVaultSpecified() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedVaults); @@ -70,7 +68,6 @@ public async Task ExecuteAsync_GetsSingleVault_WhenVaultSpecified() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedVault); @@ -99,7 +96,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoVaultsExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -123,7 +119,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -150,7 +145,6 @@ public async Task ExecuteAsync_HandlesNotFound() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Vault not found")); @@ -185,7 +179,7 @@ public async Task ExecuteAsync_RejectsInvalidVaultType(string vaultType) public async Task ExecuteAsync_AcceptsValidVaultType(string vaultType) { Service.ListVaultsAsync( - Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); var response = await ExecuteCommandAsync("--subscription", "sub123", "--vault-type", vaultType); @@ -200,11 +194,11 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS if (shouldSucceed) { Service.ListVaultsAsync( - Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); Service.GetVaultAsync( - Arg.Is("myVault"), Arg.Is("myRg"), Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("myVault"), Arg.Is("myRg"), Arg.Is("sub123"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new BackupVaultInfo("id1", "myVault", "rsv", "eastus", "myRg", "Succeeded", "Standard", "GeoRedundant", null, null, null, null, null, null)); } @@ -266,7 +260,6 @@ public async Task ExecuteAsync_AcceptsValidExpandValues_AndForwardsToService(str Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Is(e => e != VaultExpand.None)) .Returns([]); @@ -280,7 +273,6 @@ await Service.Received(1).ListVaultsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Is(e => e != VaultExpand.None)); } @@ -294,7 +286,6 @@ public async Task ExecuteAsync_OmittingExpand_PassesNoneToService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Is(VaultExpand.None)) .Returns([]); @@ -307,7 +298,6 @@ await Service.Received(1).ListVaultsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Is(VaultExpand.None)); } diff --git a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultUpdateCommandTests.cs index 51dc23f454..0f2a247127 100644 --- a/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.AzureBackup.Commands.Vault; using Azure.Mcp.Tools.AzureBackup.Models; using Azure.Mcp.Tools.AzureBackup.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,7 @@ public async Task ExecuteAsync_UpdatesVault_Successfully() Service.UpdateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, "Vault updated successfully")); // Act @@ -54,7 +53,7 @@ public async Task ExecuteAsync_HandlesException() Service.UpdateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -90,7 +89,7 @@ public async Task ExecuteAsync_HandlesNotFoundError() Service.UpdateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is("SystemAssigned"), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Not found")); // Act @@ -119,7 +118,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.UpdateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); } @@ -167,7 +166,7 @@ public async Task ExecuteAsync_AcceptsValidIdentityType(string identityType) Service.UpdateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Is(identityType), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(identityType), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); // Act @@ -210,7 +209,7 @@ public async Task ExecuteAsync_AcceptsValidSoftDeleteRetentionDays(string retent Service.UpdateVaultAsync( Arg.Is("v"), Arg.Is("rg"), Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new OperationResult("Succeeded", null, null)); // Act diff --git a/tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/RequestCommand.cs b/tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/RequestCommand.cs index 88f57099e2..1ff2513be2 100644 --- a/tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/RequestCommand.cs +++ b/tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/RequestCommand.cs @@ -222,7 +222,6 @@ private static async Task HandleCreateMigrateProjectActionAsync( options.Location, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); if (!result.HasData) diff --git a/tools/Azure.Mcp.Tools.AzureMigrate/src/Helpers/AzureMigrateProjectHelper.cs b/tools/Azure.Mcp.Tools.AzureMigrate/src/Helpers/AzureMigrateProjectHelper.cs index 7a19c8f12b..f6d8cb3a05 100644 --- a/tools/Azure.Mcp.Tools.AzureMigrate/src/Helpers/AzureMigrateProjectHelper.cs +++ b/tools/Azure.Mcp.Tools.AzureMigrate/src/Helpers/AzureMigrateProjectHelper.cs @@ -4,7 +4,6 @@ using Azure.Core; using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.AzureMigrate.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.AzureMigrate.Helpers; @@ -26,7 +25,6 @@ public async Task CreateAzureMigrateProjectAsync( string location, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -41,10 +39,10 @@ public async Task CreateAzureMigrateProjectAsync( MigrateProjectResourceType, MigrateProjectApiVersion, tenant, - retryPolicy, + null, cancellationToken); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); ResourceIdentifier projectId = new( $"/subscriptions/{subscriptionResource.Data.SubscriptionId}/resourceGroups/{resourceGroup}/providers/{MigrateProjectResourceType}/{projectName}"); diff --git a/tools/Azure.Mcp.Tools.AzureMigrate/src/Options/PlatformLandingZone/RequestOptions.cs b/tools/Azure.Mcp.Tools.AzureMigrate/src/Options/PlatformLandingZone/RequestOptions.cs index 9561c2cea5..1a87f6b0dd 100644 --- a/tools/Azure.Mcp.Tools.AzureMigrate/src/Options/PlatformLandingZone/RequestOptions.cs +++ b/tools/Azure.Mcp.Tools.AzureMigrate/src/Options/PlatformLandingZone/RequestOptions.cs @@ -106,10 +106,4 @@ public sealed class RequestOptions : ISubscriptionOption /// [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - - /// - /// Gets or sets the retry policy options for HTTP requests. - /// - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Communication/src/Commands/Email/EmailSendCommand.cs b/tools/Azure.Mcp.Tools.Communication/src/Commands/Email/EmailSendCommand.cs index 692633fe45..b2c2be4100 100644 --- a/tools/Azure.Mcp.Tools.Communication/src/Commands/Email/EmailSendCommand.cs +++ b/tools/Azure.Mcp.Tools.Communication/src/Commands/Email/EmailSendCommand.cs @@ -75,7 +75,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Bcc, options.ReplyTo, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result), CommunicationJsonContext.Default.EmailSendCommandResult); diff --git a/tools/Azure.Mcp.Tools.Communication/src/Commands/Sms/SmsSendCommand.cs b/tools/Azure.Mcp.Tools.Communication/src/Commands/Sms/SmsSendCommand.cs index de69763690..4369c552d8 100644 --- a/tools/Azure.Mcp.Tools.Communication/src/Commands/Sms/SmsSendCommand.cs +++ b/tools/Azure.Mcp.Tools.Communication/src/Commands/Sms/SmsSendCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.EnableDeliveryReport, options.Tag, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results diff --git a/tools/Azure.Mcp.Tools.Communication/src/Options/BaseCommunicationOptions.cs b/tools/Azure.Mcp.Tools.Communication/src/Options/BaseCommunicationOptions.cs index e6dbefa942..ffc2f32577 100644 --- a/tools/Azure.Mcp.Tools.Communication/src/Options/BaseCommunicationOptions.cs +++ b/tools/Azure.Mcp.Tools.Communication/src/Options/BaseCommunicationOptions.cs @@ -17,6 +17,4 @@ public class BaseCommunicationOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Communication/src/Services/CommunicationService.cs b/tools/Azure.Mcp.Tools.Communication/src/Services/CommunicationService.cs index 5eec9c0002..1326a4fa6f 100644 --- a/tools/Azure.Mcp.Tools.Communication/src/Services/CommunicationService.cs +++ b/tools/Azure.Mcp.Tools.Communication/src/Services/CommunicationService.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Communication.Models; using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Communication.Services; @@ -25,7 +24,6 @@ public async Task> SendSmsAsync( bool enableDeliveryReport = false, string? tag = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { // Validate required parameters using base class method @@ -48,7 +46,7 @@ public async Task> SendSmsAsync( // Create SMS client using Azure credential from base class and endpoint var credential = await GetCredential(tenantId, cancellationToken); - var smsClientOptions = ConfigureRetryPolicy(AddDefaultPolicies(new SmsClientOptions()), retryPolicy); + var smsClientOptions = ConfigureRetryPolicy(AddDefaultPolicies(new SmsClientOptions()), null); smsClientOptions.Transport = new HttpClientTransport(AzureService.GetClient()); var smsClient = new SmsClient(new Uri(endpoint), credential, smsClientOptions); @@ -103,7 +101,6 @@ public async Task> SendSmsAsync( string[]? bcc = null, string[]? replyTo = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { // Validate required parameters using base class method @@ -132,7 +129,7 @@ public async Task> SendSmsAsync( // Create email client with credential from base class var credential = await GetCredential(tenantId, cancellationToken); - var emailClientOptions = ConfigureRetryPolicy(AddDefaultPolicies(new EmailClientOptions()), retryPolicy); + var emailClientOptions = ConfigureRetryPolicy(AddDefaultPolicies(new EmailClientOptions()), null); emailClientOptions.Transport = new HttpClientTransport(AzureService.GetClient()); var emailClient = new EmailClient(new(endpoint), credential, emailClientOptions); diff --git a/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs b/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs index 8b1fac1553..e4de864306 100644 --- a/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs +++ b/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Communication.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Communication.Services; @@ -16,7 +15,6 @@ Task> SendSmsAsync( bool enableDeliveryReport = false, string? tag = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -32,7 +30,6 @@ Task> SendSmsAsync( /// Optional CC recipient email addresses. /// Optional BCC recipient email addresses. /// Optional reply-to addresses. - /// Optional retry policy options. /// The result of the email send operation. Task SendEmailAsync( string endpoint, @@ -46,6 +43,5 @@ Task SendEmailAsync( string[]? bcc = null, string[]? replyTo = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Email/EmailSendCommandTests.cs b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Email/EmailSendCommandTests.cs index 8f58296553..52d86c9822 100644 --- a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Email/EmailSendCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Email/EmailSendCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Communication.Commands.Email; using Azure.Mcp.Tools.Communication.Models; using Azure.Mcp.Tools.Communication.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -65,7 +64,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string? endpoint, string? Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); } @@ -122,7 +120,6 @@ public async Task ExecuteAsync_WithValidInput_CallsServiceAndReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -145,7 +142,6 @@ await Service.Received(1).SendEmailAsync( null, null, null, - null, Arg.Any()); // Verify the response contains the expected result @@ -183,7 +179,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(expectedException); diff --git a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Services/CommunicationServiceTests.cs b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Services/CommunicationServiceTests.cs index c7de655169..5bc7737c7f 100644 --- a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Services/CommunicationServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Services/CommunicationServiceTests.cs @@ -36,7 +36,7 @@ public async Task SendEmailAsync_WithEmptyEndpoint_ThrowsValidationException() // Act & Assert // Updated to use Assert.ThrowsAsync for async methods var exception = await Assert.ThrowsAsync( - () => _service.SendEmailAsync(endpoint, sender, senderName, to, subject, message, false, null, null, null, null, null, TestContext.Current.CancellationToken)); + () => _service.SendEmailAsync(endpoint, sender, senderName, to, subject, message, false, null, null, null, null, TestContext.Current.CancellationToken)); Assert.Contains("endpoint", exception.Message, StringComparison.OrdinalIgnoreCase); } diff --git a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Sms/SmsSendCommandTests.cs b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Sms/SmsSendCommandTests.cs index f2803d8924..c0ac9a4c6b 100644 --- a/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Sms/SmsSendCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Communication/tests/Azure.Mcp.Tools.Communication.Tests/Sms/SmsSendCommandTests.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Tools.Communication.Commands.Sms; using Azure.Mcp.Tools.Communication.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -43,7 +42,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceAndReturnsResults new(MessageId: "msg1", To: to.First(), Successful: true, HttpStatusCode: 202, ErrorMessage: null) }; Service.SendSmsAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(results); var args = new List @@ -70,7 +69,7 @@ public async Task ExecuteAsync_WithValidParameters_CallsServiceAndReturnsResults public async Task ExecuteAsync_ServiceThrowsException_HandlesError() { Service.SendSmsAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("fail")); // Act diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs index 1ba76f5c2b..82ee6180a4 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs @@ -94,7 +94,6 @@ public override async Task ExecuteAsync(CommandContext context, options.UploadSizeBytes, options.SecurityType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(disk), ComputeJsonContext.Default.DiskCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskDeleteCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskDeleteCommand.cs index a176662117..60f55dd20c 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskDeleteCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskGetCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskGetCommand.cs index b60034cda6..8271fa17f2 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskGetCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new([disk]), ComputeJsonContext.Default.DiskGetCommandResult); @@ -65,7 +64,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); // Apply wildcard filtering if disk name pattern is provided diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskUpdateCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskUpdateCommand.cs index 3b1d7bd854..9c0c131dfa 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskUpdateCommand.cs @@ -70,7 +70,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, null, options.Tenant, - options.RetryPolicy, cancellationToken); var matchingDisks = disks @@ -120,7 +119,6 @@ public override async Task ExecuteAsync(CommandContext context, options.DiskAccess, options.Tier, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(disk), ComputeJsonContext.Default.DiskUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmCreateCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmCreateCommand.cs index eae7d811cb..fc43058b7a 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmCreateCommand.cs @@ -100,7 +100,6 @@ public override async Task ExecuteAsync(CommandContext context, options.OsDiskSizeGb, options.OsDiskType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result), ComputeJsonContext.Default.VmCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmDeleteCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmDeleteCommand.cs index 86defcdd74..138d58f917 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmDeleteCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ForceDeletion ? true : null, options.Tenant, - options.RetryPolicy, cancellationToken); var message = deleted diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmGetCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmGetCommand.cs index 7212241407..4cf7f366fc 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmGetCommand.cs @@ -62,7 +62,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -76,7 +75,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(vm, null, null), ComputeJsonContext.Default.VmGetResult); @@ -89,7 +87,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, null, vms), ComputeJsonContext.Default.VmGetResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmPowerStateCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmPowerStateCommand.cs index f8e72c8c17..5bd5dbf453 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmPowerStateCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmPowerStateCommand.cs @@ -75,7 +75,6 @@ public override async Task ExecuteAsync(CommandContext context, options.NoWait, options.SkipShutdown, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmUpdateCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmUpdateCommand.cs index 52eb3adbfd..0c5c35b487 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmUpdateCommand.cs @@ -70,7 +70,6 @@ public override async Task ExecuteAsync(CommandContext context, options.BootDiagnostics, options.UserData, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result), ComputeJsonContext.Default.VmUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssCreateCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssCreateCommand.cs index 5c3bd584a8..54cb1e66eb 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssCreateCommand.cs @@ -100,7 +100,6 @@ public override async Task ExecuteAsync(CommandContext context, options.OsDiskSizeGb, options.OsDiskType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result), ComputeJsonContext.Default.VmssCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssDeleteCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssDeleteCommand.cs index 9bb191e209..9ebd4ab516 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssDeleteCommand.cs @@ -48,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ForceDeletion ? true : null, options.Tenant, - options.RetryPolicy, cancellationToken); var message = deleted diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssGetCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssGetCommand.cs index 28400d2edf..f414f757d3 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssGetCommand.cs @@ -61,7 +61,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, vmInstance, null), ComputeJsonContext.Default.VmssGetResult); @@ -74,7 +73,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(vmss, null, null), ComputeJsonContext.Default.VmssGetResult); @@ -86,7 +84,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, null, vmssList ?? []), ComputeJsonContext.Default.VmssGetResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssUpdateCommand.cs b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssUpdateCommand.cs index 12e0b2ec46..2d15dabd07 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssUpdateCommand.cs @@ -72,7 +72,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ScaleInPolicy, options.Tags, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result), ComputeJsonContext.Default.VmssUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskCreateOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskCreateOptions.cs index 0fca44aae0..5a213383b9 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskCreateOptions.cs @@ -158,6 +158,4 @@ public sealed class DiskCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskDeleteOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskDeleteOptions.cs index 1827b4802e..72f732dd8e 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskDeleteOptions.cs @@ -26,6 +26,4 @@ public sealed class DiskDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskGetOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskGetOptions.cs index 738facdf93..144fc6a835 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskGetOptions.cs @@ -26,6 +26,4 @@ public sealed class DiskGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskUpdateOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskUpdateOptions.cs index 026a54edaa..8dc5415f06 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskUpdateOptions.cs @@ -98,6 +98,4 @@ public sealed class DiskUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmCreateOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmCreateOptions.cs index 6d03b5b2ec..26ee06a7dd 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmCreateOptions.cs @@ -68,6 +68,4 @@ public sealed class VmCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmDeleteOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmDeleteOptions.cs index e32d311e59..1acaa50ffa 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmDeleteOptions.cs @@ -23,6 +23,4 @@ public sealed class VmDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmGetOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmGetOptions.cs index 5c595c1408..cd4a865a46 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmGetOptions.cs @@ -23,6 +23,4 @@ public sealed class VmGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmPowerStateOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmPowerStateOptions.cs index fb3b6cd1a6..16a448c333 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmPowerStateOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmPowerStateOptions.cs @@ -29,6 +29,4 @@ public sealed class VmPowerStateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmUpdateOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmUpdateOptions.cs index e775b3f47d..648937c2ac 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmUpdateOptions.cs @@ -35,6 +35,4 @@ public sealed class VmUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssCreateOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssCreateOptions.cs index 467ee72388..c3e73d71d1 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssCreateOptions.cs @@ -62,6 +62,4 @@ public sealed class VmssCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssDeleteOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssDeleteOptions.cs index 2493a28d66..087417d016 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssDeleteOptions.cs @@ -23,6 +23,4 @@ public sealed class VmssDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssGetOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssGetOptions.cs index eebc18b79c..8412014074 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssGetOptions.cs @@ -23,6 +23,4 @@ public sealed class VmssGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssUpdateOptions.cs b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssUpdateOptions.cs index 70dc92158e..732ede041b 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssUpdateOptions.cs @@ -41,6 +41,4 @@ public sealed class VmssUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs b/tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs index f506e7dfa6..45eb39b199 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs @@ -15,7 +15,6 @@ using Microsoft.Extensions.Options; using Microsoft.Mcp.Core.Areas.Server.Options; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Compute.Services; @@ -84,10 +83,9 @@ public async Task CreateVmAsync( int? osDiskSizeGb = null, string? osDiskType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -512,10 +510,9 @@ public async Task GetVmAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -532,10 +529,9 @@ public async Task> ListVmsAsync( string? resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -565,10 +561,9 @@ public async Task GetVmInstanceViewAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -588,10 +583,9 @@ public async Task GetVmInstanceViewAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -613,10 +607,9 @@ public async Task GetVmssAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -633,10 +626,9 @@ public async Task> ListVmssAsync( string? resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -666,10 +658,9 @@ public async Task> ListVmssVmsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -694,10 +685,9 @@ public async Task GetVmssVmAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -733,10 +723,9 @@ public async Task CreateVmssAsync( int? osDiskSizeGb = null, string? osDiskType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -903,10 +892,9 @@ public async Task UpdateVmssAsync( string? scaleInPolicy = null, string? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -1019,10 +1007,9 @@ public async Task UpdateVmAsync( string? bootDiagnostics = null, string? userData = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -1134,10 +1121,9 @@ public async Task DeleteVmAsync( string subscription, bool? forceDeletion = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -1169,10 +1155,9 @@ public async Task ChangeVmPowerStateAsync( bool noWait = false, bool skipShutdown = false, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -1228,10 +1213,9 @@ public async Task DeleteVmssAsync( string subscription, bool? forceDeletion = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); @@ -1452,10 +1436,9 @@ public async Task GetDiskAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroups().GetAsync(resourceGroup, cancellationToken); @@ -1468,12 +1451,11 @@ public async Task> ListDisksAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var disks = new List(); @@ -1566,10 +1548,9 @@ public async Task CreateDiskAsync( long? uploadSizeBytes = null, string? securityType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, retryPolicy: null, armClientOptions: null, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var rgResource = await subscriptionResource.GetResourceGroups().GetAsync(resourceGroup, cancellationToken); @@ -1699,10 +1680,9 @@ public async Task UpdateDiskAsync( string? diskAccessId = null, string? tier = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var rgResource = await subscriptionResource.GetResourceGroups().GetAsync(resourceGroup, cancellationToken); @@ -1835,12 +1815,11 @@ public async Task DeleteDiskAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroups().GetAsync(resourceGroup, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Compute/src/Services/IComputeService.cs b/tools/Azure.Mcp.Tools.Compute/src/Services/IComputeService.cs index 5d4b614eb6..d43e7cb160 100644 --- a/tools/Azure.Mcp.Tools.Compute/src/Services/IComputeService.cs +++ b/tools/Azure.Mcp.Tools.Compute/src/Services/IComputeService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Compute.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Compute.Services; @@ -14,14 +13,12 @@ Task GetVmAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListVmsAsync( string? resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetVmInstanceViewAsync( @@ -29,7 +26,6 @@ Task GetVmInstanceViewAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task<(VmInfo VmInfo, VmInstanceView InstanceView)> GetVmWithInstanceViewAsync( @@ -37,7 +33,6 @@ Task GetVmInstanceViewAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateVmAsync( @@ -61,7 +56,6 @@ Task CreateVmAsync( int? osDiskSizeGb = null, string? osDiskType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // Virtual Machine Scale Set operations @@ -70,14 +64,12 @@ Task GetVmssAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListVmssAsync( string? resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListVmssVmsAsync( @@ -85,7 +77,6 @@ Task> ListVmssVmsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetVmssVmAsync( @@ -94,7 +85,6 @@ Task GetVmssVmAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateVmssAsync( @@ -116,7 +106,6 @@ Task CreateVmssAsync( int? osDiskSizeGb = null, string? osDiskType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task UpdateVmssAsync( @@ -131,7 +120,6 @@ Task UpdateVmssAsync( string? scaleInPolicy = null, string? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task UpdateVmAsync( @@ -144,7 +132,6 @@ Task UpdateVmAsync( string? bootDiagnostics = null, string? userData = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // Delete operations @@ -154,7 +141,6 @@ Task DeleteVmAsync( string subscription, bool? forceDeletion = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // Power state operations @@ -166,7 +152,6 @@ Task ChangeVmPowerStateAsync( bool noWait = false, bool skipShutdown = false, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteVmssAsync( @@ -175,7 +160,6 @@ Task DeleteVmssAsync( string subscription, bool? forceDeletion = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // Disk operations @@ -184,14 +168,12 @@ Task GetDiskAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListDisksAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateDiskAsync( @@ -221,7 +203,6 @@ Task CreateDiskAsync( long? uploadSizeBytes = null, string? securityType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task UpdateDiskAsync( @@ -241,7 +222,6 @@ Task UpdateDiskAsync( string? diskAccessId = null, string? tier = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteDiskAsync( @@ -249,6 +229,5 @@ Task DeleteDiskAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskCreateCommandTests.cs index 6cec83dad5..5645e41037 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskCreateCommandTests.cs @@ -10,7 +10,6 @@ using Azure.Mcp.Tools.Compute.Services; using Azure.ResourceManager; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -94,7 +93,6 @@ public async Task ExecuteAsync_CreateDisk_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -170,7 +168,6 @@ public async Task ExecuteAsync_CreateDiskWithAllOptions_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -244,7 +241,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -314,7 +310,6 @@ public async Task ExecuteAsync_CreateDiskWithoutLocation_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -378,7 +373,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service unavailable")); @@ -479,7 +473,6 @@ public async Task ExecuteAsync_CreateDiskFromSourceResourceId_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -545,7 +538,6 @@ public async Task ExecuteAsync_CreateDiskFromBlobUri_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -617,7 +609,6 @@ public async Task ExecuteAsync_CreateDiskWithTier1Parameters_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -668,7 +659,6 @@ await Service.Received(1).CreateDiskAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -722,7 +712,6 @@ public async Task ExecuteAsync_CreateDiskWithPerformanceOptions_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -808,7 +797,6 @@ public async Task ExecuteAsync_CreateDiskForUpload_ReturnsSuccess() uploadSizeBytes, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -891,7 +879,6 @@ public async Task ExecuteAsync_CreateDiskForUploadWithSecurityData_ReturnsSucces uploadSizeBytes, "TrustedLaunch", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -961,7 +948,6 @@ public async Task ExecuteAsync_CreateDiskFromGalleryImage_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -1028,7 +1014,6 @@ public async Task ExecuteAsync_CreateDiskFromGalleryImageWithLun_ReturnsSuccess( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -1073,7 +1058,6 @@ await Service.Received(1).CreateDiskAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -1181,7 +1165,6 @@ public async Task ExecuteAsync_CreateDiskFromHttpSource_ReturnsError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new SecurityException("Endpoint must use HTTPS protocol. Got: http")); @@ -1231,7 +1214,6 @@ public async Task ExecuteAsync_CreateDiskFromNonAzureBlobUri_ReturnsError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new SecurityException("Endpoint host 'evil-server.com' is not a valid storage-blob domain for Azure Public Cloud.")); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskDeleteCommandTests.cs index 3d39ec1038..86ebde2ce9 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskDeleteCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Compute.Commands; using Azure.Mcp.Tools.Compute.Commands.Disk; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -41,7 +40,6 @@ public async Task ExecuteAsync_DeletesDisk_ReturnsSuccess() resourceGroup, subscription, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -71,7 +69,6 @@ public async Task ExecuteAsync_DiskNotFound_ReturnsFalse() resourceGroup, subscription, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(false); @@ -101,7 +98,6 @@ public async Task ExecuteAsync_DeserializationValidation() resourceGroup, subscription, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -157,7 +153,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() resourceGroup, subscription, Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException("Conflict")); @@ -192,7 +187,6 @@ await Service.Received().DeleteDiskAsync( resourceGroup, subscription, Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskGetCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskGetCommandTests.cs index 6dbb828586..7d808822ee 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskGetCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.Compute.Commands; using Azure.Mcp.Tools.Compute.Commands.Disk; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -59,7 +58,6 @@ public async Task ExecuteAsync_ListAllDisks_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisks); @@ -100,7 +98,6 @@ public async Task ExecuteAsync_ListDisksInResourceGroup_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisks); @@ -141,7 +138,6 @@ public async Task ExecuteAsync_SpecificDisk_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -183,7 +179,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -246,7 +241,6 @@ public async Task ExecuteAsync_WildcardPatternWithoutResourceGroup_ReturnsFilter Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisks); @@ -306,7 +300,6 @@ public async Task ExecuteAsync_WildcardPatternWithResourceGroup_ReturnsFilteredD Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisks); @@ -359,7 +352,6 @@ public async Task ExecuteAsync_ExactDiskNameWithoutResourceGroup_ReturnsFiltered Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisks); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskUpdateCommandTests.cs index 2cc14445b9..47d839d1b1 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Disk; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -80,7 +79,6 @@ public async Task ExecuteAsync_UpdateDiskSize_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -136,7 +134,6 @@ public async Task ExecuteAsync_UpdateDiskSku_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -191,7 +188,6 @@ public async Task ExecuteAsync_UpdateMultipleProperties_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -251,7 +247,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -296,7 +291,6 @@ public async Task ExecuteAsync_MissingResourceGroup_ResolvesFromSubscription() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(existingDisks); @@ -327,7 +321,6 @@ public async Task ExecuteAsync_MissingResourceGroup_ResolvesFromSubscription() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updatedDisk); @@ -352,7 +345,6 @@ public async Task ExecuteAsync_MissingResourceGroupAndDiskNotFound_ReturnsBadReq Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -388,7 +380,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service unavailable")); @@ -426,7 +417,6 @@ public async Task ExecuteAsync_DiskNotFound_Returns404() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundEx); @@ -507,7 +497,6 @@ public async Task ExecuteAsync_UpdateDiskWithTags_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -539,7 +528,6 @@ await Service.Received(1).UpdateDiskAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -584,7 +572,6 @@ public async Task ExecuteAsync_UpdateDiskWithEncryptionAndTier_ReturnsSuccess() diskAccess, tier, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -619,7 +606,6 @@ await Service.Received(1).UpdateDiskAsync( diskAccess, tier, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -660,7 +646,6 @@ public async Task ExecuteAsync_UpdateDiskWithAllTier1Parameters_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDisk); @@ -717,7 +702,6 @@ await Service.DidNotReceive().UpdateDiskAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmCreateCommandTests.cs index 9a4c6b3343..6dfd1f9592 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Vm; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -81,7 +80,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(createResult); } @@ -139,7 +137,6 @@ public async Task ExecuteAsync_CreatesVmWithLinuxSshKey() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -205,7 +202,6 @@ public async Task ExecuteAsync_HandlesConflictException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -251,7 +247,6 @@ public async Task ExecuteAsync_HandlesForbiddenException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); @@ -307,7 +302,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmDeleteCommandTests.cs index 96b4341418..c943e255be 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmDeleteCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Compute.Commands; using Azure.Mcp.Tools.Compute.Commands.Vm; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -72,7 +70,6 @@ public async Task ExecuteAsync_DeletesVm() Arg.Is(_knownSubscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -99,7 +96,6 @@ public async Task ExecuteAsync_WithForceDeletion_PassesForceDeletionToService() Arg.Is(_knownSubscription), Arg.Is(true), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -119,7 +115,6 @@ await Service.Received(1).DeleteVmAsync( _knownSubscription, true, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -133,7 +128,6 @@ public async Task ExecuteAsync_VmNotFound_ReturnsNotFoundMessage() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(false); @@ -163,7 +157,6 @@ public async Task ExecuteAsync_HandlesForbiddenError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); @@ -190,7 +183,6 @@ public async Task ExecuteAsync_HandlesConflictError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -215,7 +207,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmGetCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmGetCommandTests.cs index 410b121af1..1fd32d1c34 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Vm; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -75,7 +74,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns((vmInfo, instanceView)); } @@ -86,7 +84,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmInfo); } @@ -96,7 +93,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmList); } @@ -158,7 +154,6 @@ public async Task ExecuteAsync_ReturnsVmList_WhenListingSubscription() Arg.Is(x => x == null), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedVms); @@ -196,7 +191,6 @@ public async Task ExecuteAsync_ReturnsVmList_WhenListingResourceGroup() Arg.Is(_knownResourceGroup), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedVms); @@ -221,7 +215,6 @@ public async Task ExecuteAsync_ReturnsEmptyList_WhenNoVms() Arg.Any(), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -255,7 +248,6 @@ public async Task ExecuteAsync_ReturnsSpecificVm_WithoutInstanceView() Arg.Is(_knownResourceGroup), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedVm); @@ -312,7 +304,6 @@ public async Task ExecuteAsync_ReturnsSpecificVm_WithInstanceView() Arg.Is(_knownResourceGroup), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns((vmInfo, instanceView)); @@ -355,7 +346,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmInfo); @@ -382,7 +372,6 @@ public async Task ExecuteAsync_HandlesVmNotFoundException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -407,7 +396,6 @@ public async Task ExecuteAsync_HandlesForbiddenException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); @@ -430,7 +418,6 @@ public async Task ExecuteAsync_HandlesGenericException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exception); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmPowerStateCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmPowerStateCommandTests.cs index ee2b785a15..cd6b617d84 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmPowerStateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmPowerStateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Vm; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -54,7 +53,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new VmPowerStateResult("test-vm", null, "test-rg", "start", "Operation completed.", true)); } @@ -93,7 +91,6 @@ public async Task ExecuteAsync_ChangesVmPowerState(string powerAction) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -125,7 +122,6 @@ public async Task ExecuteAsync_WithNoWait_PassesNoWaitToService() Arg.Is(true), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -149,7 +145,6 @@ await Service.Received(1).ChangeVmPowerStateAsync( true, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -169,7 +164,6 @@ public async Task ExecuteAsync_StopWithSkipShutdown_PassesSkipShutdownToService( Arg.Any(), Arg.Is(true), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -192,7 +186,6 @@ await Service.Received(1).ChangeVmPowerStateAsync( Arg.Any(), true, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -210,7 +203,6 @@ public async Task ExecuteAsync_HandlesNotFoundError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -240,7 +232,6 @@ public async Task ExecuteAsync_HandlesForbiddenError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); @@ -270,7 +261,6 @@ public async Task ExecuteAsync_HandlesConflictError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -301,7 +291,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmUpdateCommandTests.cs index c9eeee5467..f2e77a9328 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Vm; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -64,7 +63,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updateResult); } @@ -110,7 +108,6 @@ public async Task ExecuteAsync_UpdatesVmWithTags() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -155,7 +152,6 @@ public async Task ExecuteAsync_UpdatesVmWithLicenseType() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -188,7 +184,6 @@ public async Task ExecuteAsync_HandlesNotFoundError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -220,7 +215,6 @@ public async Task ExecuteAsync_HandlesConflictError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -262,7 +256,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -319,7 +312,6 @@ public async Task ExecuteAsync_UpdatesVmWithUserData_PassesValueToService() Arg.Any(), Arg.Is(base64UserData), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -342,7 +334,6 @@ await Service.Received(1).UpdateVmAsync( Arg.Any(), base64UserData, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -372,7 +363,6 @@ public async Task ExecuteAsync_ClearTagsWithEmptyString_PassesEmptyTagsToService Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -395,7 +385,6 @@ await Service.Received(1).UpdateVmAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -424,7 +413,6 @@ public async Task ExecuteAsync_ClearTagsWithBareOption_PassesEmptyTagsToService( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -445,7 +433,6 @@ await Service.Received(1).UpdateVmAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssCreateCommandTests.cs index 18e764f48e..ad548b8cf1 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Vmss; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -79,7 +78,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(createResult); } @@ -135,7 +133,6 @@ public async Task ExecuteAsync_CreatesVmssWithLinuxSshKey() Arg.Is(40), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -201,7 +198,6 @@ public async Task ExecuteAsync_HandlesConflictException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -255,7 +251,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssDeleteCommandTests.cs index 2918fd774e..9b6de146f7 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssDeleteCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Compute.Commands; using Azure.Mcp.Tools.Compute.Commands.Vmss; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -73,7 +71,6 @@ public async Task ExecuteAsync_DeletesVmss() Arg.Is(_knownSubscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -100,7 +97,6 @@ public async Task ExecuteAsync_WithForceDeletion_PassesForceDeletionToService() Arg.Is(_knownSubscription), Arg.Is(true), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -120,7 +116,6 @@ await Service.Received(1).DeleteVmssAsync( _knownSubscription, true, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -134,7 +129,6 @@ public async Task ExecuteAsync_VmssNotFound_ReturnsNotFoundMessage() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(false); @@ -164,7 +158,6 @@ public async Task ExecuteAsync_HandlesForbiddenError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); @@ -191,7 +184,6 @@ public async Task ExecuteAsync_HandlesConflictError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -216,7 +208,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssGetCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssGetCommandTests.cs index 5cb57e2a90..50cdc9e476 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Vmss; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -87,7 +86,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssList); @@ -96,7 +94,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssInfo); @@ -106,7 +103,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssVmInfo); @@ -164,7 +160,6 @@ public async Task ExecuteAsync_ReturnsVmssList_WhenListingSubscription() Arg.Is((string?)null), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssList); @@ -203,7 +198,6 @@ public async Task ExecuteAsync_ReturnsVmssList_WhenListingResourceGroup() Arg.Is(_knownResourceGroup), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssList); @@ -228,7 +222,6 @@ public async Task ExecuteAsync_ReturnsEmptyList_WhenNoVmss() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new List()); @@ -263,7 +256,6 @@ public async Task ExecuteAsync_ReturnsSpecificVmss() Arg.Is(_knownResourceGroup), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssInfo); @@ -304,7 +296,6 @@ public async Task ExecuteAsync_ReturnsVmssVmInstance() Arg.Is(_knownResourceGroup), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssVmInfo); @@ -345,7 +336,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(vmssInfo); @@ -372,7 +362,6 @@ public async Task ExecuteAsync_HandlesVmssNotFoundException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -399,7 +388,6 @@ public async Task ExecuteAsync_HandlesVmssVmNotFoundException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -425,7 +413,6 @@ public async Task ExecuteAsync_HandlesForbiddenException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); @@ -448,7 +435,6 @@ public async Task ExecuteAsync_HandlesGenericException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exception); diff --git a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssUpdateCommandTests.cs index 277ff0a5a2..394df321b4 100644 --- a/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Compute.Commands.Vmss; using Azure.Mcp.Tools.Compute.Models; using Azure.Mcp.Tools.Compute.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -67,7 +66,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updateResult); } @@ -114,7 +112,6 @@ public async Task ExecuteAsync_UpdatesVmssTags() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -159,7 +156,6 @@ public async Task ExecuteAsync_ClearTagsWithBareOption_PassesEmptyTagsToService( Arg.Any(), Arg.Is(string.Empty), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -182,7 +178,6 @@ await Service.Received(1).UpdateVmssAsync( Arg.Any(), string.Empty, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -213,7 +208,6 @@ public async Task ExecuteAsync_UpdatesVmssUpgradePolicy() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -248,7 +242,6 @@ public async Task ExecuteAsync_HandlesNotFoundError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -282,7 +275,6 @@ public async Task ExecuteAsync_HandlesQuotaExceeded() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(quotaException); @@ -325,7 +317,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); diff --git a/tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerApp/ContainerAppListCommand.cs b/tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerApp/ContainerAppListCommand.cs index 6d0d896b0e..9c912fa0e2 100644 --- a/tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerApp/ContainerAppListCommand.cs +++ b/tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerApp/ContainerAppListCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(containerApps?.Results ?? [], containerApps?.AreResultsTruncated ?? false), ContainerAppsJsonContext.Default.ContainerAppListCommandResult); diff --git a/tools/Azure.Mcp.Tools.ContainerApps/src/Options/ContainerApp/ContainerAppListOptions.cs b/tools/Azure.Mcp.Tools.ContainerApps/src/Options/ContainerApp/ContainerAppListOptions.cs index b22dc6d427..e71f96c83d 100644 --- a/tools/Azure.Mcp.Tools.ContainerApps/src/Options/ContainerApp/ContainerAppListOptions.cs +++ b/tools/Azure.Mcp.Tools.ContainerApps/src/Options/ContainerApp/ContainerAppListOptions.cs @@ -17,6 +17,4 @@ public sealed class ContainerAppListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ContainerApps/src/Services/ContainerAppsService.cs b/tools/Azure.Mcp.Tools.ContainerApps/src/Services/ContainerAppsService.cs index db0f8adbde..f98e6639d7 100644 --- a/tools/Azure.Mcp.Tools.ContainerApps/src/Services/ContainerAppsService.cs +++ b/tools/Azure.Mcp.Tools.ContainerApps/src/Services/ContainerAppsService.cs @@ -4,7 +4,6 @@ using System.Text.Json; using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.ContainerApps.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ContainerApps.Services; @@ -15,7 +14,6 @@ public async Task> ListContainerApps( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -24,7 +22,7 @@ public async Task> ListContainerApps( "Microsoft.App/containerApps", resourceGroup, subscription, - retryPolicy, + null, ConvertToContainerAppInfoModel, tenant: tenant, cancellationToken: cancellationToken); diff --git a/tools/Azure.Mcp.Tools.ContainerApps/src/Services/IContainerAppsService.cs b/tools/Azure.Mcp.Tools.ContainerApps/src/Services/IContainerAppsService.cs index b06c75d957..7fff8b45ac 100644 --- a/tools/Azure.Mcp.Tools.ContainerApps/src/Services/IContainerAppsService.cs +++ b/tools/Azure.Mcp.Tools.ContainerApps/src/Services/IContainerAppsService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.ContainerApps.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ContainerApps.Services; @@ -13,6 +12,5 @@ Task> ListContainerApps( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.Tests/ContainerApp/ContainerAppListCommandTests.cs b/tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.Tests/ContainerApp/ContainerAppListCommandTests.cs index de1241c72f..0dc8bb9fdf 100644 --- a/tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.Tests/ContainerApp/ContainerAppListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ContainerApps/tests/Azure.Mcp.Tools.ContainerApps.Tests/ContainerApp/ContainerAppListCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.ContainerApps.Commands.ContainerApp; using Azure.Mcp.Tools.ContainerApps.Models; using Azure.Mcp.Tools.ContainerApps.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS // Arrange if (shouldSucceed) { - Service.ListContainerApps(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListContainerApps(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults( [ new("app1", "eastus", "rg1", "/subscriptions/sub/resourceGroups/rg1/providers/Microsoft.App/managedEnvironments/env1", "Succeeded"), @@ -62,7 +61,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS public async Task ExecuteAsync_HandlesServiceErrors() { // Arrange - Service.ListContainerApps(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListContainerApps(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -79,7 +78,7 @@ public async Task ExecuteAsync_FiltersByResourceGroup_ReturnsFilteredContainerAp { // Arrange var expectedApps = new ResourceQueryResults([new("app1", null, null, null, null)], false); - Service.ListContainerApps("sub", "rg", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListContainerApps("sub", "rg", Arg.Any(), Arg.Any()) .Returns(expectedApps); // Act @@ -88,14 +87,14 @@ public async Task ExecuteAsync_FiltersByResourceGroup_ReturnsFilteredContainerAp // Assert Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); - await Service.Received(1).ListContainerApps("sub", "rg", Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListContainerApps("sub", "rg", Arg.Any(), Arg.Any()); } [Fact] public async Task ExecuteAsync_EmptyList_ReturnsEmptyResults() { // Arrange - Service.ListContainerApps("sub", null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListContainerApps("sub", null, Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -111,7 +110,7 @@ public async Task ExecuteAsync_PropagatesTenantToService() { // Arrange var expectedApps = new ResourceQueryResults([new("app1", null, null, null, null)], false); - Service.ListContainerApps("sub", Arg.Any(), "my-tenant", Arg.Any(), Arg.Any()) + Service.ListContainerApps("sub", Arg.Any(), "my-tenant", Arg.Any()) .Returns(expectedApps); // Act @@ -119,7 +118,7 @@ public async Task ExecuteAsync_PropagatesTenantToService() // Assert Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).ListContainerApps("sub", Arg.Any(), "my-tenant", Arg.Any(), Arg.Any()); + await Service.Received(1).ListContainerApps("sub", Arg.Any(), "my-tenant", Arg.Any()); } [Fact] @@ -127,7 +126,7 @@ public async Task ExecuteAsync_ReturnsExpectedContainerAppProperties() { // Arrange var containerApp = new ContainerAppInfo("myapp", "eastus", "myrg", "/subscriptions/sub/resourceGroups/myrg/providers/Microsoft.App/managedEnvironments/myenv", "Succeeded"); - Service.ListContainerApps("sub", null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListContainerApps("sub", null, Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([containerApp], false)); // Act diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Container/ContainerSchemaInferCommand.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Container/ContainerSchemaInferCommand.cs index b339b9ef81..82c83dd71e 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Container/ContainerSchemaInferCommand.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Container/ContainerSchemaInferCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/CosmosListCommand.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/CosmosListCommand.cs index 9501e8ebce..013f04dff9 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/CosmosListCommand.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/CosmosListCommand.cs @@ -53,7 +53,6 @@ public override async Task ExecuteAsync(CommandContext context, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, options.ResourceGroup, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -69,7 +68,6 @@ public override async Task ExecuteAsync(CommandContext context, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, options.ResourceGroup, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -83,7 +81,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemGetCommand.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemGetCommand.cs index c3d64030a4..9ed029f405 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemGetCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemListRecentCommand.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemListRecentCommand.cs index 46533d830e..64c3fbd218 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemListRecentCommand.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemListRecentCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemTextSearchCommand.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemTextSearchCommand.cs index dfdb535c00..13f60914c1 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemTextSearchCommand.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemTextSearchCommand.cs @@ -85,7 +85,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemVectorSearchCommand.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemVectorSearchCommand.cs index 7fd6e0fb3d..f3999a3be6 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemVectorSearchCommand.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/Item/ItemVectorSearchCommand.cs @@ -132,7 +132,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/ItemQueryCommand.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/ItemQueryCommand.cs index 022bc33207..4763ce0733 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Commands/ItemQueryCommand.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Commands/ItemQueryCommand.cs @@ -59,7 +59,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.AuthMethod ?? AuthMethod.Credential, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(items ?? []), CosmosJsonContext.Default.ItemQueryCommandResult); diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Container/ContainerSchemaInferOptions.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Container/ContainerSchemaInferOptions.cs index 8edc02a308..ccab95620f 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Container/ContainerSchemaInferOptions.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Container/ContainerSchemaInferOptions.cs @@ -27,8 +27,6 @@ public sealed class ContainerSchemaInferOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Options/CosmosListOptions.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Options/CosmosListOptions.cs index 809ee2b6d8..1775854f66 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Options/CosmosListOptions.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Options/CosmosListOptions.cs @@ -24,8 +24,6 @@ public sealed class CosmosListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemGetOptions.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemGetOptions.cs index 26bdf46495..1945298411 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemGetOptions.cs @@ -30,8 +30,6 @@ public sealed class ItemGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemListRecentOptions.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemListRecentOptions.cs index c5726a7982..b8255344b8 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemListRecentOptions.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemListRecentOptions.cs @@ -27,8 +27,6 @@ public sealed class ItemListRecentOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemTextSearchOptions.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemTextSearchOptions.cs index 49723e0ffa..bfa635b9f1 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemTextSearchOptions.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemTextSearchOptions.cs @@ -36,8 +36,6 @@ public sealed class ItemTextSearchOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemVectorSearchOptions.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemVectorSearchOptions.cs index d504d3537f..2ff540225e 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemVectorSearchOptions.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemVectorSearchOptions.cs @@ -45,8 +45,6 @@ public sealed class ItemVectorSearchOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Options/ItemQueryOptions.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Options/ItemQueryOptions.cs index 71e03a8240..a149ee9643 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Options/ItemQueryOptions.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Options/ItemQueryOptions.cs @@ -27,8 +27,6 @@ public sealed class ItemQueryOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs index 00bdc9e0a8..013188fbc1 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs @@ -12,7 +12,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Helpers; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure; using Microsoft.Mcp.Core.Services.Azure.Authentication; using Microsoft.Mcp.Core.Services.Caching; @@ -37,12 +36,11 @@ private async Task GetCosmosAccountAsync( string accountName, string? tenant = null, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(accountName), accountName)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); // Fast path: when the resource group is known, look the account up directly // instead of enumerating every Cosmos DB account in the subscription. @@ -88,7 +86,6 @@ private async Task CreateCosmosClientWithAuth( AuthMethod authMethod, string? tenant = null, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { // Enable bulk execution and distributed tracing telemetry features once they are supported by the Microsoft.Azure.Cosmos.Aot package. @@ -97,21 +94,13 @@ private async Task CreateCosmosClientWithAuth( var clientOptions = new CosmosClientOptions(); clientOptions.CustomHandlers.Add(new UserPolicyRequestHandler(UserAgent)); - if (retryPolicy != null) - { - if (retryPolicy.MaxRetries is { } maxRetries) - clientOptions.MaxRetryAttemptsOnRateLimitedRequests = maxRetries; - if (retryPolicy.MaxDelaySeconds is { } maxDelaySeconds) - clientOptions.MaxRetryWaitTimeOnRateLimitedRequests = TimeSpan.FromSeconds(maxDelaySeconds); - } - clientOptions.HttpClientFactory = () => AzureService.GetClient(); CosmosClient cosmosClient; switch (authMethod) { case AuthMethod.Key: - var cosmosAccount = await GetCosmosAccountAsync(subscription, accountName, tenant, resourceGroup, retryPolicy, cancellationToken); + var cosmosAccount = await GetCosmosAccountAsync(subscription, accountName, tenant, resourceGroup, cancellationToken); var keys = await cosmosAccount.GetKeysAsync(cancellationToken); cosmosClient = new(GetCosmosBaseUri(accountName), keys.Value.PrimaryMasterKey, clientOptions); break; @@ -151,7 +140,6 @@ private async Task GetCosmosClientAsync( AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(subscription), subscription)); @@ -167,18 +155,17 @@ private async Task GetCosmosClientAsync( authMethod, tenant, resourceGroup, - retryPolicy, cancellationToken); await _cacheService.SetAsync(CacheGroup, key, cosmosClient, s_cacheDurationClients, cancellationToken); return cosmosClient; } - public async Task> GetCosmosAccounts(string subscription, string? resourceGroup = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> GetCosmosAccounts(string subscription, string? resourceGroup = null, string? tenant = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var accounts = new List(); if (!string.IsNullOrEmpty(resourceGroup)) @@ -224,7 +211,6 @@ public async Task> ListDatabases( AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(subscription), subscription)); @@ -237,7 +223,7 @@ public async Task> ListDatabases( return cachedDatabases; } - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup, cancellationToken); var databases = new List(); var iterator = client.GetDatabaseQueryStreamIterator(); @@ -271,7 +257,6 @@ public async Task> ListContainers( AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(databaseName), databaseName), (nameof(subscription), subscription)); @@ -284,7 +269,7 @@ public async Task> ListContainers( return cachedContainers; } - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup, cancellationToken); var containers = new List(); var database = client.GetDatabase(databaseName); @@ -320,12 +305,11 @@ public async Task> QueryItems( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(accountName), accountName), (nameof(databaseName), databaseName), (nameof(containerName), containerName), (nameof(subscription), subscription)); - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, null, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup: null, cancellationToken: cancellationToken); var container = client.GetContainer(databaseName, containerName); var baseQuery = string.IsNullOrEmpty(query) ? "SELECT * FROM c" : query; @@ -364,7 +348,6 @@ public async Task GetApproximateSchema( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -373,7 +356,7 @@ public async Task GetApproximateSchema( (nameof(containerName), containerName), (nameof(subscription), subscription)); - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, null, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup: null, cancellationToken: cancellationToken); var container = client.GetContainer(databaseName, containerName); var queryDef = new QueryDefinition("SELECT TOP @sampleSize * FROM c") @@ -448,7 +431,6 @@ public async Task> GetRecentItems( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -457,7 +439,7 @@ public async Task> GetRecentItems( (nameof(containerName), containerName), (nameof(subscription), subscription)); - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, null, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup: null, cancellationToken: cancellationToken); var container = client.GetContainer(databaseName, containerName); var queryDef = new QueryDefinition("SELECT TOP @topN * FROM c ORDER BY c._ts DESC") @@ -500,7 +482,6 @@ public async Task> GetRecentItems( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -510,7 +491,7 @@ public async Task> GetRecentItems( (nameof(id), id), (nameof(subscription), subscription)); - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, null, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup: null, cancellationToken: cancellationToken); var container = client.GetContainer(databaseName, containerName); // TODO: When Microsoft.Azure.Cosmos.Aot covers ReadItemStreamAsync + CosmosException, restore the @@ -558,7 +539,6 @@ public async Task> TextSearch( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -569,7 +549,7 @@ public async Task> TextSearch( (nameof(searchPhrase), searchPhrase), (nameof(subscription), subscription)); - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, null, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup: null, cancellationToken: cancellationToken); var container = client.GetContainer(databaseName, containerName); var selectClause = propertiesToSelect is { Count: > 0 } @@ -621,7 +601,6 @@ public async Task> VectorSearch( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -631,7 +610,7 @@ public async Task> VectorSearch( (nameof(vectorProperty), vectorProperty), (nameof(subscription), subscription)); - var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, null, retryPolicy, cancellationToken); + var client = await GetCosmosClientAsync(accountName, subscription, authMethod, tenant, resourceGroup: null, cancellationToken: cancellationToken); var container = client.GetContainer(databaseName, containerName); // Inline the embedding as a JSON array literal. The Cosmos AOT serializer diff --git a/tools/Azure.Mcp.Tools.Cosmos/src/Services/ICosmosService.cs b/tools/Azure.Mcp.Tools.Cosmos/src/Services/ICosmosService.cs index aa2b206aa7..ec504efb5c 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/src/Services/ICosmosService.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/src/Services/ICosmosService.cs @@ -4,7 +4,6 @@ using System.Text.Json; using Azure.Mcp.Tools.Cosmos.Models; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Cosmos.Services; @@ -14,7 +13,6 @@ Task> GetCosmosAccounts( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListDatabases( @@ -23,7 +21,6 @@ Task> ListDatabases( AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListContainers( @@ -33,7 +30,6 @@ Task> ListContainers( AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> QueryItems( @@ -44,7 +40,6 @@ Task> QueryItems( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetApproximateSchema( @@ -55,7 +50,6 @@ Task GetApproximateSchema( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetRecentItems( @@ -66,7 +60,6 @@ Task> GetRecentItems( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetItem( @@ -78,7 +71,6 @@ Task> GetRecentItems( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> TextSearch( @@ -92,7 +84,6 @@ Task> TextSearch( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> VectorSearch( @@ -106,7 +97,6 @@ Task> VectorSearch( string subscription, AuthMethod authMethod = AuthMethod.Credential, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GenerateEmbedding( diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Container/ContainerSchemaInferCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Container/ContainerSchemaInferCommandTests.cs index 713e469302..477f4c338d 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Container/ContainerSchemaInferCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Container/ContainerSchemaInferCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Cosmos.Models; using Azure.Mcp.Tools.Cosmos.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,6 @@ public async Task ExecuteAsync_ReturnsSchema_OnSuccess() Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(schema); @@ -82,8 +80,7 @@ public async Task ExecuteAsync_PropagatesServiceErrors() { Service.GetApproximateSchema( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("boom")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosListCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosListCommandTests.cs index ae8947bdb4..f3eaad14df 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Cosmos.Commands; using Azure.Mcp.Tools.Cosmos.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ListsAccounts_WhenNoAccountOrDatabaseProvided() Arg.Is("sub123"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccounts); @@ -70,7 +68,6 @@ public async Task ExecuteAsync_ListsDatabases_WhenAccountProvided() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedDatabases); @@ -97,7 +94,6 @@ public async Task ExecuteAsync_ListsContainers_WhenAccountAndDatabaseProvided() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedContainers); @@ -123,7 +119,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoAccountsExist() Arg.Is("sub123"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -148,7 +143,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoDatabasesExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -174,7 +168,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoContainersExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -224,7 +217,6 @@ public async Task ExecuteAsync_ReturnsError_WhenListAccountsThrows() Arg.Is("sub123"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -246,7 +238,6 @@ public async Task ExecuteAsync_ReturnsError_WhenListDatabasesThrows() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Access denied")); @@ -271,7 +262,6 @@ public async Task ExecuteAsync_ReturnsError_WhenListContainersThrows() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Access denied")); @@ -296,7 +286,6 @@ public async Task ExecuteAsync_Returns404_WhenAccountNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new KeyNotFoundException("Cosmos DB account 'missingaccount' not found in subscription 'sub123'.")); @@ -321,7 +310,6 @@ public async Task ExecuteAsync_ForwardsResourceGroup_WhenListingDatabases() Arg.Any(), Arg.Any(), Arg.Is("rg1"), - Arg.Any(), Arg.Any()) .Returns(expectedDatabases); @@ -341,7 +329,6 @@ await Service.Received(1).ListDatabases( Arg.Any(), Arg.Any(), "rg1", - Arg.Any(), Arg.Any()); } @@ -354,7 +341,6 @@ public async Task ExecuteAsync_ForwardsResourceGroup_WhenListingAccounts() Arg.Is("sub123"), Arg.Is("rg1"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccounts); @@ -371,7 +357,6 @@ await Service.Received(1).GetCosmosAccounts( "sub123", "rg1", Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -383,7 +368,6 @@ public async Task ExecuteAsync_Returns503_WhenServiceIsUnavailable() Arg.Is("sub123"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new HttpRequestException("Service Unavailable", null, HttpStatusCode.ServiceUnavailable)); diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosServiceTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosServiceTests.cs index 2e1c874fe2..63fe3a069b 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/CosmosServiceTests.cs @@ -11,7 +11,6 @@ using Microsoft.Azure.Cosmos; using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; using Microsoft.Mcp.Core.Services.Caching; using NSubstitute; @@ -92,7 +91,7 @@ await Assert.ThrowsAnyAsync(() => // Verify no fallback to key auth: GetSubscription is only called for key-based auth // (to look up the account and retrieve master keys) await _azureService.DidNotReceive() - .GetSubscription(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + .GetSubscription(Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -113,7 +112,7 @@ await Assert.ThrowsAnyAsync(() => // Verify no fallback to key auth await _azureService.DidNotReceive() - .GetSubscription(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + .GetSubscription(Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -216,7 +215,7 @@ public async Task GetCosmosAccounts_ResourceGroupNotFound_ThrowsKeyNotFoundExcep { // Arrange: the resource group lookup returns a 404, which should surface as a not-found. var subscriptionResource = Substitute.For(); - _azureService.GetSubscription("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscription("sub123", Arg.Any(), Arg.Any()) .Returns(subscriptionResource); subscriptionResource.GetResourceGroupAsync("missing-rg", Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Resource group not found")); @@ -238,7 +237,7 @@ public async Task ListDatabases_KeyAuthResourceGroupNotFound_ThrowsKeyNotFoundEx .Returns(default(List)); var subscriptionResource = Substitute.For(); - _azureService.GetSubscription("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscription("sub123", Arg.Any(), Arg.Any()) .Returns(subscriptionResource); subscriptionResource.GetResourceGroupAsync("missing-rg", Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Resource group not found")); diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemGetCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemGetCommandTests.cs index 4639470a3a..3fa8b325b5 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemGetCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Cosmos.Commands.Item; using Azure.Mcp.Tools.Cosmos.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -27,8 +26,7 @@ public async Task ExecuteAsync_ReturnsItem_OnSuccess() Service.GetItem( Arg.Is("acct"), Arg.Is("db"), Arg.Is("c"), Arg.Is("abc"), Arg.Is("pk1"), - Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(item); var response = await ExecuteCommandAsync( @@ -50,8 +48,7 @@ public async Task ExecuteAsync_ReturnsNullItem_WhenNotFound() Service.GetItem( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns((JsonElement?)null); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemListRecentCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemListRecentCommandTests.cs index 523965fe0c..194e1b79df 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemListRecentCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemListRecentCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Cosmos.Commands.Item; using Azure.Mcp.Tools.Cosmos.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -30,8 +29,7 @@ public async Task ExecuteAsync_ReturnsItems_OnSuccess() Service.GetRecentItems( Arg.Is("acct"), Arg.Is("db"), Arg.Is("c"), Arg.Is(2), - Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(items); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemQueryCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemQueryCommandTests.cs index 444ae37256..5009c9a5b7 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemQueryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemQueryCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Cosmos.Commands; using Azure.Mcp.Tools.Cosmos.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,6 @@ public async Task ExecuteAsync_ReturnsItems_WhenQueryIsProvided() Arg.Is("sub123"), Arg.Any(), null, - Arg.Any(), Arg.Any()) .Returns(expectedItems); @@ -71,7 +69,6 @@ public async Task ExecuteAsync_ReturnsItems_WhenNoQueryProvided() Arg.Is("sub123"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedItems); @@ -99,7 +96,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoItemsExist() Arg.Is("sub123"), Arg.Is(AuthMethod.Credential), Arg.Is((string?)null), - Arg.Any(), Arg.Any()) .Returns([]); @@ -130,7 +126,6 @@ public async Task ExecuteAsync_Returns500_WhenServiceThrowsException() Arg.Is("sub123"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemTextSearchCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemTextSearchCommandTests.cs index cd77a1dafa..38f0fa8d65 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemTextSearchCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemTextSearchCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Cosmos.Commands.Item; using Azure.Mcp.Tools.Cosmos.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -32,8 +31,7 @@ public async Task ExecuteAsync_ReturnsItems_OnSuccess() Arg.Is("name"), Arg.Is("azure"), Arg.Any?>(), Arg.Is(5), Arg.Is("sub"), - Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(items); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemVectorSearchCommandTests.cs b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemVectorSearchCommandTests.cs index 447db867e5..0f45c4d74b 100644 --- a/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemVectorSearchCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Cosmos/tests/Azure.Mcp.Tools.Cosmos.Tests/Item/ItemVectorSearchCommandTests.cs @@ -9,7 +9,6 @@ using Azure.Mcp.Tools.Cosmos.Models; using Azure.Mcp.Tools.Cosmos.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -41,8 +40,7 @@ public async Task ExecuteAsync_GeneratesEmbedding_AndReturnsItems() Arg.Is?>(p => p != null && p.Count == 2 && p[0] == "id" && p[1] == "title"), Arg.Is>(v => v.Count == 2 && v[0] == 0.5f), Arg.Is(3), - Arg.Is("sub"), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Is("sub"), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(items); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/Namespace/NamespaceListCommand.cs b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/Namespace/NamespaceListCommand.cs index 333106c555..ebee9e6d21 100644 --- a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/Namespace/NamespaceListCommand.cs +++ b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/Namespace/NamespaceListCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync( var namespaces = await _deviceRegistryService.ListNamespacesAsync( options.Subscription!, options.ResourceGroup, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/Namespace/NamespaceListOptions.cs b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/Namespace/NamespaceListOptions.cs index b1f430eebd..a0d060a1c8 100644 --- a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/Namespace/NamespaceListOptions.cs +++ b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/Namespace/NamespaceListOptions.cs @@ -14,6 +14,4 @@ public sealed class NamespaceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/DeviceRegistryService.cs b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/DeviceRegistryService.cs index c2f2fa726f..de21194a50 100644 --- a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/DeviceRegistryService.cs +++ b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/DeviceRegistryService.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.DeviceRegistry.Models; using Azure.Mcp.Tools.DeviceRegistry.Services.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.DeviceRegistry.Services; @@ -15,7 +14,6 @@ public class DeviceRegistryService(IAzureService azureService) public async Task> ListNamespacesAsync( string subscription, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -24,7 +22,7 @@ public async Task> ListNamespa "Microsoft.DeviceRegistry/namespaces", resourceGroup, subscription, - retryPolicy, + null, ConvertToNamespaceInfoModel, cancellationToken: cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/IDeviceRegistryService.cs b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/IDeviceRegistryService.cs index f3e0b96b50..f56ce8257c 100644 --- a/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/IDeviceRegistryService.cs +++ b/tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/IDeviceRegistryService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.DeviceRegistry.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.DeviceRegistry.Services; @@ -12,6 +11,5 @@ public interface IDeviceRegistryService Task> ListNamespacesAsync( string subscription, string? resourceGroup = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.Tests/Namespace/NamespaceListCommandTests.cs b/tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.Tests/Namespace/NamespaceListCommandTests.cs index bc46a09292..b5e5951211 100644 --- a/tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.Tests/Namespace/NamespaceListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.Tests/Namespace/NamespaceListCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.DeviceRegistry.Commands.Namespace; using Azure.Mcp.Tools.DeviceRegistry.Models; using Azure.Mcp.Tools.DeviceRegistry.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,7 +31,6 @@ public async Task ExecuteAsync_ReturnsNamespaces_WhenSubscriptionProvided() Service.ListNamespacesAsync( Arg.Is(subscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedNamespaces); @@ -59,7 +57,6 @@ public async Task ExecuteAsync_ReturnsNamespaces_WhenResourceGroupProvided() Service.ListNamespacesAsync( Arg.Is(subscription), Arg.Is(resourceGroup), - Arg.Any(), Arg.Any()) .Returns(expectedNamespaces); @@ -79,7 +76,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoNamespacesExist() Service.ListNamespacesAsync( Arg.Is(subscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); @@ -99,7 +95,6 @@ public async Task ExecuteAsync_HandlesException() Service.ListNamespacesAsync( Arg.Is(subscription), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -133,7 +128,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS ], false); Service.ListNamespacesAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedNamespaces); } @@ -157,7 +152,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() var subscription = "sub123"; Service.ListNamespacesAsync( - Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(subscription), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync("--subscription", subscription); @@ -172,7 +167,7 @@ public async Task ExecuteAsync_HandlesNotFound() var subscription = "sub123"; Service.ListNamespacesAsync( - Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(subscription), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Resource not found")); var response = await ExecuteCommandAsync("--subscription", subscription); @@ -186,7 +181,7 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() var subscription = "sub123"; Service.ListNamespacesAsync( - Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(subscription), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Forbidden, "Authorization failed")); var response = await ExecuteCommandAsync("--subscription", subscription); diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Events/EventsPublishCommand.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Events/EventsPublishCommand.cs index 1d1b89c520..cb944c5670 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Events/EventsPublishCommand.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Events/EventsPublishCommand.cs @@ -58,7 +58,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Data, options.Schema, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Subscription/SubscriptionListCommand.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Subscription/SubscriptionListCommand.cs index 1a8d70e204..fc5697d986 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Subscription/SubscriptionListCommand.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Subscription/SubscriptionListCommand.cs @@ -72,7 +72,7 @@ public override async Task ExecuteAsync(CommandContext context, { // Iterate all subscriptions and aggregate // TODO (alzimmer): Listing all subscriptions should be done in the IEventGridService implementation. - var allSubs = await _azureService.GetSubscriptions(options.Tenant, options.RetryPolicy, cancellationToken); + var allSubs = await _azureService.GetSubscriptions(options.Tenant, cancellationToken: cancellationToken); var aggregate = new List(); foreach (var sub in allSubs) { @@ -84,7 +84,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Topic, // bare name options.Location, options.Tenant, - options.RetryPolicy, cancellationToken); if (found?.Count > 0) { @@ -107,7 +106,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Topic, options.Location, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(subscriptions ?? []), EventGridJsonContext.Default.SubscriptionListCommandResult); diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Topic/TopicListCommand.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Topic/TopicListCommand.cs index 1605ce4075..4b16a6338a 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Topic/TopicListCommand.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Commands/Topic/TopicListCommand.cs @@ -37,7 +37,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(topics ?? []), EventGridJsonContext.Default.TopicListCommandResult); diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Options/Events/EventsPublishOptions.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Options/Events/EventsPublishOptions.cs index 278977f385..97d803840e 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Options/Events/EventsPublishOptions.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Options/Events/EventsPublishOptions.cs @@ -26,6 +26,4 @@ public sealed class EventsPublishOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Options/Subscription/SubscriptionListOptions.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Options/Subscription/SubscriptionListOptions.cs index 1d2109137d..cdccb9e3be 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Options/Subscription/SubscriptionListOptions.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Options/Subscription/SubscriptionListOptions.cs @@ -23,6 +23,4 @@ public sealed class SubscriptionListOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicListOptions.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicListOptions.cs index 040da5c2f5..f8da98f40b 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicListOptions.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicListOptions.cs @@ -17,6 +17,4 @@ public sealed class TopicListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Services/EventGridService.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Services/EventGridService.cs index 92a4dc7451..af9fdc1db5 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Services/EventGridService.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Services/EventGridService.cs @@ -13,7 +13,6 @@ using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.EventGrid.Services; @@ -26,10 +25,9 @@ public async Task> GetTopicsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var topics = new List(); if (!string.IsNullOrEmpty(resourceGroup)) @@ -61,11 +59,10 @@ public async Task> GetSubscriptionsAsync( string? topicName = null, string? location = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var subscriptions = new List(); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); // If specific topic is requested, get subscriptions for that topic only if (!string.IsNullOrEmpty(topicName)) @@ -88,14 +85,13 @@ public async Task PublishEventAsync( string eventData, string? eventSchema = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var operationId = Guid.NewGuid().ToString(); _logger.LogInformation("Starting event publication. OperationId: {OperationId}, Topic: {TopicName}, ResourceGroup: {ResourceGroup}, Subscription: {Subscription}", operationId, topicName, resourceGroup, subscription); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); // Find the topic to get its endpoint and access key var topic = await FindTopic(subscriptionResource, resourceGroup, topicName, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/Services/IEventGridService.cs b/tools/Azure.Mcp.Tools.EventGrid/src/Services/IEventGridService.cs index c215bb5b3a..aee93a6b62 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/src/Services/IEventGridService.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/src/Services/IEventGridService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.EventGrid.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.EventGrid.Services; @@ -12,7 +11,6 @@ Task> GetTopicsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetSubscriptionsAsync( @@ -21,7 +19,6 @@ Task> GetSubscriptionsAsync( string? topicName = null, string? location = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task PublishEventAsync( @@ -31,6 +28,5 @@ Task PublishEventAsync( string eventData, string? eventSchema = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Events/EventsPublishCommandTests.cs b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Events/EventsPublishCommandTests.cs index c7cc77edae..86ea73aad8 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Events/EventsPublishCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Events/EventsPublishCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.EventGrid.Commands.Events; using Azure.Mcp.Tools.EventGrid.Models; using Azure.Mcp.Tools.EventGrid.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -67,7 +66,6 @@ public async Task ExecuteAsync_WithValidSingleEvent_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -124,7 +122,6 @@ public async Task ExecuteAsync_WithValidArrayOfEvents_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -158,7 +155,6 @@ public async Task ExecuteAsync_WithInvalidJson_Returns400() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new JsonException("Invalid JSON format")); @@ -196,7 +192,6 @@ public async Task ExecuteAsync_WithTopicNotFound_Returns404() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException($"Event Grid topic '{topicName}' not found in resource group '{resourceGroup}'.")); @@ -239,7 +234,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); } @@ -289,7 +283,6 @@ public async Task ExecuteAsync_WithoutResourceGroup_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -337,7 +330,6 @@ public async Task ExecuteAsync_WithCloudEventsSchema_ReturnsSuccess() Arg.Any(), Arg.Is("CloudEvents"), // Verify CloudEvents schema is passed Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -386,7 +378,6 @@ public async Task ExecuteAsync_WithCustomSchema_ReturnsSuccess() Arg.Any(), Arg.Is("Custom"), // Verify Custom schema is passed Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -452,7 +443,6 @@ public async Task ExecuteAsync_WithDifferentSchemas_PassesSchemaCorrectly(string Arg.Any(), Arg.Is(schema), // Verify the schema parameter is passed correctly Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -496,7 +486,6 @@ public async Task ExecuteAsync_WithoutEventSchema_DefaultsToEventGrid() Arg.Any(), Arg.Is(schema => schema == null), // Should be null when not specified Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -532,7 +521,6 @@ public async Task ExecuteAsync_WithAccessDenied_Returns403() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Access denied to Event Grid topic")); @@ -569,7 +557,6 @@ public async Task ExecuteAsync_WithInvalidEventSchema_Returns400() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Invalid event schema specified. Supported schemas are: CloudEvents, EventGrid, or Custom.")); @@ -607,7 +594,6 @@ public async Task ExecuteAsync_WithBadRequestError_Returns400() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(400, "Invalid event data or schema format")); @@ -670,7 +656,6 @@ public async Task ExecuteAsync_WithLargeEventPayload_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -716,7 +701,6 @@ public async Task ExecuteAsync_WithCloudEventsMinimalFields_ReturnsSuccess() Arg.Any(), Arg.Is("CloudEvents"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -766,7 +750,6 @@ public async Task ExecuteAsync_WithCloudEventsDataContentType_ReturnsSuccess() Arg.Any(), Arg.Is("CloudEvents"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -814,7 +797,6 @@ public async Task ExecuteAsync_WithMixedSchemaFields_ReturnsSuccess() Arg.Any(), Arg.Is("Custom"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -869,7 +851,6 @@ public async Task ExecuteAsync_WithSchemaNameCaseInsensitive_ReturnsSuccess(stri Arg.Any(), Arg.Is(schema), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -928,7 +909,6 @@ public async Task ExecuteAsync_WithArrayOfMixedSchemaEvents_ReturnsSuccess() Arg.Any(), Arg.Is("Custom"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); diff --git a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Subscription/SubscriptionListCommandTests.cs b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Subscription/SubscriptionListCommandTests.cs index 49bf517050..08aded5a29 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Subscription/SubscriptionListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Subscription/SubscriptionListCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.EventGrid.Commands.Subscription; using Azure.Mcp.Tools.EventGrid.Services; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,7 @@ public async Task ExecuteAsync_NoParameters_ReturnsSubscriptions() new("subscription2", "Microsoft.EventGrid/eventSubscriptions", "StorageQueue", "https://storage.queue.core.windows.net/myqueue", "Succeeded", null, null, 10, 720, "2023-01-03T00:00:00Z", "2023-01-04T00:00:00Z") }; - Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedSubscriptions); // Act @@ -71,7 +70,7 @@ public async Task ExecuteAsync_WithTopicNameFilter_FiltersCorrectly() new("filtered-subscription", "Microsoft.EventGrid/eventSubscriptions", "WebHook", "https://example.com/webhook", "Succeeded", null, null, 30, 1440, "2023-01-01T00:00:00Z", "2023-01-02T00:00:00Z") }; - Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Is(resourceGroup), Arg.Is(topicName), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Is(resourceGroup), Arg.Is(topicName), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedSubscriptions); // Act @@ -94,7 +93,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoSubscriptions() // Arrange var subscription = "sub123"; - Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -117,7 +116,7 @@ public async Task ExecuteAsync_WithLocationFilter_FiltersCorrectly() new("location-filtered-subscription", "Microsoft.EventGrid/eventSubscriptions", "WebHook", "https://example.com/webhook", "Succeeded", null, null, 30, 1440, "2023-01-01T00:00:00Z", "2023-01-02T00:00:00Z") }; - Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Is(location), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptionsAsync(Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Is(location), Arg.Any(), Arg.Any()) .Returns(expectedSubscriptions); // Act @@ -135,7 +134,7 @@ public async Task ExecuteAsync_WithLocationFilter_FiltersCorrectly() public async Task ExecuteAsync_HandlesServiceErrors() { // Arrange - Service.GetSubscriptionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -160,14 +159,14 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS // Arrange if (shouldSucceed) { - Service.GetSubscriptionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetSubscriptionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns( [ new("subscription1", "Microsoft.EventGrid/eventSubscriptions", "WebHook", "https://example.com/webhook1", "Succeeded", null, null, 30, 1440, "2023-01-01T00:00:00Z", "2023-01-02T00:00:00Z") ]); // Set up subscription service for cross-subscription search scenario - _azureService.GetSubscriptions(Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscriptions(Arg.Any(), Arg.Any()) .Returns([]); } diff --git a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Topic/TopicListCommandTests.cs b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Topic/TopicListCommandTests.cs index 5b09f43a9c..1cb58d3682 100644 --- a/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Topic/TopicListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Topic/TopicListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.EventGrid.Commands; using Azure.Mcp.Tools.EventGrid.Commands.Topic; using Azure.Mcp.Tools.EventGrid.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,7 +32,7 @@ public async Task ExecuteAsync_NoParameters_ReturnsTopics() new("topic2", "westus", "https://topic2.westus.eventgrid.azure.net/api/events", "Succeeded", "Enabled", "EventGridSchema") }; - Service.GetTopicsAsync(Arg.Is(subscriptionId), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetTopicsAsync(Arg.Is(subscriptionId), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedTopics); // Act @@ -53,7 +52,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoTopics() // Arrange var subscriptionId = "sub123"; - Service.GetTopicsAsync(Arg.Is(subscriptionId), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetTopicsAsync(Arg.Is(subscriptionId), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -72,7 +71,7 @@ public async Task ExecuteAsync_HandlesException() var expectedError = "Test error"; var subscriptionId = "sub123"; - Service.GetTopicsAsync(Arg.Is(subscriptionId), null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetTopicsAsync(Arg.Is(subscriptionId), null, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); // Act @@ -100,7 +99,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS new("topic1", "eastus", "https://topic1.eastus.eventgrid.azure.net/api/events", "Succeeded", "Enabled", "EventGridSchema"), new("topic2", "westus", "https://topic2.westus.eventgrid.azure.net/api/events", "Succeeded", "Enabled", "EventGridSchema") }; - Service.GetTopicsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetTopicsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedTopics); } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupDeleteCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupDeleteCommand.cs index cba1d0bad6..42e58f8c81 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupDeleteCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(deleted, options.ConsumerGroup, options.Eventhub, options.Namespace, options.ResourceGroup), EventHubsJsonContext.Default.ConsumerGroupDeleteCommandResult); diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupGetCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupGetCommand.cs index 19c39fd953..5a96f1c689 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupGetCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupGetCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); var singleResult = consumerGroup != null ? [consumerGroup] : new List(); @@ -66,7 +65,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(consumerGroups ?? []), EventHubsJsonContext.Default.ConsumerGroupGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupUpdateCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupUpdateCommand.cs index d3a0cdf6e3..727c8f1421 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/ConsumerGroup/ConsumerGroupUpdateCommand.cs @@ -48,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.UserMetadata, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(consumerGroup), EventHubsJsonContext.Default.ConsumerGroupUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubDeleteCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubDeleteCommand.cs index 81a5fcb4ee..2c27e7c0fd 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubDeleteCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubGetCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubGetCommand.cs index e3488d5830..b761bee41a 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubGetCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubGetCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); var results = eventHub != null ? [eventHub] : new List(); @@ -60,7 +59,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(eventHubs ?? []), EventHubsJsonContext.Default.EventHubGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubUpdateCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubUpdateCommand.cs index 284223efc8..d046dda5f1 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHub/EventHubUpdateCommand.cs @@ -52,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.MessageRetentionInHours, options.Status, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceDeleteCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceDeleteCommand.cs index 4fb86c9be2..a6a445ee6c 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceDeleteCommand.cs @@ -48,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); var message = success diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceGetCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceGetCommand.cs index e3d42c2973..965d5b2903 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceGetCommand.cs @@ -62,7 +62,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = namespaceDetails != null @@ -75,7 +74,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, namespaces ?? []), EventHubsJsonContext.Default.NamespaceGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceUpdateCommand.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceUpdateCommand.cs index 1324913de7..ae74a8dac5 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Commands/Namespace/NamespaceUpdateCommand.cs @@ -101,7 +101,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ZoneRedundant, tags, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupDeleteOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupDeleteOptions.cs index cbe8035963..a8c2644dd6 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupDeleteOptions.cs @@ -26,6 +26,4 @@ public sealed class ConsumerGroupDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupGetOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupGetOptions.cs index effe8b5e24..7a0c091db8 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupGetOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupGetOptions.cs @@ -26,6 +26,4 @@ public sealed class ConsumerGroupGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupUpdateOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupUpdateOptions.cs index 173d578f65..cc71022d68 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupUpdateOptions.cs @@ -29,6 +29,4 @@ public sealed class ConsumerGroupUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubDeleteOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubDeleteOptions.cs index f93a3c4b95..447e653739 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubDeleteOptions.cs @@ -23,6 +23,4 @@ public sealed class EventHubDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubGetOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubGetOptions.cs index 4470c2ebb0..8510f1e64c 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubGetOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubGetOptions.cs @@ -23,6 +23,4 @@ public sealed class EventHubGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubUpdateOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubUpdateOptions.cs index 10536d3592..8964732790 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubUpdateOptions.cs @@ -32,6 +32,4 @@ public sealed class EventHubUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceDeleteOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceDeleteOptions.cs index 3a24695eb9..c202751230 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceDeleteOptions.cs @@ -20,6 +20,4 @@ public sealed class NamespaceDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceGetOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceGetOptions.cs index ce45ac4977..c6c7044fbe 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceGetOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceGetOptions.cs @@ -20,6 +20,4 @@ public sealed class NamespaceGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceUpdateOptions.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceUpdateOptions.cs index 2102de940c..c88afa2d45 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceUpdateOptions.cs @@ -47,6 +47,4 @@ public sealed class NamespaceUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Services/EventHubsService.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Services/EventHubsService.cs index d5a2df377d..fd4513a56e 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Services/EventHubsService.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Services/EventHubsService.cs @@ -7,7 +7,6 @@ using Azure.ResourceManager.EventHubs; using Azure.ResourceManager.EventHubs.Models; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.EventHubs.Services; @@ -61,13 +60,12 @@ public async Task> GetNamespacesAsync( string? resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { // Resource group is optional for subscription-wide listing. ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var namespaces = new List(); if (!string.IsNullOrWhiteSpace(resourceGroup)) @@ -128,7 +126,6 @@ public async Task GetNamespaceAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -136,7 +133,7 @@ public async Task GetNamespaceAsync( (nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -168,12 +165,11 @@ public async Task CreateOrUpdateNamespaceAsync( bool? zoneRedundant = null, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -257,7 +253,6 @@ public async Task DeleteNamespaceAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); @@ -266,9 +261,9 @@ public async Task DeleteNamespaceAsync( { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : await AzureService.GetSubscriptionIdByName(subscription, tenant, retryPolicy, cancellationToken); + : await AzureService.GetSubscriptionIdByName(subscription, tenant, cancellationToken); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); var namespaceId = EventHubsNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroup, namespaceName); // Get the namespace resource @@ -298,12 +293,11 @@ public async Task> GetEventHubsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(namespaceName), namespaceName)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -334,12 +328,11 @@ public async Task> GetEventHubsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(namespaceName), namespaceName), (nameof(eventHubName), eventHubName)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -390,12 +383,11 @@ public async Task CreateOrUpdateEventHubAsync( long? messageRetentionInHours = null, string? status = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(namespaceName), namespaceName)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -520,12 +512,11 @@ public async Task DeleteEventHubAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(eventHubName), eventHubName), (nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); try { @@ -577,12 +568,11 @@ public async Task CreateOrUpdateConsumerGroupAsync( string subscription, string? userMetadata = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(consumerGroupName), consumerGroupName), (nameof(eventHubName), eventHubName), (nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -665,12 +655,11 @@ public async Task DeleteConsumerGroupAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(consumerGroupName), consumerGroupName), (nameof(eventHubName), eventHubName), (nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); try { @@ -727,12 +716,11 @@ public async Task> GetConsumerGroupsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(eventHubName), eventHubName), (nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -771,12 +759,11 @@ public async Task> GetConsumerGroupsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(consumerGroupName), consumerGroupName), (nameof(eventHubName), eventHubName), (nameof(namespaceName), namespaceName), (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await ResolveSubscriptionResourceAsync(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); if (resourceGroupResource?.Value == null) @@ -830,14 +817,13 @@ private static ConsumerGroup ConvertToConsumerGroup(EventHubsConsumerGroupData c private async Task ResolveSubscriptionResourceAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : await AzureService.GetSubscriptionIdByName(subscription, tenant, retryPolicy, cancellationToken); + : await AzureService.GetSubscriptionIdByName(subscription, tenant, cancellationToken); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); return armClient.GetSubscriptionResource( ResourceManager.Resources.SubscriptionResource.CreateResourceIdentifier(subscriptionId)); } diff --git a/tools/Azure.Mcp.Tools.EventHubs/src/Services/IEventHubsService.cs b/tools/Azure.Mcp.Tools.EventHubs/src/Services/IEventHubsService.cs index bef1818688..6ae32c84a1 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/src/Services/IEventHubsService.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/src/Services/IEventHubsService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.EventHubs.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.EventHubs.Services; @@ -12,7 +11,6 @@ Task> GetNamespacesAsync( string? resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetNamespaceAsync( @@ -20,7 +18,6 @@ Task GetNamespaceAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateOrUpdateNamespaceAsync( @@ -37,7 +34,6 @@ Task CreateOrUpdateNamespaceAsync( bool? zoneRedundant = null, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteNamespaceAsync( @@ -45,7 +41,6 @@ Task DeleteNamespaceAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetEventHubsAsync( @@ -53,7 +48,6 @@ Task> GetEventHubsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetEventHubAsync( @@ -62,7 +56,6 @@ Task> GetEventHubsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateOrUpdateEventHubAsync( @@ -74,7 +67,6 @@ Task CreateOrUpdateEventHubAsync( long? messageRetentionInHours = null, string? status = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteEventHubAsync( @@ -83,7 +75,6 @@ Task DeleteEventHubAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateOrUpdateConsumerGroupAsync( @@ -94,7 +85,6 @@ Task CreateOrUpdateConsumerGroupAsync( string subscription, string? userMetadata = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteConsumerGroupAsync( @@ -104,7 +94,6 @@ Task DeleteConsumerGroupAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetConsumerGroupsAsync( @@ -113,7 +102,6 @@ Task> GetConsumerGroupsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetConsumerGroupAsync( @@ -123,6 +111,5 @@ Task> GetConsumerGroupsAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupDeleteCommandTests.cs index ff457d1850..3b640712eb 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupDeleteCommandTests.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.EventHubs.Commands.ConsumerGroup; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,7 +31,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -64,7 +62,6 @@ public async Task ExecuteAsync_DeletesConsumerGroupSuccessfully() "test-rg", "test-subscription", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -87,7 +84,6 @@ await Service.Received(1).DeleteConsumerGroupAsync( "test-rg", Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -102,7 +98,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Consumer group 'test-consumer-group' could not be found")); @@ -130,7 +125,6 @@ public async Task ExecuteAsync_HandlesAuthenticationError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("The current user does not have access to subscription 'unauthorized-sub'")); @@ -164,7 +158,6 @@ public async Task ExecuteAsync_PassesCorrectParameters() resourceGroup, subscriptionId, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -186,7 +179,6 @@ await Service.Received(1).DeleteConsumerGroupAsync( resourceGroup, subscriptionId, Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupGetCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupGetCommandTests.cs index d3135cfce1..1154fe23d4 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupGetCommandTests.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.EventHubs.Commands.ConsumerGroup; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -36,7 +35,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(consumerGroups); @@ -47,7 +45,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(consumerGroups.First()); } @@ -84,7 +81,6 @@ public async Task ExecuteAsync_ListsConsumerGroupsSuccessfully() "test-rg", "test-subscription", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedConsumerGroups); @@ -105,7 +101,6 @@ await Service.Received(1).GetConsumerGroupsAsync( "test-rg", Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -131,7 +126,6 @@ public async Task ExecuteAsync_GetsSingleConsumerGroupSuccessfully() "test-rg", "test-subscription", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedConsumerGroup); @@ -154,7 +148,6 @@ await Service.Received(1).GetConsumerGroupAsync( "test-rg", Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -169,7 +162,6 @@ public async Task ExecuteAsync_ReturnsEmptyListWhenConsumerGroupNotFound() "test-rg", "test-subscription", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns((Models.ConsumerGroup?)null); @@ -196,7 +188,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Event Hub 'test-eventhub' could not be found")); @@ -223,7 +214,6 @@ public async Task ExecuteAsync_HandlesAuthenticationError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("The current user does not have access to subscription 'unauthorized-sub'")); diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupUpdateCommandTests.cs index e2da40b193..eb13faeb29 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/ConsumerGroup/ConsumerGroupUpdateCommandTests.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.EventHubs.Commands.ConsumerGroup; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(consumerGroup); } @@ -89,7 +87,6 @@ public async Task ExecuteAsync_CreatesConsumerGroupWithUserMetadata() "test-subscription", "custom-metadata", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedConsumerGroup); @@ -114,7 +111,6 @@ await Service.Received(1).CreateOrUpdateConsumerGroupAsync( Arg.Any(), "custom-metadata", Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -141,7 +137,6 @@ public async Task ExecuteAsync_CreatesConsumerGroupWithoutUserMetadata() "test-subscription", null, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedConsumerGroup); @@ -165,7 +160,6 @@ await Service.Received(1).CreateOrUpdateConsumerGroupAsync( Arg.Any(), null, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -181,7 +175,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Event Hub 'test-eventhub' could not be found")); @@ -210,7 +203,6 @@ public async Task ExecuteAsync_HandlesAuthenticationError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("The current user does not have access to subscription 'unauthorized-sub'")); diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubDeleteCommandTests.cs index 36d144a97d..904ab89647 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubDeleteCommandTests.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.EventHubs.Commands.EventHub; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -29,7 +28,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -60,7 +58,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Namespace 'test-namespace' not found in resource group 'test-rg'")); @@ -86,7 +83,6 @@ public async Task ExecuteAsync_HandlesAuthenticationError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Authentication failed")); @@ -112,7 +108,6 @@ public async Task ExecuteAsync_SuccessfullyDeletesEventHub() Arg.Is("test-rg"), Arg.Is("test-subscription"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -138,7 +133,6 @@ public async Task ExecuteAsync_IdempotentWhenEventHubNotFound() Arg.Is("test-rg"), Arg.Is("test-subscription"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(false); diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubUpdateCommandTests.cs index f816bd6946..69675ced51 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHub/EventHubUpdateCommandTests.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.EventHubs.Commands.EventHub; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(eventHub); } @@ -81,7 +79,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Namespace 'test-namespace' not found in resource group 'test-rg'")); @@ -110,7 +107,6 @@ public async Task ExecuteAsync_HandlesAuthenticationError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Authentication failed")); @@ -151,7 +147,6 @@ public async Task ExecuteAsync_SuccessfullyCreatesEventHub() Arg.Is(336L), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(eventHub); @@ -194,7 +189,6 @@ public async Task ExecuteAsync_PassesStatusOptionToService() Arg.Any(), Arg.Is("Disabled"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(eventHub); @@ -213,6 +207,6 @@ await Service.Received(1).CreateOrUpdateEventHubAsync( "test-hub", "test-namespace", "test-rg", Arg.Any(), Arg.Any(), Arg.Any(), "Disabled", - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceDeleteCommandTests.cs index a6f78d4a2b..c71e1df68d 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceDeleteCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.EventHubs.Commands; using Azure.Mcp.Tools.EventHubs.Commands.Namespace; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -40,7 +39,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -74,7 +72,6 @@ public async Task ExecuteAsync_DeletesNamespaceSuccessfully() "test-rg", "test-sub", null, - Arg.Any(), Arg.Any()) .Returns(true); @@ -92,7 +89,6 @@ await Service.Received(1).DeleteNamespaceAsync( "test-rg", "test-sub", null, - Arg.Any(), Arg.Any()); } @@ -105,7 +101,6 @@ public async Task ExecuteAsync_DeletesNamespaceWithTenant() "test-rg", "test-sub", "test-tenant-123", - Arg.Any(), Arg.Any()) .Returns(true); @@ -124,7 +119,6 @@ await Service.Received(1).DeleteNamespaceAsync( "test-rg", "test-sub", "test-tenant-123", - Arg.Any(), Arg.Any()); } @@ -137,7 +131,6 @@ public async Task ExecuteAsync_HandlesNamespaceNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new KeyNotFoundException("Namespace not found")); @@ -161,7 +154,6 @@ public async Task ExecuteAsync_HandlesAccessDenied() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Access denied")); @@ -185,7 +177,6 @@ public async Task ExecuteAsync_HandlesConflictError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(409, "Conflict: The namespace cannot be deleted in its current state")); @@ -210,7 +201,6 @@ public async Task ExecuteAsync_HandlesAuthenticationFailure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Identity.AuthenticationFailedException("Authentication failed")); @@ -235,7 +225,6 @@ public async Task ExecuteAsync_HandlesResourceNotFoundError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Resource group not found")); @@ -259,7 +248,6 @@ public async Task ExecuteAsync_HandlesGenericServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Unexpected error")); @@ -283,7 +271,6 @@ public async Task ExecuteAsync_ReturnsSuccessMessage() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -337,7 +324,6 @@ public async Task ExecuteAsync_PassesCorrectParametersToService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -355,7 +341,6 @@ await Service.Received(1).DeleteNamespaceAsync( resourceGroup, Arg.Any(), tenant, - Arg.Any(), Arg.Any()); } @@ -368,7 +353,6 @@ public async Task ExecuteAsync_WithoutTenant_PassesNullTenant() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -385,7 +369,6 @@ await Service.Received(1).DeleteNamespaceAsync( "test-rg", "test-sub", null, // tenant should be null - Arg.Any(), Arg.Any()); } @@ -400,7 +383,6 @@ public async Task ExecuteAsync_WhenNamespaceNotFound_ReturnsNotFoundMessage() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(false); diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceGetCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceGetCommandTests.cs index 578ea3f092..b11254080d 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceGetCommandTests.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.EventHubs.Commands.Namespace; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -21,7 +20,6 @@ public async Task ExecuteAsync_ListWithoutResourceGroup_CallsServiceWithNullReso Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -34,7 +32,6 @@ await Service.Received(1).GetNamespacesAsync( Arg.Is(rg => rg == null), Arg.Is("test-subscription"), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -75,7 +72,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(namespaceDetails); } @@ -105,7 +101,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(namespaces); } @@ -135,7 +130,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Resource Group 'rg-eventhubs-test' could not be found")); @@ -157,7 +151,6 @@ public async Task ExecuteAsync_HandlesAuthenticationError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("The current user does not have access to subscription 'unauthorized-sub'")); diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceUpdateCommandTests.cs index 0639a261d3..f5b4461874 100644 --- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/Namespace/NamespaceUpdateCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.EventHubs.Commands.Namespace; using Azure.Mcp.Tools.EventHubs.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -56,7 +55,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any?>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updatedNamespace); } @@ -100,7 +98,6 @@ public async Task ExecuteAsync_UpdatesNamespaceWithSkuChanges() null, // zoneRedundant null, // tags null, // tenant - Arg.Any(), Arg.Any()) .Returns(updatedNamespace); @@ -130,7 +127,6 @@ await Service.Received(1).CreateOrUpdateNamespaceAsync( null, null, null, - Arg.Any(), Arg.Any()); } @@ -153,7 +149,6 @@ public async Task ExecuteAsync_UpdatesNamespaceWithAutoInflateSettings() Arg.Any(), Arg.Any?>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updatedNamespace); @@ -200,7 +195,6 @@ public async Task ExecuteAsync_UpdatesNamespaceWithTags() tags.ContainsKey("team") && tags["team"] == "platform"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updatedNamespace); @@ -251,7 +245,6 @@ public async Task ExecuteAsync_UpdatesNamespaceWithAllFeatures() true, Arg.Any?>(), null, - Arg.Any(), Arg.Any()) .Returns(updatedNamespace); @@ -285,7 +278,6 @@ await Service.Received(1).CreateOrUpdateNamespaceAsync( true, Arg.Any?>(), null, - Arg.Any(), Arg.Any()); } @@ -307,7 +299,6 @@ public async Task ExecuteAsync_HandlesServiceException() Arg.Any(), Arg.Any?>(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Update failed")); @@ -341,7 +332,6 @@ public async Task ExecuteAsync_HandlesKeyNotFoundException() Arg.Any(), Arg.Any?>(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new KeyNotFoundException("Namespace not found")); @@ -376,7 +366,6 @@ public async Task ExecuteAsync_WithTenant_PassesCorrectParameters() Arg.Any(), Arg.Any?>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updatedNamespace); @@ -404,7 +393,6 @@ await Service.Received(1).CreateOrUpdateNamespaceAsync( null, null, "test-tenant-123", - Arg.Any(), Arg.Any()); } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs index 0fdba048bd..829b54b9c7 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCheckNameAvailabilityCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.Location, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCreateCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCreateCommand.cs index 299418446e..69aac9d71b 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareCreateCommand.cs @@ -73,7 +73,6 @@ public override async Task ExecuteAsync(CommandContext context, allowedSubnets, tags, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(fileShare), FileSharesJsonContext.Default.FileShareCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareDeleteCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareDeleteCommand.cs index 3861f40ff6..0383498657 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareDeleteCommand.cs @@ -43,7 +43,6 @@ await fileSharesService.DeleteFileShareAsync( options.ResourceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareGetCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareGetCommand.cs index 27ce72a966..1cefddaf88 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareGetCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareGetCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new([fileShare]), FileSharesJsonContext.Default.FileShareGetCommandResult); @@ -68,7 +67,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(fileShares ?? []), FileSharesJsonContext.Default.FileShareGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareUpdateCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareUpdateCommand.cs index a27dd408e9..e98dfcf32e 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/FileShare/FileShareUpdateCommand.cs @@ -68,7 +68,6 @@ public override async Task ExecuteAsync(CommandContext context, allowedSubnets, tags, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(fileShare), FileSharesJsonContext.Default.FileShareUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetLimitsCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetLimitsCommand.cs index 15b08ce54f..37a192146d 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetLimitsCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetLimitsCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync( options.Subscription!, options.Location, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(result, FileSharesJsonContext.Default.FileShareLimitsResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetProvisioningRecommendationCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetProvisioningRecommendationCommand.cs index 4fb7e9189d..1cbe2fd471 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetProvisioningRecommendationCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetProvisioningRecommendationCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync( options.Location, options.ProvisionedStorageInGiB, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(result, FileSharesJsonContext.Default.FileShareProvisioningRecommendationResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetUsageDataCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetUsageDataCommand.cs index ba6759b146..ff099cc739 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetUsageDataCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Informational/FileShareGetUsageDataCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync( options.Subscription!, options.Location, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(result, FileSharesJsonContext.Default.FileShareUsageDataResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionGetCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionGetCommand.cs index ef3a3c338e..6bf2a39ab8 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionGetCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionGetCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FileShareName, options.ConnectionName, options.Tenant, - options.RetryPolicy, cancellationToken); var singleResult = new PrivateEndpointConnectionGetCommandResult([connection]); @@ -64,7 +63,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.FileShareName, options.Tenant, - options.RetryPolicy, cancellationToken); var result = new PrivateEndpointConnectionGetCommandResult(connections ?? []); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionUpdateCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionUpdateCommand.cs index 8c1a80618f..2960a3dbc5 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/PrivateEndpointConnection/PrivateEndpointConnectionUpdateCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Status, options.Description, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(connection), FileSharesJsonContext.Default.PrivateEndpointConnectionUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotCreateCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotCreateCommand.cs index 4b5c669ed3..a4da926f92 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotCreateCommand.cs @@ -55,7 +55,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SnapshotName, metadata, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(snapshot), FileSharesJsonContext.Default.SnapshotCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotDeleteCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotDeleteCommand.cs index 5bd066feb2..4394c24b78 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotDeleteCommand.cs @@ -45,7 +45,6 @@ await fileSharesService.DeleteSnapshotAsync( options.FileShareName, options.SnapshotName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotGetCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotGetCommand.cs index d5e32b3d68..1ae20336fe 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotGetCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotGetCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FileShareName, options.SnapshotName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new([snapshot]), FileSharesJsonContext.Default.SnapshotGetCommandResult); @@ -60,7 +59,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.FileShareName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(snapshots ?? []), FileSharesJsonContext.Default.SnapshotGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotUpdateCommand.cs b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotUpdateCommand.cs index 6f44e553e3..0c3e7174e1 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Commands/Snapshot/SnapshotUpdateCommand.cs @@ -55,7 +55,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SnapshotName, metadata, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(snapshot), FileSharesJsonContext.Default.SnapshotUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCheckNameAvailabilityOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCheckNameAvailabilityOptions.cs index 56ad144aa9..e09c85f889 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCheckNameAvailabilityOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCheckNameAvailabilityOptions.cs @@ -29,6 +29,4 @@ public sealed class FileShareCheckNameAvailabilityOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCreateOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCreateOptions.cs index d9c3a40d7c..f51a230a62 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCreateOptions.cs @@ -104,6 +104,4 @@ public sealed class FileShareCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareDeleteOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareDeleteOptions.cs index 0ad7087819..115bdc35c5 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareDeleteOptions.cs @@ -26,6 +26,4 @@ public sealed class FileShareDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareGetOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareGetOptions.cs index c1ad6b8d05..61df27c8f5 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareGetOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareGetOptions.cs @@ -26,6 +26,4 @@ public sealed class FileShareGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareUpdateOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareUpdateOptions.cs index bce61928cb..5192666274 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareUpdateOptions.cs @@ -74,6 +74,4 @@ public sealed class FileShareUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetLimitsOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetLimitsOptions.cs index 32beb15f8f..9805d06354 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetLimitsOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetLimitsOptions.cs @@ -17,6 +17,4 @@ public sealed class FileShareGetLimitsOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetProvisioningRecommendationOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetProvisioningRecommendationOptions.cs index 1b66ebf126..15d70072fb 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetProvisioningRecommendationOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetProvisioningRecommendationOptions.cs @@ -20,6 +20,4 @@ public sealed class FileShareGetProvisioningRecommendationOptions : ISubscriptio [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetUsageDataOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetUsageDataOptions.cs index 0c475233dd..bb3f1edb36 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetUsageDataOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetUsageDataOptions.cs @@ -17,6 +17,4 @@ public sealed class FileShareGetUsageDataOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionGetOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionGetOptions.cs index 44676e7e19..66893fb3cf 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionGetOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionGetOptions.cs @@ -23,6 +23,4 @@ public sealed class PrivateEndpointConnectionGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionUpdateOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionUpdateOptions.cs index b958e06634..f587e53179 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionUpdateOptions.cs @@ -29,6 +29,4 @@ public sealed class PrivateEndpointConnectionUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotCreateOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotCreateOptions.cs index 983ceb8a45..7e0a4a48ee 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotCreateOptions.cs @@ -26,6 +26,4 @@ public sealed class SnapshotCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotDeleteOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotDeleteOptions.cs index b20345f271..2321ee7f9e 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotDeleteOptions.cs @@ -23,6 +23,4 @@ public sealed class SnapshotDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotGetOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotGetOptions.cs index 8eea460ace..3682d8d238 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotGetOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotGetOptions.cs @@ -23,6 +23,4 @@ public sealed class SnapshotGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotUpdateOptions.cs b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotUpdateOptions.cs index 551535dfe6..c0f6caedb3 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotUpdateOptions.cs @@ -26,6 +26,4 @@ public sealed class SnapshotUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Services/FileSharesService.cs b/tools/Azure.Mcp.Tools.FileShares/src/Services/FileSharesService.cs index 45431c7878..4dd19a8734 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Services/FileSharesService.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Services/FileSharesService.cs @@ -8,7 +8,7 @@ using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; + namespace Azure.Mcp.Tools.FileShares.Services; @@ -25,12 +25,11 @@ public async Task> ListFileSharesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var fileShares = new List(); @@ -73,7 +72,6 @@ public async Task GetFileShareAsync( string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -83,7 +81,7 @@ public async Task GetFileShareAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var fileShareResource = await resourceGroupResource.Value.GetFileShares().GetAsync(fileShareName, cancellationToken); @@ -116,7 +114,6 @@ public async Task CreateOrUpdateFileShareAsync( string[]? allowedSubnets = null, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -125,7 +122,7 @@ public async Task CreateOrUpdateFileShareAsync( (nameof(fileShareName), fileShareName), (nameof(location), location)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -211,7 +208,6 @@ public async Task PatchFileShareAsync( string[]? allowedSubnets = null, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -219,7 +215,7 @@ public async Task PatchFileShareAsync( (nameof(resourceGroup), resourceGroup), (nameof(fileShareName), fileShareName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -297,7 +293,6 @@ public async Task DeleteFileShareAsync( string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -307,7 +302,7 @@ public async Task DeleteFileShareAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var fileShareResource = await resourceGroupResource.Value.GetFileShares().GetAsync(fileShareName, cancellationToken); @@ -333,7 +328,6 @@ public async Task CheckNameAvailabilityAsync( string fileShareName, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -341,7 +335,7 @@ public async Task CheckNameAvailabilityAsync( (nameof(fileShareName), fileShareName), (nameof(location), location)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var content = new ResourceManager.FileShares.Models.FileShareNameAvailabilityContent { Name = fileShareName, @@ -368,7 +362,6 @@ public async Task CreateSnapshotAsync( string snapshotName, Dictionary? metadata = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -377,7 +370,7 @@ public async Task CreateSnapshotAsync( (nameof(fileShareName), fileShareName), (nameof(snapshotName), snapshotName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -418,7 +411,6 @@ public async Task GetSnapshotAsync( string fileShareName, string snapshotId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -427,7 +419,7 @@ public async Task GetSnapshotAsync( (nameof(fileShareName), fileShareName), (nameof(snapshotId), snapshotId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -451,7 +443,6 @@ public async Task> ListSnapshotsAsync( string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -461,7 +452,7 @@ public async Task> ListSnapshotsAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -492,7 +483,6 @@ public async Task PatchSnapshotAsync( string snapshotId, Dictionary? metadata = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -501,7 +491,7 @@ public async Task PatchSnapshotAsync( (nameof(fileShareName), fileShareName), (nameof(snapshotId), snapshotId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -542,7 +532,6 @@ public async Task DeleteSnapshotAsync( string fileShareName, string snapshotId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -553,7 +542,7 @@ public async Task DeleteSnapshotAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -582,14 +571,13 @@ public async Task GetLimitsAsync( string subscription, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( (nameof(subscription), subscription), (nameof(location), location)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var response = await subscriptionResource.GetLimitsAsync(new(location), cancellationToken); var output = response.Value.Properties; @@ -623,7 +611,6 @@ public async Task GetUsageDataAsync( string subscription, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -632,7 +619,7 @@ public async Task GetUsageDataAsync( try { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var response = await subscriptionResource.GetUsageDataAsync(new(location), cancellationToken); var result = response.Value; @@ -657,7 +644,6 @@ public async Task GetProvisioningReco string location, int provisionedStorageGiB, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -665,7 +651,7 @@ public async Task GetProvisioningReco (nameof(location), location), (nameof(provisionedStorageGiB), provisionedStorageGiB.ToString())); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var response = await subscriptionResource.GetProvisioningRecommendationAsync(new(location), new(provisionedStorageGiB), cancellationToken); var output = response.Value.Properties; @@ -686,7 +672,6 @@ public async Task GetPrivateEndpointConnectionAsy string fileShareName, string connectionName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -697,7 +682,7 @@ public async Task GetPrivateEndpointConnectionAsy try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -726,7 +711,6 @@ public async Task> ListPrivateEndpointConnec string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -736,7 +720,7 @@ public async Task> ListPrivateEndpointConnec try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -772,7 +756,6 @@ public async Task UpdatePrivateEndpointConnection string status, string? description = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -784,7 +767,7 @@ public async Task UpdatePrivateEndpointConnection try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource( SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs b/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs index 6fb16ed87c..0a43b6f2d3 100644 --- a/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs +++ b/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.FileShares.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.FileShares.Services; @@ -18,7 +17,6 @@ Task> ListFileSharesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -29,7 +27,6 @@ Task GetFileShareAsync( string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -53,7 +50,6 @@ Task CreateOrUpdateFileShareAsync( string[]? allowedSubnets = null, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -73,7 +69,6 @@ Task PatchFileShareAsync( string[]? allowedSubnets = null, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -84,7 +79,6 @@ Task DeleteFileShareAsync( string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -95,7 +89,6 @@ Task CheckNameAvailabilityAsync( string fileShareName, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -108,7 +101,6 @@ Task CreateSnapshotAsync( string snapshotName, Dictionary? metadata = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -120,7 +112,6 @@ Task GetSnapshotAsync( string fileShareName, string snapshotId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -131,7 +122,6 @@ Task> ListSnapshotsAsync( string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -144,7 +134,6 @@ Task PatchSnapshotAsync( string snapshotId, Dictionary? metadata = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -156,7 +145,6 @@ Task DeleteSnapshotAsync( string fileShareName, string snapshotId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// Get file share limits for a subscription and location. @@ -165,7 +153,6 @@ Task GetLimitsAsync( string subscription, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -175,7 +162,6 @@ Task GetUsageDataAsync( string subscription, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -186,7 +172,6 @@ Task GetProvisioningRecommendationAsy string location, int provisionedStorageGiB, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// /// Get a specific private endpoint connection for a file share. @@ -197,7 +182,6 @@ Task GetPrivateEndpointConnectionAsync( string fileShareName, string connectionName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -208,7 +192,6 @@ Task> ListPrivateEndpointConnectionsAsync( string resourceGroup, string fileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -222,6 +205,5 @@ Task UpdatePrivateEndpointConnectionAsync( string status, string? description = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareCreateCommandTests.cs b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareCreateCommandTests.cs index c48a98f8bf..ced4b12b20 100644 --- a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareCreateCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.FileShares.Commands.FileShare; using Azure.Mcp.Tools.FileShares.Models; using Azure.Mcp.Tools.FileShares.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -107,7 +106,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedShare); } @@ -155,7 +153,6 @@ public async Task ExecuteAsync_PassesNfsEncryptionInTransitToService() Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedShare); @@ -186,7 +183,6 @@ await Service.Received(1).CreateOrUpdateFileShareAsync( Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -228,7 +224,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedShare); @@ -265,7 +260,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareUpdateCommandTests.cs index 09900b2e00..78067cf85a 100644 --- a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileShare/FileShareUpdateCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.FileShares.Commands.FileShare; using Azure.Mcp.Tools.FileShares.Models; using Azure.Mcp.Tools.FileShares.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -100,7 +99,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedShare); } @@ -143,7 +141,6 @@ public async Task ExecuteAsync_PassesNfsEncryptionInTransitToService() Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedShare); @@ -168,7 +165,6 @@ await Service.Received(1).PatchFileShareAsync( Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -205,7 +201,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedShare); @@ -236,7 +231,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any>(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexListCommand.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexListCommand.cs index 98a00a8ac9..55c5a1e8c3 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexListCommand.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexListCommand.cs @@ -53,7 +53,6 @@ public override async Task ExecuteAsync(CommandContext context, var indexes = await _foundryExtensionsService.ListKnowledgeIndexes( options.Endpoint, options.Tenant, - options.RetryPolicy, cancellationToken: cancellationToken); context.Response.Results = ResponseResult.Create(new(indexes ?? []), FoundryExtensionsJsonContext.Default.KnowledgeIndexListCommandResult); diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexSchemaCommand.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexSchemaCommand.cs index 8750bf7c6a..a15c7ad3a0 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexSchemaCommand.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/KnowledgeIndexSchemaCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Endpoint, options.Index, options.Tenant, - options.RetryPolicy, cancellationToken: cancellationToken) ?? throw new Exception("Failed to retrieve knowledge index schema - no data returned."); context.Response.Results = ResponseResult.Create(new(indexSchema), FoundryExtensionsJsonContext.Default.KnowledgeIndexSchemaCommandResult); diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiChatCompletionsCreateCommand.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiChatCompletionsCreateCommand.cs index a13ae78440..e0893b1ac0 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiChatCompletionsCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiChatCompletionsCreateCommand.cs @@ -72,7 +72,6 @@ public override async Task ExecuteAsync(CommandContext context, options.User, options.Tenant, options.AuthMethod ?? AuthMethod.Credential, - options.RetryPolicy, cancellationToken: cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiCompletionsCreateCommand.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiCompletionsCreateCommand.cs index 9deaab062c..e8ed819ad4 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiCompletionsCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiCompletionsCreateCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Temperature, options.Tenant, options.AuthMethod ?? AuthMethod.Credential, - options.RetryPolicy, cancellationToken: cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiEmbeddingsCreateCommand.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiEmbeddingsCreateCommand.cs index 3713c68d7a..3bc3e084c1 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiEmbeddingsCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiEmbeddingsCreateCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Dimensions, options.Tenant, options.AuthMethod ?? AuthMethod.Credential, - options.RetryPolicy, cancellationToken: cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiModelsListCommand.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiModelsListCommand.cs index fd52eaded0..debf75c70c 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiModelsListCommand.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/OpenAiModelsListCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Tenant, options.AuthMethod ?? AuthMethod.Credential, - options.RetryPolicy, cancellationToken: cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/ResourceGetCommand.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/ResourceGetCommand.cs index be2c929009..b8ce17da5e 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/ResourceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/ResourceGetCommand.cs @@ -54,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.ResourceName!, options.Tenant, - options.RetryPolicy, cancellationToken: cancellationToken); context.Response.Results = ResponseResult.Create( @@ -68,7 +67,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken: cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexListOptions.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexListOptions.cs index 06ab0330e5..1dc04a599e 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexListOptions.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexListOptions.cs @@ -14,6 +14,4 @@ public sealed class KnowledgeIndexListOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexSchemaOptions.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexSchemaOptions.cs index 14e3071a15..1047ee56bf 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexSchemaOptions.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexSchemaOptions.cs @@ -17,6 +17,4 @@ public sealed class KnowledgeIndexSchemaOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiChatCompletionsCreateOptions.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiChatCompletionsCreateOptions.cs index e7f283124a..a9c22878ee 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiChatCompletionsCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiChatCompletionsCreateOptions.cs @@ -54,8 +54,6 @@ public sealed class OpenAiChatCompletionsCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiCompletionsCreateOptions.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiCompletionsCreateOptions.cs index 62cf5f85d1..365777f1fb 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiCompletionsCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiCompletionsCreateOptions.cs @@ -33,8 +33,6 @@ public sealed class OpenAiCompletionsCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiEmbeddingsCreateOptions.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiEmbeddingsCreateOptions.cs index a94db34262..c44c829556 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiEmbeddingsCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiEmbeddingsCreateOptions.cs @@ -36,8 +36,6 @@ public sealed class OpenAiEmbeddingsCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiModelsListOptions.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiModelsListOptions.cs index 71251b6e03..2bcf50c244 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiModelsListOptions.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiModelsListOptions.cs @@ -21,8 +21,6 @@ public sealed class OpenAiModelsListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } [Option(Description = OptionDescriptions.AuthMethod)] public AuthMethod? AuthMethod { get; set; } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/ResourceGetOptions.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/ResourceGetOptions.cs index 1b114c8848..076b727a4a 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/ResourceGetOptions.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/ResourceGetOptions.cs @@ -20,6 +20,4 @@ public sealed class ResourceGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/FoundryExtensionsService.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/FoundryExtensionsService.cs index 389f2da4d4..33d8d6b78e 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/FoundryExtensionsService.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/FoundryExtensionsService.cs @@ -12,7 +12,6 @@ using Azure.ResourceManager.CognitiveServices; using Microsoft.Mcp.Core.Helpers; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using OpenAI.Chat; namespace Azure.Mcp.Tools.FoundryExtensions.Services; @@ -108,7 +107,6 @@ private static string TruncateForLogging(string value) public async Task> ListKnowledgeIndexes( string endpoint, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(endpoint), endpoint)); @@ -146,7 +144,6 @@ public async Task GetKnowledgeIndexSchema( string endpoint, string indexName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -196,7 +193,6 @@ public async Task CreateCompletionAsync( double? temperature = null, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -206,7 +202,7 @@ public async Task CreateCompletionAsync( (nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken: cancellationToken); // Get the Cognitive Services account @@ -272,7 +268,6 @@ public async Task CreateEmbeddingsAsync( int? dimensions = null, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -282,7 +277,7 @@ public async Task CreateEmbeddingsAsync( (nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken: cancellationToken); // Get the Cognitive Services account @@ -328,12 +323,11 @@ public async Task ListOpenAiModelsAsync( string resourceGroup, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(resourceName), resourceName), (nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken: cancellationToken); // Get the Cognitive Services account @@ -409,7 +403,6 @@ public async Task CreateChatCompletionsAsync( string? user = null, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -423,7 +416,7 @@ public async Task CreateChatCompletionsAsync( throw new ArgumentException("Messages array cannot be null or empty", nameof(messages)); } - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken: cancellationToken); // Get the Cognitive Services account @@ -605,12 +598,11 @@ public async Task> ListAiResourcesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var resources = new List(); @@ -648,7 +640,6 @@ public async Task GetAiResourceAsync( string resourceGroup, string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -656,7 +647,7 @@ public async Task GetAiResourceAsync( (nameof(resourceGroup), resourceGroup), (nameof(resourceName), resourceName)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var rgResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken: cancellationToken); if (rgResource?.Value == null) diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/IFoundryExtensionsService.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/IFoundryExtensionsService.cs index bc5884572d..c9f8302536 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/IFoundryExtensionsService.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/src/Services/IFoundryExtensionsService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Tools.FoundryExtensions.Models; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.FoundryExtensions.Services; @@ -12,14 +11,12 @@ public interface IFoundryExtensionsService Task> ListKnowledgeIndexes( string endpoint, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetKnowledgeIndexSchema( string endpoint, string indexName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateCompletionAsync( @@ -32,7 +29,6 @@ Task CreateCompletionAsync( double? temperature = null, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default ); @@ -47,7 +43,6 @@ Task CreateEmbeddingsAsync( int? dimensions = null, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default ); @@ -57,7 +52,6 @@ Task ListOpenAiModelsAsync( string resourceGroup, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default ); @@ -78,7 +72,6 @@ Task CreateChatCompletionsAsync( string? user = null, string? tenant = null, AuthMethod authMethod = AuthMethod.Credential, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default ); @@ -86,7 +79,6 @@ Task> ListAiResourcesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default ); @@ -95,7 +87,6 @@ Task GetAiResourceAsync( string resourceGroup, string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default ); } diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexListCommandTests.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexListCommandTests.cs index 605fab232d..d404b74701 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexListCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.FoundryExtensions.Commands; using Azure.Mcp.Tools.FoundryExtensions.Models; using Azure.Mcp.Tools.FoundryExtensions.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -31,7 +30,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS // Arrange if (shouldSucceed) { - Service.ListKnowledgeIndexes(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListKnowledgeIndexes(Arg.Any(), Arg.Any(), Arg.Any()) .Returns([new() { Name = "test-index", Type = "aisearch", Version = "1.0", Description = "Test index" }]); } @@ -55,7 +54,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS public async Task ExecuteAsync_HandlesServiceErrors() { // Arrange - Service.ListKnowledgeIndexes(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListKnowledgeIndexes(Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -77,7 +76,7 @@ public async Task ExecuteAsync_ReturnsExpectedResults() new() { Name = "test-index2", Type = "aisearch", Version = "1.1", Description = "Second test index" } }; - Service.ListKnowledgeIndexes(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListKnowledgeIndexes(Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedIndexes); // Act diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexSchemaCommandTests.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexSchemaCommandTests.cs index 8f37a757d6..f35186f49f 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexSchemaCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/KnowledgeIndexSchemaCommandTests.cs @@ -4,7 +4,6 @@ using System.Net; using Azure.Mcp.Tools.FoundryExtensions.Commands; using Azure.Mcp.Tools.FoundryExtensions.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -40,7 +39,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Description = "desc", Tags = new Dictionary { { "env", "test" } } }; - Service.GetKnowledgeIndexSchema(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetKnowledgeIndexSchema(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(mockSchema); } @@ -64,7 +63,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS public async Task ExecuteAsync_HandlesServiceErrors() { // Arrange - Service.GetKnowledgeIndexSchema(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetKnowledgeIndexSchema(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -89,7 +88,7 @@ public async Task ExecuteAsync_ReturnsExpectedResults() Version = "1.0" }; - Service.GetKnowledgeIndexSchema(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetKnowledgeIndexSchema(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedSchema); // Act diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiCompletionsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiCompletionsCreateCommandTests.cs index b1166c2413..4e7cd97ea9 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiCompletionsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiCompletionsCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.FoundryExtensions.Models; using Azure.Mcp.Tools.FoundryExtensions.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -38,7 +37,6 @@ public async Task ExecuteAsync_CreatesCompletion_WhenValidOptionsProvided() Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -84,7 +82,6 @@ public async Task ExecuteAsync_OptionalParameters_PassedToService() Arg.Is(temperature), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -113,7 +110,6 @@ await Service.Received(1).CreateCompletionAsync( Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()); } @@ -138,7 +134,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiEmbeddingsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiEmbeddingsCreateCommandTests.cs index de352fede1..afd0b17058 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiEmbeddingsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiEmbeddingsCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.FoundryExtensions.Models; using Azure.Mcp.Tools.FoundryExtensions.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -38,7 +37,6 @@ public async Task ExecuteAsync_CreatesEmbeddings_WhenValidOptionsProvided() Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -93,7 +91,6 @@ public async Task ExecuteAsync_OptionalParameters_PassedToService() Arg.Is(dimensions), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -123,7 +120,6 @@ await Service.Received(1).CreateEmbeddingsAsync( Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()); } @@ -149,7 +145,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiModelsListCommandTests.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiModelsListCommandTests.cs index b1a39d4774..6693408da5 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiModelsListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/OpenAiModelsListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.FoundryExtensions.Models; using Azure.Mcp.Tools.FoundryExtensions.Services; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -53,7 +52,6 @@ public async Task ExecuteAsync_ListsModels_WhenValidOptionsProvided() Arg.Is(resourceGroup), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(new OpenAiModelsListResult(expectedModels, resourceName)); @@ -99,7 +97,6 @@ public async Task ExecuteAsync_ReturnsEmptyList_WhenNoModelsDeployed() Arg.Is(resourceGroup), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(new OpenAiModelsListResult([], resourceName)); @@ -131,7 +128,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -177,7 +173,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string args, bool sho Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(new OpenAiModelsListResult([], "myresource")); } @@ -211,7 +206,6 @@ public async Task ExecuteAsync_VerifiesServiceCall_WithCorrectParameters() Arg.Is(resourceGroup), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .Returns(new OpenAiModelsListResult([], resourceName)); @@ -228,7 +222,6 @@ await Service.Received(1).ListOpenAiModelsAsync( resourceGroup, Arg.Any(), AuthMethod.Credential, - Arg.Any(), Arg.Any()); } @@ -246,7 +239,6 @@ public async Task ExecuteAsync_HandlesServiceAuthentication_Exception() Arg.Any(), Arg.Any(), Arg.Is(AuthMethod.Credential), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Authentication failed")); diff --git a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/ResourceGetCommandTests.cs b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/ResourceGetCommandTests.cs index 39be430a55..e051c4b0a9 100644 --- a/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/ResourceGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FoundryExtensions/tests/Azure.Mcp.Tools.FoundryExtensions.Tests/ResourceGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.FoundryExtensions.Commands; using Azure.Mcp.Tools.FoundryExtensions.Models; using Azure.Mcp.Tools.FoundryExtensions.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -59,7 +58,6 @@ public async Task ExecuteAsync_ListsAllResources_WhenNoResourceNameProvided() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResources); @@ -93,7 +91,6 @@ public async Task ExecuteAsync_ListsResourcesInResourceGroup_WhenResourceGroupPr Arg.Any(), Arg.Is("test-rg"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResources); @@ -138,7 +135,6 @@ public async Task ExecuteAsync_GetsSpecificResource_WhenResourceNameAndGroupProv Arg.Is("test-rg"), Arg.Is("test-resource"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResource); @@ -163,7 +159,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoResourcesExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -182,7 +177,6 @@ public async Task ExecuteAsync_HandlesListException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -203,7 +197,6 @@ public async Task ExecuteAsync_HandlesGetException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -227,7 +220,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(params string[] args) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -236,7 +228,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(params string[] args) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new AiResourceInformation()); @@ -289,7 +280,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(resourceWithDeployments); diff --git a/tools/Azure.Mcp.Tools.FunctionApp/src/Commands/FunctionApp/FunctionAppGetCommand.cs b/tools/Azure.Mcp.Tools.FunctionApp/src/Commands/FunctionApp/FunctionAppGetCommand.cs index 89039e2936..b9899ffdd3 100644 --- a/tools/Azure.Mcp.Tools.FunctionApp/src/Commands/FunctionApp/FunctionAppGetCommand.cs +++ b/tools/Azure.Mcp.Tools.FunctionApp/src/Commands/FunctionApp/FunctionAppGetCommand.cs @@ -53,7 +53,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FunctionApp, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(functionApps ?? []), FunctionAppJsonContext.Default.FunctionAppGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.FunctionApp/src/Options/FunctionApp/FunctionAppGetOptions.cs b/tools/Azure.Mcp.Tools.FunctionApp/src/Options/FunctionApp/FunctionAppGetOptions.cs index 9a6ac8c019..41cc2c46d7 100644 --- a/tools/Azure.Mcp.Tools.FunctionApp/src/Options/FunctionApp/FunctionAppGetOptions.cs +++ b/tools/Azure.Mcp.Tools.FunctionApp/src/Options/FunctionApp/FunctionAppGetOptions.cs @@ -20,6 +20,4 @@ public sealed class FunctionAppGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.FunctionApp/src/Services/FunctionAppService.cs b/tools/Azure.Mcp.Tools.FunctionApp/src/Services/FunctionAppService.cs index 5c4e7de38b..fb8057f603 100644 --- a/tools/Azure.Mcp.Tools.FunctionApp/src/Services/FunctionAppService.cs +++ b/tools/Azure.Mcp.Tools.FunctionApp/src/Services/FunctionAppService.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.FunctionApp.Models; using Azure.ResourceManager.AppService; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Caching; namespace Azure.Mcp.Tools.FunctionApp.Services; @@ -25,12 +24,11 @@ public sealed class FunctionAppService(IAzureService azureService, ICacheService string? functionAppName, string? resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var functionApps = new List(); if (string.IsNullOrEmpty(functionAppName)) { diff --git a/tools/Azure.Mcp.Tools.FunctionApp/src/Services/IFunctionAppService.cs b/tools/Azure.Mcp.Tools.FunctionApp/src/Services/IFunctionAppService.cs index 416f961562..a610a9d4b5 100644 --- a/tools/Azure.Mcp.Tools.FunctionApp/src/Services/IFunctionAppService.cs +++ b/tools/Azure.Mcp.Tools.FunctionApp/src/Services/IFunctionAppService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.FunctionApp.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.FunctionApp.Services; @@ -13,6 +12,5 @@ public interface IFunctionAppService string? functionAppName, string? resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.Tests/FunctionApp/FunctionAppGetCommandTests.cs b/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.Tests/FunctionApp/FunctionAppGetCommandTests.cs index 396c2c0ce9..f1a0c43b5d 100644 --- a/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.Tests/FunctionApp/FunctionAppGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.FunctionApp/tests/Azure.Mcp.Tools.FunctionApp.Tests/FunctionApp/FunctionAppGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.FunctionApp.Commands.FunctionApp; using Azure.Mcp.Tools.FunctionApp.Models; using Azure.Mcp.Tools.FunctionApp.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,6 @@ public async Task ExecuteAsync_Listing_ValidatesInputCorrectly(string args, bool Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(testFunctionApps); } @@ -70,7 +68,6 @@ public async Task ExecuteAsync_ReturnsFunctionAppList() Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedFunctionApps); @@ -84,7 +81,6 @@ await Service.Received(1).GetFunctionApp( Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Any(), - Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, FunctionAppJsonContext.Default.FunctionAppGetCommandResult); @@ -108,7 +104,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoFunctionApp() Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Is(s => string.IsNullOrEmpty(s)), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -130,7 +125,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -164,7 +158,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([new("app1", "rg1", "eastus", "plan1", "Running", "app1.azurewebsites.net", null)]); } @@ -183,7 +176,6 @@ public async Task ExecuteAsync_ReturnsFunctionApp() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([expected]); @@ -203,7 +195,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns((List?)null); diff --git a/tools/Azure.Mcp.Tools.Grafana/src/Commands/Workspace/WorkspaceListCommand.cs b/tools/Azure.Mcp.Tools.Grafana/src/Commands/Workspace/WorkspaceListCommand.cs index 696c733fc8..d9a570e41c 100644 --- a/tools/Azure.Mcp.Tools.Grafana/src/Commands/Workspace/WorkspaceListCommand.cs +++ b/tools/Azure.Mcp.Tools.Grafana/src/Commands/Workspace/WorkspaceListCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(workspaces?.Results ?? [], workspaces?.AreResultsTruncated ?? false), GrafanaJsonContext.Default.WorkspaceListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Grafana/src/Options/Workspace/WorkspaceListOptions.cs b/tools/Azure.Mcp.Tools.Grafana/src/Options/Workspace/WorkspaceListOptions.cs index c8a9d85394..733a47aa8d 100644 --- a/tools/Azure.Mcp.Tools.Grafana/src/Options/Workspace/WorkspaceListOptions.cs +++ b/tools/Azure.Mcp.Tools.Grafana/src/Options/Workspace/WorkspaceListOptions.cs @@ -17,6 +17,4 @@ public sealed class WorkspaceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs b/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs index b132f3f95e..b3d2a9bab7 100644 --- a/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs +++ b/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Grafana.Models; using Azure.Mcp.Tools.Grafana.Services.Models; using Microsoft.Mcp.Core.Models.Identity; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Grafana.Services; @@ -19,7 +18,6 @@ public async Task> ListWorkspacesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -28,7 +26,7 @@ public async Task> ListWorkspacesAsync( "Microsoft.Dashboard/grafana", resourceGroup: resourceGroup, subscription, - retryPolicy, + null, ConvertToWorkspaceModel, tenant: tenant, cancellationToken: cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs b/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs index f5a985d33e..c8f9b84386 100644 --- a/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs +++ b/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Grafana.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Grafana.Services; @@ -14,13 +13,11 @@ public interface IGrafanaService /// /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy configuration /// List of Grafana workspace details /// When the service request fails Task> ListWorkspacesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.Tests/WorkspaceListCommandTests.cs b/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.Tests/WorkspaceListCommandTests.cs index ab1e0154ef..7235b677ed 100644 --- a/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.Tests/WorkspaceListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Grafana/tests/Azure.Mcp.Tools.Grafana.Tests/WorkspaceListCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Grafana.Commands.Workspace; using Azure.Mcp.Tools.Grafana.Models; using Azure.Mcp.Tools.Grafana.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -62,7 +61,7 @@ public async Task ExecuteAsync_ReturnsWorkspaces_WhenWorkspacesExist() ) ], false); - Service.ListWorkspacesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWorkspacesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedWorkspaces); // Act @@ -80,7 +79,7 @@ public async Task ExecuteAsync_ReturnsWorkspaces_WhenWorkspacesExist() public async Task ExecuteAsync_ReturnsEmpty_WhenNoWorkspacesExist() { // Arrange - Service.ListWorkspacesAsync("sub123", Arg.Any(), null, Arg.Any(), Arg.Any()) + Service.ListWorkspacesAsync("sub123", Arg.Any(), null, Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -113,7 +112,7 @@ public async Task ExecuteAsync_WithTenant_PassesTenantToService() ) ], false); - Service.ListWorkspacesAsync("sub123", Arg.Any(), "tenant456", Arg.Any(), Arg.Any()) + Service.ListWorkspacesAsync("sub123", Arg.Any(), "tenant456", Arg.Any()) .Returns(expectedWorkspaces); // Act @@ -131,7 +130,7 @@ public async Task ExecuteAsync_HandlesException_AndSetsException() var expectedError = "Test error. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; var subscriptionId = "sub123"; - Service.ListWorkspacesAsync(subscriptionId, Arg.Any(), null, Arg.Any(), Arg.Any()) + Service.ListWorkspacesAsync(subscriptionId, Arg.Any(), null, Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -148,7 +147,7 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( { // Arrange const string resourceGroup = "test-rg"; - Service.ListWorkspacesAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWorkspacesAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -156,6 +155,6 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( // Assert Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).ListWorkspacesAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListWorkspacesAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Insights/src/Commands/InsightsGetCommand.cs b/tools/Azure.Mcp.Tools.Insights/src/Commands/InsightsGetCommand.cs index ecdca316ae..def518405d 100644 --- a/tools/Azure.Mcp.Tools.Insights/src/Commands/InsightsGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Insights/src/Commands/InsightsGetCommand.cs @@ -182,8 +182,8 @@ public override async Task ExecuteAsync( IProgress progress = new Progress(msg => _ = NotifyProgressAsync(context, msg, cancellationToken)); var aggregation = scope == InsightsOptionDefinitions.ScopeTenant - ? await _insightsService.AggregateTenantAsync(options.Tenant, options.RetryPolicy, cancellationToken, progress, options.NoCache) - : await _insightsService.AggregateSubscriptionAsync(options.Subscription!, options.Tenant, options.RetryPolicy, cancellationToken, progress, options.NoCache); + ? await _insightsService.AggregateTenantAsync(options.Tenant, cancellationToken, progress, options.NoCache) + : await _insightsService.AggregateSubscriptionAsync(options.Subscription!, options.Tenant, cancellationToken, progress, options.NoCache); // Return empty list if no resources are found if (aggregation.ResourceTypes.Count == 0) diff --git a/tools/Azure.Mcp.Tools.Insights/src/Options/InsightsGetOptions.cs b/tools/Azure.Mcp.Tools.Insights/src/Options/InsightsGetOptions.cs index e28f6ccf3d..441279771a 100644 --- a/tools/Azure.Mcp.Tools.Insights/src/Options/InsightsGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Insights/src/Options/InsightsGetOptions.cs @@ -23,6 +23,4 @@ public class InsightsGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs b/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs index ef4464f63d..f6357cb636 100644 --- a/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs +++ b/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Insights.Services.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Insights.Services; @@ -20,7 +19,6 @@ public interface IInsightsService Task AggregateSubscriptionAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, IProgress? progress = null, bool noCache = false); @@ -33,7 +31,6 @@ Task AggregateSubscriptionAsync( /// Fetch new ARG data if true, else use cached data. Task AggregateTenantAsync( string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, IProgress? progress = null, bool noCache = false); diff --git a/tools/Azure.Mcp.Tools.Insights/src/Services/InsightsService.cs b/tools/Azure.Mcp.Tools.Insights/src/Services/InsightsService.cs index 609798c5f2..a1d988b738 100644 --- a/tools/Azure.Mcp.Tools.Insights/src/Services/InsightsService.cs +++ b/tools/Azure.Mcp.Tools.Insights/src/Services/InsightsService.cs @@ -9,7 +9,6 @@ using Azure.ResourceManager.ResourceGraph.Models; using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Caching; namespace Azure.Mcp.Tools.Insights.Services; @@ -49,14 +48,13 @@ and resourceGroup !startswith "defaultresourcegroup-" public async Task AggregateSubscriptionAsync( string subscription, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, IProgress? progress = null, bool noCache = false) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); // Cache ARG data by subscription ID var cacheKey = $"sub:{subscriptionResource.Data.SubscriptionId}"; @@ -102,12 +100,11 @@ public async Task AggregateSubscriptionAsync( public async Task AggregateTenantAsync( string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken, IProgress? progress = null, bool noCache = false) { - var subscriptions = await AzureService.GetSubscriptions(tenant, retryPolicy, cancellationToken); + var subscriptions = await AzureService.GetSubscriptions(tenant, cancellationToken: cancellationToken); if (subscriptions.Count == 0) { throw new InvalidOperationException("No accessible subscriptions were found in the tenant."); diff --git a/tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/InsightsGetCommandTests.cs b/tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/InsightsGetCommandTests.cs index e930c99cdd..0887527c66 100644 --- a/tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/InsightsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/InsightsGetCommandTests.cs @@ -10,7 +10,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Mcp.Core.Commands; using Microsoft.Mcp.Core.Models.Command; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using ModelContextProtocol.Protocol; using ModelContextProtocol.Server; @@ -53,7 +52,7 @@ public async Task ExecuteAsync_WithoutSamplingCapability_ReturnsBadRequest() public async Task ExecuteAsync_WithSubscription_CallsAggregateSubscription() { var aggregation = CreatePopulatedAggregation(); - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(aggregation); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs("[]"); @@ -64,7 +63,6 @@ public async Task ExecuteAsync_WithSubscription_CallsAggregateSubscription() await Service.Received(1).AggregateSubscriptionAsync( "sub1", Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any?>(), Arg.Any()); @@ -79,7 +77,7 @@ await _samplingService.Received(1).SampleTextAsync( [Fact] public async Task ExecuteAsync_WithoutSubscription_CallsAggregateTenant() { - Service.AggregateTenantAsync(default, default, TestContext.Current.CancellationToken) + Service.AggregateTenantAsync(default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs("[]"); @@ -89,18 +87,17 @@ public async Task ExecuteAsync_WithoutSubscription_CallsAggregateTenant() Assert.Equal(HttpStatusCode.OK, response.Status); await Service.Received(1).AggregateTenantAsync( "tenant-1", - Arg.Any(), Arg.Any(), Arg.Any?>(), Arg.Any()); await Service.DidNotReceiveWithAnyArgs().AggregateSubscriptionAsync( - default!, default, default, TestContext.Current.CancellationToken); + default!, default, TestContext.Current.CancellationToken); } [Fact] public async Task ExecuteAsync_SamplingReturnsInsights_ReturnsResultsList() { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(""" @@ -124,7 +121,7 @@ public async Task ExecuteAsync_SamplingReturnsInsights_ReturnsResultsList() [Fact] public async Task ExecuteAsync_AggregateThrows_ReturnsErrorInResponse() { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ThrowsAsyncForAnyArgs(new InvalidOperationException("boom")); var response = await ExecuteWithSamplingAsync("--subscription", "sub1"); @@ -136,7 +133,7 @@ public async Task ExecuteAsync_AggregateThrows_ReturnsErrorInResponse() [Fact] public async Task ExecuteAsync_QuotedSubscription_StripsQuotes() { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs("[]"); @@ -147,7 +144,6 @@ public async Task ExecuteAsync_QuotedSubscription_StripsQuotes() await Service.Received(1).AggregateSubscriptionAsync( "sub1", Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any?>(), Arg.Any()); @@ -164,9 +160,9 @@ public async Task ExecuteAsync_InvalidScope_ReturnsBadRequest(string scope) Assert.Equal(HttpStatusCode.BadRequest, response.Status); Assert.Contains("scope", response.Message, StringComparison.OrdinalIgnoreCase); await Service.DidNotReceiveWithAnyArgs().AggregateSubscriptionAsync( - default!, default, default, TestContext.Current.CancellationToken); + default!, default, TestContext.Current.CancellationToken); await Service.DidNotReceiveWithAnyArgs().AggregateTenantAsync( - default, default, TestContext.Current.CancellationToken); + default, TestContext.Current.CancellationToken); } [Fact] @@ -177,7 +173,7 @@ public async Task ExecuteAsync_TenantScopeWithSubscription_ReturnsBadRequest() Assert.Equal(HttpStatusCode.BadRequest, response.Status); Assert.Contains("subscription", response.Message, StringComparison.OrdinalIgnoreCase); await Service.DidNotReceiveWithAnyArgs().AggregateTenantAsync( - default, default, TestContext.Current.CancellationToken); + default, TestContext.Current.CancellationToken); } [Fact] @@ -190,14 +186,14 @@ public async Task ExecuteAsync_SubscriptionScopeWithNoDefault_ReturnsBadRequest( Assert.Equal(HttpStatusCode.BadRequest, response.Status); Assert.Contains("default subscription", response.Message, StringComparison.OrdinalIgnoreCase); await Service.DidNotReceiveWithAnyArgs().AggregateSubscriptionAsync( - default!, default, default, TestContext.Current.CancellationToken); + default!, default, TestContext.Current.CancellationToken); } [Fact] public async Task ExecuteAsync_UsesDefaultSubscription_WhenNotProvided() { _azureService.GetDefaultSubscriptionId().Returns("default-sub"); - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs("[]"); @@ -208,7 +204,6 @@ public async Task ExecuteAsync_UsesDefaultSubscription_WhenNotProvided() await Service.Received(1).AggregateSubscriptionAsync( "default-sub", Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any?>(), Arg.Any()); @@ -219,7 +214,7 @@ await Service.Received(1).AggregateSubscriptionAsync( [InlineData(false)] public async Task ExecuteAsync_NoCacheFlag_PropagatesToService(bool noCache) { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs("[]"); @@ -233,7 +228,6 @@ public async Task ExecuteAsync_NoCacheFlag_PropagatesToService(bool noCache) await Service.Received(1).AggregateSubscriptionAsync( "sub1", Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any?>(), noCache); @@ -249,7 +243,7 @@ public async Task ExecuteAsync_QueryExceedsMaxLength_ReturnsBadRequest() Assert.Equal(HttpStatusCode.BadRequest, response.Status); Assert.Contains("query", response.Message, StringComparison.OrdinalIgnoreCase); await Service.DidNotReceiveWithAnyArgs().AggregateSubscriptionAsync( - default!, default, default, TestContext.Current.CancellationToken); + default!, default, TestContext.Current.CancellationToken); } [Theory] @@ -258,7 +252,7 @@ await Service.DidNotReceiveWithAnyArgs().AggregateSubscriptionAsync( [InlineData(" trim me ", "trim me")] public async Task ExecuteAsync_SanitizesQueryBeforeSampling(string rawQuery, string expected) { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs("[]"); @@ -277,7 +271,7 @@ await _samplingService.Received(1).SampleTextAsync( [Fact] public async Task ExecuteAsync_WhitespaceOnlyQuery_OmittedFromPayload() { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs("[]"); @@ -296,7 +290,7 @@ await _samplingService.Received(1).SampleTextAsync( [Fact] public async Task ExecuteAsync_SamplingReturnsSensitiveContent_DropsThoseInsights() { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(""" @@ -317,7 +311,7 @@ public async Task ExecuteAsync_SamplingReturnsSensitiveContent_DropsThoseInsight [Fact] public async Task ExecuteAsync_NoResourcesInScope_ReturnsEmptyWithoutSampling() { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreateEmptyAggregation()); var response = await ExecuteWithSamplingAsync("--subscription", "sub1"); @@ -337,7 +331,7 @@ await _samplingService.DidNotReceiveWithAnyArgs().SampleTextAsync( [InlineData("""{ "message": "no insights here" }""")] // valid JSON but not an insights array public async Task ExecuteAsync_SamplingReturnsUnparseable_ReturnsBadGatewayWithoutStackTrace(string sampled) { - Service.AggregateSubscriptionAsync(default!, default, default, TestContext.Current.CancellationToken) + Service.AggregateSubscriptionAsync(default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(CreatePopulatedAggregation()); _samplingService.SampleTextAsync(default!, default!, default!, default, TestContext.Current.CancellationToken) .ReturnsForAnyArgs(sampled); diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Commands/Device/IoTHubDeviceListCommand.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Commands/Device/IoTHubDeviceListCommand.cs index 29bc04ba2a..68f0b45ee1 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Commands/Device/IoTHubDeviceListCommand.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Commands/Device/IoTHubDeviceListCommand.cs @@ -73,7 +73,6 @@ public override async Task ExecuteAsync( options.Subscription!, options.Tenant, maxCount, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(result, IoTHubJsonContext.Default.DeviceListResult); diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs index 576e6ae445..05d56b8755 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs @@ -57,7 +57,6 @@ public override async Task ExecuteAsync( options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Options/Device/IoTHubDeviceListOptions.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Options/Device/IoTHubDeviceListOptions.cs index 6d8ee750dc..89e4cb0ea8 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Options/Device/IoTHubDeviceListOptions.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Options/Device/IoTHubDeviceListOptions.cs @@ -23,6 +23,4 @@ public sealed class IoTHubDeviceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Options/IoTHub/IoTHubGetOptions.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Options/IoTHub/IoTHubGetOptions.cs index 9cc14822f2..46e539350f 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Options/IoTHub/IoTHubGetOptions.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Options/IoTHub/IoTHubGetOptions.cs @@ -20,6 +20,4 @@ public sealed class IoTHubGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubDeviceService.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubDeviceService.cs index a15afb8be6..e3f065427e 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubDeviceService.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubDeviceService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.IoTHub.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.IoTHub.Services; @@ -14,6 +13,5 @@ Task ListDevices( string subscription, string? tenant = null, int? maxCount = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubHostnameResolver.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubHostnameResolver.cs index ae8b1a6568..7c144bad6d 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubHostnameResolver.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubHostnameResolver.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using Microsoft.Mcp.Core.Options; - namespace Azure.Mcp.Tools.IoTHub.Services; /// @@ -16,6 +14,5 @@ Task GetHostnameAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs index 1b859cede2..a6e97146b7 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.IoTHub.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.IoTHub.Services; @@ -14,6 +13,5 @@ Task GetIoTHub( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubDeviceService.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubDeviceService.cs index 4d7e8d0d0d..2269d59602 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubDeviceService.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubDeviceService.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.IoTHub.Commands; using Azure.Mcp.Tools.IoTHub.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.IoTHub.Services; @@ -56,7 +55,6 @@ public async Task ListDevices( string subscription, string? tenant = null, int? maxCount = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -66,7 +64,7 @@ public async Task ListDevices( return await ExecuteWithTimeoutAsync(async ct => { - var hostname = await _hostnameResolver.GetHostnameAsync(hubName, resourceGroup, subscription, tenant, retryPolicy, ct); + var hostname = await _hostnameResolver.GetHostnameAsync(hubName, resourceGroup, subscription, tenant, ct); // The registry API has no continuation token, so fetch one more than the requested max // (top = maxCount + 1). If the hub returns the extra device we know more devices exist @@ -75,10 +73,9 @@ public async Task ListDevices( var maxCountParam = maxCount.HasValue ? $"&top={maxCount.Value + 1}" : string.Empty; var requestUri = $"https://{hostname}/devices?api-version={RegistryApiVersion}{maxCountParam}"; - // Send the request through an Azure.Core pipeline so the caller's RetryPolicyOptions - // governs transient-failure retries (408/429/5xx and network errors). + // Send the request through an Azure.Core pipeline with the SDK's default retry behavior. using var httpClient = _httpClientFactory.CreateClient(); - var clientOptions = ConfigureRetryPolicy(AddDefaultPolicies(new IoTHubClientOptions()), retryPolicy); + var clientOptions = AddDefaultPolicies(new IoTHubClientOptions()); clientOptions.Transport = new HttpClientTransport(httpClient); var pipeline = HttpPipelineBuilder.Build(clientOptions); diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubHostnameResolver.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubHostnameResolver.cs index 7a1f702222..bd882ed898 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubHostnameResolver.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubHostnameResolver.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Caching; namespace Azure.Mcp.Tools.IoTHub.Services; @@ -24,7 +23,6 @@ public async Task GetHostnameAsync( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var cacheKey = $"{subscription}/{resourceGroup}/{hubName}"; @@ -34,7 +32,7 @@ public async Task GetHostnameAsync( return cached; } - var hub = await _ioTHubService.GetIoTHub(hubName, resourceGroup, subscription, tenant: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + var hub = await _ioTHubService.GetIoTHub(hubName, resourceGroup, subscription, tenant: tenant, cancellationToken: cancellationToken); var hostname = hub.HostName ?? throw new InvalidOperationException("IoT Hub hostname is null"); await _cacheService.SetAsync(HostnameCacheGroup, cacheKey, hostname, s_cacheDuration, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs index cf67064716..013a68d960 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.IoTHub.Models; using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.IoTHub.Services; @@ -21,7 +20,6 @@ public async Task GetIoTHub( string resourceGroup, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -31,8 +29,8 @@ public async Task GetIoTHub( try { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, cancellationToken: cancellationToken); var iotHubResourceId = new ResourceIdentifier( $"/subscriptions/{subscriptionResource.Data.SubscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/IotHubs/{hubName}"); var hub = await armClient.GetGenericResource(iotHubResourceId).GetAsync(cancellationToken); diff --git a/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/Device/IoTHubDeviceListCommandTests.cs b/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/Device/IoTHubDeviceListCommandTests.cs index 93e09e0bc3..7aa0a81248 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/Device/IoTHubDeviceListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/Device/IoTHubDeviceListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.IoTHub.Commands.Device; using Azure.Mcp.Tools.IoTHub.Models; using Azure.Mcp.Tools.IoTHub.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -41,7 +40,6 @@ public async Task ExecuteAsync_ListDevices_Success() "sub-id", "tenant-id", 100, - Arg.Any(), Arg.Any()) .Returns(new DeviceListResult(devices, false)); @@ -84,7 +82,6 @@ public async Task ExecuteAsync_ListDevices_Truncated_SetsMessage() "sub-id", "tenant-id", 100, - Arg.Any(), Arg.Any()) .Returns(new DeviceListResult(new List { CreateDevice("device1") }, true)); @@ -127,7 +124,6 @@ public async Task ExecuteAsync_DeserializationValidation() "sub-id", "tenant-id", 100, - Arg.Any(), Arg.Any()) .Returns(new DeviceListResult(devices, false)); @@ -164,7 +160,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() "sub-id", "tenant-id", 100, - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/IoTHub/IoTHubGetCommandTests.cs b/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/IoTHub/IoTHubGetCommandTests.cs index 95ab9f8d71..c4c983026f 100644 --- a/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/IoTHub/IoTHubGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/IoTHub/IoTHubGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.IoTHub.Commands.IoTHub; using Azure.Mcp.Tools.IoTHub.Models; using Azure.Mcp.Tools.IoTHub.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -38,7 +37,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new IoTHubDescription( Id: "/subscriptions/sub123/resourceGroups/rg1/providers/Microsoft.Devices/IotHubs/hub1", @@ -93,7 +91,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new IoTHubDescription( Id: "/subscriptions/sub123/resourceGroups/rg1/providers/Microsoft.Devices/IotHubs/hub1", @@ -122,7 +119,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -141,7 +137,6 @@ public async Task ExecuteAsync_HandlesNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Resource not found")); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Admin/AdminSettingsGetCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Admin/AdminSettingsGetCommand.cs index 8f92a68e29..e9468c54e0 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Admin/AdminSettingsGetCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Admin/AdminSettingsGetCommand.cs @@ -32,7 +32,7 @@ public override async Task ExecuteAsync(CommandContext context, { try { - var settingsResult = await _keyVaultService.GetVaultSettings(options.Vault, options.Subscription!, options.Tenant, options.RetryPolicy, cancellationToken); + var settingsResult = await _keyVaultService.GetVaultSettings(options.Vault, options.Subscription!, options.Tenant, cancellationToken); // Convert settings to a dictionary of strings for easier serialization in case the service adds new settings in the future. Dictionary settings = new(StringComparer.OrdinalIgnoreCase); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateCreateCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateCreateCommand.cs index cca3c27c42..7e68cdbfad 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateCreateCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Certificate, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(CertificateDetails.FromCertificate(certificate), KeyVaultJsonContext.Default.CertificateDetails); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateGetCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateGetCommand.cs index 8037b6c42e..651849f460 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateGetCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateGetCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Vault, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(certificates ?? [], null), KeyVaultJsonContext.Default.CertificateGetCommandResult); @@ -53,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Certificate, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, CertificateDetails.FromCertificate(certificate)), KeyVaultJsonContext.Default.CertificateGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateImportCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateImportCommand.cs index c7ffeb1396..c731531724 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateImportCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Certificate/CertificateImportCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Password, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(CertificateDetails.FromCertificate(certificate), KeyVaultJsonContext.Default.CertificateDetails); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyCreateCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyCreateCommand.cs index 1ece2d1913..483d7f7bfb 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyCreateCommand.cs @@ -39,7 +39,6 @@ public override async Task ExecuteAsync(CommandContext context, options.KeyType, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(KeyDetails.FromKey(key), KeyVaultJsonContext.Default.KeyDetails); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs index b05222a491..19d8499367 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Key/KeyGetCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.IncludeManaged, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(keys ?? [], null), KeyVaultJsonContext.Default.KeyGetCommandResult); @@ -54,7 +53,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Key, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, KeyDetails.FromKey(key)), KeyVaultJsonContext.Default.KeyGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretCreateCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretCreateCommand.cs index 96b1ec0c6c..7fcab5ae0c 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretCreateCommand.cs @@ -39,7 +39,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Value!, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(SecretDetails.FromSecret(secret), KeyVaultJsonContext.Default.SecretDetails); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretGetCommand.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretGetCommand.cs index 1d2484b076..2af0391e1c 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretGetCommand.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Commands/Secret/SecretGetCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Vault, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(Secrets: secrets ?? [], Secret: null), KeyVaultJsonContext.Default.SecretGetCommandResult); @@ -53,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Secret, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, SecretDetails.FromSecret(secret)), KeyVaultJsonContext.Default.SecretGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Options/BaseKeyVaultOptions.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Options/BaseKeyVaultOptions.cs index fcd7aebf22..3dea9cd69e 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Options/BaseKeyVaultOptions.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Options/BaseKeyVaultOptions.cs @@ -17,6 +17,4 @@ public class BaseKeyVaultOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs index aeed6882e3..335ceb0271 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs @@ -5,7 +5,6 @@ using Azure.Security.KeyVault.Certificates; using Azure.Security.KeyVault.Keys; using Azure.Security.KeyVault.Secrets; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.KeyVault.Services; @@ -18,7 +17,6 @@ public interface IKeyVaultService /// The name of the certificate to create /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy for the operation /// A cancellation token /// The created certificate Task CreateCertificate( @@ -26,7 +24,6 @@ Task CreateCertificate( string certificateName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -37,7 +34,6 @@ Task CreateCertificate( /// The type of key to create (e.g., RSA, EC, OCT) /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy for the operation /// The created key Task CreateKey( string vaultName, @@ -45,7 +41,6 @@ Task CreateKey( string keyType, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -56,7 +51,6 @@ Task CreateKey( /// The value of the secret /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy for the operation /// The created secret Task CreateSecret( string vaultName, @@ -64,7 +58,6 @@ Task CreateSecret( string secretValue, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -74,14 +67,12 @@ Task CreateSecret( /// The name of the certificate to retrieve /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy for the operation /// The certificate Task GetCertificate( string vaultName, string certificateName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -91,14 +82,12 @@ Task GetCertificate( /// The name of the key to retrieve /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy for the operation /// The key Task GetKey( string vaultName, string keyName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -108,14 +97,12 @@ Task GetKey( /// The name of the secret to retrieve /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy for the operation /// The secret value Task GetSecret( string vaultName, string secretName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -124,13 +111,11 @@ Task GetSecret( /// Name of the Key Vault. /// Subscription ID containing the Key Vault. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// List of certificate names in the vault. Task> ListCertificates( string vaultName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -139,14 +124,12 @@ Task> ListCertificates( /// Name of the Key Vault. /// Subscription ID containing the Key Vault. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// List of key names in the vault. Task> ListKeys( string vaultName, bool includeManagedKeys, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -155,13 +138,11 @@ Task> ListKeys( /// Name of the Key Vault. /// Subscription ID containing the Key Vault. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// List of secret names in the vault. Task> ListSecrets( string vaultName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -173,7 +154,6 @@ Task> ListSecrets( /// Optional password if the certificate is a protected PFX. /// The subscription ID or name. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// The imported certificate. Task ImportCertificate( string vaultName, @@ -182,7 +162,6 @@ Task ImportCertificate( string? password, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -191,12 +170,10 @@ Task ImportCertificate( /// The name of the Key Vault. /// The subscription ID or name. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// Structured vault settings. Task GetVaultSettings( string vaultName, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Services/KeyVaultService.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Services/KeyVaultService.cs index 8d8856ee53..637529a5e3 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/src/Services/KeyVaultService.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/src/Services/KeyVaultService.cs @@ -6,7 +6,6 @@ using Azure.Security.KeyVault.Certificates; using Azure.Security.KeyVault.Keys; using Azure.Security.KeyVault.Secrets; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.KeyVault.Services; @@ -19,13 +18,12 @@ public async Task> ListKeys( bool includeManagedKeys, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateKeyClient(vaultName, credential, retryPolicy); + var client = CreateKeyClient(vaultName, credential); var keys = new List(); await foreach (var key in client.GetPropertiesOfKeysAsync(cancellationToken).Where(x => includeManagedKeys || !x.Managed)) @@ -41,13 +39,12 @@ public async Task GetKey( string keyName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(keyName), keyName), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateKeyClient(vaultName, credential, retryPolicy); + var client = CreateKeyClient(vaultName, credential); return await client.GetKeyAsync(keyName, cancellationToken: cancellationToken); } @@ -58,14 +55,13 @@ public async Task CreateKey( string keyType, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(keyName), keyName), (nameof(keyType), keyType), (nameof(subscriptionId), subscriptionId)); var type = new KeyType(keyType); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateKeyClient(vaultName, credential, retryPolicy); + var client = CreateKeyClient(vaultName, credential); return await client.CreateKeyAsync(keyName, type, cancellationToken: cancellationToken); } @@ -74,13 +70,12 @@ public async Task> ListSecrets( string vaultName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateSecretClient(vaultName, credential, retryPolicy); + var client = CreateSecretClient(vaultName, credential); var secrets = new List(); await foreach (var secret in client.GetPropertiesOfSecretsAsync(cancellationToken)) @@ -97,13 +92,12 @@ public async Task CreateSecret( string secretValue, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(secretName), secretName), (nameof(secretValue), secretValue), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateSecretClient(vaultName, credential, retryPolicy); + var client = CreateSecretClient(vaultName, credential); return await client.SetSecretAsync(secretName, secretValue, cancellationToken); } @@ -113,13 +107,12 @@ public async Task GetSecret( string secretName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(secretName), secretName), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateSecretClient(vaultName, credential, retryPolicy); + var client = CreateSecretClient(vaultName, credential); return await client.GetSecretAsync(secretName, cancellationToken: cancellationToken); } @@ -128,13 +121,12 @@ public async Task> ListCertificates( string vaultName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateCertificateClient(vaultName, credential, retryPolicy); + var client = CreateCertificateClient(vaultName, credential); var certificates = new List(); await foreach (var certificate in client.GetPropertiesOfCertificatesAsync(cancellationToken: cancellationToken)) @@ -150,13 +142,12 @@ public async Task GetCertificate( string certificateName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(certificateName), certificateName), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateCertificateClient(vaultName, credential, retryPolicy); + var client = CreateCertificateClient(vaultName, credential); return await client.GetCertificateAsync(certificateName, cancellationToken); } @@ -166,13 +157,12 @@ public async Task CreateCertificate( string certificateName, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(certificateName), certificateName), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateCertificateClient(vaultName, credential, retryPolicy); + var client = CreateCertificateClient(vaultName, credential); var certificateOperation = await client.StartCreateCertificateAsync(certificateName, CertificatePolicy.Default, cancellationToken: cancellationToken); await WaitForLroCompletionAsync(certificateOperation, cancellationToken); @@ -186,13 +176,12 @@ public async Task ImportCertificate( string? password, string subscriptionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(certificateName), certificateName), (nameof(certificateData), certificateData), (nameof(subscriptionId), subscriptionId)); var credential = await GetCredential(tenantId, cancellationToken); - var client = CreateCertificateClient(vaultName, credential, retryPolicy); + var client = CreateCertificateClient(vaultName, credential); // certificateData expected as base64 PFX bytes or raw PEM text. byte[] bytes; @@ -294,35 +283,32 @@ internal static void ValidateVaultName(string vaultName) } // Create clients with injected HttpClient, this will enable record/playback during testing. - private KeyClient CreateKeyClient(string vaultName, Azure.Core.TokenCredential credential, RetryPolicyOptions? retry) + private KeyClient CreateKeyClient(string vaultName, Azure.Core.TokenCredential credential) { var vaultUri = new Uri(BuildVaultUri(vaultName)); var httpClient = AzureService.GetClient(); httpClient.BaseAddress = vaultUri; - var options = new KeyClientOptions(); - options = ConfigureRetryPolicy(AddDefaultPolicies(options), retry); + var options = AddDefaultPolicies(new KeyClientOptions()); options.Transport = new Azure.Core.Pipeline.HttpClientTransport(httpClient); return new(vaultUri, credential, options); } - private SecretClient CreateSecretClient(string vaultName, Azure.Core.TokenCredential credential, RetryPolicyOptions? retry) + private SecretClient CreateSecretClient(string vaultName, Azure.Core.TokenCredential credential) { var vaultUri = new Uri(BuildVaultUri(vaultName)); var httpClient = AzureService.GetClient(); httpClient.BaseAddress = vaultUri; - var options = new SecretClientOptions(); - options = ConfigureRetryPolicy(AddDefaultPolicies(options), retry); + var options = AddDefaultPolicies(new SecretClientOptions()); options.Transport = new Azure.Core.Pipeline.HttpClientTransport(httpClient); return new(vaultUri, credential, options); } - private CertificateClient CreateCertificateClient(string vaultName, Azure.Core.TokenCredential credential, RetryPolicyOptions? retry) + private CertificateClient CreateCertificateClient(string vaultName, Azure.Core.TokenCredential credential) { var vaultUri = new Uri(BuildVaultUri(vaultName)); var httpClient = AzureService.GetClient(); httpClient.BaseAddress = vaultUri; - var options = new CertificateClientOptions(); - options = ConfigureRetryPolicy(AddDefaultPolicies(options), retry); + var options = AddDefaultPolicies(new CertificateClientOptions()); options.Transport = new Azure.Core.Pipeline.HttpClientTransport(httpClient); return new(vaultUri, credential, options); } @@ -331,24 +317,22 @@ public async Task GetVaultSettings( string vaultName, string subscription, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(vaultName), vaultName), (nameof(subscription), subscription)); var credential = await GetCredential(tenantId, cancellationToken); var hsmUri = new Uri(GetHsmUri(vaultName)); - var hsmClient = CreateSettingsClient(hsmUri, credential, retryPolicy); + var hsmClient = CreateSettingsClient(hsmUri, credential); var hsmResponse = await hsmClient.GetSettingsAsync(cancellationToken); return hsmResponse.Value; } - private KeyVaultSettingsClient CreateSettingsClient(Uri hsmUri, Azure.Core.TokenCredential credential, RetryPolicyOptions? retry) + private KeyVaultSettingsClient CreateSettingsClient(Uri hsmUri, Azure.Core.TokenCredential credential) { var httpClient = AzureService.GetClient(); httpClient.BaseAddress = hsmUri; - var options = new KeyVaultAdministrationClientOptions(); - options = ConfigureRetryPolicy(AddDefaultPolicies(options), retry); + var options = AddDefaultPolicies(new KeyVaultAdministrationClientOptions()); options.Transport = new Azure.Core.Pipeline.HttpClientTransport(httpClient); return new(hsmUri, credential, options); } diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Admin/AdminSettingsGetCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Admin/AdminSettingsGetCommandTests.cs index 1dac28fd50..4a8e26fc51 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Admin/AdminSettingsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Admin/AdminSettingsGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.KeyVault.Commands.Admin; using Azure.Mcp.Tools.KeyVault.Services; using Azure.Security.KeyVault.Administration; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -27,7 +26,6 @@ public async Task ExecuteAsync_ReturnsSettingsDictionary() Arg.Is(KnownVaultName), Arg.Is(KnownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns((GetSettingsResult)null!); @@ -46,7 +44,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -70,7 +67,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns((GetSettingsResult)null!); } diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateCreateCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateCreateCommandTests.cs index 004bf49a50..c4bb836459 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateCreateCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.KeyVault.Commands.Certificate; using Azure.Mcp.Tools.KeyVault.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,6 @@ public async Task ExecuteAsync_CallsServiceCorrectly() Arg.Is(_knownCertificateName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -47,7 +45,6 @@ await Service.Received(1).CreateCertificate( _knownCertificateName, _knownSubscriptionId, Arg.Any(), - Arg.Any(), Arg.Any()); // Should handle the exception @@ -79,7 +76,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(_knownCertificateName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateGetCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateGetCommandTests.cs index 1b82221a63..7cd2e10e39 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateGetCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.KeyVault.Commands.Certificate; using Azure.Mcp.Tools.KeyVault.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,6 @@ public async Task ExecuteAsync_CallsServiceCorrectly() Arg.Is(_knownCertificateName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -47,7 +45,6 @@ await Service.Received(1).GetCertificate( Arg.Is(_knownCertificateName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()); // Should handle the exception @@ -65,7 +62,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(_knownCertificateName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -91,7 +87,6 @@ public async Task ExecuteAsync_ReturnsCertificatesList_WhenCertificateNameNotPro Arg.Is(_knownVaultName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedCertificates); @@ -119,7 +114,6 @@ public async Task ExecuteAsync_HandlesException_WhenListingCertificates() Arg.Is(_knownVaultName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateImportCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateImportCommandTests.cs index 03a3c318ba..952fcfc801 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateImportCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Certificate/CertificateImportCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.KeyVault.Commands.Certificate; using Azure.Mcp.Tools.KeyVault.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,7 +31,6 @@ public async Task ExecuteAsync_CallsService_WithExpectedParameters() null, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // force exception to avoid building return object @@ -51,7 +49,6 @@ await Service.Received(1).ImportCertificate( null, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()); Assert.Equal(HttpStatusCode.InternalServerError, response.Status); // due to forced exception } @@ -98,7 +95,6 @@ public async Task ExecuteAsync_HandlesServiceException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expected)); @@ -125,7 +121,6 @@ public async Task ExecuteAsync_CallsService_WithPemData() null, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -144,7 +139,6 @@ await Service.Received(1).ImportCertificate( null, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()); Assert.Equal(HttpStatusCode.InternalServerError, response.Status); } @@ -161,7 +155,6 @@ public async Task ExecuteAsync_CallsService_WithPassword() password, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -179,7 +172,6 @@ await Service.Received(1).ImportCertificate( password, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()); Assert.Equal(HttpStatusCode.InternalServerError, response.Status); } @@ -199,7 +191,6 @@ public async Task ExecuteAsync_CallsService_WithFilePath() null, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -218,7 +209,6 @@ await Service.Received(1).ImportCertificate( null, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()); Assert.Equal(HttpStatusCode.InternalServerError, response.Status); } @@ -246,7 +236,6 @@ public async Task ExecuteAsync_Returns400_OnInvalidCertificateData() null, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException(errorMessage)); @@ -274,7 +263,6 @@ public async Task ExecuteAsync_Returns500_OnInvalidPassword() password, _knownSubscription, Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(mismatchMessage)); diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyCreateCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyCreateCommandTests.cs index 9cec10d7a4..19875ba651 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.KeyVault.Commands.Key; using Azure.Mcp.Tools.KeyVault.Services; using Azure.Security.KeyVault.Keys; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_CreatesKey_WithValidInput() Arg.Is(_knownKeyType.ToString()), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(_knownKeyVaultKey); @@ -92,7 +90,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(_knownKeyType.ToString()), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyGetCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyGetCommandTests.cs index 296579d5fe..74f41867a3 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Key/KeyGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.KeyVault.Commands.Key; using Azure.Mcp.Tools.KeyVault.Services; using Azure.Security.KeyVault.Keys; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ReturnsKey() Arg.Is(_knownKeyName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(_knownKeyVaultKey); @@ -76,7 +74,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(_knownKeyName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -103,7 +100,6 @@ public async Task ExecuteAsync_ReturnsKeysList_WhenKeyNameNotProvided() Arg.Is(false), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedKeys); @@ -132,7 +128,6 @@ public async Task ExecuteAsync_ReturnsKeysList_WithManagedKeys() Arg.Is(true), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedKeys); @@ -162,7 +157,6 @@ public async Task ExecuteAsync_HandlesException_WhenListingKeys() Arg.Any(), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -190,7 +184,6 @@ public async Task ExecuteAsync_ReturnsKeysList_IncludesNullManagedKeys_WhenInclu Arg.Is(false), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedKeys); diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretCreateCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretCreateCommandTests.cs index 831234df42..3e905e0118 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.KeyVault.Commands.Secret; using Azure.Mcp.Tools.KeyVault.Services; using Azure.Security.KeyVault.Secrets; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,7 +31,6 @@ public async Task ExecuteAsync_CreatesSecret_WhenValidInput() Arg.Is(_knownSecretValue), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(_knownKeyVaultSecret); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(_knownSecretValue), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretGetCommandTests.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretGetCommandTests.cs index afcbf46a09..8d72c7d3f9 100644 --- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/Secret/SecretGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.KeyVault.Commands.Secret; using Azure.Mcp.Tools.KeyVault.Services; using Azure.Security.KeyVault.Secrets; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -31,7 +30,6 @@ public async Task ExecuteAsync_ReturnsSecret() Arg.Is(_knownSecretName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(_knownKeyVaultSecret); @@ -61,7 +59,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -87,7 +84,6 @@ public async Task ExecuteAsync_ReturnsSecretsList_WhenSecretNameNotProvided() Arg.Is(_knownVaultName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedSecrets); @@ -115,7 +111,6 @@ public async Task ExecuteAsync_HandlesException_WhenListingSecrets() Arg.Is(_knownVaultName), Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterGetCommand.cs b/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterGetCommand.cs index 43d6e68292..a0bcb63f5b 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterGetCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Cluster, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = cluster is null ? diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterListCommand.cs b/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterListCommand.cs index 89e6291310..000798bac2 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterListCommand.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Commands/ClusterListCommand.cs @@ -36,7 +36,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new ClusterListCommandResult(clusterNames?.Results ?? [], clusterNames?.AreResultsTruncated ?? false), KustoJsonContext.Default.ClusterListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Commands/DatabaseListCommand.cs b/tools/Azure.Mcp.Tools.Kusto/src/Commands/DatabaseListCommand.cs index 828af9287f..cb545fec42 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Commands/DatabaseListCommand.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Commands/DatabaseListCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, databasesNames = await kustoService.ListDatabasesAsync( options.ClusterUri!, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -47,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Cluster!, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Commands/QueryCommand.cs b/tools/Azure.Mcp.Tools.Kusto/src/Commands/QueryCommand.cs index 8c69151e05..d5b4178664 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Commands/QueryCommand.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Commands/QueryCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, options.Query, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -52,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, options.Query, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Commands/SampleCommand.cs b/tools/Azure.Mcp.Tools.Kusto/src/Commands/SampleCommand.cs index 19fe151de7..1783a01665 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Commands/SampleCommand.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Commands/SampleCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, query, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -57,7 +56,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, query, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableListCommand.cs b/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableListCommand.cs index aa9e6b7c05..82d274e3bd 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableListCommand.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableListCommand.cs @@ -39,7 +39,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ClusterUri!, options.Database, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -49,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Cluster!, options.Database, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableSchemaCommand.cs b/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableSchemaCommand.cs index f9b163dbe0..3f7fa99f17 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableSchemaCommand.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Commands/TableSchemaCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, options.Table, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -51,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, options.Table, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterGetOptions.cs b/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterGetOptions.cs index 19f2f3fefc..47807c86db 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterGetOptions.cs @@ -17,6 +17,4 @@ public sealed class ClusterGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterListOptions.cs b/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterListOptions.cs index dd01010d49..110a9f8332 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterListOptions.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterListOptions.cs @@ -17,6 +17,4 @@ public sealed class ClusterListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Options/DatabaseListOptions.cs b/tools/Azure.Mcp.Tools.Kusto/src/Options/DatabaseListOptions.cs index 74da8ee1d2..ab9c41b605 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Options/DatabaseListOptions.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Options/DatabaseListOptions.cs @@ -20,6 +20,4 @@ public sealed class DatabaseListOptions : ISubscriptionOption, IClusterOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Options/QueryOptions.cs b/tools/Azure.Mcp.Tools.Kusto/src/Options/QueryOptions.cs index 1b00c31f4b..37d51cc6ca 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Options/QueryOptions.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Options/QueryOptions.cs @@ -26,6 +26,4 @@ public sealed class QueryOptions : ISubscriptionOption, IDatabaseOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Options/SampleOptions.cs b/tools/Azure.Mcp.Tools.Kusto/src/Options/SampleOptions.cs index 987aecb8c9..92281884ce 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Options/SampleOptions.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Options/SampleOptions.cs @@ -29,6 +29,4 @@ public sealed class SampleOptions : ISubscriptionOption, ITableOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Options/TableListOptions.cs b/tools/Azure.Mcp.Tools.Kusto/src/Options/TableListOptions.cs index 830aa77b29..1a50724d68 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Options/TableListOptions.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Options/TableListOptions.cs @@ -23,6 +23,4 @@ public sealed class TableListOptions : ISubscriptionOption, IDatabaseOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Options/TableSchemaOptions.cs b/tools/Azure.Mcp.Tools.Kusto/src/Options/TableSchemaOptions.cs index fd26f4935c..7da93f999b 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Options/TableSchemaOptions.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Options/TableSchemaOptions.cs @@ -26,6 +26,4 @@ public sealed class TableSchemaOptions : ISubscriptionOption, ITableOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs b/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs index bdda69c34a..5328313ba0 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Kusto.Models; using Microsoft.Mcp.Core.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Kusto.Services; @@ -15,27 +14,23 @@ Task> ListClustersAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetClusterAsync( string subscription, string clusterName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListDatabasesAsync( string clusterUri, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListDatabasesAsync( string subscription, string clusterName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> QueryItemsAsync( @@ -43,7 +38,6 @@ Task> QueryItemsAsync( string databaseName, string query, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> QueryItemsAsync( @@ -52,14 +46,12 @@ Task> QueryItemsAsync( string databaseName, string query, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListTablesAsync( string clusterUri, string databaseName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListTablesAsync( @@ -67,7 +59,6 @@ Task> ListTablesAsync( string clusterName, string databaseName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetTableSchemaAsync( @@ -75,7 +66,6 @@ Task GetTableSchemaAsync( string databaseName, string tableName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetTableSchemaAsync( @@ -84,6 +74,5 @@ Task GetTableSchemaAsync( string databaseName, string tableName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs b/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs index 18e079c568..d23fc185f4 100644 --- a/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs +++ b/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Kusto.Models; using Azure.Mcp.Tools.Kusto.Validation; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Caching; using Microsoft.Mcp.Core.Validation; @@ -58,7 +57,6 @@ public async Task> ListClustersAsync( string subscriptionId, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscriptionId), subscriptionId)); @@ -67,7 +65,7 @@ public async Task> ListClustersAsync( "Microsoft.Kusto/clusters", resourceGroup: resourceGroup, subscriptionId, - retryPolicy, + null, item => ConvertToClusterModel(item).ClusterName, tenant: tenant, cancellationToken: cancellationToken); @@ -79,7 +77,6 @@ public async Task GetClusterAsync( string subscriptionId, string clusterName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscriptionId), subscriptionId)); @@ -88,7 +85,7 @@ public async Task GetClusterAsync( "Microsoft.Kusto/clusters", resourceGroup: null, // all resource groups subscription: subscriptionId, - retryPolicy: retryPolicy, + null, converter: ConvertToClusterModel, additionalFilter: $"name =~ '{EscapeKqlString(clusterName)}'", tenant: tenant, @@ -105,21 +102,19 @@ public async Task> ListDatabasesAsync( string subscriptionId, string clusterName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( (nameof(subscriptionId), subscriptionId), (nameof(clusterName), clusterName)); - string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant, retryPolicy); - return await ListDatabasesAsync(clusterUri, tenant, retryPolicy, cancellationToken); + string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant); + return await ListDatabasesAsync(clusterUri, tenant, cancellationToken); } public async Task> ListDatabasesAsync( string clusterUri, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(clusterUri), clusterUri)); @@ -137,7 +132,6 @@ public async Task> ListTablesAsync( string clusterName, string databaseName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -145,15 +139,14 @@ public async Task> ListTablesAsync( (nameof(clusterName), clusterName), (nameof(databaseName), databaseName)); - string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant, retryPolicy); - return await ListTablesAsync(clusterUri, databaseName, tenant, retryPolicy, cancellationToken); + string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant); + return await ListTablesAsync(clusterUri, databaseName, tenant, cancellationToken); } public async Task> ListTablesAsync( string clusterUri, string databaseName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(clusterUri), clusterUri), (nameof(databaseName), databaseName)); @@ -172,11 +165,10 @@ public async Task GetTableSchemaAsync( string databaseName, string tableName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant, retryPolicy); - return await GetTableSchemaAsync(clusterUri, databaseName, tableName, tenant, retryPolicy, cancellationToken); + string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant); + return await GetTableSchemaAsync(clusterUri, databaseName, tableName, tenant, cancellationToken); } public async Task GetTableSchemaAsync( @@ -184,7 +176,6 @@ public async Task GetTableSchemaAsync( string databaseName, string tableName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -214,7 +205,6 @@ public async Task> QueryItemsAsync( string databaseName, string query, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -223,8 +213,8 @@ public async Task> QueryItemsAsync( (nameof(databaseName), databaseName), (nameof(query), query)); - string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant, retryPolicy); - return await QueryItemsAsync(clusterUri, databaseName, query, tenant, retryPolicy, cancellationToken); + string clusterUri = await GetClusterUriAsync(subscriptionId, clusterName, tenant); + return await QueryItemsAsync(clusterUri, databaseName, query, tenant, cancellationToken); } public async Task> QueryItemsAsync( @@ -232,7 +222,6 @@ public async Task> QueryItemsAsync( string databaseName, string query, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -353,10 +342,9 @@ private async Task GetOrCreateCslQueryProviderAsync(string clusterU private async Task GetClusterUriAsync( string subscriptionId, string clusterName, - string? tenant, - RetryPolicyOptions? retryPolicy) + string? tenant) { - var cluster = await GetClusterAsync(subscriptionId, clusterName, tenant, retryPolicy); + var cluster = await GetClusterAsync(subscriptionId, clusterName, tenant); var value = cluster?.ClusterUri; if (string.IsNullOrEmpty(value)) diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterGetCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterGetCommandTests.cs index 4cc7fd3052..351dcc1b69 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Kusto.Commands; using Azure.Mcp.Tools.Kusto.Models; using Azure.Mcp.Tools.Kusto.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,7 +38,7 @@ public async Task ExecuteAsync_ReturnsCluster_WhenClusterExists() ); Service.GetClusterAsync( - "sub123", "clusterA", Arg.Any(), Arg.Any(), Arg.Any()) + "sub123", "clusterA", Arg.Any(), Arg.Any()) .Returns(expectedCluster); var response = await ExecuteCommandAsync("--subscription sub123 --cluster clusterA"); @@ -54,7 +53,7 @@ public async Task ExecuteAsync_ReturnsCluster_WhenClusterExists() public async Task ExecuteAsync_Returns404_WhenClusterDoesNotExist() { Service.GetClusterAsync( - "sub123", "clusterA", Arg.Any(), Arg.Any(), Arg.Any()) + "sub123", "clusterA", Arg.Any(), Arg.Any()) .ThrowsAsync(new KeyNotFoundException("Kusto cluster 'clusterA' not found for subscription 'sub123'.")); var response = await ExecuteCommandAsync("--subscription sub123 --cluster clusterA"); @@ -68,7 +67,7 @@ public async Task ExecuteAsync_HandlesException_AndSetsException() { var expectedError = "Test error. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; Service.GetClusterAsync( - "sub123", "clusterA", Arg.Any(), Arg.Any(), Arg.Any()) + "sub123", "clusterA", Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync("--subscription sub123 --cluster clusterA"); diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterListCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterListCommandTests.cs index 84fc159f35..efaf3a31ae 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/ClusterListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Kusto.Commands; using Azure.Mcp.Tools.Kusto.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -21,7 +20,7 @@ public async Task ExecuteAsync_ReturnsClusters_WhenClustersExist() // Arrange var expectedClusters = new ResourceQueryResults(["clusterA", "clusterB"], false); Service.ListClustersAsync( - "sub123", Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + "sub123", Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedClusters); // Act @@ -37,7 +36,7 @@ public async Task ExecuteAsync_ReturnsClusters_WhenClustersExist() public async Task ExecuteAsync_ReturnsEmpty_WhenNoClustersExist() { // Arrange - Service.ListClustersAsync("sub123", Arg.Any(), null, null, Arg.Any()) + Service.ListClustersAsync("sub123", Arg.Any(), null, Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -57,7 +56,7 @@ public async Task ExecuteAsync_HandlesException_AndSetsException() var subscriptionId = "sub123"; // Arrange - Service.ListClustersAsync(subscriptionId, Arg.Any(), null, Arg.Any(), Arg.Any()) + Service.ListClustersAsync(subscriptionId, Arg.Any(), null, Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -74,7 +73,7 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( { // Arrange const string resourceGroup = "test-rg"; - Service.ListClustersAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListClustersAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -82,6 +81,6 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( // Assert Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).ListClustersAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListClustersAsync(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/DatabaseListCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/DatabaseListCommandTests.cs index cef70c52a5..4959912a67 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/DatabaseListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/DatabaseListCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Kusto.Commands; using Azure.Mcp.Tools.Kusto.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,13 +29,13 @@ public async Task ExecuteAsync_ReturnsDatabases(string cliArgs, bool useClusterU { Service.ListDatabasesAsync( "https://mycluster.kusto.windows.net", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedDatabases); } else { Service.ListDatabasesAsync( - "sub1", "mycluster", Arg.Any(), Arg.Any(), Arg.Any()) + "sub1", "mycluster", Arg.Any(), Arg.Any()) .Returns(expectedDatabases); } @@ -57,13 +56,13 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoDatabasesExist(string cliArgs, { Service.ListDatabasesAsync( "https://mycluster.kusto.windows.net", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } else { Service.ListDatabasesAsync( - "sub1", "mycluster", Arg.Any(), Arg.Any(), Arg.Any()) + "sub1", "mycluster", Arg.Any(), Arg.Any()) .Returns([]); } @@ -85,13 +84,13 @@ public async Task ExecuteAsync_HandlesException_AndSetsException(string cliArgs, { Service.ListDatabasesAsync( "https://mycluster.kusto.windows.net", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } else { Service.ListDatabasesAsync( - "sub1", "mycluster", Arg.Any(), Arg.Any(), Arg.Any()) + "sub1", "mycluster", Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/QueryCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/QueryCommandTests.cs index cbe2950135..3936d84ea4 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/QueryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/QueryCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Kusto.Commands; using Azure.Mcp.Tools.Kusto.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,14 +32,14 @@ public async Task ExecuteAsync_ReturnsQueryResults(string cliArgs, bool useClust "https://mycluster.kusto.windows.net", "db1", "StormEvents | take 1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJson); } else { Service.QueryItemsAsync( "sub1", "mycluster", "db1", "StormEvents | take 1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJson); } @@ -67,14 +66,14 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoResults(string cliArgs, bool u "https://mycluster.kusto.windows.net", "db1", "StormEvents | take 1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } else { Service.QueryItemsAsync( "sub1", "mycluster", "db1", "StormEvents | take 1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } @@ -95,14 +94,14 @@ public async Task ExecuteAsync_HandlesException_AndSetsException(string cliArgs, "https://mycluster.kusto.windows.net", "db1", "StormEvents | take 1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } else { Service.QueryItemsAsync( "sub1", "mycluster", "db1", "StormEvents | take 1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/SampleCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/SampleCommandTests.cs index 83c9ec1915..eefaf4213e 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/SampleCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/SampleCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Kusto.Commands; using Azure.Mcp.Tools.Kusto.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -32,14 +31,14 @@ public async Task ExecuteAsync_ReturnsSampleResults(string cliArgs, bool useClus "https://mycluster.kusto.windows.net", "db1", "['table1'] | sample 10", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJson); } else { Service.QueryItemsAsync( "sub1", "mycluster", "db1", "['table1'] | sample 10", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJson); } @@ -66,14 +65,14 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoResults(string cliArgs, bool u "https://mycluster.kusto.windows.net", "db1", "['table1'] | sample 10", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } else { Service.QueryItemsAsync( "sub1", "mycluster", "db1", "['table1'] | sample 10", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } @@ -95,14 +94,14 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoResults(string cliArgs, bool u // "https://mycluster.kusto.windows.net", // "db1", // "table1 | sample 10", - // Arg.Any(), Arg.Any()) + // Arg.Any()) // .Returns(Task.FromException>(new Exception("Test error"))); // } // else // { // _kusto.QueryItems( // "sub1", "mycluster", "db1", "table1 | sample 10", - // Arg.Any(), Arg.Any()) + // Arg.Any()) // .Returns(Task.FromException>(new Exception("Test error"))); // } // var command = new SampleCommand(_logger, _kusto); diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableListCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableListCommandTests.cs index b03ecf4f68..df74828cdc 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableListCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Kusto.Commands; using Azure.Mcp.Tools.Kusto.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,14 +29,14 @@ public async Task ExecuteAsync_ReturnsTables(string cliArgs, bool useClusterUri) Service.ListTablesAsync( "https://mycluster.kusto.windows.net", "db1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedTables); } else { Service.ListTablesAsync( "sub1", "mycluster", "db1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedTables); } @@ -57,14 +56,14 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoTables(string cliArgs, bool us Service.ListTablesAsync( "https://mycluster.kusto.windows.net", "db1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } else { Service.ListTablesAsync( "sub1", "mycluster", "db1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); } @@ -84,14 +83,14 @@ public async Task ExecuteAsync_HandlesException_AndSetsException(string cliArgs, Service.ListTablesAsync( "https://mycluster.kusto.windows.net", "db1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } else { Service.ListTablesAsync( "sub1", "mycluster", "db1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } diff --git a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableSchemaCommandTests.cs b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableSchemaCommandTests.cs index 1f8a65139f..2918c62afd 100644 --- a/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableSchemaCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.Tests/TableSchemaCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Kusto.Commands; using Azure.Mcp.Tools.Kusto.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,14 +31,14 @@ public async Task ExecuteAsync_ReturnsSchema(string cliArgs, bool useClusterUri) "https://mycluster.kusto.windows.net", "db1", "table1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedSchema); } else { Service.GetTableSchemaAsync( "sub1", "mycluster", "db1", "table1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedSchema); } @@ -64,14 +63,14 @@ public async Task ExecuteAsync_ReturnsNull_WhenNoSchema(string cliArgs, bool use "https://mycluster.kusto.windows.net", "db1", "table1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } else { Service.GetTableSchemaAsync( "sub1", "mycluster", "db1", "table1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } @@ -94,14 +93,14 @@ public async Task ExecuteAsync_HandlesException_AndSetsException(string cliArgs, "https://mycluster.kusto.windows.net", "db1", "table1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } else { Service.GetTableSchemaAsync( "sub1", "mycluster", "db1", "table1", - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestCreateCommand.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestCreateCommand.cs index c98656434e..4c5d581061 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestCreateCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.RampUpTime, options.Endpoint, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results if any were returned diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestGetCommand.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestGetCommand.cs index d62ddd3b54..cc175d5d2a 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestGetCommand.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTest/TestGetCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.TestId, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results if any were returned diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceCreateCommand.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceCreateCommand.cs index 95004917bb..4a888241e8 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceCreateCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.TestResourceName, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results if any were returned context.Response.Results = results != null ? diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceListCommand.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceListCommand.cs index 4fb4b7473f..28ba8d4dc8 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceListCommand.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestResource/TestResourceListCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.TestResourceName, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results if any were returned context.Response.Results = ResponseResult.Create(new(results ?? []), LoadTestJsonContext.Default.TestResourceListCommandResult); diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunCreateOrUpdateCommand.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunCreateOrUpdateCommand.cs index fff84834e0..dd97d3d3f1 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunCreateOrUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunCreateOrUpdateCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.DisplayName, options.Description, false, // DebugMode false will default to a normal test run - in future we may add a DebugMode option - options.RetryPolicy, cancellationToken); // Set results if any were returned context.Response.Results = results != null ? diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunGetCommand.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunGetCommand.cs index c21e5ea601..d589c8054d 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunGetCommand.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestRun/TestRunGetCommand.cs @@ -60,7 +60,6 @@ public override async Task ExecuteAsync(CommandContext context, options.TestrunId, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results if any were returned context.Response.Results = result != null @@ -76,7 +75,6 @@ public override async Task ExecuteAsync(CommandContext context, options.TestId, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(results ?? []), LoadTestJsonContext.Default.TestRunGetCommandResult); } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestCreateOptions.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestCreateOptions.cs index 120233440b..1b747743b7 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestCreateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -65,6 +64,4 @@ public sealed class TestCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestGetOptions.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestGetOptions.cs index cd78ebd1e6..0eb27f201e 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestGetOptions.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestGetOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -29,6 +28,4 @@ public sealed class TestGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceCreateOptions.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceCreateOptions.cs index a048f13eb9..b78a377eb0 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceCreateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class TestResourceCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceListOptions.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceListOptions.cs index 7c2ab01a51..943dbe466c 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceListOptions.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceListOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class TestResourceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunCreateOrUpdateOptions.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunCreateOrUpdateOptions.cs index eb92780848..6700d1a03f 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunCreateOrUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunCreateOrUpdateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -53,6 +52,4 @@ public sealed class TestRunCreateOrUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunGetOptions.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunGetOptions.cs index eb72dce39f..73792b8c53 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunGetOptions.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunGetOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -35,6 +34,4 @@ public sealed class TestRunGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Services/ILoadTestingService.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Services/ILoadTestingService.cs index c8c547c13d..5de7a6bc9a 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Services/ILoadTestingService.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Services/ILoadTestingService.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Tools.LoadTesting.Models.LoadTest; using Azure.Mcp.Tools.LoadTesting.Models.LoadTestResource; using Azure.Mcp.Tools.LoadTesting.Models.LoadTestRun; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.LoadTesting.Services; @@ -15,7 +14,6 @@ Task CreateOrUpdateLoadTestingResourceAsync( string resourceGroup, string? testResourceName = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetLoadTestResourcesAsync( @@ -23,7 +21,6 @@ Task> GetLoadTestResourcesAsync( string? resourceGroup = null, string? testResourceName = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetLoadTestRunAsync( @@ -32,7 +29,6 @@ Task GetLoadTestRunAsync( string testRunId, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateOrUpdateLoadTestRunAsync( @@ -46,7 +42,6 @@ Task CreateOrUpdateLoadTestRunAsync( string? displayName = null, string? description = null, bool? debugMode = false, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetLoadTestRunsFromTestIdAsync( @@ -55,7 +50,6 @@ Task> GetLoadTestRunsFromTestIdAsync( string testId, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetTestAsync( @@ -64,7 +58,6 @@ Task GetTestAsync( string testId, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateTestAsync( @@ -79,6 +72,5 @@ Task CreateTestAsync( int? rampUpTime = 1, string? endpointUrl = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/src/Services/LoadTestingService.cs b/tools/Azure.Mcp.Tools.LoadTesting/src/Services/LoadTestingService.cs index 298cbd3bb6..090b457938 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/src/Services/LoadTestingService.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/src/Services/LoadTestingService.cs @@ -14,7 +14,6 @@ using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.LoadTesting.Services; @@ -26,13 +25,12 @@ public async Task> GetLoadTestResourcesAsync( string? resourceGroup = null, string? testResourceName = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - var client = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var client = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); if (!string.IsNullOrEmpty(testResourceName)) { var resourceId = LoadTestingResource.CreateResourceIdentifier(subscriptionId, resourceGroup, testResourceName); @@ -80,13 +78,12 @@ public async Task CreateOrUpdateLoadTestingResourceAsync( string resourceGroup, string? testResourceName = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup)); - var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - var client = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var client = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); var rgResource = client.GetResourceGroupResource(ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroup)); if (testResourceName == null) { @@ -120,13 +117,12 @@ public async Task GetLoadTestRunAsync( string testRunId, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(testResourceName), testResourceName), (nameof(testRunId), testRunId)); - var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, retryPolicy, cancellationToken) + var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, cancellationToken) ?? throw new Exception($"Load Test '{testResourceName}' not found in subscription '{subscriptionId}' and resource group '{resourceGroup}'."); var dataPlaneUri = loadTestResource[0]?.DataPlaneUri; if (string.IsNullOrEmpty(dataPlaneUri)) @@ -135,7 +131,7 @@ public async Task GetLoadTestRunAsync( } var credential = await GetCredential(tenant, cancellationToken); - var loadTestClient = new LoadTestRunClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions(retryPolicy)); + var loadTestClient = new LoadTestRunClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions()); var loadTestRunResponse = await loadTestClient.GetTestRunAsync(testRunId, new() { CancellationToken = cancellationToken }); if (loadTestRunResponse == null || loadTestRunResponse.IsError) @@ -153,12 +149,11 @@ public async Task> GetLoadTestRunsFromTestIdAsync( string testId, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(testResourceName), testResourceName), (nameof(testId), testId)); - var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; - var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, retryPolicy, cancellationToken) + var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; + var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, cancellationToken) ?? throw new Exception($"Load Test '{testResourceName}' not found in subscription '{subscriptionId}' and resource group '{resourceGroup}'."); var dataPlaneUri = loadTestResource[0]?.DataPlaneUri; if (string.IsNullOrEmpty(dataPlaneUri)) @@ -167,7 +162,7 @@ public async Task> GetLoadTestRunsFromTestIdAsync( } var credential = await GetCredential(tenant, cancellationToken); - var loadTestClient = new LoadTestRunClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions(retryPolicy)); + var loadTestClient = new LoadTestRunClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions()); var loadTestRunResponse = loadTestClient.GetTestRunsAsync(testId: testId) ?? throw new Exception($"Failed to retrieve Azure Load Test Run."); @@ -200,13 +195,12 @@ public async Task CreateOrUpdateLoadTestRunAsync( string? displayName = null, string? description = null, bool? debugMode = false, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(testResourceName), testResourceName), (nameof(testRunId), testRunId)); - var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, retryPolicy, cancellationToken) + var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, cancellationToken) ?? throw new Exception($"Load Test '{testResourceName}' not found in subscription '{subscriptionId}' and resource group '{resourceGroup}'."); var dataPlaneUri = loadTestResource[0]?.DataPlaneUri; if (string.IsNullOrEmpty(dataPlaneUri)) @@ -215,7 +209,7 @@ public async Task CreateOrUpdateLoadTestRunAsync( } var credential = await GetCredential(tenant, cancellationToken); - var loadTestClient = new LoadTestRunClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions(retryPolicy)); + var loadTestClient = new LoadTestRunClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions()); TestRunRequest requestBody = new() { @@ -247,12 +241,11 @@ public async Task GetTestAsync( string testId, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(testResourceName), testResourceName), (nameof(testId), testId)); - var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; - var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, retryPolicy, cancellationToken) + var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; + var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, cancellationToken) ?? throw new Exception($"Load Test '{testResourceName}' not found in subscription '{subscriptionId}' and resource group '{resourceGroup}'."); var dataPlaneUri = loadTestResource[0]?.DataPlaneUri; if (string.IsNullOrEmpty(dataPlaneUri)) @@ -261,7 +254,7 @@ public async Task GetTestAsync( } var credential = await GetCredential(tenant, cancellationToken); - var loadTestClient = new LoadTestAdministrationClient(new Uri($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions(retryPolicy)); + var loadTestClient = new LoadTestAdministrationClient(new Uri($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions()); var loadTestResponse = await loadTestClient.GetTestAsync(testId, new RequestContext { CancellationToken = cancellationToken }); if (loadTestResponse == null || loadTestResponse.IsError) @@ -284,7 +277,6 @@ public async Task CreateTestAsync( int? rampUpTime = 1, string? endpointUrl = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(testResourceName), testResourceName), (nameof(testId), testId)); @@ -294,9 +286,9 @@ public async Task CreateTestAsync( EndpointValidator.ValidatePublicTargetUrl(endpointUrl, logger); } - var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + var subscriptionId = (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, retryPolicy, cancellationToken) + var loadTestResource = await GetLoadTestResourcesAsync(subscriptionId, resourceGroup, testResourceName, tenant, cancellationToken) ?? throw new Exception($"Load Test '{testResourceName}' not found in subscription '{subscriptionId}' and resource group '{resourceGroup}'."); var dataPlaneUri = loadTestResource[0]?.DataPlaneUri; if (string.IsNullOrEmpty(dataPlaneUri)) @@ -305,7 +297,7 @@ public async Task CreateTestAsync( } var credential = await GetCredential(tenant, cancellationToken); - var loadTestClient = new LoadTestAdministrationClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions(retryPolicy)); + var loadTestClient = new LoadTestAdministrationClient(new($"https://{dataPlaneUri}"), credential, CreateLoadTestingClientOptions()); OptionalLoadTestConfig optionalLoadTestConfig = new() { Duration = (duration ?? 20) * 60, // Convert minutes to seconds @@ -335,9 +327,9 @@ public async Task CreateTestAsync( return JsonSerializer.Deserialize(loadTest, LoadTestJsonContext.Default.Test) ?? new(); } - private LoadTestingClientOptions CreateLoadTestingClientOptions(RetryPolicyOptions? retryPolicy) + private LoadTestingClientOptions CreateLoadTestingClientOptions() { - var clientOptions = ConfigureRetryPolicy(AddDefaultPolicies(new LoadTestingClientOptions()), retryPolicy); + var clientOptions = ConfigureRetryPolicy(AddDefaultPolicies(new LoadTestingClientOptions()), null); clientOptions.Transport = new HttpClientTransport(AzureService.GetClient()); return clientOptions; } diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestCreateCommandTests.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestCreateCommandTests.cs index 073155000c..7905c6b257 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.LoadTesting.Commands.LoadTest; using Azure.Mcp.Tools.LoadTesting.Models.LoadTest; using Azure.Mcp.Tools.LoadTesting.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,9 +38,7 @@ public async Task ExecuteAsync_CreateLoadTest_WhenExists() Arg.Is((int?)50), Arg.Is((int?)1), Arg.Is("https://example.com/api/test"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expected); // Act @@ -80,9 +77,7 @@ public async Task ExecuteAsync_HandlesBadRequestErrors() Arg.Is((int?)50), Arg.Is((int?)1), Arg.Is((string?)null), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(new Test()); var response = await ExecuteCommandAsync( @@ -107,9 +102,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is(50), Arg.Is(1), Arg.Is("https://example.com/api/test"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestGetCommandTests.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestGetCommandTests.cs index c024cf47b7..f31b33f5d1 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.LoadTesting.Commands.LoadTest; using Azure.Mcp.Tools.LoadTesting.Models.LoadTest; using Azure.Mcp.Tools.LoadTesting.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,9 +32,7 @@ public async Task ExecuteAsync_ReturnsLoadTest_WhenExists() Arg.Is("testResourceName"), Arg.Is("testId1"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -60,9 +57,7 @@ public async Task ExecuteAsync_HandlesBadRequestErrors() Arg.Is("testResourceName"), Arg.Is("testId1"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(new Test()); var response = await ExecuteCommandAsync( @@ -82,9 +77,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is("testResourceName"), Arg.Is("testId1"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourceCreateCommandTests.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourceCreateCommandTests.cs index ff0a5b7b36..4467651021 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourceCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourceCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.LoadTesting.Commands.LoadTestResource; using Azure.Mcp.Tools.LoadTesting.Models.LoadTestResource; using Azure.Mcp.Tools.LoadTesting.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,9 +31,7 @@ public async Task ExecuteAsync_CreateLoadTests() Arg.Is("sub123"), Arg.Is("resourceGroup123"), Arg.Is("testResourceName"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expectedLoadTests); var response = await ExecuteCommandAsync( @@ -58,9 +55,7 @@ public async Task ExecuteAsync_CreateLoadTests_FromDefaultResource() Arg.Is("sub123"), Arg.Is("resourceGroup123"), Arg.Is((string?)null), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expectedLoadTests); var response = await ExecuteCommandAsync( @@ -81,9 +76,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is("sub123"), Arg.Is("resourceGroup123"), Arg.Is("loadTestName"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourcesListCommandTests.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourcesListCommandTests.cs index a3ddf6afb8..347e83c75a 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourcesListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestResourcesListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.LoadTesting.Commands.LoadTestResource; using Azure.Mcp.Tools.LoadTesting.Models.LoadTestResource; using Azure.Mcp.Tools.LoadTesting.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,9 +31,7 @@ public async Task ExecuteAsync_ReturnsLoadTests_FromResourceGroup() Arg.Is("sub123"), Arg.Is("resourceGroup123"), Arg.Is((string?)null), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expectedLoadTests); var response = await ExecuteCommandAsync( @@ -59,9 +56,7 @@ public async Task ExecuteAsync_ReturnsLoadTests_FromTestResource() Arg.Is("sub123"), Arg.Is("resourceGroup123"), Arg.Is("testResourceName"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expectedLoadTests); var response = await ExecuteCommandAsync( @@ -83,9 +78,7 @@ public async Task ExecuteAsync_ReturnsLoadTests_WhenLoadTestsNotExist() Arg.Is("sub123"), Arg.Is("resourceGroup123"), Arg.Is("loadTestName"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns([]); var response = await ExecuteCommandAsync( @@ -105,9 +98,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is("sub123"), Arg.Is("resourceGroup123"), Arg.Is("loadTestName"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunCreateOrUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunCreateOrUpdateCommandTests.cs index b3b3047316..2e4e0f980a 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunCreateOrUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunCreateOrUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.LoadTesting.Commands.LoadTestRun; using Azure.Mcp.Tools.LoadTesting.Models.LoadTestRun; using Azure.Mcp.Tools.LoadTesting.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -38,9 +37,7 @@ public async Task ExecuteAsync_UpdateLoadTestRun_TestNotExisting() Arg.Is("tenant123"), Arg.Is("displayName"), Arg.Is((string?)null), - Arg.Is(false), - Arg.Any(), - Arg.Any()) + Arg.Is(false), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -69,9 +66,7 @@ public async Task ExecuteAsync_HandlesBadRequestErrors() Arg.Is("tenant123"), Arg.Is((string?)null), Arg.Is((string?)null), - Arg.Is(false), - Arg.Any(), - Arg.Any()) + Arg.Is(false), Arg.Any()) .Returns(new TestRun()); var response = await ExecuteCommandAsync( @@ -98,9 +93,7 @@ public async Task ExecuteAsync_CreatesLoadTestRun() Arg.Is("tenant123"), Arg.Is("displayName"), Arg.Is((string?)null), - Arg.Is(false), - Arg.Any(), - Arg.Any()) + Arg.Is(false), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -133,9 +126,7 @@ public async Task ExecuteAsync_RerunLoadTestRun() Arg.Is("tenant123"), Arg.Is((string?)null), Arg.Is((string?)null), - Arg.Is(false), - Arg.Any(), - Arg.Any()) + Arg.Is(false), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -167,9 +158,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is("tenant123"), Arg.Is((string?)null), Arg.Is((string?)null), - Arg.Is(false), - Arg.Any(), - Arg.Any()) + Arg.Is(false), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunGetCommandTests.cs b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunGetCommandTests.cs index e0a56feef3..99d7ea0102 100644 --- a/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.Tests/TestRunGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.LoadTesting.Commands.LoadTestRun; using Azure.Mcp.Tools.LoadTesting.Models.LoadTestRun; using Azure.Mcp.Tools.LoadTesting.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,9 +32,7 @@ public async Task ExecuteAsync_ReturnsLoadTestRun_WhenExists() Arg.Is("testResourceName"), Arg.Is("run1"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -61,9 +58,7 @@ public async Task ExecuteAsync_HandlesBadRequestErrors() Arg.Is("testResourceName"), Arg.Is("run1"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(new TestRun()); var response = await ExecuteCommandAsync("--tenant", "tenant123"); @@ -79,9 +74,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is("testResourceName"), Arg.Is("run1"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync( @@ -109,9 +102,7 @@ public async Task ExecuteAsync_ReturnsLoadTestRuns_WhenTestIdProvided() Arg.Is("testResourceName"), Arg.Is("testId"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -137,9 +128,7 @@ public async Task ExecuteAsync_HandlesListServiceErrors() Arg.Is("testResourceName"), Arg.Is("testId"), Arg.Is("resourceGroup123"), - Arg.Is("tenant123"), - Arg.Any(), - Arg.Any()) + Arg.Is("tenant123"), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCancelCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCancelCommand.cs index a9035d127e..921204423f 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCancelCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCancelCommand.cs @@ -45,7 +45,6 @@ await _service.CancelAutoexportJobAsync( options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(options.JobName!, "Cancelled"), ManagedLustreJsonContext.Default.AutoexportJobCancelResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCreateCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCreateCommand.cs index b481e8b2a8..60a35e5acc 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobCreateCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.AutoexportPrefix, options.AdminStatus, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(job), ManagedLustreJsonContext.Default.AutoexportJobCreateResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobDeleteCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobDeleteCommand.cs index 19248eea7f..7d592cf062 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobDeleteCommand.cs @@ -45,7 +45,6 @@ await _service.DeleteAutoexportJobAsync( options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(options.JobName!, "Deleted"), ManagedLustreJsonContext.Default.AutoexportJobDeleteResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobGetCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobGetCommand.cs index d6e83201a6..87c22fd180 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoexportJob/AutoexportJobGetCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result, null), ManagedLustreJsonContext.Default.AutoexportJobGetResult); @@ -63,7 +62,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.FilesystemName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, results ?? []), ManagedLustreJsonContext.Default.AutoexportJobGetResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCancelCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCancelCommand.cs index 41cce74575..8bdc07889e 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCancelCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCancelCommand.cs @@ -45,7 +45,6 @@ await _service.CancelAutoimportJobAsync( options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(options.JobName!, "Cancelled"), ManagedLustreJsonContext.Default.AutoimportJobCancelResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCreateCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCreateCommand.cs index 25fae08f22..f6b9baff8b 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobCreateCommand.cs @@ -66,7 +66,6 @@ public override async Task ExecuteAsync(CommandContext context, options.EnableDeletions, options.MaximumErrors, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(job), ManagedLustreJsonContext.Default.AutoimportJobCreateResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobDeleteCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobDeleteCommand.cs index 3c2206b9c9..923469cd21 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobDeleteCommand.cs @@ -45,7 +45,6 @@ await _service.DeleteAutoimportJobAsync( options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(options.JobName!, "Deleted"), ManagedLustreJsonContext.Default.AutoimportJobDeleteResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobGetCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobGetCommand.cs index 9130f34a67..52196b16f4 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/AutoimportJob/AutoimportJobGetCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result, null), ManagedLustreJsonContext.Default.AutoimportJobGetResult); @@ -64,7 +63,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.FilesystemName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, results ?? []), ManagedLustreJsonContext.Default.AutoimportJobGetResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemCreateCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemCreateCommand.cs index a8f86243fe..fb57181123 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemCreateCommand.cs @@ -79,7 +79,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SourceVault, options.UserAssignedIdentityId, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(fs), ManagedLustreJsonContext.Default.FileSystemCreateResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemListCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemListCommand.cs index ccf2020f5b..ac25eec7bd 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemListCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemListCommand.cs @@ -36,7 +36,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(fileSystems ?? []), ManagedLustreJsonContext.Default.FileSystemListResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemUpdateCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemUpdateCommand.cs index 074272d203..01563e6c46 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/FileSystemUpdateCommand.cs @@ -63,7 +63,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SquashUid, options.SquashGid, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(fs), ManagedLustreJsonContext.Default.FileSystemUpdateResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCancelCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCancelCommand.cs index e49c96fa14..cc8ba0bc2c 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCancelCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCancelCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FilesystemName, options.JobName!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(options.JobName, cancelledJob.Properties?.AdminStatus ?? "Unknown"), ManagedLustreJsonContext.Default.ImportJobCancelResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCreateCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCreateCommand.cs index c1e58c9f3a..e9fb7a8bf5 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobCreateCommand.cs @@ -61,7 +61,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ImportPrefixes, options.MaximumErrors, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(job), ManagedLustreJsonContext.Default.ImportJobCreateResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobDeleteCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobDeleteCommand.cs index e972843467..ddc210556f 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobDeleteCommand.cs @@ -44,7 +44,6 @@ await _service.DeleteImportJobAsync( options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(options.JobName), ManagedLustreJsonContext.Default.ImportJobDeleteResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobGetCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobGetCommand.cs index bedc510678..a565e71319 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/ImportJob/ImportJobGetCommand.cs @@ -49,7 +49,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FilesystemName, options.JobName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result, null), ManagedLustreJsonContext.Default.ImportJobGetResult); @@ -62,7 +61,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.FilesystemName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, results), ManagedLustreJsonContext.Default.ImportJobGetResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs index 4e5980c500..c43ee9736d 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs @@ -35,7 +35,7 @@ public override async Task ExecuteAsync(CommandContext context, { try { - var skus = await _service.SkuGetInfoAsync(options.Subscription!, options.Tenant, options.Location, options.RetryPolicy, cancellationToken); + var skus = await _service.SkuGetInfoAsync(options.Subscription!, options.Tenant, options.Location, cancellationToken); context.Response.Results = ResponseResult.Create(new(skus ?? []), ManagedLustreJsonContext.Default.SkuGetResult); } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeAskCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeAskCommand.cs index f0d200d70c..f186f60359 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeAskCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeAskCommand.cs @@ -54,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Sku, options.Size, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(result), ManagedLustreJsonContext.Default.FileSystemSubnetSizeResult); } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeValidateCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeValidateCommand.cs index 74f7bd9186..3aae65f527 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeValidateCommand.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/SubnetSize/SubnetSizeValidateCommand.cs @@ -56,7 +56,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SubnetId, options.Location, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(subnetIsValid), ManagedLustreJsonContext.Default.FileSystemCheckSubnetResult); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCancelOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCancelOptions.cs index 07c3445406..dd6c8b0f2f 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCancelOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCancelOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class AutoexportJobCancelOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCreateOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCreateOptions.cs index 05a6c80d57..a0f2db3db6 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCreateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -29,6 +28,4 @@ public sealed class AutoexportJobCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobDeleteOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobDeleteOptions.cs index 41c21a6931..8ad9cd646c 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobDeleteOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class AutoexportJobDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobGetOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobGetOptions.cs index 138b2cc650..0ef605647d 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobGetOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobGetOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class AutoexportJobGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCancelOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCancelOptions.cs index f374652031..ef36881cf3 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCancelOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCancelOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class AutoimportJobCancelOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCreateOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCreateOptions.cs index c4f91fd8b6..d1ce24fe3d 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCreateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -38,6 +37,4 @@ public sealed class AutoimportJobCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobDeleteOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobDeleteOptions.cs index 3464cc7d04..70ba43e238 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobDeleteOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class AutoimportJobDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobGetOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobGetOptions.cs index ce1a58d3ad..c26cb18472 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobGetOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobGetOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public class AutoimportJobGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemCreateOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemCreateOptions.cs index 13db63bec1..ee74116123 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemCreateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -81,6 +80,4 @@ public sealed class FileSystemCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemListOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemListOptions.cs index 04009884dc..842e2606f0 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemListOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemListOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -17,6 +16,4 @@ public sealed class FileSystemListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemUpdateOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemUpdateOptions.cs index 3ca23df7be..973805a03e 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemUpdateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -38,6 +37,4 @@ public sealed class FileSystemUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCancelOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCancelOptions.cs index 1d1f5f735a..82537346fe 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCancelOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCancelOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class ImportJobCancelOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCreateOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCreateOptions.cs index a234ae49fe..061d87a860 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCreateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -47,6 +46,4 @@ public sealed class ImportJobCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobDeleteOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobDeleteOptions.cs index 04870fb942..59eb61a481 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobDeleteOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class ImportJobDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobGetOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobGetOptions.cs index b93e7ec921..0d6f89258a 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobGetOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobGetOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -23,6 +22,4 @@ public sealed class ImportJobGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/Sku/SkuGetOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/Sku/SkuGetOptions.cs index 3ffb7f9dea..d0621807b1 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/Sku/SkuGetOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/Sku/SkuGetOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -17,6 +16,4 @@ public sealed class SkuGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeAskOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeAskOptions.cs index 2ce5d721b0..4fe2346c54 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeAskOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeAskOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -20,6 +19,4 @@ public sealed class SubnetSizeAskOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeValidateOptions.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeValidateOptions.cs index 159ada5496..594d96e020 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeValidateOptions.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeValidateOptions.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. using Azure.Mcp.Core.Options; using Microsoft.Mcp.Core.Options; @@ -26,6 +25,4 @@ public sealed class SubnetSizeValidateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/IManagedLustreService.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/IManagedLustreService.cs index 507fc9b9aa..38716a24d5 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/IManagedLustreService.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/IManagedLustreService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.ManagedLustre.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ManagedLustre.Services; @@ -12,13 +11,11 @@ Task> ListFileSystemsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetRequiredAmlFSSubnetsSize(string subscription, string sku, int size, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CheckAmlFSSubnetAsync( @@ -28,14 +25,12 @@ Task CheckAmlFSSubnetAsync( string subnetId, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> SkuGetInfoAsync( string subscription, string? tenant = null, string? location = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateFileSystemAsync( @@ -65,7 +60,6 @@ Task CreateFileSystemAsync( string? sourceVaultId = null, string? userAssignedIdentityId = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task UpdateFileSystemAsync( @@ -81,7 +75,6 @@ Task UpdateFileSystemAsync( long? squashUid = null, long? squashGid = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateAutoexportJobAsync( @@ -92,7 +85,6 @@ Task CreateAutoexportJobAsync( string? autoexportPrefix = null, string? adminStatus = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CancelAutoexportJobAsync( @@ -101,7 +93,6 @@ Task CancelAutoexportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetAutoexportJobAsync( @@ -110,7 +101,6 @@ Task GetAutoexportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListAutoexportJobsAsync( @@ -118,7 +108,6 @@ Task GetAutoexportJobAsync( string resourceGroup, string filesystemName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteAutoexportJobAsync( @@ -127,7 +116,6 @@ Task DeleteAutoexportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateAutoimportJobAsync( @@ -141,7 +129,6 @@ Task CreateAutoimportJobAsync( bool? enableDeletions = null, long? maximumErrors = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CancelAutoimportJobAsync( @@ -150,7 +137,6 @@ Task CancelAutoimportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetAutoimportJobAsync( @@ -159,7 +145,6 @@ Task GetAutoimportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListAutoimportJobsAsync( @@ -167,7 +152,6 @@ Task> ListAutoimportJobsAsync( string resourceGroup, string filesystemName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteAutoimportJobAsync( @@ -176,7 +160,6 @@ Task DeleteAutoimportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); // One-time blob import jobs @@ -189,7 +172,6 @@ Task CreateImportJobAsync( string[]? importPrefixes = null, long? maximumErrors = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CancelImportJobAsync( @@ -198,7 +180,6 @@ Task CancelImportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetImportJobAsync( @@ -207,7 +188,6 @@ Task GetImportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListImportJobsAsync( @@ -215,7 +195,6 @@ Task> ListImportJobsAsync( string resourceGroup, string filesystemName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task DeleteImportJobAsync( @@ -224,7 +203,6 @@ Task DeleteImportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/ManagedLustreService.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/ManagedLustreService.cs index 9de5086fb8..dff3c84530 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/ManagedLustreService.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Services/ManagedLustreService.cs @@ -8,7 +8,6 @@ using Azure.ResourceManager.StorageCache; using Azure.ResourceManager.StorageCache.Models; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ManagedLustre.Services; @@ -21,7 +20,6 @@ public async Task> ListFileSystemsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -29,7 +27,7 @@ public async Task> ListFileSystemsAsync( var results = new List(); if (!string.IsNullOrWhiteSpace(resourceGroup)) { - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); foreach (var fs in rg.GetAmlFileSystems()) { results.Add(Map(fs)); @@ -38,7 +36,7 @@ public async Task> ListFileSystemsAsync( } else { - var sub = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); + var sub = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); await foreach (var fs in sub.GetAmlFileSystemsAsync(cancellationToken)) { results.Add(Map(fs)); @@ -302,10 +300,9 @@ public async Task GetRequiredAmlFSSubnetsSize( string sku, int size, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); + var sub = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); var fileSystemSizeContent = new RequiredAmlFileSystemSubnetsSizeContent { SkuName = sku, @@ -321,12 +318,11 @@ public async Task> SkuGetInfoAsync( string subscription, string? tenant = null, string? location = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var sub = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); + var sub = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); var results = new List(); @@ -379,7 +375,6 @@ public async Task CreateFileSystemAsync( string? sourceVaultId = null, string? userAssignedIdentityId = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), @@ -389,9 +384,9 @@ public async Task CreateFileSystemAsync( (nameof(sku), sku), (nameof(subnetId), subnetId)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); - var sub = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) + var sub = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); var data = new AmlFileSystemData(new(location)) @@ -469,12 +464,11 @@ public async Task UpdateFileSystemAsync( long? squashUid = null, long? squashGid = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(name), name)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); var fs = await rg.GetAmlFileSystemAsync(name, cancellationToken); @@ -511,12 +505,11 @@ public async Task CheckAmlFSSubnetAsync( string subnetId, string location, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(sku), sku), (nameof(subnetId), subnetId), (nameof(location), location)); - var sub = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); + var sub = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new Exception($"Subscription '{subscription}' not found"); var content = new AmlFileSystemSubnetContent { FilesystemSubnet = subnetId, @@ -551,7 +544,6 @@ public async Task CreateAutoexportJobAsync( string? autoexportPrefix = null, string? adminStatus = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -559,7 +551,7 @@ public async Task CreateAutoexportJobAsync( (nameof(resourceGroup), resourceGroup), (nameof(filesystemName), filesystemName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); var fs = await rg.GetAmlFileSystemAsync(filesystemName, cancellationToken: cancellationToken); @@ -613,7 +605,6 @@ public async Task CancelAutoexportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -622,7 +613,7 @@ public async Task CancelAutoexportJobAsync( (nameof(filesystemName), filesystemName), (nameof(jobName), jobName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); try @@ -659,7 +650,6 @@ public async Task GetAutoexportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -671,7 +661,7 @@ public async Task GetAutoexportJobAsync( try { // Get the resource group - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken); + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken); // Get the filesystem var fs = await rg.GetAmlFileSystems().GetAsync(filesystemName, cancellationToken: cancellationToken); @@ -693,7 +683,6 @@ public async Task> ListAutoexportJobsAsync( string resourceGroup, string filesystemName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -704,7 +693,7 @@ public async Task> ListAutoexportJobsAsync( try { // Get the resource group - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken); + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken); // Get the filesystem var fs = await rg.GetAmlFileSystems().GetAsync(filesystemName, cancellationToken: cancellationToken); @@ -731,7 +720,6 @@ public async Task DeleteAutoexportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -740,7 +728,7 @@ public async Task DeleteAutoexportJobAsync( (nameof(filesystemName), filesystemName), (nameof(jobName), jobName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); try @@ -775,7 +763,6 @@ public async Task CreateAutoimportJobAsync( bool? enableDeletions = null, long? maximumErrors = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -783,7 +770,7 @@ public async Task CreateAutoimportJobAsync( (nameof(resourceGroup), resourceGroup), (nameof(filesystemName), filesystemName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); var fs = await rg.GetAmlFileSystemAsync(filesystemName, cancellationToken: cancellationToken); @@ -860,7 +847,6 @@ public async Task CancelAutoimportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -869,7 +855,7 @@ public async Task CancelAutoimportJobAsync( (nameof(filesystemName), filesystemName), (nameof(jobName), jobName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); try @@ -908,7 +894,6 @@ public async Task GetAutoimportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -920,7 +905,7 @@ public async Task GetAutoimportJobAsync( try { // Get the resource group - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken); + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken); // Get the filesystem var fs = await rg.GetAmlFileSystems().GetAsync(filesystemName, cancellationToken: cancellationToken); @@ -942,7 +927,6 @@ public async Task> ListAutoimportJobsAsync( string resourceGroup, string filesystemName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -953,7 +937,7 @@ public async Task> ListAutoimportJobsAsync( try { // Get the resource group - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken); + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken); // Get the filesystem var fs = await rg.GetAmlFileSystems().GetAsync(filesystemName, cancellationToken: cancellationToken); @@ -980,7 +964,6 @@ public async Task DeleteAutoimportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -989,7 +972,7 @@ public async Task DeleteAutoimportJobAsync( (nameof(filesystemName), filesystemName), (nameof(jobName), jobName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); try @@ -1022,7 +1005,6 @@ public async Task CreateImportJobAsync( string[]? importPrefixes = null, long? maximumErrors = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -1030,7 +1012,7 @@ public async Task CreateImportJobAsync( (nameof(resourceGroup), resourceGroup), (nameof(filesystemName), filesystemName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); var fs = await rg.GetAmlFileSystemAsync(filesystemName, cancellationToken: cancellationToken); @@ -1088,7 +1070,6 @@ public async Task DeleteImportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -1097,7 +1078,7 @@ public async Task DeleteImportJobAsync( (nameof(filesystemName), filesystemName), (nameof(jobName), jobName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); try @@ -1127,7 +1108,6 @@ public async Task> ListImportJobsAsync( string resourceGroup, string filesystemName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -1136,7 +1116,7 @@ public async Task> ListImportJobsAsync( (nameof(filesystemName), filesystemName)); // Get the resource group - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); // Get the filesystem @@ -1162,7 +1142,6 @@ public async Task GetImportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -1172,7 +1151,7 @@ public async Task GetImportJobAsync( (nameof(jobName), jobName)); // Get the resource group - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); // Get the filesystem @@ -1194,7 +1173,6 @@ public async Task CancelImportJobAsync( string filesystemName, string jobName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -1203,7 +1181,7 @@ public async Task CancelImportJobAsync( (nameof(filesystemName), filesystemName), (nameof(jobName), jobName)); - var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found"); try diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCancelCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCancelCommandTests.cs index 3d1bdae27c..5603cef93e 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCancelCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCancelCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoexportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,9 +34,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); // Act @@ -56,9 +53,7 @@ await Service.Received(1).CancelAutoexportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -89,9 +84,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Autoexport job not found")); // Act @@ -115,9 +108,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); // Act diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCreateCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCreateCommandTests.cs index a358f4464f..0e74407c1d 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobCreateCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoexportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -36,9 +35,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("autoexport-20250107120000"); // Act @@ -58,9 +55,7 @@ await Service.Received(1).CreateAutoexportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -92,9 +87,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "not found")); // Act @@ -119,9 +112,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("boom")); // Act @@ -146,9 +137,7 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("autoexport-20250107120000"); // Act @@ -166,9 +155,7 @@ await Service.Received(1).CreateAutoexportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Fact] @@ -183,9 +170,7 @@ public async Task ExecuteAsync_Succeeds_WithJobName() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(jobName); // Act @@ -204,9 +189,7 @@ await Service.Received(1).CreateAutoexportJobAsync( Arg.Is(jobName), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Fact] @@ -221,9 +204,7 @@ public async Task ExecuteAsync_Succeeds_WithAutoexportPrefix() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("blob_autoexport"); // Act @@ -242,9 +223,7 @@ await Service.Received(1).CreateAutoexportJobAsync( Arg.Any(), Arg.Is(prefix), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -260,9 +239,7 @@ public async Task ExecuteAsync_Succeeds_WithAdminStatus(string adminStatus) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("blob_autoexport"); // Act @@ -281,9 +258,7 @@ await Service.Received(1).CreateAutoexportJobAsync( Arg.Any(), Arg.Any(), Arg.Is(adminStatus), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Fact] @@ -301,9 +276,7 @@ public async Task ExecuteAsync_Succeeds_WithAllOptionalParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(jobName); // Act @@ -324,8 +297,6 @@ await Service.Received(1).CreateAutoexportJobAsync( Arg.Is(jobName), Arg.Is(prefix), Arg.Is(adminStatus), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobDeleteCommandTests.cs index d6ab26923a..3f05316430 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobDeleteCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoexportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,9 +31,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() // Arrange Service.DeleteAutoexportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); // Act @@ -53,9 +50,7 @@ await Service.Received(1).DeleteAutoexportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -86,9 +81,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Autoexport job not found")); // Act @@ -112,9 +105,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); // Act diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobGetCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobGetCommandTests.cs index e52440498c..7b9c50f289 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoexportJob/AutoexportJobGetCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoexportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -42,9 +41,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() Service.GetAutoexportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJob); // Act @@ -63,9 +60,7 @@ await Service.Received(1).GetAutoexportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -96,9 +91,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Autoexport job not found")); // Act @@ -122,9 +115,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); // Act @@ -151,9 +142,7 @@ public async Task ExecuteAsync_ListsAllJobs_WhenJobNameNotProvided() Service.ListAutoexportJobsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJobs); // Act @@ -170,13 +159,11 @@ await Service.Received(1).ListAutoexportJobsAsync( Arg.Is(_subscription), Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); // Should NOT have called GetAutoexportJobAsync await Service.DidNotReceive().GetAutoexportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCancelCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCancelCommandTests.cs index 06d45498f3..b441f25286 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCancelCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCancelCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoimportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,9 +34,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); // Act @@ -56,9 +53,7 @@ await Service.Received(1).CancelAutoimportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -89,9 +84,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Autoimport job not found")); // Act @@ -115,9 +108,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); // Act @@ -141,9 +132,7 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); // Act @@ -160,8 +149,6 @@ await Service.Received(1).CancelAutoimportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCreateCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCreateCommandTests.cs index 971ecfcf01..6caf11382c 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobCreateCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoimportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,9 +38,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("autoimport-20250107120000"); // Act @@ -64,9 +61,7 @@ await Service.Received(1).CreateAutoimportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -87,9 +82,7 @@ public async Task ExecuteAsync_Succeeds_WithDifferentConflictResolutionModes(str Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("blob_autoimport"); // Act @@ -111,9 +104,7 @@ await Service.Received(1).CreateAutoimportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -132,9 +123,7 @@ public async Task ExecuteAsync_Succeeds_WithDifferentAdminStatus(string adminSta Arg.Is(adminStatus), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("blob_autoimport"); // Act @@ -156,9 +145,7 @@ await Service.Received(1).CreateAutoimportJobAsync( adminStatus, Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -193,9 +180,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "not found")); // Act @@ -223,9 +208,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("boom")); // Act @@ -253,9 +236,7 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns("autoimport-20250107120000"); // Act @@ -276,9 +257,7 @@ await Service.Received(1).CreateAutoimportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobDeleteCommandTests.cs index 0acda98d38..62f4674927 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobDeleteCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoimportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,9 +34,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); // Act @@ -56,9 +53,7 @@ await Service.Received(1).DeleteAutoimportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -89,9 +84,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Autoimport job not found")); // Act @@ -115,9 +108,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); // Act @@ -141,9 +132,7 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); // Act @@ -160,8 +149,6 @@ await Service.Received(1).DeleteAutoimportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobGetCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobGetCommandTests.cs index 96a3bbd9ed..95acce2f99 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/AutoimportJob/AutoimportJobGetCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.AutoimportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,9 +44,7 @@ public async Task ExecuteAsync_Succeeds_WithRequiredParameters() Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJob); // Act @@ -66,9 +63,7 @@ await Service.Received(1).GetAutoimportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Theory] @@ -99,9 +94,7 @@ public async Task ExecuteAsync_ServiceThrows_RequestFailed_UsesStatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "Autoimport job not found")); // Act @@ -125,9 +118,7 @@ public async Task ExecuteAsync_ServiceThrows_GenericException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); // Act @@ -161,9 +152,7 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJob); // Act @@ -180,9 +169,7 @@ await Service.Received(1).GetAutoimportJobAsync( Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), Arg.Is(_jobName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); } [Fact] @@ -197,9 +184,7 @@ public async Task ExecuteAsync_ListsAllJobs_WhenJobNameNotProvided() Service.ListAutoimportJobsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expectedJobs); // Act @@ -216,13 +201,11 @@ await Service.Received(1).ListAutoimportJobsAsync( Arg.Is(_subscription), Arg.Is(_resourceGroup), Arg.Is(_fileSystemName), - Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any(), Arg.Any()); // Should NOT have called GetAutoimportJobAsync await Service.DidNotReceive().GetAutoimportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemCreateCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemCreateCommandTests.cs index 9a4f84aebd..ab20f1f62f 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem; using Azure.Mcp.Tools.ManagedLustre.Models; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -73,9 +72,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); } @@ -141,9 +138,7 @@ public async Task ExecuteAsync_RootSquashNotNone_WithParams_CallsService() null, null, null, - null, - Arg.Any(), - Arg.Any()) + null, Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -185,9 +180,7 @@ await Service.Received(1).CreateFileSystemAsync( null, null, null, - null, - Arg.Any(), - Arg.Any()); + null, Arg.Any()); } [Fact] @@ -259,9 +252,7 @@ public async Task ExecuteAsync_EncryptionEnabledWithKeyAndVault_CallsService() "https://kv.vault.azure.net/keys/k/123", "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.KeyVault/vaults/kv", "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - null, - Arg.Any(), - Arg.Any()) + null, Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -303,9 +294,7 @@ await Service.Received(1).CreateFileSystemAsync( "https://kv.vault.azure.net/keys/k/123", "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.KeyVault/vaults/kv", "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - null, - Arg.Any(), - Arg.Any()); + null, Arg.Any()); } [Fact] @@ -333,9 +322,7 @@ public async Task ExecuteAsync_ServiceThrowsGeneralException_Returns500() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("error")); var response = await ExecuteCommandAsync( @@ -379,9 +366,7 @@ public async Task ExecuteAsync_HandlesRequestFailedException_Conflict() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(409, "conflict")); var response = await ExecuteCommandAsync( @@ -425,9 +410,7 @@ public async Task ExecuteAsync_HsmOneContainerMissing_ReturnsErrorFromService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Both hsm-container and hsm-log-container must be provided")); var response = await ExecuteCommandAsync( diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemListCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemListCommandTests.cs index 0b935d004d..55dbe22a1e 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem; using Azure.Mcp.Tools.ManagedLustre.Models; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -82,9 +81,7 @@ public async Task ExecuteAsync_ReturnsFileSystems() Service.ListFileSystemsAsync( Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -136,9 +133,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.ListFileSystemsAsync( Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); } @@ -168,9 +163,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoItems() Service.ListFileSystemsAsync( Arg.Is(_knownSubscriptionId), Arg.Is(x => x == null), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -189,9 +182,7 @@ public async Task ExecuteAsync_HandlesRequestFailedException_NotFound() Service.ListFileSystemsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "not found")); var response = await ExecuteCommandAsync("--subscription", _knownSubscriptionId); @@ -208,9 +199,7 @@ public async Task ExecuteAsync_HandlesRequestFailedException_Forbidden() Service.ListFileSystemsAsync( Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Forbidden, "forbidden")); var response = await ExecuteCommandAsync("--subscription", _knownSubscriptionId); diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemUpdateCommandTests.cs index fb4df75156..f22aebfd13 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/FileSystemUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem; using Azure.Mcp.Tools.ManagedLustre.Models; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -55,9 +54,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(CreateLustre()); } @@ -95,9 +92,7 @@ public async Task ExecuteAsync_MaintenanceUpdate_CallsServiceAndReturnsResult() null, null, null, - null, - Arg.Any(), - Arg.Any()) + null, Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -118,9 +113,7 @@ await Service.Received(1).UpdateFileSystemAsync( null, null, null, - null, - Arg.Any(), - Arg.Any()); + null, Arg.Any()); var result = ValidateAndDeserializeResponse(response, ManagedLustreJsonContext.Default.FileSystemUpdateResult); Assert.Equal(Name, result.FileSystem.Name); @@ -140,9 +133,7 @@ public async Task ExecuteAsync_RootSquashUpdate_CallsService() "nid1,nid2", 1000, 1000, - null, - Arg.Any(), - Arg.Any()) + null, Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -165,9 +156,7 @@ await Service.Received(1).UpdateFileSystemAsync( "nid1,nid2", 1000, 1000, - null, - Arg.Any(), - Arg.Any()); + null, Arg.Any()); } [Fact] @@ -183,9 +172,7 @@ public async Task ExecuteAsync_ServiceThrowsRequestFailed_ReturnsStatus() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(404, "not found")); var response = await ExecuteCommandAsync( @@ -221,9 +208,7 @@ public async Task ExecuteAsync_RootSquashMode_Validation_Works(string args, bool Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(CreateLustre()); } @@ -254,9 +239,7 @@ public async Task ExecuteAsync_RootSquashMode_WithUidGid_SucceedsAndCallsService "nid1,nid2", 2000, 3000, - null, - Arg.Any(), - Arg.Any()) + null, Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync( @@ -279,9 +262,7 @@ await Service.Received(1).UpdateFileSystemAsync( "nid1,nid2", 2000, 3000, - null, - Arg.Any(), - Arg.Any()); + null, Arg.Any()); } [Fact] diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCancelCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCancelCommandTests.cs index 52497e6760..89b4314cb5 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCancelCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCancelCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.ImportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -41,8 +40,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { var mockJob = new Models.ImportJob { Name = JobName, Properties = new Models.ImportJobProperties { AdminStatus = "Cancel" } }; Service.CancelImportJobAsync( - Arg.Is(Sub), Arg.Is(Rg), Arg.Is(Name), Arg.Is(JobName), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Is(Sub), Arg.Is(Rg), Arg.Is(Name), Arg.Is(JobName), Arg.Any(), Arg.Any()) .Returns(mockJob); } @@ -68,8 +66,7 @@ public async Task ExecuteAsync_ValidInput_CallsServiceAndReturnsSuccess() // Arrange var mockJob = new Models.ImportJob { Name = JobName, Properties = new Models.ImportJobProperties { AdminStatus = "Cancel" } }; Service.CancelImportJobAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(mockJob); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name} --job-name {JobName}"; @@ -87,7 +84,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() // Arrange Service.CancelImportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name} --job-name {JobName}"; @@ -107,7 +104,7 @@ public async Task ExecuteAsync_DeserializationValidation() var mockJob = new Models.ImportJob { Name = JobName, Properties = new Models.ImportJobProperties { AdminStatus = "Cancel" } }; Service.CancelImportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(mockJob); // Act diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCreateCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCreateCommandTests.cs index 49ad54cdfd..66be6d821e 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.ImportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,9 +45,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(JobName); } @@ -85,9 +82,7 @@ public async Task ExecuteAsync_WithOptionalParameters_CallsService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(jobName); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name} --job-name {jobName} --conflict-resolution-mode {conflictMode} --import-prefixes {prefixes} --maximum-errors {maxErrors}"; @@ -100,7 +95,7 @@ public async Task ExecuteAsync_WithOptionalParameters_CallsService() await Service.Received(1).CreateImportJobAsync( Sub, Rg, Name, jobName, conflictMode, Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -109,8 +104,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() // Arrange Service.CreateImportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name}"; @@ -128,8 +122,7 @@ public async Task ExecuteAsync_DeserializationValidation() // Arrange Service.CreateImportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(JobName); // Act diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobDeleteCommandTests.cs index 76e22fc05e..e1cf4cd6ec 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobDeleteCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.ImportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -40,8 +39,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS if (shouldSucceed) { Service.DeleteImportJobAsync( - Arg.Is(Sub), Arg.Is(Rg), Arg.Is(Name), Arg.Is(JobName), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Is(Sub), Arg.Is(Rg), Arg.Is(Name), Arg.Is(JobName), Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); } @@ -66,8 +64,7 @@ public async Task ExecuteAsync_ValidInput_CallsServiceAndReturnsSuccess() { // Arrange Service.DeleteImportJobAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name} --job-name {JobName}"; @@ -85,7 +82,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() // Arrange Service.DeleteImportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name} --job-name {JobName}"; @@ -104,7 +101,7 @@ public async Task ExecuteAsync_DeserializationValidation() // Arrange Service.DeleteImportJobAsync( Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(Task.CompletedTask); // Act diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobGetCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobGetCommandTests.cs index 042ee0ba16..99b9d0357c 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/ImportJob/ImportJobGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.ImportJob; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -42,7 +41,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.GetImportJobAsync( Arg.Is(Sub), Arg.Is(Rg), Arg.Is(Name), Arg.Is(JobName), - Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(importJob); } @@ -80,8 +79,7 @@ public async Task ExecuteAsync_WithJobName_CallsGetSingleJob() }; Service.GetImportJobAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(importJob); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name} --job-name {JobName}"; @@ -92,8 +90,7 @@ public async Task ExecuteAsync_WithJobName_CallsGetSingleJob() // Assert Assert.Equal(HttpStatusCode.OK, response.Status); await Service.DidNotReceive().ListImportJobsAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -107,8 +104,7 @@ public async Task ExecuteAsync_WithoutJobName_CallsListJobs() }; Service.ListImportJobsAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(importJobs); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name}"; @@ -125,8 +121,7 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsErrorResponse() { // Arrange Service.ListImportJobsAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); var args = $"--subscription {Sub} --resource-group {Rg} --filesystem-name {Name}"; @@ -149,8 +144,7 @@ public async Task ExecuteAsync_DeserializationValidation() }; Service.ListImportJobsAsync( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(importJobs); // Act diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/Sku/SkuGetCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/Sku/SkuGetCommandTests.cs index fbfe9cea62..9118a5d280 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/Sku/SkuGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/Sku/SkuGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.Sku; using Azure.Mcp.Tools.ManagedLustre.Models; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -48,9 +47,7 @@ public async Task ExecuteAsync_ReturnsSkus() Service.SkuGetInfoAsync( Arg.Is(_knownSubscriptionId), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(expected); // Act @@ -76,9 +73,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.SkuGetInfoAsync( Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns([new("n", "eastus", false, [])]); } diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeAskCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeAskCommandTests.cs index a88fed9da3..a54b692600 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeAskCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeAskCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.SubnetSize; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,9 +32,7 @@ public async Task ExecuteAsync_ReturnsRequiredIPs() Arg.Is(_knownSubscriptionId), Arg.Is("AMLFS-Durable-Premium-40"), Arg.Is(480), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(21); // Act @@ -61,9 +58,7 @@ public async Task ExecuteAsync_ValidSkus_DoNotThrow(string sku) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()).Returns(10); + Arg.Any(), Arg.Any()).Returns(10); // Act var response = await ExecuteCommandAsync( @@ -88,9 +83,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(10); // Act @@ -123,9 +116,7 @@ public async Task ExecuteAsync_ServiceThrows_IsHandled() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("error")); // Act diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeValidateCommandTests.cs b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeValidateCommandTests.cs index ed42b144a5..b2b78d8c8e 100644 --- a/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeValidateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ManagedLustre/tests/Azure.Mcp.Tools.ManagedLustre.Tests/FileSystem/SubnetSize/SubnetSizeValidateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ManagedLustre.Commands; using Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.SubnetSize; using Azure.Mcp.Tools.ManagedLustre.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,9 +34,7 @@ public async Task ExecuteAsync_Succeeds_ForValidInput() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .Returns(true); // Act @@ -79,9 +76,7 @@ public async Task ExecuteAsync_ServiceThrows_IsHandled() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) + Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("error")); // Act diff --git a/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductGetCommand.cs b/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductGetCommand.cs index fe6a41909b..b408cb2542 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductGetCommand.cs @@ -48,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SkuId, options.IncludeServiceInstructionTemplates, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results diff --git a/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductListCommand.cs b/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductListCommand.cs index fd24e4beab..a59155d6c8 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductListCommand.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/src/Commands/Product/ProductListCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.NextCursor, options.Expand, options.Tenant, - options.RetryPolicy, cancellationToken); // Set results diff --git a/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductGetOptions.cs b/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductGetOptions.cs index a78bfbdbf3..35942951ff 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductGetOptions.cs @@ -35,6 +35,4 @@ public sealed class ProductGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductListOptions.cs b/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductListOptions.cs index 4abeeb95de..a67914a197 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductListOptions.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductListOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Azure.Mcp.Core.Options; @@ -35,6 +35,4 @@ public sealed class ProductListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Marketplace/src/Services/IMarketplaceService.cs b/tools/Azure.Mcp.Tools.Marketplace/src/Services/IMarketplaceService.cs index 65248cee05..815fab8fbb 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/src/Services/IMarketplaceService.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/src/Services/IMarketplaceService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Marketplace.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Marketplace.Services; @@ -18,7 +17,6 @@ Task GetProduct( string? skuId = null, bool? includeServiceInstructionTemplates = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task ListProducts( @@ -31,6 +29,5 @@ Task ListProducts( string? nextCursor = null, string? expand = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs b/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs index 1fce229baa..239eabb135 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs @@ -43,7 +43,6 @@ public async Task GetProduct( string? skuId = null, bool? includeServiceInstructionTemplates = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -54,7 +53,7 @@ public async Task GetProduct( string productUrl = BuildProductUrl(managementEndpoint, subscription, productId, includeStopSoldPlans, language, lookupOfferInTenantLevel, planId, skuId, includeServiceInstructionTemplates); - return await GetMarketplaceSingleProductResponseAsync(productUrl, tenantId, retryPolicy, cancellationToken); + return await GetMarketplaceSingleProductResponseAsync(productUrl, tenantId, cancellationToken); } /// @@ -83,7 +82,6 @@ public async Task ListProducts( string? nextCursor = null, string? expand = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -91,7 +89,7 @@ public async Task ListProducts( var managementEndpoint = AzureService.CloudConfiguration.ArmEnvironment.Endpoint.ToString().TrimEnd('/'); string productsUrl = BuildProductsListUrl(managementEndpoint, subscription, language, search, filter, orderBy, select, nextCursor, expand); - return await GetMarketplaceListProductsResponseAsync(productsUrl, tenantId, retryPolicy, cancellationToken); + return await GetMarketplaceListProductsResponseAsync(productsUrl, tenantId, cancellationToken); } private static string BuildProductsListUrl( @@ -137,10 +135,10 @@ private static string BuildProductsListUrl( return $"{managementEndpoint}/subscriptions/{subscription}/providers/Microsoft.Marketplace/products?{queryString}"; } - private async Task GetMarketplaceListProductsResponseAsync(string url, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + private async Task GetMarketplaceListProductsResponseAsync(string url, string? tenant, CancellationToken cancellationToken) { var productsListResponse = await ExecuteMarketplaceRequestAsync( - url, MarketplaceJsonContext.Default.ProductsListResponse, retryPolicy, tenant, cancellationToken); + url, MarketplaceJsonContext.Default.ProductsListResponse, tenant, cancellationToken); return new() { @@ -188,12 +186,11 @@ private static string BuildProductUrl( return $"{managementEndpoint}/subscriptions/{subscription}/providers/Microsoft.Marketplace/products/{productId}?{queryString}"; } - private async Task GetMarketplaceSingleProductResponseAsync(string url, string? tenant, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) + private async Task GetMarketplaceSingleProductResponseAsync(string url, string? tenant, CancellationToken cancellationToken) { var productDetails = await ExecuteMarketplaceRequestAsync( url, MarketplaceJsonContext.Default.ProductDetails, - retryPolicy, tenant, cancellationToken ); @@ -203,7 +200,6 @@ private async Task GetMarketplaceSingleProductResponseAsync(stri private async Task ExecuteMarketplaceRequestAsync( string url, JsonTypeInfo jsonTypeInfo, - RetryPolicyOptions? retryPolicy, string? tenant, CancellationToken cancellationToken ) @@ -212,7 +208,7 @@ CancellationToken cancellationToken using var httpClient = AzureService.GetClient(); var clientOptions = ConfigureRetryPolicy( AddDefaultPolicies(new MarketplaceClientOptions()), - retryPolicy); + null); clientOptions.Transport = new HttpClientTransport(httpClient); var pipeline = HttpPipelineBuilder.Build(clientOptions); diff --git a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductGetCommandTests.cs b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductGetCommandTests.cs index 724976e897..f5095332c4 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Marketplace.Commands.Product; using Azure.Mcp.Tools.Marketplace.Models; using Azure.Mcp.Tools.Marketplace.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_WithValidParameters_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedProduct); @@ -89,7 +87,6 @@ public async Task ExecuteAsync_HandlesServiceException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductListCommandTests.cs b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductListCommandTests.cs index 5de0f6c26e..117f4e665f 100644 --- a/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Marketplace/tests/Azure.Mcp.Tools.Marketplace.Tests/Product/ProductListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Marketplace.Commands.Product; using Azure.Mcp.Tools.Marketplace.Models; using Azure.Mcp.Tools.Marketplace.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -54,7 +53,6 @@ public async Task ExecuteAsync_WithValidParameters_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ProductListResponseWithNextCursor { Items = expectedProducts }); @@ -93,7 +91,6 @@ public async Task ExecuteAsync_WithOptionalParameters_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ProductListResponseWithNextCursor { Items = expectedProducts }); @@ -137,7 +134,6 @@ public async Task ExecuteAsync_WithEmptyResults_ReturnsSuccessWithNullResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ProductListResponseWithNextCursor { Items = [] }); @@ -167,7 +163,6 @@ public async Task ExecuteAsync_HandlesServiceException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -207,7 +202,6 @@ public async Task ExecuteAsync_WithMultipleODataOptions_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ProductListResponseWithNextCursor { Items = expectedProducts }); @@ -260,7 +254,6 @@ public async Task ExecuteAsync_WithResultsContainingNextCursor_ReturnsNextCursor Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(productsListResult); @@ -305,7 +298,6 @@ public async Task ExecuteAsync_WithoutNextCursorInResults_DoesNotIncludeNextCurs Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(productsListResult); @@ -344,7 +336,6 @@ public async Task ExecuteAsync_WithExpandOption_ReturnsSuccess() Arg.Any(), Arg.Is(expand), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ProductListResponseWithNextCursor { Items = expectedProducts }); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/ActivityLog/ActivityLogListCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/ActivityLog/ActivityLogListCommand.cs index ca56100be4..2939cbcf07 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/ActivityLog/ActivityLogListCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/ActivityLog/ActivityLogListCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.EventLevel, options.Top ?? 10, options.Tenant, - options.RetryPolicy, cancellationToken); // Return empty array if no results diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelGetCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelGetCommand.cs index 1fdb3d0d26..7f68258643 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelGetCommand.cs @@ -39,7 +39,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.HealthModel, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(model), MonitorJsonContext.Default.HealthModelGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelListCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelListCommand.cs index dde64be399..4c742ff8e3 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelListCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/HealthModels/HealthModelListCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(models, MonitorJsonContext.Default.ListHealthModelSummary); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/ResourceLogQueryCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/ResourceLogQueryCommand.cs index 8393e02d2d..1bf92c057e 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/ResourceLogQueryCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/ResourceLogQueryCommand.cs @@ -48,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Hours, options.Limit, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(results, MonitorJsonContext.Default.ListJsonNode); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/WorkspaceLogQueryCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/WorkspaceLogQueryCommand.cs index 2409ab4ef5..0609fe4435 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/WorkspaceLogQueryCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Log/WorkspaceLogQueryCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Hours, options.Limit, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(results, MonitorJsonContext.Default.ListJsonNode); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsDefinitionsCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsDefinitionsCommand.cs index 28d1e69a5c..cdfa46abc7 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsDefinitionsCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsDefinitionsCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.MetricNamespace, options.SearchString, options.Tenant, - options.RetryPolicy, cancellationToken); if (allResults?.Count > 0) diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsQueryCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsQueryCommand.cs index 021c7750a3..bb8c1280ec 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsQueryCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Metrics/MetricsQueryCommand.cs @@ -79,7 +79,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Aggregation, options.Filter, options.Tenant, - options.RetryPolicy, cancellationToken); // Validate bucket count limit diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Table/TableListCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Table/TableListCommand.cs index e2059e9d04..9d15cef593 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Table/TableListCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Table/TableListCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Workspace, options.TableType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(tables ?? []), MonitorJsonContext.Default.TableListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/TableType/TableTypeListCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/TableType/TableTypeListCommand.cs index ec83c80d79..02b4e6cb6b 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/TableType/TableTypeListCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/TableType/TableTypeListCommand.cs @@ -37,7 +37,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Workspace, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(tableTypes ?? []), MonitorJsonContext.Default.TableTypeListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsCreateOrUpdateCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsCreateOrUpdateCommand.cs index ff8ebe0d72..d0e51e28db 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsCreateOrUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsCreateOrUpdateCommand.cs @@ -69,7 +69,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.WebtestResource, options.Tenant, - options.RetryPolicy, cancellationToken); } catch @@ -126,7 +125,6 @@ public override async Task ExecuteAsync(CommandContext context, sslLifetimeCheckInDays: options.SslLifetimeCheck, timeoutInSeconds: options.Timeout, tenant: options.Tenant, - retryPolicy: options.RetryPolicy, cancellationToken: cancellationToken); } else @@ -159,7 +157,6 @@ public override async Task ExecuteAsync(CommandContext context, sslLifetimeCheckInDays: options.SslLifetimeCheck, timeoutInSeconds: options.Timeout, tenant: options.Tenant, - retryPolicy: options.RetryPolicy, cancellationToken: cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsGetCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsGetCommand.cs index b5fbde1a8a..9fec707f9c 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/WebTests/WebTestsGetCommand.cs @@ -57,7 +57,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.WebtestResource!, options.Tenant, - options.RetryPolicy, cancellationToken); if (webTest != null) @@ -74,8 +73,8 @@ public override async Task ExecuteAsync(CommandContext context, { // Otherwise, list web tests var webTests = options.ResourceGroup == null - ? await _monitorWebTestService.ListWebTests(options.Subscription!, options.Tenant, options.RetryPolicy, cancellationToken) - : await _monitorWebTestService.ListWebTests(options.Subscription!, options.ResourceGroup, options.Tenant, options.RetryPolicy, cancellationToken); + ? await _monitorWebTestService.ListWebTests(options.Subscription!, options.Tenant, cancellationToken) + : await _monitorWebTestService.ListWebTests(options.Subscription!, options.ResourceGroup, options.Tenant, cancellationToken); context.Response.Results = ResponseResult.Create(new(null, webTests ?? []), MonitorJsonContext.Default.WebTestsGetCommandResult); } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Workspace/WorkspaceListCommand.cs b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Workspace/WorkspaceListCommand.cs index 4ed1cb3cfb..c7654e3290 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Commands/Workspace/WorkspaceListCommand.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Commands/Workspace/WorkspaceListCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(workspaces ?? []), MonitorJsonContext.Default.WorkspaceListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/ActivityLog/ActivityLogListOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/ActivityLog/ActivityLogListOptions.cs index c2564c6b73..a4e10ed432 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/ActivityLog/ActivityLogListOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/ActivityLog/ActivityLogListOptions.cs @@ -33,6 +33,4 @@ public class ActivityLogListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelGetOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelGetOptions.cs index 5603a4783e..05a015fee6 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelGetOptions.cs @@ -20,6 +20,4 @@ public sealed class HealthModelGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelListOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelListOptions.cs index 8c51a2b1c1..b35b99ad94 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelListOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelListOptions.cs @@ -17,6 +17,4 @@ public sealed class HealthModelListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/Metrics/BaseMetricsOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/Metrics/BaseMetricsOptions.cs index 8cb117c109..44686a23d0 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/Metrics/BaseMetricsOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/Metrics/BaseMetricsOptions.cs @@ -32,6 +32,4 @@ public abstract class BaseMetricsOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/ResourceLogQueryOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/ResourceLogQueryOptions.cs index 007c2016f4..24b1fc7d3f 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/ResourceLogQueryOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/ResourceLogQueryOptions.cs @@ -29,6 +29,4 @@ public sealed class ResourceLogQueryOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/TableListOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/TableListOptions.cs index 9a8a090d67..6ae3424082 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/TableListOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/TableListOptions.cs @@ -23,6 +23,4 @@ public sealed class TableListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/TableType/TableTypeListOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/TableType/TableTypeListOptions.cs index b4c14d6dce..80e8960941 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/TableType/TableTypeListOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/TableType/TableTypeListOptions.cs @@ -20,6 +20,4 @@ public sealed class TableTypeListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsCreateOrUpdateOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsCreateOrUpdateOptions.cs index 16872eb652..b5f7739e2e 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsCreateOrUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsCreateOrUpdateOptions.cs @@ -78,6 +78,4 @@ public sealed class WebTestsCreateOrUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public required string ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsGetOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsGetOptions.cs index 75a921a785..eec5a6ec6c 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsGetOptions.cs @@ -20,6 +20,4 @@ public sealed class WebTestsGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceListOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceListOptions.cs index 46cd3c8df4..9e10b8d006 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceListOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceListOptions.cs @@ -17,6 +17,4 @@ public sealed class WorkspaceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceLogQueryOptions.cs b/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceLogQueryOptions.cs index 6196619101..5263b3ce03 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceLogQueryOptions.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceLogQueryOptions.cs @@ -29,6 +29,4 @@ public sealed class WorkspaceLogQueryOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorHealthModelService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorHealthModelService.cs index 379ef9e462..a27b31ae31 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorHealthModelService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorHealthModelService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Monitor.Models.HealthModels; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -14,14 +13,12 @@ public interface IMonitorHealthModelService /// Subscription ID or name. /// Optional resource group to scope the listing. /// Optional tenant ID. - /// Optional retry policy. /// A cancellation token. /// List health models. Task> ListHealthModels( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -31,7 +28,6 @@ Task> ListHealthModels( /// The resource group containing the health model. /// The health model name. /// Optional tenant ID. - /// Optional retry policy. /// A cancellation token. /// The health model resource. Task GetHealthModel( @@ -39,6 +35,5 @@ Task GetHealthModel( string resourceGroup, string healthModelName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorMetricsService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorMetricsService.cs index 739f1e789a..2a7cb28827 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorMetricsService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorMetricsService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Monitor.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -26,7 +25,6 @@ public interface IMonitorMetricsService /// Optional OData filter to apply /// Required metric namespace /// Optional tenant ID for multi-tenant scenarios - /// Optional retry policy parameters /// Cancellation token /// List of metric results with time series data Task> QueryMetricsAsync( @@ -42,7 +40,6 @@ Task> QueryMetricsAsync( string? aggregation = null, string? filter = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -55,7 +52,6 @@ Task> QueryMetricsAsync( /// Optional metric namespace /// Optional search string to filter metric definitions by name and description /// Optional tenant ID for multi-tenant scenarios - /// Optional retry policy parameters /// Cancellation token /// List of metric definitions Task> ListMetricDefinitionsAsync( @@ -66,7 +62,6 @@ Task> ListMetricDefinitionsAsync( string? metricNamespace = null, string? searchString = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -78,7 +73,6 @@ Task> ListMetricDefinitionsAsync( /// The resource name /// Optional search string to filter namespaces /// Optional tenant ID for multi-tenant scenarios - /// Optional retry policy parameters /// Cancellation token /// List of metric namespaces Task> ListMetricNamespacesAsync( @@ -88,6 +82,5 @@ Task> ListMetricNamespacesAsync( string resourceName, string? searchString = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorService.cs index 0edaf620f2..065f5afe97 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorService.cs @@ -4,7 +4,6 @@ using System.Text.Json.Nodes; using Azure.Mcp.Tools.Monitor.Models; using Azure.Mcp.Tools.Monitor.Models.ActivityLog; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -18,7 +17,6 @@ Task> QueryResourceLogs( int? hours = 24, int? limit = 20, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> QueryWorkspace( @@ -27,7 +25,6 @@ Task> QueryWorkspace( string query, int timeSpanDays = 1, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListTables( @@ -35,14 +32,12 @@ Task> ListTables( string resourceGroup, string workspace, string? tableType = "CustomLog", string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListWorkspaces( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> QueryWorkspaceLogs( @@ -52,7 +47,6 @@ Task> QueryWorkspaceLogs( string table, int? hours = 24, int? limit = 20, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListTableTypes( @@ -60,7 +54,6 @@ Task> ListTableTypes( string resourceGroup, string workspace, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); Task> ListActivityLogs( @@ -72,6 +65,5 @@ Task> ListActivityLogs( ActivityLogEventLevel? eventLevel = null, int top = 10, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorWebTestService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorWebTestService.cs index 085ed30d81..532daa47a6 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorWebTestService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorWebTestService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Monitor.Models.WebTests; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -11,14 +10,12 @@ public interface IMonitorWebTestService Task> ListWebTests( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListWebTests( string subscription, string resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetWebTest( @@ -26,7 +23,6 @@ Task GetWebTest( string resourceGroup, string name, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateWebTest( @@ -53,7 +49,6 @@ Task CreateWebTest( int? sslLifetimeCheckInDays = null, int? timeoutInSeconds = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task UpdateWebTest( @@ -80,6 +75,5 @@ Task UpdateWebTest( int? sslLifetimeCheckInDays = null, int? timeoutInSeconds = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs index e53a5bbef7..efc110f8e2 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Core; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -19,7 +18,6 @@ public interface IResourceResolverService /// The resource type (optional, e.g., 'Microsoft.Storage/storageAccounts') /// The resource name or full resource ID /// Optional tenant ID for multi-tenant scenarios - /// Optional retry policy parameters /// The full Azure resource ID Task ResolveResourceIdAsync( string subscription, @@ -27,6 +25,5 @@ Task ResolveResourceIdAsync( string? resourceType, string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs index 380b5b9c23..ecf2ff3661 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs @@ -6,7 +6,6 @@ using Azure.ResourceManager.CloudHealth; using Azure.ResourceManager.Models; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -29,12 +28,11 @@ public async Task> ListHealthModels( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var results = new List(); if (string.IsNullOrEmpty(resourceGroup)) @@ -91,7 +89,6 @@ public async Task GetHealthModel( string resourceGroup, string healthModelName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -99,7 +96,7 @@ public async Task GetHealthModel( (nameof(resourceGroup), resourceGroup), (nameof(healthModelName), healthModelName)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var model = await resourceGroupResource.Value.GetHealthModels().GetAsync(healthModelName, cancellationToken); var healthState = await TryGetRootHealthStateAsync(model.Value, healthModelName, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorMetricsService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorMetricsService.cs index 9135a8bfbe..9b7d0d5fbb 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorMetricsService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorMetricsService.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Monitor.Models; using Azure.ResourceManager.Monitor; using Azure.ResourceManager.Monitor.Models; -using Microsoft.Mcp.Core.Options; using MetricDefinition = Azure.Mcp.Tools.Monitor.Models.MetricDefinition; using MetricNamespace = Azure.Mcp.Tools.Monitor.Models.MetricNamespace; using MetricResult = Azure.Mcp.Tools.Monitor.Models.MetricResult; @@ -32,19 +31,18 @@ public async Task> QueryMetricsAsync( string? aggregation = null, string? filter = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceName), resourceName), (nameof(metricNamespace), metricNamespace)); ArgumentNullException.ThrowIfNull(metricNames); - var resourceId = await _resourceResolverService.ResolveResourceIdAsync(subscription, resourceGroup, resourceType, resourceName, tenant, retryPolicy, cancellationToken); + var resourceId = await _resourceResolverService.ResolveResourceIdAsync(subscription, resourceGroup, resourceType, resourceName, tenant, cancellationToken); if (string.IsNullOrEmpty(resourceId)) { throw new ArgumentException($"Resource '{resourceName}' not found or could not be resolved."); } - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); // Parse time range DateTimeOffset? startTimeOffset = null; @@ -213,17 +211,16 @@ public async Task> ListMetricDefinitionsAsync( string? metricNamespace = null, string? searchString = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceName), resourceName)); - var resourceId = await _resourceResolverService.ResolveResourceIdAsync(subscription, resourceGroup, resourceType, resourceName, tenant, retryPolicy, cancellationToken); + var resourceId = await _resourceResolverService.ResolveResourceIdAsync(subscription, resourceGroup, resourceType, resourceName, tenant, cancellationToken); if (string.IsNullOrEmpty(resourceId)) { throw new ArgumentException($"Resource '{resourceName}' not found or could not be resolved."); } - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); // List metric definitions using the new API var definitionsPageable = armClient.GetMonitorMetricDefinitionsAsync( @@ -285,17 +282,16 @@ public async Task> ListMetricNamespacesAsync( string resourceName, string? searchString = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceName), resourceName)); - var resourceId = await _resourceResolverService.ResolveResourceIdAsync(subscription, resourceGroup, resourceType, resourceName, tenant, retryPolicy, cancellationToken); + var resourceId = await _resourceResolverService.ResolveResourceIdAsync(subscription, resourceGroup, resourceType, resourceName, tenant, cancellationToken); if (string.IsNullOrEmpty(resourceId)) { throw new ArgumentException($"Resource '{resourceName}' not found or could not be resolved."); } - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); // List metric namespaces using the new API var namespacesPageable = armClient.GetMonitorMetricNamespacesAsync(new(resourceId!), cancellationToken: cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs index a7f4883b55..a43251e78f 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs @@ -35,7 +35,6 @@ public async Task> QueryResourceLogs( int? hours, int? limit, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceId), resourceId), (nameof(table), table)); @@ -47,7 +46,7 @@ public async Task> QueryResourceLogs( var options = AddDefaultPolicies(new LogsQueryClientOptions()); options.Audience = GetLogsQueryAudience(); - options.ConfigureRetryOptions(retryPolicy); + options.ConfigureRetryOptions(null); options.Transport = new HttpClientTransport(AzureService.GetClient()); var client = new LogsQueryClient(credential, options); var timeRange = new LogsQueryTimeRange(TimeSpan.FromHours(hours ?? 24)); @@ -96,7 +95,6 @@ public async Task> QueryWorkspace( string query, int timeSpanDays = 1, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(workspace), workspace), (nameof(query), query)); @@ -106,11 +104,11 @@ public async Task> QueryWorkspace( var options = AddDefaultPolicies(new LogsQueryClientOptions()); options.Audience = GetLogsQueryAudience(); - options.ConfigureRetryOptions(retryPolicy); + options.ConfigureRetryOptions(null); options.Transport = new HttpClientTransport(AzureService.GetClient()); var client = new LogsQueryClient(credential, options); - var (workspaceId, _) = await GetWorkspaceInfo(workspace, subscription, tenant, retryPolicy, cancellationToken); + var (workspaceId, _) = await GetWorkspaceInfo(workspace, subscription, tenant, cancellationToken); var response = await client.QueryWorkspaceAsync( workspaceId, @@ -148,14 +146,13 @@ public async Task> ListTables( string workspace, string? tableType, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(workspace), workspace)); - var (_, resolvedWorkspaceName) = await GetWorkspaceInfo(workspace, subscription, tenant, retryPolicy, cancellationToken); + var (_, resolvedWorkspaceName) = await GetWorkspaceInfo(workspace, subscription, tenant, cancellationToken); - var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) ?? + var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group {resourceGroup} not found in subscription {subscription}"); var workspaceResponse = await resourceGroupResource.GetOperationalInsightsWorkspaceAsync(resolvedWorkspaceName, cancellationToken) .ConfigureAwait(false); @@ -182,14 +179,13 @@ public async Task> ListWorkspaces( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); if (!string.IsNullOrEmpty(resourceGroup)) { - var rgResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var rgResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found in subscription '{subscription}'."); return await rgResource @@ -204,7 +200,7 @@ public async Task> ListWorkspaces( .ConfigureAwait(false); } - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var workspaces = await subscriptionResource .GetOperationalInsightsWorkspacesAsync(cancellationToken) @@ -226,12 +222,11 @@ public async Task> QueryWorkspaceLogs( int? hours, int? limit, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(workspace), workspace), (nameof(table), table)); - var (workspaceId, _) = await GetWorkspaceInfo(workspace, subscription, tenant, retryPolicy, cancellationToken); + var (workspaceId, _) = await GetWorkspaceInfo(workspace, subscription, tenant, cancellationToken); query = BuildQuery(query, table, limit); ValidateRequiredParameters((nameof(query), query)); KqlQueryValidator.ValidateQuerySafety(query); @@ -242,7 +237,7 @@ public async Task> QueryWorkspaceLogs( var options = AddDefaultPolicies(new LogsQueryClientOptions()); options.Audience = GetLogsQueryAudience(); - options.ConfigureRetryOptions(retryPolicy); + options.ConfigureRetryOptions(null); options.Transport = new HttpClientTransport(AzureService.GetClient()); var client = new LogsQueryClient(credential, options); var timeRange = new LogsQueryTimeRange(TimeSpan.FromHours(hours ?? 24)); @@ -316,14 +311,13 @@ public async Task> ListTableTypes( string resourceGroup, string workspace, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup), (nameof(workspace), workspace)); - var (_, resolvedWorkspaceName) = await GetWorkspaceInfo(workspace, subscription, tenant, retryPolicy, cancellationToken); + var (_, resolvedWorkspaceName) = await GetWorkspaceInfo(workspace, subscription, tenant, cancellationToken); - var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) + var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group {resourceGroup} not found in subscription {subscription}"); var workspaceResponse = await resourceGroupResource.GetOperationalInsightsWorkspaceAsync(resolvedWorkspaceName, cancellationToken) .ConfigureAwait(false); @@ -356,7 +350,6 @@ public async Task> ListActivityLogs( ActivityLogEventLevel? eventLevel, int top, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceName), resourceName)); @@ -368,14 +361,14 @@ public async Task> ListActivityLogs( // Resolve the resource ID from the resource name var resourceIdentifier = await resourceResolverService.ResolveResourceIdAsync( - subscription, resourceGroup, resourceType, resourceName, tenant, retryPolicy, cancellationToken); + subscription, resourceGroup, resourceType, resourceName, tenant, cancellationToken); string resourceId = resourceIdentifier.ToString(); string subscriptionId = resourceIdentifier.SubscriptionId ?? throw new ArgumentException($"Unable to extract subscription ID from resource ID: {resourceId}"); // Get the activity logs from the Azure Management API - var activityLogs = await CallActivityLogApiAsync(subscriptionId, resourceId, hours, eventLevel, tenant, retryPolicy, cancellationToken); + var activityLogs = await CallActivityLogApiAsync(subscriptionId, resourceId, hours, eventLevel, tenant, cancellationToken); // Take only the requested number of logs return activityLogs.Take(top).ToList(); @@ -387,7 +380,6 @@ private async Task> CallActivityLogApiAsync( double hours, ActivityLogEventLevel? eventLevel, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { var returnValue = new List(); @@ -473,12 +465,11 @@ private async Task MakeActivityLogRequestAsync(string u string workspace, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { // If we're given an ID and need an ID, or given a name and need a name, return as is bool isId = IsWorkspaceId(workspace); - var workspaces = await ListWorkspaces(subscription, resourceGroup: null, tenant, retryPolicy, cancellationToken); + var workspaces = await ListWorkspaces(subscription, resourceGroup: null, tenant, cancellationToken); // Find the workspace var matchingWorkspace = workspaces.FirstOrDefault(w => diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs index af153d6cfb..ea7fa80c14 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs @@ -8,7 +8,6 @@ using Azure.ResourceManager.ApplicationInsights; using Azure.ResourceManager.ApplicationInsights.Models; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -18,12 +17,11 @@ public class MonitorWebTestService(IAzureService azureService) public async Task> ListWebTests( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var webTests = await subscriptionResource .GetApplicationInsightsWebTestsAsync(cancellationToken) @@ -45,14 +43,13 @@ public async Task> ListWebTests( string subscription, string resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( (nameof(subscription), subscription), (nameof(resourceGroup), resourceGroup)); - var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) ?? + var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group {resourceGroup} not found in subscription {subscription}"); var webTests = await resourceGroupResource @@ -76,7 +73,6 @@ public async Task GetWebTest( string resourceGroup, string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -84,7 +80,7 @@ public async Task GetWebTest( (nameof(resourceGroup), resourceGroup), (nameof(resourceName), resourceName)); - var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) ?? + var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group {resourceGroup} not found in subscription {subscription}"); var webTest = await resourceGroupResource.GetApplicationInsightsWebTestAsync(resourceName, cancellationToken).ConfigureAwait(false); @@ -152,7 +148,6 @@ public async Task CreateWebTest( int? sslLifetimeCheckInDays = null, int? timeoutInSeconds = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -163,7 +158,7 @@ public async Task CreateWebTest( (nameof(location), location), (nameof(requestUrl), requestUrl)); - var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) ?? + var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group {resourceGroup} not found in subscription {subscription}"); // Check if web test already exists @@ -292,7 +287,6 @@ public async Task UpdateWebTest( int? sslLifetimeCheckInDays = null, int? timeoutInSeconds = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -300,7 +294,7 @@ public async Task UpdateWebTest( (nameof(resourceGroup), resourceGroup), (nameof(resourceName), resourceName)); - var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, retryPolicy, cancellationToken) ?? + var resourceGroupResource = await AzureService.GetResourceGroupResource(subscription, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group {resourceGroup} not found in subscription {subscription}"); // Get existing web test diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/ResourceResolverService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/ResourceResolverService.cs index e720f2f2e8..493c8d5e5c 100644 --- a/tools/Azure.Mcp.Tools.Monitor/src/Services/ResourceResolverService.cs +++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/ResourceResolverService.cs @@ -4,7 +4,6 @@ using Azure.Core; using Azure.Mcp.Core.Services.Azure; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Monitor.Services; @@ -17,7 +16,6 @@ public async Task ResolveResourceIdAsync( string? resourceType, string resourceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription), (nameof(resourceName), resourceName)); @@ -35,7 +33,7 @@ public async Task ResolveResourceIdAsync( } // Need to discover the resource - get subscription resource - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); // Get all resources matching the name var allMatchingResources = await subscriptionResource.GetGenericResourcesAsync(cancellationToken: cancellationToken) diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/ActivityLog/ActivityLogListCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/ActivityLog/ActivityLogListCommandTests.cs index d725443c7a..91ce51e86c 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/ActivityLog/ActivityLogListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/ActivityLog/ActivityLogListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Monitor.Commands.ActivityLog; using Azure.Mcp.Tools.Monitor.Models.ActivityLog; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -52,7 +51,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(testActivityLogs); } @@ -108,7 +106,6 @@ public async Task ExecuteAsync_ReturnsActivityLogsList() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedActivityLogs); @@ -128,7 +125,6 @@ await Service.Received(1).ListActivityLogs( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, MonitorJsonContext.Default.ActivityLogListCommandResult); @@ -153,7 +149,6 @@ public async Task ExecuteAsync_ReturnsEmptyListWhenNoActivityLogs() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -181,7 +176,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -215,7 +209,6 @@ public async Task ExecuteAsync_HandlesOptionalParametersCorrectly(string partial Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns( [ diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelGetCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelGetCommandTests.cs index 7a291dbb4c..ec61f4d337 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Monitor.Commands.HealthModels; using Azure.Mcp.Tools.Monitor.Models.HealthModels; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -22,7 +21,7 @@ public class HealthModelGetCommandTests : SubscriptionCommandUnitTestsBase(), Arg.Any(), Arg.Any()) + Service.GetHealthModel(TestSubscription, TestResourceGroup, TestHealthModel, Arg.Any(), Arg.Any()) .Returns(new HealthModelDetail { Id = null, diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelListCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelListCommandTests.cs index 71706a0e13..30de4c0142 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/HealthModels/HealthModelListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Monitor.Commands.HealthModels; using Azure.Mcp.Tools.Monitor.Models.HealthModels; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -26,7 +25,7 @@ public async Task ExecuteAsync_ReturnsLeanSummaries_WhenTheyExist() new() { Id = "/subscriptions/sub123/resourceGroups/rg1/providers/Microsoft.CloudHealth/healthmodels/hm-one", Name = "hm-one", ResourceGroup = "rg1", Location = "eastus2", ProvisioningState = "Succeeded" }, new() { Id = "/subscriptions/sub123/resourceGroups/rg2/providers/Microsoft.CloudHealth/healthmodels/hm-two", Name = "hm-two", ResourceGroup = "rg2", Location = "westus2", ProvisioningState = "Provisioning" }, ]; - Service.ListHealthModels(TestSubscription, Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHealthModels(TestSubscription, Arg.Any(), Arg.Any(), Arg.Any()) .Returns(summaries); var response = await ExecuteCommandAsync("--subscription", TestSubscription); @@ -53,12 +52,12 @@ public async Task ExecuteAsync_ReturnsLeanSummaries_WhenTheyExist() [Fact] public async Task ExecuteAsync_ForwardsResourceGroup_WhenProvided() { - Service.ListHealthModels(Arg.Any(), Arg.Is(TestResourceGroup), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHealthModels(Arg.Any(), Arg.Is(TestResourceGroup), Arg.Any(), Arg.Any()) .Returns([]); var response = await ExecuteCommandAsync("--subscription", TestSubscription, "--resource-group", TestResourceGroup); Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).ListHealthModels(Arg.Any(), Arg.Is(TestResourceGroup), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListHealthModels(Arg.Any(), Arg.Is(TestResourceGroup), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/ResourceLogQueryCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/ResourceLogQueryCommandTests.cs index 98d22d761f..2e48669a24 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/ResourceLogQueryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/ResourceLogQueryCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Monitor.Commands.Log; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockResults); } @@ -86,7 +84,6 @@ public async Task ExecuteAsync_ReturnsQueryResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockResults); @@ -110,7 +107,6 @@ await Service.Received(1).QueryResourceLogs( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -127,7 +123,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() int.Parse(_knownHours), int.Parse(_knownLimit), _knownTenant, - Arg.Any(), Arg.Any()) .Returns(mockResults); @@ -151,7 +146,6 @@ await Service.Received(1).QueryResourceLogs( int.Parse(_knownHours), int.Parse(_knownLimit), _knownTenant, - Arg.Any(), Arg.Any()); } @@ -168,7 +162,6 @@ public async Task ExecuteAsync_WithDefaultParameters_UsesExpectedDefaults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockResults); @@ -189,7 +182,6 @@ await Service.Received(1).QueryResourceLogs( Arg.Any(), // Default hours Arg.Any(), // Default limit Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -205,7 +197,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -238,7 +229,6 @@ public async Task ExecuteAsync_WithComplexResourceId_HandlesCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockResults); @@ -259,7 +249,6 @@ await Service.Received(1).QueryResourceLogs( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs index 052062be1f..7cabd1d2d2 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Monitor.Commands.Log; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockResults); } @@ -86,7 +84,6 @@ public async Task ExecuteAsync_ReturnsQueryResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockResults); @@ -110,7 +107,6 @@ await Service.Received(1).QueryWorkspaceLogs( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -127,7 +123,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() int.Parse(_knownHours), int.Parse(_knownLimit), _knownTenant, - Arg.Any(), Arg.Any()) .Returns(mockResults); @@ -151,7 +146,6 @@ await Service.Received(1).QueryWorkspaceLogs( int.Parse(_knownHours), int.Parse(_knownLimit), _knownTenant, - Arg.Any(), Arg.Any()); } @@ -168,7 +162,6 @@ public async Task ExecuteAsync_WithDefaultParameters_UsesExpectedDefaults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockResults); @@ -189,7 +182,6 @@ await Service.Received(1).QueryWorkspaceLogs( Arg.Any(), // Default hours Arg.Any(), // Default limit Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -205,7 +197,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/LogAnalyticsHelper.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/LogAnalyticsHelper.cs index 9e251fa38f..6a89fcd162 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/LogAnalyticsHelper.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/LogAnalyticsHelper.cs @@ -48,7 +48,7 @@ private async Task GetWorkspaceIdAsync() } // Get workspace info using the monitor service - var workspaces = await _monitorService.ListWorkspaces(_subscription, tenant: _tenantId, retryPolicy: null).ConfigureAwait(false); + var workspaces = await _monitorService.ListWorkspaces(_subscription, tenant: _tenantId).ConfigureAwait(false); var workspace = workspaces.FirstOrDefault(w => w.Name.Equals(_workspaceName, StringComparison.OrdinalIgnoreCase)) ?? throw new InvalidOperationException($"Could not find workspace {_workspaceName}"); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsDefinitionsCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsDefinitionsCommandTests.cs index 8da06deb66..bfaaf3998e 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsDefinitionsCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsDefinitionsCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Monitor.Models; using Azure.Mcp.Tools.Monitor.Services; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -76,7 +75,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns( [ @@ -138,7 +136,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() "Microsoft.Storage/storageAccounts", null, "tenant1", - Arg.Any(), Arg.Any()) .Returns(expectedResults); @@ -162,7 +159,6 @@ await Service.Received(1).ListMetricDefinitionsAsync( "Microsoft.Storage/storageAccounts", null, "tenant1", - Arg.Any(), Arg.Any()); } @@ -178,7 +174,6 @@ public async Task ExecuteAsync_WithSearchString_CallsServiceWithSearchParameter( Arg.Any(), "cpu", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns( [ @@ -210,7 +205,6 @@ await Service.Received(1).ListMetricDefinitionsAsync( Arg.Any(), "cpu", Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -237,7 +231,6 @@ public async Task ExecuteAsync_WithAllOptionalParameters_CallsServiceCorrectly() "Microsoft.Storage/storageAccounts", "memory", "tenant1", - Arg.Any(), Arg.Any()) .Returns(expectedResults); @@ -263,7 +256,6 @@ await Service.Received(1).ListMetricDefinitionsAsync( "Microsoft.Storage/storageAccounts", "memory", "tenant1", - Arg.Any(), Arg.Any()); } @@ -283,7 +275,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -309,7 +300,6 @@ public async Task ExecuteAsync_HandlesServiceException_LogsError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exception); @@ -369,7 +359,6 @@ public async Task ExecuteAsync_WithResults_ReturnsCorrectStructure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(metricDefinitions); @@ -394,7 +383,6 @@ public async Task ExecuteAsync_WithNoResults_ReturnsNullResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -418,7 +406,6 @@ public async Task ExecuteAsync_WithNullResults_ReturnsNullResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(Task.FromResult>(null!)); @@ -448,7 +435,6 @@ public async Task ExecuteAsync_WithDefaultLimit_TruncatesResultsTo10() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(metricDefinitions); @@ -462,7 +448,7 @@ public async Task ExecuteAsync_WithDefaultLimit_TruncatesResultsTo10() Assert.Contains("Results truncated to 10 of 15", response.Message); Assert.Contains("metric definitions", response.Message); // Verify service receives all data but command applies limit internally - await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -479,7 +465,6 @@ public async Task ExecuteAsync_WithCustomLimit_TruncatesResultsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(metricDefinitions); @@ -493,7 +478,7 @@ public async Task ExecuteAsync_WithCustomLimit_TruncatesResultsCorrectly() Assert.Contains("Results truncated to 5 of 20", response.Message); Assert.Contains("metric definitions", response.Message); // Verify service is called correctly - await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -510,7 +495,6 @@ public async Task ExecuteAsync_WithResultsExceedingLimit_ShowsTruncationMessage( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(metricDefinitions); @@ -524,7 +508,7 @@ public async Task ExecuteAsync_WithResultsExceedingLimit_ShowsTruncationMessage( Assert.Contains("Results truncated to 8 of 25", response.Message); Assert.Contains("Use --search-string to filter results", response.Message); // Verify the service was called - await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -541,7 +525,6 @@ public async Task ExecuteAsync_WithResultsUnderLimit_ShowsAllResultsMessage() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(metricDefinitions); @@ -554,7 +537,7 @@ public async Task ExecuteAsync_WithResultsUnderLimit_ShowsAllResultsMessage() // Verify that all results are returned without truncation Assert.Equal("All 3 metric definitions returned.", response.Message); // Verify the service was called - await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListMetricDefinitionsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } #endregion @@ -584,7 +567,6 @@ public async Task ExecuteAsync_BindsOptionsCorrectly() "Microsoft.Compute/virtualMachines", "performance", "test-tenant", - Arg.Any(), Arg.Any()) .Returns(expectedResults); @@ -610,7 +592,6 @@ await Service.Received(1).ListMetricDefinitionsAsync( "Microsoft.Compute/virtualMachines", "performance", "test-tenant", - Arg.Any(), Arg.Any()); } diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsQueryCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsQueryCommandTests.cs index e2bda66800..f3d0c7c8a7 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsQueryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MetricsQueryCommandTests.cs @@ -9,7 +9,6 @@ using Azure.Mcp.Tools.Monitor.Services; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -91,7 +90,6 @@ public async Task ExecuteAsync_BindsAllOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -124,7 +122,6 @@ await Service.Received(1).QueryMetricsAsync( "Average", // aggregation "dimension eq 'value'", // filter null, // tenant - Arg.Any(), Arg.Any()); } @@ -145,7 +142,6 @@ public async Task ExecuteAsync_HandlesOptionalParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -170,7 +166,6 @@ await Service.Received(1).QueryMetricsAsync( Arg.Is(t => t == null), // aggregation (not provided) Arg.Is(t => t == null), // filter (not provided) Arg.Is(t => t == null), // tenant - Arg.Any(), Arg.Any()); } @@ -253,7 +248,6 @@ public async Task ExecuteAsync_ValidInput_ReturnsSuccess(string args) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResults); @@ -287,7 +281,6 @@ public async Task ExecuteAsync_EmptyResults_ReturnsSuccessWithEmptyResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -320,7 +313,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -351,7 +343,6 @@ await Service.Received(1).QueryMetricsAsync( "Average", null, null, - Arg.Any(), Arg.Any()); } @@ -414,7 +405,6 @@ public async Task ExecuteAsync_ExceedsBucketLimit_ReturnsBadRequest() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(resultsWithTooManyBuckets); @@ -470,7 +460,6 @@ public async Task ExecuteAsync_ExceedsCustomBucketLimit_ReturnsBadRequest() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(resultsWithTooManyBuckets); @@ -550,7 +539,6 @@ public async Task ExecuteAsync_ChecksAllBucketTypes_ForLimitExceeded(string buck Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(results); @@ -603,7 +591,6 @@ public async Task ExecuteAsync_WithinBucketLimit_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(resultsWithinLimit); @@ -656,7 +643,6 @@ public async Task ExecuteAsync_BucketLimitExceeded_LogsWarning() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(resultsWithTooManyBuckets); @@ -698,7 +684,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsInternalServerError Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(expectedException); @@ -733,7 +718,6 @@ public async Task ExecuteAsync_ServiceThrowsException_LogsError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(expectedException); @@ -802,7 +786,6 @@ public async Task ExecuteAsync_MultipleMetricsWithMixedBucketCounts_ValidatesEac Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(results); @@ -856,7 +839,6 @@ public async Task ExecuteAsync_MultipleTimeSeriesPerMetric_ValidatesAll() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(results); @@ -910,7 +892,6 @@ public async Task ExecuteAsync_NullBuckets_DoesNotCountTowardsLimit() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(results); @@ -943,7 +924,6 @@ public async Task ExecuteAsync_NullResults_ReturnsSuccessWithEmptyResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(Task.FromResult((List)null!)); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs index a6d2fdac6f..72c8b424a6 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs @@ -4,7 +4,6 @@ using Azure.Core; using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -37,7 +36,6 @@ public MonitorMetricsServiceTests() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ResourceIdentifier(TestResourceId)); } @@ -193,7 +191,6 @@ public async Task QueryMetricsAsync_WithResourceResolutionFailure_ThrowsExceptio Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Resource not found")); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/ResourceResolverServiceTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/ResourceResolverServiceTests.cs index c71ddd7b24..bcff3a2fa0 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/ResourceResolverServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/ResourceResolverServiceTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Monitor.Services; using Azure.ResourceManager.Resources; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -26,7 +25,7 @@ public ResourceResolverServiceTests() _azureService = Substitute.For(); _service = new ResourceResolverService(_azureService); - _azureService.GetSubscription(Arg.Any(), Arg.Any(), Arg.Any(), cancellationToken: Arg.Any()) + _azureService.GetSubscription(Arg.Any(), Arg.Any(), cancellationToken: Arg.Any()) .Returns(_subscriptionResource); } @@ -64,7 +63,7 @@ public async Task ResolveResourceIdAsync_WithFullResourceId_ReturnsDirectly() // Assert Assert.Equal(fullResourceId, result.ToString()); // Verify that subscription service was not called since we're passing a full resource ID - await _azureService.DidNotReceive().GetSubscription(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await _azureService.DidNotReceive().GetSubscription(Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -83,7 +82,7 @@ public async Task ResolveResourceIdAsync_WithResourceGroupAndType_BuildsDirectPa // Assert Assert.Equal(expectedResourceId, result); - await _azureService.DidNotReceive().GetSubscription(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await _azureService.DidNotReceive().GetSubscription(Arg.Any(), Arg.Any(), Arg.Any()); } [Theory] @@ -150,7 +149,7 @@ public async Task ResolveResourceIdAsync_ResourceDiscovery_SingleResourceFound_R var resourcesAsyncPageable = CreateAsyncPageableWithItems(resource); subscriptionResource.GetGenericResourcesAsync(cancellationToken: Arg.Any()).Returns(resourcesAsyncPageable); - _azureService.GetSubscription(subscription, Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscription(subscription, Arg.Any(), Arg.Any()) .Returns(subscriptionResource); // Act diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Table/TableListCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Table/TableListCommandTests.cs index c4e6fb4c42..de003911a4 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Table/TableListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Table/TableListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Monitor.Commands; using Azure.Mcp.Tools.Monitor.Commands.Table; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -42,7 +41,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(testTables); } @@ -80,7 +78,6 @@ public async Task ExecuteAsync_ReturnsTablesList() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedTables); @@ -98,7 +95,6 @@ await Service.Received(1).ListTables( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, MonitorJsonContext.Default.TableListCommandResult); @@ -121,7 +117,6 @@ public async Task ExecuteAsync_WithTableTypeParameter_CallsServiceWithCorrectPar _knownWorkspace, _knownTableType, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedTables); @@ -140,7 +135,6 @@ await Service.Received(1).ListTables( _knownWorkspace, _knownTableType, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -154,7 +148,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoTables() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -180,7 +173,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/TableType/TableTypeListCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/TableType/TableTypeListCommandTests.cs index 4cf88613f0..8c72e87460 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/TableType/TableTypeListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/TableType/TableTypeListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Monitor.Commands; using Azure.Mcp.Tools.Monitor.Commands.TableType; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,7 +38,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(testTableTypes); } @@ -76,7 +74,6 @@ public async Task ExecuteAsync_ReturnsTableTypesList() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedTableTypes); @@ -93,7 +90,6 @@ await Service.Received(1).ListTableTypes( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, MonitorJsonContext.Default.TableTypeListCommandResult); @@ -115,7 +111,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() _knownResourceGroup, _knownWorkspace, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedTableTypes); @@ -132,7 +127,6 @@ await Service.Received(1).ListTableTypes( _knownResourceGroup, _knownWorkspace, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -145,7 +139,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoTableTypes() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -169,7 +162,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsCreateOrUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsCreateOrUpdateCommandTests.cs index 98c4a16cba..9d92ff95bc 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsCreateOrUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsCreateOrUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Monitor.Commands.WebTests; using Azure.Mcp.Tools.Monitor.Models.WebTests; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -120,7 +119,7 @@ public async Task ExecuteAsync_CreateNewWebTest_ReturnsSuccess() }; // Setup GetWebTest to throw (resource doesn't exist - CREATE scenario) - Service.GetWebTest("sub1", "rg1", "newwebtest", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetWebTest("sub1", "rg1", "newwebtest", Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Resource not found")); Service.CreateWebTest( @@ -147,7 +146,6 @@ public async Task ExecuteAsync_CreateNewWebTest_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -174,7 +172,7 @@ public async Task ExecuteAsync_CreateWithoutRequiredParameters_ReturnsError() }; // Setup GetWebTest to throw (resource doesn't exist - CREATE scenario) - Service.GetWebTest("sub1", "rg1", "newwebtest", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetWebTest("sub1", "rg1", "newwebtest", Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Resource not found")); // Act @@ -223,7 +221,7 @@ public async Task ExecuteAsync_UpdateExistingWebTest_ReturnsSuccess() }; // Setup GetWebTest to return existing resource (UPDATE scenario) - Service.GetWebTest("sub1", "rg1", "existingwebtest", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetWebTest("sub1", "rg1", "existingwebtest", Arg.Any(), Arg.Any()) .Returns(existingWebTest); Service.UpdateWebTest( @@ -250,7 +248,6 @@ public async Task ExecuteAsync_UpdateExistingWebTest_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(updatedWebTest); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsGetCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsGetCommandTests.cs index 570152afb3..9ef022fa42 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/WebTests/WebTestsGetCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Monitor.Models.WebTests; using Azure.Mcp.Tools.Monitor.Services; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -97,7 +96,7 @@ public async Task ExecuteAsync_BindsAllOptionsCorrectly() Id = "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Insights/webtests/webtest1" }; - Service.GetWebTest("sub1", "rg1", "webtest1", null, Arg.Any(), Arg.Any()) + Service.GetWebTest("sub1", "rg1", "webtest1", null, Arg.Any()) .Returns(expectedResult); // Act @@ -107,7 +106,7 @@ await ExecuteCommandAsync( "--webtest-resource", "webtest1"); // Assert - await Service.Received(1).GetWebTest("sub1", "rg1", "webtest1", null, Arg.Any(), Arg.Any()); + await Service.Received(1).GetWebTest("sub1", "rg1", "webtest1", null, Arg.Any()); } #endregion @@ -133,7 +132,7 @@ public async Task ExecuteAsync_ValidInput_ReturnsSuccess() AppInsightsComponentId = "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Insights/components/appinsights1" }; - Service.GetWebTest("sub1", "rg1", "webtest1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetWebTest("sub1", "rg1", "webtest1", Arg.Any(), Arg.Any()) .Returns(expectedResult); // Act @@ -163,7 +162,6 @@ public async Task ExecuteAsync_WebTestNotFound_ReturnsNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Error retrieving details for web test 'nonexistent'")); @@ -188,7 +186,7 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() Location = "eastus" }; - Service.GetWebTest(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetWebTest(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedResult); // Act @@ -198,7 +196,7 @@ await ExecuteCommandAsync( "--webtest-resource", "webtest1"); // Assert - await Service.Received(1).GetWebTest("sub1", "rg1", "webtest1", null, Arg.Any(), Arg.Any()); + await Service.Received(1).GetWebTest("sub1", "rg1", "webtest1", null, Arg.Any()); } #endregion @@ -244,7 +242,7 @@ public async Task ExecuteAsync_ListAllWebTests_ReturnsSuccess() } }; - Service.ListWebTests("sub1", null, Arg.Any(), Arg.Any()) + Service.ListWebTests("sub1", null, Arg.Any()) .Returns(expectedResults); // Act @@ -273,7 +271,7 @@ public async Task ExecuteAsync_ListWebTestsWithResourceGroup_ReturnsFilteredResu } }; - Service.ListWebTests("sub1", "rg1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWebTests("sub1", "rg1", Arg.Any(), Arg.Any()) .Returns(expectedResults); // Act @@ -292,14 +290,14 @@ public async Task ExecuteAsync_ListWebTestsWithResourceGroup_ReturnsFilteredResu public async Task ExecuteAsync_ListCallsServiceWithCorrectParameters() { // Arrange - Service.ListWebTests(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWebTests(Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act await ExecuteCommandAsync("--subscription", "sub1", "--resource-group", "rg1"); // Assert - await Service.Received(1).ListWebTests("sub1", "rg1", Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListWebTests("sub1", "rg1", Arg.Any(), Arg.Any()); } #endregion @@ -316,7 +314,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ReturnsInternalServerError Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(expectedException); @@ -342,7 +339,6 @@ public async Task ExecuteAsync_ServiceThrowsException_LogsError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(expectedException); diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Workspace/WorkspaceListCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Workspace/WorkspaceListCommandTests.cs index ec3977782d..9fae22bbd2 100644 --- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Workspace/WorkspaceListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Workspace/WorkspaceListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Monitor.Commands.Workspace; using Azure.Mcp.Tools.Monitor.Models; using Azure.Mcp.Tools.Monitor.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -32,7 +31,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS new() { Name = "workspace1", CustomerId = "guid1" }, new() { Name = "workspace2", CustomerId = "guid2" } }; - Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(testWorkspaces); } @@ -62,7 +61,7 @@ public async Task ExecuteAsync_ReturnsWorkspacesList() new() { Name = "workspace2", CustomerId = "guid2" }, new() { Name = "workspace3", CustomerId = "guid3" } }; - Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(expectedWorkspaces); // Act @@ -70,7 +69,7 @@ public async Task ExecuteAsync_ReturnsWorkspacesList() // Assert // Verify the mock was called - await Service.Received(1).ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, MonitorJsonContext.Default.WorkspaceListCommandResult); @@ -85,7 +84,7 @@ public async Task ExecuteAsync_ReturnsWorkspacesList() public async Task ExecuteAsync_ReturnsEmptyWhenNoWorkspaces() { // Arrange - Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -101,7 +100,7 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoWorkspaces() public async Task ExecuteAsync_HandlesServiceErrors() { // Arrange - Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWorkspaces(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -118,7 +117,7 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( { // Arrange const string resourceGroup = "test-rg"; - Service.ListWorkspaces(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListWorkspaces(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -126,6 +125,6 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( // Assert Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).ListWorkspaces(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListWorkspaces(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.MySql/src/Services/MySqlService.cs b/tools/Azure.Mcp.Tools.MySql/src/Services/MySqlService.cs index e60896a6ff..270e641645 100644 --- a/tools/Azure.Mcp.Tools.MySql/src/Services/MySqlService.cs +++ b/tools/Azure.Mcp.Tools.MySql/src/Services/MySqlService.cs @@ -319,7 +319,7 @@ public async Task> GetTableSchemaAsync(string subscriptionId, strin public async Task> ListServersAsync(string subscriptionId, string resourceGroup, CancellationToken cancellationToken) { - var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, null, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, cancellationToken) ?? throw new KeyNotFoundException($"Resource group '{resourceGroup}' not found."); var serverList = new List(); @@ -364,7 +364,7 @@ public async Task GetTablesAsync(string subscriptionId, string public async Task GetServerConfigAsync(string subscriptionId, string resourceGroup, string server, CancellationToken cancellationToken) { - var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, null, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, cancellationToken) ?? throw new KeyNotFoundException($"Resource group '{resourceGroup}' not found."); var mysqlServer = await rg.GetMySqlFlexibleServerAsync(server, cancellationToken); @@ -384,7 +384,7 @@ public async Task GetServerConfigAsync(string subscriptionId, string res public async Task GetServerParameterAsync(string subscriptionId, string resourceGroup, string server, string param, CancellationToken cancellationToken) { - var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, null, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, cancellationToken) ?? throw new KeyNotFoundException($"Resource group '{resourceGroup}' not found."); var mysqlServer = await rg.GetMySqlFlexibleServerAsync(server, cancellationToken); @@ -399,7 +399,7 @@ public async Task GetServerParameterAsync(string subscriptionId, string public async Task SetServerParameterAsync(string subscriptionId, string resourceGroup, string server, string param, string value, CancellationToken cancellationToken) { - var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, null, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, null, cancellationToken) ?? throw new KeyNotFoundException($"Resource group '{resourceGroup}' not found."); var mysqlServer = await rg.GetMySqlFlexibleServerAsync(server, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.MySql/tests/Azure.Mcp.Tools.MySql.Tests/Services/MySqlServiceTests.cs b/tools/Azure.Mcp.Tools.MySql/tests/Azure.Mcp.Tools.MySql.Tests/Services/MySqlServiceTests.cs index b8c43652dd..ed39f92cd9 100644 --- a/tools/Azure.Mcp.Tools.MySql/tests/Azure.Mcp.Tools.MySql.Tests/Services/MySqlServiceTests.cs +++ b/tools/Azure.Mcp.Tools.MySql/tests/Azure.Mcp.Tools.MySql.Tests/Services/MySqlServiceTests.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.MySql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,7 +38,7 @@ public void Constructor_WithValidDependencies_CreatesInstance() public async Task ListServersAsync_WhenAzureServiceThrows_RethrowsException() { var exception = new InvalidOperationException("Resource group not found"); - _azureService.GetResourceGroupResource("sub123", "rg1", Arg.Any(), Arg.Any(), Arg.Any()).ThrowsAsync(exception); + _azureService.GetResourceGroupResource("sub123", "rg1", Arg.Any(), Arg.Any()).ThrowsAsync(exception); var thrownException = await Assert.ThrowsAsync(() => _mysqlService.ListServersAsync("sub123", "rg1", TestContext.Current.CancellationToken)); @@ -51,7 +50,7 @@ public async Task ListServersAsync_WhenAzureServiceThrows_RethrowsException() public async Task ListServersInSubscriptionAsync_WhenAzureServiceThrows_RethrowsException() { var exception = new InvalidOperationException("Subscription not found"); - _azureService.GetSubscription("sub123", Arg.Any(), Arg.Any(), Arg.Any()).ThrowsAsync(exception); + _azureService.GetSubscription("sub123", Arg.Any(), Arg.Any()).ThrowsAsync(exception); var thrownException = await Assert.ThrowsAsync(() => _mysqlService.ListServersInSubscriptionAsync("sub123", TestContext.Current.CancellationToken)); @@ -62,7 +61,7 @@ public async Task ListServersInSubscriptionAsync_WhenAzureServiceThrows_Rethrows [Fact] public async Task ListServersAsync_WhenResourceGroupNotFound_ThrowsKeyNotFoundException() { - _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any()) .Returns(Task.FromResult(null)); var ex = await Assert.ThrowsAsync(() => @@ -74,7 +73,7 @@ public async Task ListServersAsync_WhenResourceGroupNotFound_ThrowsKeyNotFoundEx [Fact] public async Task GetServerConfigAsync_WhenResourceGroupNotFound_ThrowsKeyNotFoundException() { - _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any()) .Returns(Task.FromResult(null)); var ex = await Assert.ThrowsAsync(() => @@ -86,7 +85,7 @@ public async Task GetServerConfigAsync_WhenResourceGroupNotFound_ThrowsKeyNotFou [Fact] public async Task GetServerParameterAsync_WhenResourceGroupNotFound_ThrowsKeyNotFoundException() { - _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any()) .Returns(Task.FromResult(null)); var ex = await Assert.ThrowsAsync(() => @@ -98,7 +97,7 @@ public async Task GetServerParameterAsync_WhenResourceGroupNotFound_ThrowsKeyNot [Fact] public async Task SetServerParameterAsync_WhenResourceGroupNotFound_ThrowsKeyNotFoundException() { - _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetResourceGroupResource("sub123", "missing-rg", Arg.Any(), Arg.Any()) .Returns(Task.FromResult(null)); var ex = await Assert.ThrowsAsync(() => diff --git a/tools/Azure.Mcp.Tools.Policy/src/Commands/Assignment/PolicyAssignmentListCommand.cs b/tools/Azure.Mcp.Tools.Policy/src/Commands/Assignment/PolicyAssignmentListCommand.cs index c453b5e08d..6c9a361035 100644 --- a/tools/Azure.Mcp.Tools.Policy/src/Commands/Assignment/PolicyAssignmentListCommand.cs +++ b/tools/Azure.Mcp.Tools.Policy/src/Commands/Assignment/PolicyAssignmentListCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Scope, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Policy/src/Options/Assignment/PolicyAssignmentListOptions.cs b/tools/Azure.Mcp.Tools.Policy/src/Options/Assignment/PolicyAssignmentListOptions.cs index 3ac891add3..67d1e06be4 100644 --- a/tools/Azure.Mcp.Tools.Policy/src/Options/Assignment/PolicyAssignmentListOptions.cs +++ b/tools/Azure.Mcp.Tools.Policy/src/Options/Assignment/PolicyAssignmentListOptions.cs @@ -17,6 +17,4 @@ public sealed class PolicyAssignmentListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Policy/src/Services/IPolicyService.cs b/tools/Azure.Mcp.Tools.Policy/src/Services/IPolicyService.cs index 02d40974fe..5c5170a982 100644 --- a/tools/Azure.Mcp.Tools.Policy/src/Services/IPolicyService.cs +++ b/tools/Azure.Mcp.Tools.Policy/src/Services/IPolicyService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Policy.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Policy.Services; @@ -14,14 +13,12 @@ public interface IPolicyService /// The subscription ID or name. /// Optional scope to filter policy assignments. If not provided, lists all assignments in the subscription. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// Optional cancellation token for the operation. /// A list of policy assignments. Task> ListPolicyAssignmentsAsync( string subscription, string? scope = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -29,12 +26,10 @@ Task> ListPolicyAssignmentsAsync( /// /// The resource ID of the policy definition. /// Optional tenant ID for cross-tenant operations. - /// Optional retry policy for the operation. /// Optional cancellation token for the operation. /// The policy definition or null if not found. Task GetPolicyDefinitionAsync( string policyDefinitionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Policy/src/Services/PolicyService.cs b/tools/Azure.Mcp.Tools.Policy/src/Services/PolicyService.cs index 1207fcb256..47ce8e5864 100644 --- a/tools/Azure.Mcp.Tools.Policy/src/Services/PolicyService.cs +++ b/tools/Azure.Mcp.Tools.Policy/src/Services/PolicyService.cs @@ -8,7 +8,6 @@ using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Policy.Services; @@ -21,11 +20,10 @@ public async Task> ListPolicyAssignmentsAsync( string subscription, string? scope = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var subscriptionResource = await AzureService.GetSubscription(subscription, tenantId, retryPolicy, cancellationToken); - var armClient = await CreateArmClientAsync(tenantId, retryPolicy, cancellationToken: cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenantId, cancellationToken); + var armClient = await CreateArmClientAsync(tenantId, null, cancellationToken: cancellationToken); var assignments = new List(); @@ -73,7 +71,6 @@ public async Task> ListPolicyAssignmentsAsync( result.PolicyDefinition = await GetPolicyDefinitionAsync( assignment.Data.PolicyDefinitionId, tenantId, - retryPolicy, cancellationToken); } catch (Exception ex) @@ -94,7 +91,6 @@ public async Task> ListPolicyAssignmentsAsync( public async Task GetPolicyDefinitionAsync( string policyDefinitionId, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var resourceId = new ResourceIdentifier(policyDefinitionId); @@ -113,7 +109,7 @@ public async Task> ListPolicyAssignmentsAsync( var subscriptionId = resourceId.SubscriptionId; if (!string.IsNullOrEmpty(subscriptionId)) { - var subscriptionResource = await AzureService.GetSubscription(subscriptionId, tenantId, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscriptionId, tenantId, cancellationToken); policyDefinitionResource = await subscriptionResource.GetSubscriptionPolicyDefinitionAsync(policyDefinitionName, cancellationToken); } } @@ -121,11 +117,11 @@ public async Task> ListPolicyAssignmentsAsync( { // Built-in (tenant-level) policy definition - try to get from any subscription's built-in definitions // Built-in policies are accessible from any subscription - var subscriptions = await AzureService.GetSubscriptions(tenantId, retryPolicy, cancellationToken); + var subscriptions = await AzureService.GetSubscriptions(tenantId, cancellationToken); if (subscriptions.Count > 0) { var firstSubscriptionId = subscriptions[0].SubscriptionId; - var subscriptionResource = await AzureService.GetSubscription(firstSubscriptionId, tenantId, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(firstSubscriptionId, tenantId, cancellationToken); policyDefinitionResource = await subscriptionResource.GetSubscriptionPolicyDefinitionAsync(policyDefinitionName, cancellationToken); } } diff --git a/tools/Azure.Mcp.Tools.Policy/tests/Azure.Mcp.Tools.Policy.Tests/Assignment/PolicyAssignmentListCommandTests.cs b/tools/Azure.Mcp.Tools.Policy/tests/Azure.Mcp.Tools.Policy.Tests/Assignment/PolicyAssignmentListCommandTests.cs index d53734376b..5ec31f2c51 100644 --- a/tools/Azure.Mcp.Tools.Policy/tests/Azure.Mcp.Tools.Policy.Tests/Assignment/PolicyAssignmentListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Policy/tests/Azure.Mcp.Tools.Policy.Tests/Assignment/PolicyAssignmentListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Policy.Commands.Assignment; using Azure.Mcp.Tools.Policy.Models; using Azure.Mcp.Tools.Policy.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -54,7 +53,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); } @@ -97,7 +95,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(assignments); @@ -119,7 +116,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); @@ -139,7 +135,6 @@ public async Task ExecuteAsync_WithScope_PassesScopeToService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -153,7 +148,6 @@ await Service.Received(1).ListPolicyAssignmentsAsync( "test-sub", scope, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -165,7 +159,6 @@ public async Task ExecuteAsync_WithoutScope_PassesNullScope() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -177,7 +170,6 @@ await Service.Received(1).ListPolicyAssignmentsAsync( "test-sub", null, Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -189,7 +181,6 @@ public async Task ExecuteAsync_ReturnsEmptyList_WhenNoAssignments() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); diff --git a/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerConfigGetCommand.cs b/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerConfigGetCommand.cs index 4808d6114d..9b6e12002c 100644 --- a/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerConfigGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerConfigGetCommand.cs @@ -32,7 +32,7 @@ public override async Task ExecuteAsync(CommandContext context, { try { - var config = await _postgresService.GetServerConfigAsync(options.Subscription!, options.ResourceGroup, options.User, options.Server, options.Tenant, options.RetryPolicy, cancellationToken); + var config = await _postgresService.GetServerConfigAsync(options.Subscription!, options.ResourceGroup, options.User, options.Server, options.Tenant, cancellationToken); context.Response.Results = config?.Length > 0 ? ResponseResult.Create(new(config), PostgresJsonContext.Default.ServerConfigGetCommandResult) : null; diff --git a/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamGetCommand.cs b/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamGetCommand.cs index 0d0f4356c3..20edbbde8a 100644 --- a/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamGetCommand.cs @@ -32,7 +32,7 @@ public override async Task ExecuteAsync(CommandContext context, { try { - var parameterValue = await _postgresService.GetServerParameterAsync(options.Subscription!, options.ResourceGroup, options.User, options.Server, options.Param, options.Tenant, options.RetryPolicy, cancellationToken); + var parameterValue = await _postgresService.GetServerParameterAsync(options.Subscription!, options.ResourceGroup, options.User, options.Server, options.Param, options.Tenant, cancellationToken); context.Response.Results = parameterValue?.Length > 0 ? ResponseResult.Create(new(parameterValue), PostgresJsonContext.Default.ServerParamGetCommandResult) : null; diff --git a/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamSetCommand.cs b/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamSetCommand.cs index 44d1c26a39..45eb94353b 100644 --- a/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamSetCommand.cs +++ b/tools/Azure.Mcp.Tools.Postgres/src/Commands/Server/ServerParamSetCommand.cs @@ -35,7 +35,7 @@ public override async Task ExecuteAsync(CommandContext context, { ServerParameterValidator.EnsureParameterAllowed(options.Param); - var result = await _postgresService.SetServerParameterAsync(options.Subscription!, options.ResourceGroup, options.User, options.Server, options.Param, options.Value, options.Tenant, options.RetryPolicy, cancellationToken); + var result = await _postgresService.SetServerParameterAsync(options.Subscription!, options.ResourceGroup, options.User, options.Server, options.Param, options.Value, options.Tenant, cancellationToken); context.Response.Results = !string.IsNullOrEmpty(result) ? ResponseResult.Create(new(result, options.Param!, options.Value!), PostgresJsonContext.Default.ServerParamSetCommandResult) : null; diff --git a/tools/Azure.Mcp.Tools.Postgres/src/Options/Server/BaseServerOptions.cs b/tools/Azure.Mcp.Tools.Postgres/src/Options/Server/BaseServerOptions.cs index b3063ee1a2..02647b3910 100644 --- a/tools/Azure.Mcp.Tools.Postgres/src/Options/Server/BaseServerOptions.cs +++ b/tools/Azure.Mcp.Tools.Postgres/src/Options/Server/BaseServerOptions.cs @@ -23,6 +23,4 @@ public class BaseServerOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Postgres/src/Services/IPostgresService.cs b/tools/Azure.Mcp.Tools.Postgres/src/Services/IPostgresService.cs index 87ab843c9a..8387dfaee4 100644 --- a/tools/Azure.Mcp.Tools.Postgres/src/Services/IPostgresService.cs +++ b/tools/Azure.Mcp.Tools.Postgres/src/Services/IPostgresService.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using Microsoft.Mcp.Core.Options; - namespace Azure.Mcp.Tools.Postgres.Services; public interface IPostgresService @@ -52,7 +50,6 @@ Task GetServerConfigAsync( string user, string server, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetServerParameterAsync( @@ -62,7 +59,6 @@ Task GetServerParameterAsync( string server, string param, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task SetServerParameterAsync( @@ -73,6 +69,5 @@ Task SetServerParameterAsync( string param, string value, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Postgres/src/Services/PostgresService.cs b/tools/Azure.Mcp.Tools.Postgres/src/Services/PostgresService.cs index 0d230e4351..ef9469b020 100644 --- a/tools/Azure.Mcp.Tools.Postgres/src/Services/PostgresService.cs +++ b/tools/Azure.Mcp.Tools.Postgres/src/Services/PostgresService.cs @@ -12,7 +12,6 @@ using Azure.ResourceManager.Resources; using Microsoft.Mcp.Core.Commands; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; using Npgsql; @@ -267,10 +266,9 @@ public async Task GetServerConfigAsync( string user, string server, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found."); var pgServer = await rg.GetPostgreSqlFlexibleServerAsync(server, cancellationToken); @@ -292,10 +290,9 @@ public async Task GetServerParameterAsync( string server, string param, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found."); var pgServer = await rg.GetPostgreSqlFlexibleServerAsync(server, cancellationToken); @@ -316,10 +313,9 @@ public async Task SetServerParameterAsync( string param, string value, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, cancellationToken) + var rg = await AzureService.GetResourceGroupResource(subscriptionId, resourceGroup, tenant, cancellationToken) ?? throw new Exception($"Resource group '{resourceGroup}' not found."); var pgServer = await rg.GetPostgreSqlFlexibleServerAsync(server, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerConfigGetCommandTests.cs b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerConfigGetCommandTests.cs index bf474b1c3a..24f42bac3f 100644 --- a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerConfigGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerConfigGetCommandTests.cs @@ -18,7 +18,7 @@ public class ServerConfigGetCommandTests : SubscriptionCommandUnitTestsBase(), Arg.Any(), Arg.Any()).Returns(expectedConfig); + Service.GetServerConfigAsync("sub123", "rg1", "user1", "server123", Arg.Any(), Arg.Any()).Returns(expectedConfig); var response = await ExecuteCommandAsync( "--subscription", "sub123", @@ -33,7 +33,7 @@ public async Task ExecuteAsync_ReturnsConfig_WhenConfigExists() [Fact] public async Task ExecuteAsync_ReturnsNull_WhenConfigDoesNotExist() { - Service.GetServerConfigAsync("sub123", "rg1", "user1", "server123", Arg.Any(), Arg.Any(), Arg.Any()).Returns(""); + Service.GetServerConfigAsync("sub123", "rg1", "user1", "server123", Arg.Any(), Arg.Any()).Returns(""); var response = await ExecuteCommandAsync( "--subscription", "sub123", @@ -67,18 +67,17 @@ public async Task ExecuteAsync_ReturnsError_WhenParameterIsMissing(string missin } [Fact] - public async Task ExecuteAsync_ForwardsTenantAndRetryPolicy() + public async Task ExecuteAsync_ForwardsTenant() { - Service.GetServerConfigAsync("sub123", "rg1", "user1", "server123", Arg.Any(), Arg.Any(), Arg.Any()).Returns("config123"); + Service.GetServerConfigAsync("sub123", "rg1", "user1", "server123", Arg.Any(), Arg.Any()).Returns("config123"); await ExecuteCommandAsync( "--subscription", "sub123", "--resource-group", "rg1", "--user", "user1", "--server", "server123", - "--tenant", "tenant123", - "--retry-max-retries", "3"); + "--tenant", "tenant123"); - await Service.Received(1).GetServerConfigAsync("sub123", "rg1", "user1", "server123", "tenant123", Arg.Is(p => p != null && p.MaxRetries == 3), Arg.Any()); + await Service.Received(1).GetServerConfigAsync("sub123", "rg1", "user1", "server123", "tenant123", Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamGetCommandTests.cs b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamGetCommandTests.cs index ae7d4ac52a..9cfab6978c 100644 --- a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamGetCommandTests.cs @@ -18,7 +18,7 @@ public class ServerParamGetCommandTests : SubscriptionCommandUnitTestsBase(), Arg.Any(), Arg.Any()).Returns(expectedValue); + Service.GetServerParameterAsync("sub123", "rg1", "user1", "server123", "param123", Arg.Any(), Arg.Any()).Returns(expectedValue); var response = await ExecuteCommandAsync( "--subscription", "sub123", @@ -34,7 +34,7 @@ public async Task ExecuteAsync_ReturnsParamValue_WhenParamExists() [Fact] public async Task ExecuteAsync_ReturnsNull_WhenParamDoesNotExist() { - Service.GetServerParameterAsync("sub123", "rg1", "user1", "server123", "param123", Arg.Any(), Arg.Any(), Arg.Any()).Returns(""); + Service.GetServerParameterAsync("sub123", "rg1", "user1", "server123", "param123", Arg.Any(), Arg.Any()).Returns(""); var response = await ExecuteCommandAsync( "--subscription", "sub123", "--resource-group", "rg1", @@ -70,9 +70,9 @@ public async Task ExecuteAsync_ReturnsError_WhenParameterIsMissing(string missin } [Fact] - public async Task ExecuteAsync_ForwardsTenantAndRetryPolicy() + public async Task ExecuteAsync_ForwardsTenant() { - Service.GetServerParameterAsync("sub123", "rg1", "user1", "server123", "param123", Arg.Any(), Arg.Any(), Arg.Any()).Returns("value123"); + Service.GetServerParameterAsync("sub123", "rg1", "user1", "server123", "param123", Arg.Any(), Arg.Any()).Returns("value123"); await ExecuteCommandAsync( "--subscription", "sub123", @@ -80,9 +80,8 @@ await ExecuteCommandAsync( "--user", "user1", "--server", "server123", "--param", "param123", - "--tenant", "tenant123", - "--retry-max-retries", "3"); + "--tenant", "tenant123"); - await Service.Received(1).GetServerParameterAsync("sub123", "rg1", "user1", "server123", "param123", "tenant123", Arg.Is(p => p != null && p.MaxRetries == 3), Arg.Any()); + await Service.Received(1).GetServerParameterAsync("sub123", "rg1", "user1", "server123", "param123", "tenant123", Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamSetCommandTests.cs b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamSetCommandTests.cs index 09c6becb74..1dd88ef332 100644 --- a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamSetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Server/ServerParamSetCommandTests.cs @@ -20,7 +20,7 @@ public class ServerParamSetCommandTests : SubscriptionCommandUnitTestsBase(), Arg.Any(), Arg.Any()).Returns(expectedMessage); + Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "work_mem", "256MB", Arg.Any(), Arg.Any()).Returns(expectedMessage); var response = await ExecuteCommandAsync( "--subscription", "sub123", @@ -40,7 +40,7 @@ public async Task ExecuteAsync_ReturnsSuccessMessage_WhenParamIsSet() [Fact] public async Task ExecuteAsync_ReturnsNull_WhenParamDoesNotExist() { - Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "shared_buffers", "512MB", Arg.Any(), Arg.Any(), Arg.Any()).Returns(""); + Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "shared_buffers", "512MB", Arg.Any(), Arg.Any()).Returns(""); var response = await ExecuteCommandAsync( "--subscription", "sub123", @@ -83,7 +83,7 @@ public async Task ExecuteAsync_ReturnsError_WhenParameterIsMissing(string missin public async Task ExecuteAsync_CallsServiceWithCorrectParameters() { var expectedMessage = "Parameter updated successfully."; - Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", Arg.Any(), Arg.Any(), Arg.Any()).Returns(expectedMessage); + Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", Arg.Any(), Arg.Any()).Returns(expectedMessage); await ExecuteCommandAsync( "--subscription", "sub123", @@ -93,13 +93,13 @@ await ExecuteCommandAsync( "--param", "max_connections", "--value", "200"); - await Service.Received(1).SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", Arg.Any(), Arg.Any()); } [Fact] - public async Task ExecuteAsync_ForwardsTenantAndRetryPolicy() + public async Task ExecuteAsync_ForwardsTenant() { - Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", Arg.Any(), Arg.Any(), Arg.Any()).Returns("ok"); + Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", Arg.Any(), Arg.Any()).Returns("ok"); await ExecuteCommandAsync( "--subscription", "sub123", @@ -108,10 +108,9 @@ await ExecuteCommandAsync( "--server", "server123", "--param", "max_connections", "--value", "200", - "--tenant", "tenant123", - "--retry-max-retries", "3"); + "--tenant", "tenant123"); - await Service.Received(1).SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", "tenant123", Arg.Is(p => p != null && p.MaxRetries == 3), Arg.Any()); + await Service.Received(1).SetServerParameterAsync("sub123", "rg1", "user1", "server123", "max_connections", "200", "tenant123", Arg.Any()); } [Theory] @@ -136,14 +135,14 @@ public async Task ExecuteAsync_ReturnsError_WhenSecuritySensitiveParameterIsUsed Assert.NotNull(response); Assert.Equal(HttpStatusCode.Forbidden, response.Status); Assert.Contains("security-sensitive", response.Message); - await Service.DidNotReceiveWithAnyArgs().SetServerParameterAsync("", "", "", "", "", "", null, null, TestContext.Current.CancellationToken); + await Service.DidNotReceiveWithAnyArgs().SetServerParameterAsync("", "", "", "", "", "", null, TestContext.Current.CancellationToken); } [Fact] public async Task ExecuteAsync_AllowsNonBlockedParameters() { var expectedMessage = "Parameter 'custom_setting' updated successfully."; - Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "custom_setting", "42", Arg.Any(), Arg.Any(), Arg.Any()).Returns(expectedMessage); + Service.SetServerParameterAsync("sub123", "rg1", "user1", "server123", "custom_setting", "42", Arg.Any(), Arg.Any()).Returns(expectedMessage); var response = await ExecuteCommandAsync( "--subscription", "sub123", diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceTests.cs b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceTests.cs index 1ce538f1ae..32518f59aa 100644 --- a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceTests.cs @@ -221,57 +221,54 @@ public async Task ListTablesAsync_UsesParameterizedSchemaQuery_AndDefaultsAreNot } [Fact] - public async Task GetServerConfigAsync_ForwardsTenantAndRetryPolicy() + public async Task GetServerConfigAsync_ForwardsTenant() { // Arrange var tenant = "tenant123"; - var retryPolicy = new Microsoft.Mcp.Core.Options.RetryPolicyOptions(); _azureService - .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, Arg.Any()) + .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, Arg.Any()) .Returns((ResourceGroupResource?)null); // Act & Assert — resource group lookup happens first; null triggers the exception await Assert.ThrowsAsync(() => - _postgresService.GetServerConfigAsync(subscriptionId, resourceGroup, user, server, tenant, retryPolicy, TestContext.Current.CancellationToken)); + _postgresService.GetServerConfigAsync(subscriptionId, resourceGroup, user, server, tenant, TestContext.Current.CancellationToken)); await _azureService.Received(1) - .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, Arg.Any()); + .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, Arg.Any()); } [Fact] - public async Task GetServerParameterAsync_ForwardsTenantAndRetryPolicy() + public async Task GetServerParameterAsync_ForwardsTenant() { // Arrange var tenant = "tenant123"; - var retryPolicy = new Microsoft.Mcp.Core.Options.RetryPolicyOptions(); _azureService - .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, Arg.Any()) + .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, Arg.Any()) .Returns((ResourceGroupResource?)null); // Act & Assert await Assert.ThrowsAsync(() => - _postgresService.GetServerParameterAsync(subscriptionId, resourceGroup, user, server, "param123", tenant, retryPolicy, TestContext.Current.CancellationToken)); + _postgresService.GetServerParameterAsync(subscriptionId, resourceGroup, user, server, "param123", tenant, TestContext.Current.CancellationToken)); await _azureService.Received(1) - .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, Arg.Any()); + .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, Arg.Any()); } [Fact] - public async Task SetServerParameterAsync_ForwardsTenantAndRetryPolicy() + public async Task SetServerParameterAsync_ForwardsTenant() { // Arrange var tenant = "tenant123"; - var retryPolicy = new Microsoft.Mcp.Core.Options.RetryPolicyOptions(); _azureService - .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, Arg.Any()) + .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, Arg.Any()) .Returns((ResourceGroupResource?)null); // Act & Assert await Assert.ThrowsAsync(() => - _postgresService.SetServerParameterAsync(subscriptionId, resourceGroup, user, server, "param123", "value123", tenant, retryPolicy, TestContext.Current.CancellationToken)); + _postgresService.SetServerParameterAsync(subscriptionId, resourceGroup, user, server, "param123", "value123", tenant, TestContext.Current.CancellationToken)); await _azureService.Received(1) - .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, retryPolicy, Arg.Any()); + .GetResourceGroupResource(subscriptionId, resourceGroup, tenant, Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceCreateCommand.cs b/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceCreateCommand.cs index 14a8f4747c..e3aba3e942 100644 --- a/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceCreateCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.PublicNetworkAccess ?? false, options.Modules, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceListCommand.cs b/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceListCommand.cs index d1a4e34287..bdf7a33a5a 100644 --- a/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceListCommand.cs +++ b/tools/Azure.Mcp.Tools.Redis/src/Commands/ResourceListCommand.cs @@ -39,7 +39,6 @@ public override async Task ExecuteAsync(CommandContext context, var resources = await _redisService.ListResourcesAsync( options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(resources ?? []), RedisJsonContext.Default.ResourceListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceCreateOptions.cs b/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceCreateOptions.cs index 3f9eccb1d6..258131a465 100644 --- a/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceCreateOptions.cs @@ -53,6 +53,4 @@ public sealed class ResourceCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceListOptions.cs b/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceListOptions.cs index 1963126778..6577829138 100644 --- a/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceListOptions.cs +++ b/tools/Azure.Mcp.Tools.Redis/src/Options/ResourceListOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Azure.Mcp.Core.Options; @@ -14,6 +14,4 @@ public sealed class ResourceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Redis/src/Services/IRedisService.cs b/tools/Azure.Mcp.Tools.Redis/src/Services/IRedisService.cs index 2bde1827b6..23788a738a 100644 --- a/tools/Azure.Mcp.Tools.Redis/src/Services/IRedisService.cs +++ b/tools/Azure.Mcp.Tools.Redis/src/Services/IRedisService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Redis.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Redis.Services; @@ -13,14 +12,12 @@ public interface IRedisService /// /// The subscription ID or name /// Optional tenant ID for cross-tenant operations - /// Optional retry policy configuration /// A cancellation token /// List of Redis resource details /// When the service request fails Task> ListResourcesAsync( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -36,7 +33,6 @@ Task> ListResourcesAsync( /// Whether to enable public network access (default false) /// The modules to enable (e.g. "RedisJSON", "RedisBloom") /// Optional tenant ID for cross-tenant operations - /// Optional retry policy configuration /// A cancellation token /// Details of the Redis resource being created. /// When the service request fails @@ -50,6 +46,5 @@ Task CreateResourceAsync( bool? publicNetworkAccessEnabled = false, string[]? modules = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Redis/src/Services/RedisService.cs b/tools/Azure.Mcp.Tools.Redis/src/Services/RedisService.cs index 17a0ce388e..423d26d45d 100644 --- a/tools/Azure.Mcp.Tools.Redis/src/Services/RedisService.cs +++ b/tools/Azure.Mcp.Tools.Redis/src/Services/RedisService.cs @@ -14,7 +14,6 @@ using Azure.ResourceManager.Resources.Models; using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Models.Identity; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Redis.Services; @@ -24,12 +23,11 @@ public class RedisService(IAzureService _azureService, ILogger _lo public async Task> ListResourcesAsync( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new KeyNotFoundException($"Subscription '{subscription}' not found"); var resources = new List(); @@ -70,7 +68,6 @@ public async Task CreateResourceAsync( bool? publicNetworkAccessEnabled = false, string[]? modules = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default ) { @@ -86,7 +83,7 @@ public async Task CreateResourceAsync( sku = "Balanced_B0"; } - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new KeyNotFoundException($"Subscription '{subscription}' not found"); var resourceGroups = subscriptionResource.GetResourceGroups(); diff --git a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisCommandTests.cs b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisCommandTests.cs index e8991e14bd..fbdea8ff1e 100644 --- a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisCommandTests.cs @@ -90,19 +90,4 @@ public async Task Should_list_redis_caches_by_subscription_id_with_tenant_name() Assert.Equal(JsonValueKind.Array, caches.ValueKind); } - [Fact] - public async Task Should_list_redis_caches_with_retry_policy() - { - var result = await CallToolAsync( - "redis_list", - new() - { - { "subscription", Settings.SubscriptionId }, - { "retry-max-retries", 3 }, - { "retry-delay", 2 } - }); - - var caches = result.AssertProperty("resources"); - Assert.Equal(JsonValueKind.Array, caches.ValueKind); - } } diff --git a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisServiceTests.cs b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisServiceTests.cs index 1b9f9ed932..016d181989 100644 --- a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/RedisServiceTests.cs @@ -7,7 +7,6 @@ using Azure.ResourceManager.Redis.Models; using Azure.ResourceManager.Resources; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using NSubstitute; using Xunit; @@ -24,7 +23,7 @@ public async Task ListResourcesAsync_ThrowsKeyNotFoundException_WhenSubscription // Arrange - GetSubscription returning null should surface as a typed // not-found exception (404) rather than a plain Exception (500). See #458. var azureService = Substitute.For(); - azureService.GetSubscription("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + azureService.GetSubscription("sub123", Arg.Any(), Arg.Any()) .Returns((SubscriptionResource)null!); var service = CreateService(azureService); @@ -39,7 +38,7 @@ public async Task CreateResourceAsync_ThrowsKeyNotFoundException_WhenSubscriptio { // Arrange var azureService = Substitute.For(); - azureService.GetSubscription("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + azureService.GetSubscription("sub123", Arg.Any(), Arg.Any()) .Returns((SubscriptionResource)null!); var service = CreateService(azureService); diff --git a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceCreateCommandTests.cs index e0172ba23a..05a9117d8f 100644 --- a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Redis.Commands; using Azure.Mcp.Tools.Redis.Models; using Azure.Mcp.Tools.Redis.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new Resource { Name = "test-redis" }); } @@ -79,7 +77,6 @@ public async Task ExecuteAsync_CreatesResource_WithBasicParameters() false, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResource); @@ -112,7 +109,6 @@ await Service.Received(1).CreateResourceAsync( false, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -132,7 +128,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Resource group 'test-rg' not found")); @@ -159,7 +154,6 @@ await Service.Received(1).CreateResourceAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -192,7 +186,6 @@ public async Task ExecuteAsync_CreatesResource_WithModules() modules.Contains("RedisBloom") && modules.Contains("RedisJSON")), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResource); @@ -225,7 +218,6 @@ await Service.Received(1).CreateResourceAsync( modules.Contains("RedisBloom") && modules.Contains("RedisJSON")), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -254,7 +246,6 @@ public async Task ExecuteAsync_CreatesResource_WithAccessKeyAuthenticationEnable Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResource); @@ -283,7 +274,6 @@ await Service.Received(1).CreateResourceAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -312,7 +302,6 @@ public async Task ExecuteAsync_CreatesResource_WithPublicNetworkAccessEnabled() true, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResource); @@ -341,7 +330,6 @@ await Service.Received(1).CreateResourceAsync( true, Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -373,7 +361,6 @@ public async Task ExecuteAsync_CreatesResource_WithAllOptionalParameters() modules.Length == 1 && modules.Contains("RedisJSON")), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResource); @@ -406,7 +393,6 @@ await Service.Received(1).CreateResourceAsync( modules.Length == 1 && modules.Contains("RedisJSON")), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -424,7 +410,6 @@ public async Task ExecuteAsync_ReturnsNotFound_WhenResourceGroupNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new KeyNotFoundException("Resource group 'test-rg' not found in subscription 'sub123'")); diff --git a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceListCommandTests.cs b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceListCommandTests.cs index 408c8fd1d1..1d3da6015a 100644 --- a/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Redis/tests/Azure.Mcp.Tools.Redis.Tests/ResourceListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Redis.Models.CacheForRedis; using Azure.Mcp.Tools.Redis.Models.ManagedRedis; using Azure.Mcp.Tools.Redis.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -36,7 +35,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Service.ListResourcesAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); } @@ -51,7 +49,7 @@ public async Task ExecuteAsync_ReturnsCaches_WhenCachesExist() { // Arrange var expectedCaches = new CacheModel[] { new() { Name = "cache1" }, new() { Name = "cache2" } }; - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .Returns(expectedCaches); // Act @@ -69,7 +67,7 @@ public async Task ExecuteAsync_ReturnsCaches_WhenCachesExist() public async Task ExecuteAsync_ReturnsEmpty_WhenNoCaches() { // Arrange - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()).Returns([]); + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()).Returns([]); // Act var response = await ExecuteCommandAsync("--subscription", "sub123"); @@ -85,7 +83,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() { // Arrange var expectedError = "Test error. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -101,7 +99,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() public async Task ExecuteAsync_ReturnsNotFound_WhenSubscriptionNotFound() { // Arrange - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .ThrowsAsync(new KeyNotFoundException("Subscription 'sub123' not found")); // Act @@ -116,7 +114,7 @@ public async Task ExecuteAsync_ReturnsNotFound_WhenSubscriptionNotFound() public async Task ExecuteAsync_PreservesStatusCode_WhenRequestFailedException() { // Arrange - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException(403, "Forbidden")); // Act @@ -138,7 +136,7 @@ public async Task ExecuteAsync_ReturnsAccessPolicyAssignments_WhenAssignmentsExi }; var expectedCaches = new CacheModel[] { new() { Name = "cache1" }, new() { Name = "cache2", AccessPolicyAssignments = expectedAssignments } }; - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .Returns(expectedCaches); // Act @@ -164,7 +162,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoAccessPolicyAssignments() { // Arrange var expectedCaches = new CacheModel[] { new() { Name = "cache1" } }; - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .Returns(expectedCaches); // Act @@ -209,7 +207,7 @@ public async Task ExecuteAsync_ReturnsDatabases_WhenDatabasesExist() var expectedCaches = new CacheModel[] { new() { Name = "cache1", Databases = expectedDatabases } }; - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .Returns(expectedCaches); // Act @@ -235,7 +233,7 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoDatabases() // Arrange var expectedCaches = new CacheModel[] { new() { Name = "cache1" } }; - Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListResourcesAsync("sub123", Arg.Any(), Arg.Any()) .Returns(expectedCaches); // Act diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/DrillGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/DrillGetCommand.cs index 96aa86c5a7..25f606b52a 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/DrillGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/DrillGetCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, var drills = await _resilienceManagementService.ListDrillsAsync( options.ServiceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); result = new DrillGetCommandResult(Drills: drills.ToList()); } @@ -52,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new DrillGetCommandResult(Drill: drill); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/Resources/DrillResourceGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/Resources/DrillResourceGetCommand.cs index faf387cb03..259430d983 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/Resources/DrillResourceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Drills/Resources/DrillResourceGetCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.Drill, options.Tenant, - options.RetryPolicy, cancellationToken); result = new DrillResourceGetCommandResult(DrillResources: drillResources.ToList()); } @@ -55,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Drill, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new DrillResourceGetCommandResult(DrillResource: drillResource); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Assignments/GoalAssignmentGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Assignments/GoalAssignmentGetCommand.cs index 69df59d53d..872ea4312a 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Assignments/GoalAssignmentGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Assignments/GoalAssignmentGetCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, var goalAssignments = await _resilienceManagementService.ListGoalAssignmentsAsync( options.ServiceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); result = new GoalAssignmentGetCommandResult(GoalAssignments: goalAssignments.ToList()); } @@ -52,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new GoalAssignmentGetCommandResult(GoalAssignment: goalAssignment); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Resources/GoalResourceGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Resources/GoalResourceGetCommand.cs index 715e1d708f..236660f055 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Resources/GoalResourceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Resources/GoalResourceGetCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.GoalAssignment, options.Tenant, - options.RetryPolicy, cancellationToken); result = new GoalResourceGetCommandResult(GoalResources: goalResources.ToList()); } @@ -55,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.GoalAssignment, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new GoalResourceGetCommandResult(GoalResource: goalResource); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Templates/GoalTemplateGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Templates/GoalTemplateGetCommand.cs index 5ffd9edfd8..a98cd05b21 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Templates/GoalTemplateGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Templates/GoalTemplateGetCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, var goalTemplates = await _resilienceManagementService.ListGoalTemplatesAsync( options.ServiceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); result = new GoalTemplateGetCommandResult(GoalTemplates: goalTemplates.ToList()); } @@ -53,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new GoalTemplateGetCommandResult(GoalTemplate: goalTemplate); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/RecoveryJobGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/RecoveryJobGetCommand.cs index acd1bd83bf..e3ffdea468 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/RecoveryJobGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/RecoveryJobGetCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.RecoveryPlan, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryJobGetCommandResult(RecoveryJobs: recoveryJobs.ToList()); } @@ -55,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.RecoveryPlan, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryJobGetCommandResult(RecoveryJob: recoveryJob); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/Resources/RecoveryJobResourceGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/Resources/RecoveryJobResourceGetCommand.cs index 4b8d7b8999..5e52fdca8c 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/Resources/RecoveryJobResourceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Jobs/Resources/RecoveryJobResourceGetCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.RecoveryPlan, options.RecoveryJob, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryJobResourceGetCommandResult(RecoveryJobResources: recoveryJobResources.ToList()); } @@ -57,7 +56,6 @@ public override async Task ExecuteAsync(CommandContext context, options.RecoveryJob, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryJobResourceGetCommandResult(RecoveryJobResource: recoveryJobResource); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanCreateCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanCreateCommand.cs index bf9d7ca2d2..b5e797edf3 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanCreateCommand.cs @@ -91,7 +91,6 @@ public override async Task ExecuteAsync(CommandContext context, options.UserAssignedIdentity, options.DefaultGroupDescription, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanDeleteCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanDeleteCommand.cs index 6336852336..8b8c2066ea 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanDeleteCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.RecoveryPlan, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanGetCommand.cs index 3b2fac69dd..d854c8acc6 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanGetCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, var recoveryPlans = await _resilienceManagementService.ListRecoveryPlansAsync( options.ServiceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryPlanGetCommandResult(RecoveryPlans: recoveryPlans.ToList()); } @@ -53,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryPlanGetCommandResult(RecoveryPlan: recoveryPlan); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanUpdateResourcesCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanUpdateResourcesCommand.cs index c5b72329ce..eb05df2364 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanUpdateResourcesCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanUpdateResourcesCommand.cs @@ -66,7 +66,6 @@ public override async Task ExecuteAsync(CommandContext context, options.RecoveryPlan, content, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/Resources/RecoveryResourceGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/Resources/RecoveryResourceGetCommand.cs index 7ee4be7028..8eda695e1c 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/Resources/RecoveryResourceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/Resources/RecoveryResourceGetCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.RecoveryPlan, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryResourceGetCommandResult(RecoveryResources: recoveryResources.ToList()); } @@ -55,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.RecoveryPlan, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); result = new RecoveryResourceGetCommandResult(RecoveryResource: recoveryResource); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommand.cs index 000a1b9d84..1711398fc5 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommand.cs @@ -59,7 +59,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServiceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommand.cs index 90e2885ce6..a7e5289c23 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.UsagePlan, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); result = new UsagePlanEnrollmentGetCommandResult(Enrollments: enrollments.ToList()); } @@ -58,7 +57,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); result = new UsagePlanEnrollmentGetCommandResult(Enrollment: enrollment); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanCreateCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanCreateCommand.cs index e402efe916..b1fee71b00 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanCreateCommand.cs @@ -56,7 +56,6 @@ public override async Task ExecuteAsync(CommandContext context, options.PlanType, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanGetCommand.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanGetCommand.cs index a04c9540f4..d5c8a1e4cf 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanGetCommand.cs @@ -52,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); result = new UsagePlanGetCommandResult(UsagePlan: usagePlan); } @@ -62,7 +61,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); result = new UsagePlanGetCommandResult(UsagePlans: usagePlans.ToList()); } @@ -71,7 +69,6 @@ public override async Task ExecuteAsync(CommandContext context, var usagePlans = await _resilienceManagementService.ListUsagePlansBySubscriptionAsync( options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); result = new UsagePlanGetCommandResult(UsagePlans: usagePlans.ToList()); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/DrillGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/DrillGetOption.cs index f5e44e96d0..68f1a54eb5 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/DrillGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/DrillGetOption.cs @@ -17,6 +17,4 @@ public sealed class DrillGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Resources/DrillResourceGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Resources/DrillResourceGetOption.cs index 3c14c491ce..0d813eced7 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Resources/DrillResourceGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Resources/DrillResourceGetOption.cs @@ -20,6 +20,4 @@ public sealed class DrillResourceGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Assignments/GoalAssignmentGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Assignments/GoalAssignmentGetOption.cs index 6a32f17289..fa4f049389 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Assignments/GoalAssignmentGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Assignments/GoalAssignmentGetOption.cs @@ -17,6 +17,4 @@ public sealed class GoalAssignmentGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Resources/GoalResourceGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Resources/GoalResourceGetOption.cs index 6bc21deb3f..4f56f0303e 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Resources/GoalResourceGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Resources/GoalResourceGetOption.cs @@ -20,6 +20,4 @@ public sealed class GoalResourceGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Templates/GoalTemplateGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Templates/GoalTemplateGetOption.cs index 3ecb38f19f..5cde4ed9a4 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Templates/GoalTemplateGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Templates/GoalTemplateGetOption.cs @@ -17,6 +17,4 @@ public sealed class GoalTemplateGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/RecoveryJobGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/RecoveryJobGetOption.cs index e13c5f4f49..9fe2d1bbed 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/RecoveryJobGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/RecoveryJobGetOption.cs @@ -20,6 +20,4 @@ public sealed class RecoveryJobGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/Resources/RecoveryJobResourceGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/Resources/RecoveryJobResourceGetOption.cs index 888df8d2c5..36a582a6ca 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/Resources/RecoveryJobResourceGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/Resources/RecoveryJobResourceGetOption.cs @@ -23,6 +23,4 @@ public sealed class RecoveryJobResourceGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCreateOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCreateOption.cs index 9dd5a07b94..46a7bd0686 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCreateOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCreateOption.cs @@ -33,6 +33,4 @@ public sealed class RecoveryPlanCreateOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanDeleteOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanDeleteOption.cs index 7980c3fb47..d7cfff2588 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanDeleteOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanDeleteOption.cs @@ -17,6 +17,4 @@ public sealed class RecoveryPlanDeleteOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanGetOption.cs index 928dbef39f..4e567230ff 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanGetOption.cs @@ -17,6 +17,4 @@ public sealed class RecoveryPlanGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanUpdateResourcesOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanUpdateResourcesOption.cs index 60980275cb..e67dddf2a0 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanUpdateResourcesOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanUpdateResourcesOption.cs @@ -31,6 +31,4 @@ public sealed class RecoveryPlanUpdateResourcesOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/Resources/RecoveryResourceGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/Resources/RecoveryResourceGetOption.cs index 0f4de09907..883498531a 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/Resources/RecoveryResourceGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/Resources/RecoveryResourceGetOption.cs @@ -20,6 +20,4 @@ public sealed class RecoveryResourceGetOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentCreateOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentCreateOption.cs index 81811e1bc8..6d5d3ef220 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentCreateOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentCreateOption.cs @@ -26,6 +26,4 @@ public class UsagePlanEnrollmentCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentGetOption.cs index b4fdeccdca..5a9f74b171 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentGetOption.cs @@ -23,6 +23,4 @@ public sealed class UsagePlanEnrollmentGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanCreateOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanCreateOption.cs index de94614b3c..d48314dd4a 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanCreateOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanCreateOption.cs @@ -24,6 +24,4 @@ public class UsagePlanCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanGetOption.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanGetOption.cs index 1e5853de9c..dc72629052 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanGetOption.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanGetOption.cs @@ -20,6 +20,4 @@ public sealed class UsagePlanGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs index d94ebed658..984cee9827 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs @@ -4,65 +4,64 @@ using System.Text.Json; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.ResourceManager.ResilienceManagement.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ResilienceManagement.Services; public interface IResilienceManagementService { - Task> ListGoalTemplatesAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListGoalTemplatesAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default); - Task GetGoalTemplateAsync(string serviceGroup, string goalTemplate, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetGoalTemplateAsync(string serviceGroup, string goalTemplate, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListGoalAssignmentsAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListGoalAssignmentsAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default); - Task GetGoalAssignmentAsync(string serviceGroup, string goalAssignment, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetGoalAssignmentAsync(string serviceGroup, string goalAssignment, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListUsagePlansAsync(string resourceGroup, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListUsagePlansAsync(string resourceGroup, string subscription, string? tenant = null, CancellationToken cancellationToken = default); - Task GetUsagePlanAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetUsagePlanAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListUsagePlansBySubscriptionAsync(string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListUsagePlansBySubscriptionAsync(string subscription, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListUsagePlanEnrollmentsAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListUsagePlanEnrollmentsAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, CancellationToken cancellationToken = default); - Task GetUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string subscription, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListGoalResourcesAsync(string serviceGroup, string goalAssignment, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListGoalResourcesAsync(string serviceGroup, string goalAssignment, string? tenant = null, CancellationToken cancellationToken = default); - Task GetGoalResourceAsync(string serviceGroup, string goalAssignment, string goalResource, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetGoalResourceAsync(string serviceGroup, string goalAssignment, string goalResource, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListRecoveryPlansAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListRecoveryPlansAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default); - Task GetRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default); - Task CreateRecoveryPlanAsync(string serviceGroup, string recoveryPlan, RecoveryPlanKind planType, string? planDescription, RecoveryPlanIdentityKind identityType, string? userAssignedIdentity = null, string? defaultGroupDescription = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task CreateRecoveryPlanAsync(string serviceGroup, string recoveryPlan, RecoveryPlanKind planType, string? planDescription, RecoveryPlanIdentityKind identityType, string? userAssignedIdentity = null, string? defaultGroupDescription = null, string? tenant = null, CancellationToken cancellationToken = default); - Task DeleteRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task DeleteRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default); - Task UpdateRecoveryPlanResourcesAsync(string serviceGroup, string recoveryPlan, UpdateRecoveryResourcesContent content, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task UpdateRecoveryPlanResourcesAsync(string serviceGroup, string recoveryPlan, UpdateRecoveryResourcesContent content, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListRecoveryResourcesAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListRecoveryResourcesAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default); - Task GetRecoveryResourceAsync(string serviceGroup, string recoveryPlan, string recoveryResource, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetRecoveryResourceAsync(string serviceGroup, string recoveryPlan, string recoveryResource, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListRecoveryJobsAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListRecoveryJobsAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default); - Task GetRecoveryJobAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetRecoveryJobAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListRecoveryJobResourcesAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListRecoveryJobResourcesAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, CancellationToken cancellationToken = default); - Task GetRecoveryJobResourceAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string recoveryJobTarget, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetRecoveryJobResourceAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string recoveryJobTarget, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListDrillsAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListDrillsAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default); - Task GetDrillAsync(string serviceGroup, string drill, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetDrillAsync(string serviceGroup, string drill, string? tenant = null, CancellationToken cancellationToken = default); - Task> ListDrillResourcesAsync(string serviceGroup, string drill, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task> ListDrillResourcesAsync(string serviceGroup, string drill, string? tenant = null, CancellationToken cancellationToken = default); - Task GetDrillResourceAsync(string serviceGroup, string drill, string drillResource, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task GetDrillResourceAsync(string serviceGroup, string drill, string drillResource, string? tenant = null, CancellationToken cancellationToken = default); - Task CreateUsagePlanAsync(string resourceGroup, string usagePlan, UsagePlanKind planType, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task CreateUsagePlanAsync(string resourceGroup, string usagePlan, UsagePlanKind planType, string subscription, string? tenant = null, CancellationToken cancellationToken = default); - Task CreateUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string serviceGroup, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); + Task CreateUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string serviceGroup, string subscription, string? tenant = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs index 03050bc7bb..86688e4a7c 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs @@ -10,16 +10,15 @@ using Azure.ResourceManager.Models; using Azure.ResourceManager.ResilienceManagement; using Azure.ResourceManager.ResilienceManagement.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ResilienceManagement.Services; public sealed class ResilienceManagementService(IAzureService azureService) : BaseAzureResourceService(azureService), IResilienceManagementService { - public async Task> ListGoalTemplatesAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListGoalTemplatesAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = new ResourceIdentifier($"/providers/Microsoft.Management/serviceGroups/{serviceGroup}"); GoalTemplateCollection goalTemplates = armClient.GetGoalTemplates(serviceGroupId); @@ -35,9 +34,9 @@ public async Task> ListGoalTemplatesAsync(string se return result; } - public async Task GetGoalTemplateAsync(string serviceGroup, string goalTemplate, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetGoalTemplateAsync(string serviceGroup, string goalTemplate, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = new ResourceIdentifier($"/providers/Microsoft.Management/serviceGroups/{serviceGroup}"); GoalTemplateCollection goalTemplates = armClient.GetGoalTemplates(serviceGroupId); @@ -78,9 +77,9 @@ private static GoalTemplateInfo MapGoalTemplate(GoalTemplateData data) SystemData: mappedSystemData); } - public async Task> ListGoalAssignmentsAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListGoalAssignmentsAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = new ResourceIdentifier($"/providers/Microsoft.Management/serviceGroups/{serviceGroup}"); GoalAssignmentCollection goalAssignments = armClient.GetGoalAssignments(serviceGroupId); @@ -96,9 +95,9 @@ public async Task> ListGoalAssignmentsAsync(string return result; } - public async Task GetGoalAssignmentAsync(string serviceGroup, string goalAssignment, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetGoalAssignmentAsync(string serviceGroup, string goalAssignment, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = new ResourceIdentifier($"/providers/Microsoft.Management/serviceGroups/{serviceGroup}"); GoalAssignmentCollection goalAssignments = armClient.GetGoalAssignments(serviceGroupId); @@ -136,13 +135,13 @@ private static GoalAssignmentInfo MapGoalAssignment(GoalAssignmentData data) SystemData: mappedSystemData); } - public async Task> ListUsagePlansAsync(string resourceGroup, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListUsagePlansAsync(string resourceGroup, string subscription, string? tenant = null, CancellationToken cancellationToken = default) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var resourceGroupId = new ResourceIdentifier($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}"); var resourceGroupResource = armClient.GetResourceGroupResource(resourceGroupId); @@ -159,13 +158,13 @@ public async Task> ListUsagePlansAsync(string resou return result; } - public async Task> ListUsagePlansBySubscriptionAsync(string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListUsagePlansBySubscriptionAsync(string subscription, string? tenant = null, CancellationToken cancellationToken = default) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var subscriptionId2 = new ResourceIdentifier($"/subscriptions/{subscriptionId}"); var subscriptionResource = armClient.GetSubscriptionResource(subscriptionId2); @@ -210,13 +209,13 @@ private static UsagePlanInfo MapUsagePlan(UsagePlanData data) SystemData: mappedSystemData); } - public async Task GetUsagePlanAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetUsagePlanAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, CancellationToken cancellationToken = default) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var resourceGroupId = new ResourceIdentifier($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}"); var resourceGroupResource = armClient.GetResourceGroupResource(resourceGroupId); @@ -226,13 +225,13 @@ public async Task GetUsagePlanAsync(string resourceGroup, string return MapUsagePlan(resource.Data); } - public async Task> ListUsagePlanEnrollmentsAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListUsagePlanEnrollmentsAsync(string resourceGroup, string usagePlan, string subscription, string? tenant = null, CancellationToken cancellationToken = default) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var usagePlanId = new ResourceIdentifier($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlan}"); var usagePlanResource = armClient.GetUsagePlanResource(usagePlanId); @@ -249,13 +248,13 @@ public async Task> ListUsagePlanEnrollmentsAsync(st return result; } - public async Task GetUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string subscription, string? tenant = null, CancellationToken cancellationToken = default) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var usagePlanId = new ResourceIdentifier($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlan}"); var usagePlanResource = armClient.GetUsagePlanResource(usagePlanId); @@ -298,9 +297,9 @@ private static UsagePlanEnrollmentInfo MapUsagePlanEnrollment(UsagePlanEnrollmen SystemData: mappedSystemData); } - public async Task> ListGoalResourcesAsync(string serviceGroup, string goalAssignment, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListGoalResourcesAsync(string serviceGroup, string goalAssignment, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var goalAssignmentId = GoalAssignmentResource.CreateResourceIdentifier(serviceGroup, goalAssignment); GoalMembersCollection goalMembers = armClient.GetGoalAssignmentResource(goalAssignmentId).GetAllGoalMembers(); @@ -316,9 +315,9 @@ public async Task> ListGoalResourcesAsync(string se return result; } - public async Task GetGoalResourceAsync(string serviceGroup, string goalAssignment, string goalResource, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetGoalResourceAsync(string serviceGroup, string goalAssignment, string goalResource, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var goalMemberId = GoalMembersResource.CreateResourceIdentifier(serviceGroup, goalAssignment, goalResource); GoalMembersResource resource = await armClient.GetGoalMembersResource(goalMemberId).GetAsync(cancellationToken); @@ -367,9 +366,9 @@ private static GoalResourceInfo MapGoalResource(GoalMembersData data) SystemData: mappedSystemData); } - public async Task> ListRecoveryPlansAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListRecoveryPlansAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = new ResourceIdentifier($"/providers/Microsoft.Management/serviceGroups/{serviceGroup}"); RecoveryPlanCollection recoveryPlans = armClient.GetRecoveryPlans(serviceGroupId); @@ -385,9 +384,9 @@ public async Task> ListRecoveryPlansAsync(string se return result; } - public async Task GetRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryPlanId = RecoveryPlanResource.CreateResourceIdentifier(serviceGroup, recoveryPlan); Response response = await armClient.GetRecoveryPlanResource(recoveryPlanId).GetAsync(cancellationToken); @@ -396,9 +395,9 @@ public async Task GetRecoveryPlanAsync(string serviceGroup, string return document.RootElement.Clone(); } - public async Task CreateRecoveryPlanAsync(string serviceGroup, string recoveryPlan, RecoveryPlanKind planType, string? planDescription, RecoveryPlanIdentityKind identityType, string? userAssignedIdentity = null, string? defaultGroupDescription = null, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task CreateRecoveryPlanAsync(string serviceGroup, string recoveryPlan, RecoveryPlanKind planType, string? planDescription, RecoveryPlanIdentityKind identityType, string? userAssignedIdentity = null, string? defaultGroupDescription = null, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = new ResourceIdentifier($"/providers/Microsoft.Management/serviceGroups/{serviceGroup}"); RecoveryPlanCollection recoveryPlans = armClient.GetRecoveryPlans(serviceGroupId); @@ -467,9 +466,9 @@ internal static string ResolveRecoveryPlanDescription(string? planDescription, s => planDescription ?? existingPlanDescription ?? throw new ArgumentException("--plan-description is required when creating a recovery plan.", nameof(planDescription)); - public async Task DeleteRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task DeleteRecoveryPlanAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = new ResourceIdentifier($"/providers/Microsoft.Management/serviceGroups/{serviceGroup}"); RecoveryPlanCollection recoveryPlans = armClient.GetRecoveryPlans(serviceGroupId); @@ -490,9 +489,9 @@ public async Task DeleteRecoveryPlanAsync(string serviceGroup, string reco } } - public async Task UpdateRecoveryPlanResourcesAsync(string serviceGroup, string recoveryPlan, UpdateRecoveryResourcesContent content, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task UpdateRecoveryPlanResourcesAsync(string serviceGroup, string recoveryPlan, UpdateRecoveryResourcesContent content, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryPlanId = RecoveryPlanResource.CreateResourceIdentifier(serviceGroup, recoveryPlan); RecoveryPlanResource recoveryPlanResource = await armClient.GetRecoveryPlanResource(recoveryPlanId).GetAsync(cancellationToken); @@ -718,9 +717,9 @@ internal static ResourceIdentifier ParseUserAssignedIdentityResourceId(string us } } - public async Task> ListRecoveryResourcesAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListRecoveryResourcesAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryPlanId = RecoveryPlanResource.CreateResourceIdentifier(serviceGroup, recoveryPlan); RecoveryPlanResource recoveryPlanResource = await armClient.GetRecoveryPlanResource(recoveryPlanId).GetAsync(cancellationToken); @@ -737,9 +736,9 @@ public async Task> ListRecoveryResourcesAsync(strin return result; } - public async Task GetRecoveryResourceAsync(string serviceGroup, string recoveryPlan, string recoveryResource, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetRecoveryResourceAsync(string serviceGroup, string recoveryPlan, string recoveryResource, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryPlanId = RecoveryPlanResource.CreateResourceIdentifier(serviceGroup, recoveryPlan); RecoveryPlanResource recoveryPlanResource = await armClient.GetRecoveryPlanResource(recoveryPlanId).GetAsync(cancellationToken); @@ -750,9 +749,9 @@ public async Task GetRecoveryResourceAsync(string serviceGroup, str return document.RootElement.Clone(); } - public async Task> ListRecoveryJobsAsync(string serviceGroup, string recoveryPlan, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListRecoveryJobsAsync(string serviceGroup, string recoveryPlan, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryPlanId = RecoveryPlanResource.CreateResourceIdentifier(serviceGroup, recoveryPlan); RecoveryJobCollection recoveryJobs = armClient.GetRecoveryPlanResource(recoveryPlanId).GetRecoveryJobs(); @@ -768,9 +767,9 @@ public async Task> ListRecoveryJobsAsync(string ser return result; } - public async Task GetRecoveryJobAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetRecoveryJobAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryJobId = RecoveryJobResource.CreateResourceIdentifier(serviceGroup, recoveryPlan, recoveryJob); Response response = await armClient.GetRecoveryJobResource(recoveryJobId).GetAsync(cancellationToken); @@ -779,9 +778,9 @@ public async Task GetRecoveryJobAsync(string serviceGroup, string r return document.RootElement.Clone(); } - public async Task> ListRecoveryJobResourcesAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListRecoveryJobResourcesAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryJobId = RecoveryJobResource.CreateResourceIdentifier(serviceGroup, recoveryPlan, recoveryJob); RecoveryJobResource recoveryJobResource = await armClient.GetRecoveryJobResource(recoveryJobId).GetAsync(cancellationToken); @@ -798,9 +797,9 @@ public async Task> ListRecoveryJobResourcesAsync(st return result; } - public async Task GetRecoveryJobResourceAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string recoveryJobTarget, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetRecoveryJobResourceAsync(string serviceGroup, string recoveryPlan, string recoveryJob, string recoveryJobTarget, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var recoveryJobTargetId = RecoveryJobTargetResource.CreateResourceIdentifier(serviceGroup, recoveryPlan, recoveryJob, recoveryJobTarget); Response response = await armClient.GetRecoveryJobTargetResource(recoveryJobTargetId).GetAsync(cancellationToken); @@ -809,9 +808,9 @@ public async Task GetRecoveryJobResourceAsync(string serviceGroup, return document.RootElement.Clone(); } - public async Task> ListDrillsAsync(string serviceGroup, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListDrillsAsync(string serviceGroup, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = CreateServiceGroupResourceIdentifier(serviceGroup); ResilienceManagementDrillCollection drills = armClient.GetResilienceManagementDrills(serviceGroupId); @@ -827,9 +826,9 @@ public async Task> ListDrillsAsync(string serviceGr return result; } - public async Task GetDrillAsync(string serviceGroup, string drill, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetDrillAsync(string serviceGroup, string drill, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var serviceGroupId = CreateServiceGroupResourceIdentifier(serviceGroup); ResilienceManagementDrillCollection drills = armClient.GetResilienceManagementDrills(serviceGroupId); @@ -848,9 +847,9 @@ public async Task GetDrillAsync(string serviceGroup, string drill, st SystemData: root.TryGetProperty("systemData", out JsonElement systemDataElement) ? systemDataElement.Clone() : default); } - public async Task> ListDrillResourcesAsync(string serviceGroup, string drill, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task> ListDrillResourcesAsync(string serviceGroup, string drill, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var drillId = ResilienceManagementDrillResource.CreateResourceIdentifier(serviceGroup, drill); ResilienceManagementDrillResource drillResource = armClient.GetResilienceManagementDrillResource(drillId); @@ -867,9 +866,9 @@ public async Task> ListDrillResourcesAsync(string s return result; } - public async Task GetDrillResourceAsync(string serviceGroup, string drill, string drillResource, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task GetDrillResourceAsync(string serviceGroup, string drill, string drillResource, string? tenant = null, CancellationToken cancellationToken = default) { - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var drillId = ResilienceManagementDrillResource.CreateResourceIdentifier(serviceGroup, drill); ResilienceManagementDrillResource drillInstanceResource = armClient.GetResilienceManagementDrillResource(drillId); @@ -915,13 +914,13 @@ private static ResourceIdentifier CreateServiceGroupResourceIdentifier(string se return tags; } - public async Task CreateUsagePlanAsync(string resourceGroup, string usagePlan, UsagePlanKind planType, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task CreateUsagePlanAsync(string resourceGroup, string usagePlan, UsagePlanKind planType, string subscription, string? tenant = null, CancellationToken cancellationToken = default) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var resourceGroupId = new ResourceIdentifier($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}"); var resourceGroupResource = armClient.GetResourceGroupResource(resourceGroupId); @@ -946,13 +945,13 @@ public async Task CreateUsagePlanAsync(string resourceGroup, stri return MapUsagePlan(operation.Value.Data); } - public async Task CreateUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string serviceGroup, string subscription, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) + public async Task CreateUsagePlanEnrollmentAsync(string resourceGroup, string usagePlan, string enrollment, string serviceGroup, string subscription, string? tenant = null, CancellationToken cancellationToken = default) { var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; - ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: retryPolicy, cancellationToken: cancellationToken); + ArmClient armClient = await CreateArmClientAsync(tenantIdOrName: tenant, retryPolicy: null, cancellationToken: cancellationToken); var usagePlanId = new ResourceIdentifier($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureResilienceManagement/usagePlans/{usagePlan}"); UsagePlanEnrollmentCollection enrollments = armClient.GetUsagePlanResource(usagePlanId).GetUsagePlanEnrollments(); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/DrillGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/DrillGetCommandTests.cs index 09cb85e33b..c1cb86f965 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/DrillGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/DrillGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Drills; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -38,7 +37,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.ListDrillsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListDrillsAsync(Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); } @@ -51,7 +50,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS public async Task ExecuteAsync_ListsDrills_WhenNameOmitted() { var expected = new List { new("id1", "drill1"), new("id2", "drill2") }; - Service.ListDrillsAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListDrillsAsync(ServiceGroup, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); @@ -64,7 +63,7 @@ public async Task ExecuteAsync_ListsDrills_WhenNameOmitted() [Fact] public async Task ExecuteAsync_GetsDrill_WhenNameProvided() { - Service.GetDrillAsync(ServiceGroup, "drill1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetDrillAsync(ServiceGroup, "drill1", Arg.Any(), Arg.Any()) .Returns(Drill("drill1")); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--name", "drill1"); @@ -79,7 +78,7 @@ public async Task ExecuteAsync_GetsDrill_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListDrillsAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListDrillsAsync(ServiceGroup, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); @@ -91,7 +90,7 @@ public async Task ExecuteAsync_HandlesException() [Fact] public async Task ExecuteAsync_HandlesNotFoundException() { - Service.ListDrillsAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListDrillsAsync(ServiceGroup, Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Drill not found")); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/Resources/DrillResourceGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/Resources/DrillResourceGetCommandTests.cs index 4ec257e79a..4d4eeffefe 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/Resources/DrillResourceGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Drills/Resources/DrillResourceGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Drills.Resources; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -38,7 +37,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.ListDrillResourcesAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListDrillResourcesAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); } @@ -51,7 +50,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS public async Task ExecuteAsync_ListsDrillResources_WhenNameOmitted() { var expected = new List { new("id1", "target1"), new("id2", "target2") }; - Service.ListDrillResourcesAsync(ServiceGroup, Drill, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListDrillResourcesAsync(ServiceGroup, Drill, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--drill", Drill); @@ -64,7 +63,7 @@ public async Task ExecuteAsync_ListsDrillResources_WhenNameOmitted() [Fact] public async Task ExecuteAsync_GetsDrillResource_WhenNameProvided() { - Service.GetDrillResourceAsync(ServiceGroup, Drill, "target1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetDrillResourceAsync(ServiceGroup, Drill, "target1", Arg.Any(), Arg.Any()) .Returns(Info("target1")); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--drill", Drill, "--name", "target1"); @@ -78,7 +77,7 @@ public async Task ExecuteAsync_GetsDrillResource_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListDrillResourcesAsync(ServiceGroup, Drill, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListDrillResourcesAsync(ServiceGroup, Drill, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--drill", Drill); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Assignments/GoalAssignmentGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Assignments/GoalAssignmentGetCommandTests.cs index a97ebe1a41..dfe4d7ce82 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Assignments/GoalAssignmentGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Assignments/GoalAssignmentGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Goals.Assignments; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -22,7 +21,7 @@ public class GoalAssignmentGetCommandTests : CommandUnitTestsBase { new("id1", "assignment1"), new("id2", "assignment2") }; - Service.ListGoalAssignmentsAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListGoalAssignmentsAsync(ServiceGroup, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); @@ -37,7 +36,7 @@ public async Task ExecuteAsync_ListsGoalAssignments_WhenNameOmitted() public async Task ExecuteAsync_GetsGoalAssignment_WhenNameProvided() { var expected = new GoalAssignmentInfo("id1", "assignment1"); - Service.GetGoalAssignmentAsync(ServiceGroup, "assignment1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetGoalAssignmentAsync(ServiceGroup, "assignment1", Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--name", "assignment1"); @@ -52,7 +51,7 @@ public async Task ExecuteAsync_GetsGoalAssignment_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListGoalAssignmentsAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListGoalAssignmentsAsync(ServiceGroup, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Resources/GoalResourceGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Resources/GoalResourceGetCommandTests.cs index 65934ef46c..08d6ea572b 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Resources/GoalResourceGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Resources/GoalResourceGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Goals.Resources; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -23,7 +22,7 @@ public class GoalResourceGetCommandTests : CommandUnitTestsBase { new("id1", "resource1"), new("id2", "resource2") }; - Service.ListGoalResourcesAsync(ServiceGroup, GoalAssignment, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListGoalResourcesAsync(ServiceGroup, GoalAssignment, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--goal-assignment", GoalAssignment); @@ -38,7 +37,7 @@ public async Task ExecuteAsync_ListsGoalResources_WhenNameOmitted() public async Task ExecuteAsync_GetsGoalResource_WhenNameProvided() { var expected = new GoalResourceInfo("id1", "resource1"); - Service.GetGoalResourceAsync(ServiceGroup, GoalAssignment, "resource1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetGoalResourceAsync(ServiceGroup, GoalAssignment, "resource1", Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--goal-assignment", GoalAssignment, "--name", "resource1"); @@ -53,7 +52,7 @@ public async Task ExecuteAsync_GetsGoalResource_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListGoalResourcesAsync(ServiceGroup, GoalAssignment, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListGoalResourcesAsync(ServiceGroup, GoalAssignment, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--goal-assignment", GoalAssignment); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Templates/GoalTemplateGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Templates/GoalTemplateGetCommandTests.cs index d83cbbef2e..ce1a602334 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Templates/GoalTemplateGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Templates/GoalTemplateGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Goals.Templates; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -22,7 +21,7 @@ public class GoalTemplateGetCommandTests : CommandUnitTestsBase { new("id1", "template1"), new("id2", "template2") }; - Service.ListGoalTemplatesAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListGoalTemplatesAsync(ServiceGroup, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); @@ -37,7 +36,7 @@ public async Task ExecuteAsync_ListsGoalTemplates_WhenNameOmitted() public async Task ExecuteAsync_GetsGoalTemplate_WhenNameProvided() { var expected = new GoalTemplateInfo("id1", "template1"); - Service.GetGoalTemplateAsync(ServiceGroup, "template1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetGoalTemplateAsync(ServiceGroup, "template1", Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--name", "template1"); @@ -52,7 +51,7 @@ public async Task ExecuteAsync_GetsGoalTemplate_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListGoalTemplatesAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListGoalTemplatesAsync(ServiceGroup, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/RecoveryJobGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/RecoveryJobGetCommandTests.cs index 7f237dc47d..bfb68ec9f6 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/RecoveryJobGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/RecoveryJobGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Recovery.Jobs; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -27,7 +26,7 @@ private static JsonElement Element(string name) public async Task ExecuteAsync_ListsRecoveryJobs_WhenNameOmitted() { var expected = new List { new("id1", "job1"), new("id2", "job2") }; - Service.ListRecoveryJobsAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryJobsAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan); @@ -40,7 +39,7 @@ public async Task ExecuteAsync_ListsRecoveryJobs_WhenNameOmitted() [Fact] public async Task ExecuteAsync_GetsRecoveryJob_WhenNameProvided() { - Service.GetRecoveryJobAsync(ServiceGroup, RecoveryPlan, "job1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetRecoveryJobAsync(ServiceGroup, RecoveryPlan, "job1", Arg.Any(), Arg.Any()) .Returns(Element("job1")); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan, "--name", "job1"); @@ -54,7 +53,7 @@ public async Task ExecuteAsync_GetsRecoveryJob_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListRecoveryJobsAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryJobsAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/Resources/RecoveryJobResourceGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/Resources/RecoveryJobResourceGetCommandTests.cs index 9d5b197fd3..aa5ea6b4d1 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/Resources/RecoveryJobResourceGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Jobs/Resources/RecoveryJobResourceGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Recovery.Jobs.Resources; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -28,7 +27,7 @@ private static JsonElement Element(string name) public async Task ExecuteAsync_ListsRecoveryJobResources_WhenNameOmitted() { var expected = new List { new("id1", "target1"), new("id2", "target2") }; - Service.ListRecoveryJobResourcesAsync(ServiceGroup, RecoveryPlan, RecoveryJob, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryJobResourcesAsync(ServiceGroup, RecoveryPlan, RecoveryJob, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan, "--recovery-job", RecoveryJob); @@ -41,7 +40,7 @@ public async Task ExecuteAsync_ListsRecoveryJobResources_WhenNameOmitted() [Fact] public async Task ExecuteAsync_GetsRecoveryJobResource_WhenNameProvided() { - Service.GetRecoveryJobResourceAsync(ServiceGroup, RecoveryPlan, RecoveryJob, "target1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetRecoveryJobResourceAsync(ServiceGroup, RecoveryPlan, RecoveryJob, "target1", Arg.Any(), Arg.Any()) .Returns(Element("target1")); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan, "--recovery-job", RecoveryJob, "--name", "target1"); @@ -55,7 +54,7 @@ public async Task ExecuteAsync_GetsRecoveryJobResource_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListRecoveryJobResourcesAsync(ServiceGroup, RecoveryPlan, RecoveryJob, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryJobResourcesAsync(ServiceGroup, RecoveryPlan, RecoveryJob, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan, "--recovery-job", RecoveryJob); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanCreateCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanCreateCommandTests.cs index c51e88df83..15c6e1d5b1 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Recovery.Plans; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -50,7 +49,6 @@ public async Task ExecuteAsync_ValidatesRequiredInput(string args, bool shouldSu Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(Element("plan1")); } @@ -84,7 +82,6 @@ await Service.DidNotReceive().CreateRecoveryPlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), TestContext.Current.CancellationToken); } @@ -114,7 +111,6 @@ await Service.DidNotReceive().CreateRecoveryPlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), TestContext.Current.CancellationToken); } @@ -140,7 +136,6 @@ await Service.DidNotReceive().CreateRecoveryPlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), TestContext.Current.CancellationToken); } @@ -158,7 +153,6 @@ public async Task ExecuteAsync_AcceptsRecoveryPlanNameBoundaryLengths(string rec Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(Element(recoveryPlan)); @@ -203,7 +197,6 @@ public async Task ExecuteAsync_AcceptsPlanDescriptionBoundaryLengths(string plan Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(Element("plan1")); @@ -248,7 +241,6 @@ public async Task ExecuteAsync_AcceptsDefaultGroupDescriptionBoundaryLengths(str Arg.Any(), defaultGroupDescription, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(Element("plan1")); @@ -286,7 +278,6 @@ await Service.DidNotReceive().CreateRecoveryPlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -302,7 +293,6 @@ public async Task ExecuteAsync_ReturnsRecoveryPlanAndForwardsCompletePutOptions( UserAssignedIdentityResourceId, "default", null, - null, Arg.Any()) .Returns(Element("plan1")); @@ -319,7 +309,6 @@ await Service.Received(1).CreateRecoveryPlanAsync( UserAssignedIdentityResourceId, "default", null, - null, Arg.Any()); } @@ -335,7 +324,6 @@ public async Task ExecuteAsync_ForwardsNullWhenDefaultGroupDescriptionIsOmitted( UserAssignedIdentityResourceId, null, null, - null, Arg.Any()) .Returns(Element("plan1")); @@ -357,7 +345,6 @@ await Service.Received(1).CreateRecoveryPlanAsync( UserAssignedIdentityResourceId, null, null, - null, Arg.Any()); } @@ -395,7 +382,6 @@ await Service.DidNotReceive().CreateRecoveryPlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), TestContext.Current.CancellationToken); } @@ -411,7 +397,6 @@ public async Task ExecuteAsync_ForwardsNullForSystemAssignedIdentity() null, null, null, - null, Arg.Any()) .Returns(Element("plan1")); @@ -432,7 +417,6 @@ await Service.Received(1).CreateRecoveryPlanAsync( null, null, null, - null, Arg.Any()); } @@ -448,7 +432,6 @@ public async Task ExecuteAsync_ForwardsSystemAndUserAssignedIdentity() UserAssignedIdentityResourceId, null, null, - null, Arg.Any()) .Returns(Element("plan1")); @@ -470,7 +453,6 @@ await Service.Received(1).CreateRecoveryPlanAsync( UserAssignedIdentityResourceId, null, null, - null, Arg.Any()); } @@ -533,7 +515,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -565,7 +546,6 @@ private void ConfigureRequestFailure(HttpStatusCode status, string message) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)status, message)); } diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanDeleteCommandTests.cs index 0bffe14c5d..423299953e 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanDeleteCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands; using Azure.Mcp.Tools.ResilienceManagement.Commands.Recovery.Plans; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -39,7 +38,6 @@ public async Task ExecuteAsync_ValidatesRequiredInput(string args, bool shouldSu Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -63,7 +61,6 @@ await Service.DidNotReceive().DeleteRecoveryPlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -80,7 +77,6 @@ await Service.DidNotReceive().DeleteRecoveryPlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -93,7 +89,6 @@ public async Task ExecuteAsync_ReturnsDeleteResult(bool deleted) "sg1", "plan1", null, - null, Arg.Any()) .Returns(deleted); @@ -115,7 +110,6 @@ public async Task ExecuteAsync_SanitizesRequestFailedException(HttpStatusCode st Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)status, providerDetails)); @@ -133,7 +127,6 @@ public async Task ExecuteAsync_HandlesUnexpectedServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanGetCommandTests.cs index ebdb245154..f096f712f7 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Recovery.Plans; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -26,7 +25,7 @@ private static JsonElement Element(string name) public async Task ExecuteAsync_ListsRecoveryPlans_WhenNameOmitted() { var expected = new List { new("id1", "plan1"), new("id2", "plan2") }; - Service.ListRecoveryPlansAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryPlansAsync(ServiceGroup, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); @@ -39,7 +38,7 @@ public async Task ExecuteAsync_ListsRecoveryPlans_WhenNameOmitted() [Fact] public async Task ExecuteAsync_GetsRecoveryPlan_WhenNameProvided() { - Service.GetRecoveryPlanAsync(ServiceGroup, "plan1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetRecoveryPlanAsync(ServiceGroup, "plan1", Arg.Any(), Arg.Any()) .Returns(Element("plan1")); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--name", "plan1"); @@ -53,7 +52,7 @@ public async Task ExecuteAsync_GetsRecoveryPlan_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListRecoveryPlansAsync(ServiceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryPlansAsync(ServiceGroup, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanUpdateResourcesCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanUpdateResourcesCommandTests.cs index 91ed3759f3..1e569c765f 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanUpdateResourcesCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanUpdateResourcesCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; using Azure.ResourceManager.ResilienceManagement.Models; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -80,7 +79,6 @@ await Service.DidNotReceive().UpdateRecoveryPlanResourcesAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -98,7 +96,6 @@ public async Task ExecuteAsync_ForwardsResourceUpdates() content.ResourcesToUpdate[0].Properties.SelectedProtectionSolutionType == ResourceProtectionSolutionType.AzureNative && content.ResourcesToUpdate[0].Properties.SelectedProtectionSolutionSetting != null), null, - null, Arg.Any()) .Returns(UpdateResult()); @@ -114,7 +111,6 @@ await Service.Received(1).UpdateRecoveryPlanResourcesAsync( "plan1", Arg.Any(), null, - null, Arg.Any()); } @@ -129,7 +125,6 @@ public async Task ExecuteAsync_AllowsRemovalOnly() content.ResourcesToRemove.Count == 1 && content.ResourcesToRemove[0].ToString() == RecoveryResourceId), null, - null, Arg.Any()) .Returns(UpdateResult()); @@ -164,7 +159,6 @@ public async Task ExecuteAsync_AllowsNullInclusionState() Arg.Any(), Arg.Is(content => content.ResourcesToUpdate[0].Properties.InclusionState == null), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(UpdateResult()); @@ -186,7 +180,6 @@ public async Task ExecuteAsync_AllowsReadOnlyIdToBeOmitted() content.ResourcesToUpdate.Count == 1 && content.ResourcesToUpdate[0].Properties.RecoveryResourceUniqueId == "12345678-9012-3456-7890-123456789012"), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(UpdateResult()); @@ -262,7 +255,6 @@ public async Task ExecuteAsync_SanitizesProviderFailure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.BadRequest, "provider details")); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/Resources/RecoveryResourceGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/Resources/RecoveryResourceGetCommandTests.cs index e40462b8fa..e00c23d40e 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/Resources/RecoveryResourceGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/Resources/RecoveryResourceGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.Recovery.Plans.Resources; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -27,7 +26,7 @@ private static JsonElement Element(string name) public async Task ExecuteAsync_ListsRecoveryResources_WhenNameOmitted() { var expected = new List { new("id1", "member1"), new("id2", "member2") }; - Service.ListRecoveryResourcesAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryResourcesAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan); @@ -40,7 +39,7 @@ public async Task ExecuteAsync_ListsRecoveryResources_WhenNameOmitted() [Fact] public async Task ExecuteAsync_GetsRecoveryResource_WhenNameProvided() { - Service.GetRecoveryResourceAsync(ServiceGroup, RecoveryPlan, "member1", Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetRecoveryResourceAsync(ServiceGroup, RecoveryPlan, "member1", Arg.Any(), Arg.Any()) .Returns(Element("member1")); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan, "--name", "member1"); @@ -54,7 +53,7 @@ public async Task ExecuteAsync_GetsRecoveryResource_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListRecoveryResourcesAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListRecoveryResourcesAsync(ServiceGroup, RecoveryPlan, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--service-group", ServiceGroup, "--recovery-plan", RecoveryPlan); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommandTests.cs index 1f6beac33f..3e9b849eb7 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.UsagePlans.Enrollments; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new UsagePlanEnrollmentInfo("id1", "e1")); } @@ -95,7 +93,6 @@ await Service.DidNotReceive().CreateUsagePlanEnrollmentAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -110,7 +107,6 @@ public async Task ExecuteAsync_ReturnsCreatedEnrollment() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new UsagePlanEnrollmentInfo("id1", "en1")); @@ -137,7 +133,6 @@ public async Task ExecuteAsync_SanitizesRequestFailedException(HttpStatusCode st Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)status, providerDetails)); @@ -159,7 +154,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommandTests.cs index 5b26ed79e0..a052ac891a 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.UsagePlans.Enrollments; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -24,7 +23,7 @@ public class UsagePlanEnrollmentGetCommandTests : SubscriptionCommandUnitTestsBa public async Task ExecuteAsync_ListsEnrollments_WhenNameOmitted() { var expected = new List { new("id1", "enrollment1"), new("id2", "enrollment2") }; - Service.ListUsagePlanEnrollmentsAsync(ResourceGroup, UsagePlan, SubscriptionId, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListUsagePlanEnrollmentsAsync(ResourceGroup, UsagePlan, SubscriptionId, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--subscription", SubscriptionId, "--resource-group", ResourceGroup, "--usage-plan", UsagePlan); @@ -39,7 +38,7 @@ public async Task ExecuteAsync_ListsEnrollments_WhenNameOmitted() public async Task ExecuteAsync_GetsEnrollment_WhenNameProvided() { var expected = new UsagePlanEnrollmentInfo("id1", "enrollment1"); - Service.GetUsagePlanEnrollmentAsync(ResourceGroup, UsagePlan, "enrollment1", SubscriptionId, Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetUsagePlanEnrollmentAsync(ResourceGroup, UsagePlan, "enrollment1", SubscriptionId, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--subscription", SubscriptionId, "--resource-group", ResourceGroup, "--usage-plan", UsagePlan, "--name", "enrollment1"); @@ -54,7 +53,7 @@ public async Task ExecuteAsync_GetsEnrollment_WhenNameProvided() public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListUsagePlanEnrollmentsAsync(ResourceGroup, UsagePlan, SubscriptionId, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListUsagePlanEnrollmentsAsync(ResourceGroup, UsagePlan, SubscriptionId, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--subscription", SubscriptionId, "--resource-group", ResourceGroup, "--usage-plan", UsagePlan); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanCreateCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanCreateCommandTests.cs index 508a2480cb..7642829394 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.UsagePlans; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new UsagePlanInfo("id1", "up1", "Microsoft.ResilienceManagement/usagePlans", "eastus")); } @@ -80,7 +78,6 @@ await Service.DidNotReceive().CreateUsagePlanAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -94,7 +91,6 @@ public async Task ExecuteAsync_ReturnsCreatedUsagePlan() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new UsagePlanInfo("id1", "up1", "Microsoft.ResilienceManagement/usagePlans", "eastus")); @@ -117,7 +113,6 @@ public async Task ExecuteAsync_HandlesConflictWithoutAssumingNameCollision() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Conflict, "Provider-specific conflict details")); @@ -143,7 +138,6 @@ public async Task ExecuteAsync_SanitizesRequestFailedException(HttpStatusCode st Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)status, providerDetails)); @@ -164,7 +158,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanGetCommandTests.cs index e7c9dcd791..9c34e7c8db 100644 --- a/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ResilienceManagement.Commands.UsagePlans; using Azure.Mcp.Tools.ResilienceManagement.Models; using Azure.Mcp.Tools.ResilienceManagement.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -23,7 +22,7 @@ public class UsagePlanGetCommandTests : SubscriptionCommandUnitTestsBase { new("id1", "plan1"), new("id2", "plan2") }; - Service.ListUsagePlansBySubscriptionAsync(SubscriptionId, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListUsagePlansBySubscriptionAsync(SubscriptionId, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--subscription", SubscriptionId); @@ -38,7 +37,7 @@ public async Task ExecuteAsync_ListsUsagePlansBySubscription_WhenNoResourceGroup public async Task ExecuteAsync_ListsUsagePlansByResourceGroup_WhenResourceGroupOnly() { var expected = new List { new("id1", "plan1") }; - Service.ListUsagePlansAsync(ResourceGroup, SubscriptionId, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListUsagePlansAsync(ResourceGroup, SubscriptionId, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--subscription", SubscriptionId, "--resource-group", ResourceGroup); @@ -52,7 +51,7 @@ public async Task ExecuteAsync_ListsUsagePlansByResourceGroup_WhenResourceGroupO public async Task ExecuteAsync_GetsUsagePlan_WhenNameAndResourceGroupProvided() { var expected = new UsagePlanInfo("id1", "plan1", "Microsoft.AzureResilience/usagePlans", "westus"); - Service.GetUsagePlanAsync(ResourceGroup, "plan1", SubscriptionId, Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetUsagePlanAsync(ResourceGroup, "plan1", SubscriptionId, Arg.Any(), Arg.Any()) .Returns(expected); var response = await ExecuteCommandAsync("--subscription", SubscriptionId, "--resource-group", ResourceGroup, "--name", "plan1"); @@ -75,7 +74,7 @@ public async Task ExecuteAsync_ReturnsError_WhenNameProvidedWithoutResourceGroup public async Task ExecuteAsync_HandlesException() { var expectedError = "Test error"; - Service.ListUsagePlansBySubscriptionAsync(SubscriptionId, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListUsagePlansBySubscriptionAsync(SubscriptionId, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); var response = await ExecuteCommandAsync("--subscription", SubscriptionId); diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/AvailabilityStatus/AvailabilityStatusGetCommand.cs b/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/AvailabilityStatus/AvailabilityStatusGetCommand.cs index b563b29e42..7be3b47717 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/AvailabilityStatus/AvailabilityStatusGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/AvailabilityStatus/AvailabilityStatusGetCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, { var status = await _resourceHealthService.GetAvailabilityStatusAsync( options.ResourceId, - options.RetryPolicy, cancellationToken); statuses = [status]; @@ -54,7 +53,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken) ?? []; } diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/ServiceHealthEvents/ServiceHealthEventsListCommand.cs b/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/ServiceHealthEvents/ServiceHealthEventsListCommand.cs index 74ce8ee5ce..072b40a1cf 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/ServiceHealthEvents/ServiceHealthEventsListCommand.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/src/Commands/ServiceHealthEvents/ServiceHealthEventsListCommand.cs @@ -63,7 +63,6 @@ public override async Task ExecuteAsync(CommandContext context, options.QueryStartTime, options.QueryEndTime, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(events ?? []), ResourceHealthJsonContext.Default.ServiceHealthEventsListCommandResult); diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/AvailabilityStatus/AvailabilityStatusGetOptions.cs b/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/AvailabilityStatus/AvailabilityStatusGetOptions.cs index 4fa111bf36..880b14e1a5 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/AvailabilityStatus/AvailabilityStatusGetOptions.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/AvailabilityStatus/AvailabilityStatusGetOptions.cs @@ -20,6 +20,4 @@ public sealed class AvailabilityStatusGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/ServiceHealthEvents/ServiceHealthEventsListOptions.cs b/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/ServiceHealthEvents/ServiceHealthEventsListOptions.cs index 9d423523a9..3a525ecbeb 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/ServiceHealthEvents/ServiceHealthEventsListOptions.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/src/Options/ServiceHealthEvents/ServiceHealthEventsListOptions.cs @@ -38,6 +38,4 @@ public sealed class ServiceHealthEventsListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs b/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs index 53dda36d46..e9bb461807 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.ResourceHealth.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ResourceHealth.Services; @@ -12,12 +11,10 @@ public interface IResourceHealthService /// Gets the current availability status of the specified Azure resource. /// /// The Azure resource ID - /// Optional retry policy configuration /// The availability status of the resource /// When the service request fails Task GetAvailabilityStatusAsync( string resourceId, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -26,14 +23,12 @@ Task GetAvailabilityStatusAsync( /// The subscription ID or name /// Optional resource group name to filter results /// Optional tenant ID - /// Optional retry policy configuration /// List of availability statuses for resources /// When the service request fails Task> ListAvailabilityStatusesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -47,7 +42,6 @@ Task> ListAvailabilityStatusesAsync( /// Optional start time for the query /// Optional end time for the query /// Optional tenant ID - /// Optional retry policy configuration /// List of service health events /// When the service request fails Task> ListServiceHealthEventsAsync( @@ -59,6 +53,5 @@ Task> ListServiceHealthEventsAsync( string? queryStartTime = null, string? queryEndTime = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/ResourceHealthService.cs b/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/ResourceHealthService.cs index 25804237a2..3003057d45 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/ResourceHealthService.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/ResourceHealthService.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.ResourceHealth.Models; using Azure.Mcp.Tools.ResourceHealth.Models.Internal; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ResourceHealth.Services; @@ -19,7 +18,6 @@ public class ResourceHealthService(IAzureService azureService) public async Task GetAvailabilityStatusAsync( string resourceId, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(resourceId), resourceId)); @@ -51,12 +49,11 @@ public async Task> ListAvailabilityStatusesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var subscriptionId = subscriptionResource.Id.SubscriptionId; var managementEndpoint = AzureService.CloudConfiguration.ArmEnvironment.Endpoint; @@ -93,12 +90,11 @@ public async Task> ListServiceHealthEventsAsync( string? queryStartTime = null, string? queryEndTime = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken); var subscriptionId = subscriptionResource.Id.SubscriptionId; var managementEndpoint = AzureService.CloudConfiguration.ArmEnvironment.Endpoint; diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/AvailabilityStatus/AvailabilityStatusGetCommandTests.cs b/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/AvailabilityStatus/AvailabilityStatusGetCommandTests.cs index 469d773457..c15159d2d2 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/AvailabilityStatus/AvailabilityStatusGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/AvailabilityStatus/AvailabilityStatusGetCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ResourceHealth.Commands.AvailabilityStatus; using Azure.Mcp.Tools.ResourceHealth.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -30,7 +29,7 @@ public async Task ExecuteAsync_ReturnsAvailabilityStatus_WhenResourceIdProvided( DetailedStatus = "Virtual machine is running normally" }; - Service.GetAvailabilityStatusAsync(resourceId, Arg.Any(), Arg.Any()) + Service.GetAvailabilityStatusAsync(resourceId, Arg.Any()) .Returns(expectedStatus); var response = await ExecuteCommandAsync("--resourceId", resourceId, "--subscription", subscriptionId); @@ -51,7 +50,7 @@ public async Task ExecuteAsync_HandlesException_WhenGettingSingleResource() var subscriptionId = "12345678-1234-1234-1234-123456789012"; var expectedError = "Test error. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; - Service.GetAvailabilityStatusAsync(resourceId, Arg.Any(), Arg.Any()) + Service.GetAvailabilityStatusAsync(resourceId, Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync("--resourceId", resourceId, "--subscription", subscriptionId); @@ -68,7 +67,7 @@ public async Task ExecuteAsync_ReturnsBadRequest_WhenResourceIdIsInvalid() var subscriptionId = "12345678-1234-1234-1234-123456789012"; var expectedError = "Invalid Azure resource ID. Provide a resource ID in the format /subscriptions//resourceGroups//providers///. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; - Service.GetAvailabilityStatusAsync(resourceId, Arg.Any(), Arg.Any()) + Service.GetAvailabilityStatusAsync(resourceId, Arg.Any()) .ThrowsAsync(new FormatException("Invalid resource ID format.")); var response = await ExecuteCommandAsync("--resourceId", resourceId, "--subscription", subscriptionId); @@ -88,7 +87,7 @@ public async Task ExecuteAsync_ReturnsHelpfulError_WhenResourceHealthReturnsUnpr var errorMessage = "Resource type is not supported."; var expectedError = $"Azure Resource Health could not process availability status for resource type '{resourceType}'. Error code: {errorCode}. Details: {errorMessage}. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; - Service.GetAvailabilityStatusAsync(resourceId, Arg.Any(), Arg.Any()) + Service.GetAvailabilityStatusAsync(resourceId, Arg.Any()) .ThrowsAsync(new ResourceHealthUnprocessableEntityException(resourceId, resourceType, errorCode, errorMessage)); var response = await ExecuteCommandAsync("--resourceId", resourceId, "--subscription", subscriptionId); @@ -124,7 +123,7 @@ public async Task ExecuteAsync_ReturnsAvailabilityStatuses_WhenResourceIdNotProv } }; - Service.ListAvailabilityStatusesAsync(subscriptionId, null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListAvailabilityStatusesAsync(subscriptionId, null, Arg.Any(), Arg.Any()) .Returns(expectedStatuses); var response = await ExecuteCommandAsync("--subscription", subscriptionId); @@ -153,7 +152,7 @@ public async Task ExecuteAsync_ReturnsFilteredAvailabilityStatuses_WhenResourceG } }; - Service.ListAvailabilityStatusesAsync(subscriptionId, resourceGroup, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListAvailabilityStatusesAsync(subscriptionId, resourceGroup, Arg.Any(), Arg.Any()) .Returns(expectedStatuses); var response = await ExecuteCommandAsync("--subscription", subscriptionId, "--resource-group", resourceGroup); @@ -171,7 +170,7 @@ public async Task ExecuteAsync_HandlesException_WhenListingResources() var subscriptionId = "12345678-1234-1234-1234-123456789012"; var expectedError = "Test error. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; - Service.ListAvailabilityStatusesAsync(subscriptionId, null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListAvailabilityStatusesAsync(subscriptionId, null, Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync("--subscription", subscriptionId); @@ -189,7 +188,7 @@ public async Task ExecuteAsync_ReturnsConflict_WhenResourceHealthListRequestConf var errorMessage = "The subscription is not registered to use namespace 'Microsoft.ResourceHealth'."; var expectedError = $"Azure Resource Health returned Conflict. The subscription may need the Microsoft.ResourceHealth provider registered, or the provider may still be registering. Details: {errorMessage}. To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; - Service.ListAvailabilityStatusesAsync(subscriptionId, null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListAvailabilityStatusesAsync(subscriptionId, null, Arg.Any(), Arg.Any()) .ThrowsAsync(new ResourceHealthRequestFailedException(HttpStatusCode.Conflict, errorCode, errorMessage)); var response = await ExecuteCommandAsync("--subscription", subscriptionId); @@ -205,7 +204,7 @@ public async Task ExecuteAsync_ReturnsBadRequest_WhenSubscriptionLookupFails() var subscription = "missing-subscription"; var expectedError = $"Could not find subscription with name {subscription} (Parameter 'subscriptionName'). To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azmcp/troubleshooting."; - Service.ListAvailabilityStatusesAsync(subscription, null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListAvailabilityStatusesAsync(subscription, null, Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException($"Could not find subscription with name {subscription}", "subscriptionName")); var response = await ExecuteCommandAsync("--subscription", subscription); diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/ServiceHealthEvents/ServiceHealthEventsListCommandTests.cs b/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/ServiceHealthEvents/ServiceHealthEventsListCommandTests.cs index e22bc67706..f558cc90f5 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/ServiceHealthEvents/ServiceHealthEventsListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/ServiceHealthEvents/ServiceHealthEventsListCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.ResourceHealth.Commands.ServiceHealthEvents; using Azure.Mcp.Tools.ResourceHealth.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -38,7 +37,6 @@ public async Task ExecuteAsync_ValidatesInput(string args, bool shouldSucceed) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); } @@ -82,7 +80,6 @@ public async Task ExecuteAsync_WithValidSubscription_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -109,7 +106,6 @@ public async Task ExecuteAsync_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException(expectedError)); @@ -139,7 +135,6 @@ public async Task ExecuteAsync_ReturnsConflict_WhenResourceHealthRequestConflict Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new ResourceHealthRequestFailedException(HttpStatusCode.Conflict, errorCode, errorMessage)); @@ -165,7 +160,6 @@ public async Task ExecuteAsync_ReturnsBadRequest_WhenSubscriptionLookupFails() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException($"Could not find subscription with name {subscription}", "subscriptionName")); diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/Services/ResourceHealthServiceSsrfValidationTests.cs b/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/Services/ResourceHealthServiceSsrfValidationTests.cs index 17b57828e7..2877fd151b 100644 --- a/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/Services/ResourceHealthServiceSsrfValidationTests.cs +++ b/tools/Azure.Mcp.Tools.ResourceHealth/tests/Azure.Mcp.Tools.ResourceHealth.Tests/Services/ResourceHealthServiceSsrfValidationTests.cs @@ -49,7 +49,7 @@ private void SetupMocksForValidRequest(HttpResponseMessage response, string subs var subscriptionResource = Substitute.For(); subscriptionResource.Id.Returns(SubscriptionResource.CreateResourceIdentifier(subscriptionId)); - _azureService.GetSubscription(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscription(Arg.Any(), Arg.Any(), Arg.Any()) .Returns(subscriptionResource); // Mock HttpClientFactory diff --git a/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexGetCommand.cs b/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexGetCommand.cs index 8ce56215c2..fffb7738ba 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexGetCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, var indexes = await _searchService.GetIndexDetails( options.Service, options.Index, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(indexes ?? []), SearchJsonContext.Default.IndexGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexQueryCommand.cs b/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexQueryCommand.cs index 4458b4895d..85dd03c9f8 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexQueryCommand.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Commands/Index/IndexQueryCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Service, options.Index, options.Query, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(results, SearchJsonContext.Default.ListJsonElement); diff --git a/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseGetCommand.cs b/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseGetCommand.cs index 8899a7cf0b..a80271d7d7 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseGetCommand.cs @@ -37,7 +37,7 @@ public override async Task ExecuteAsync(CommandContext context, { try { - var bases = await _searchService.ListKnowledgeBases(options.Service, options.KnowledgeBase, options.RetryPolicy, cancellationToken); + var bases = await _searchService.ListKnowledgeBases(options.Service, options.KnowledgeBase, cancellationToken); context.Response.Results = ResponseResult.Create(new(bases ?? []), SearchJsonContext.Default.KnowledgeBaseGetCommandResult); } catch (Exception ex) diff --git a/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseRetrieveCommand.cs b/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseRetrieveCommand.cs index 5aedd6267f..0bcd4e44cc 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseRetrieveCommand.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeBaseRetrieveCommand.cs @@ -85,7 +85,7 @@ public override async Task ExecuteAsync(CommandContext context, try { - var result = await _searchService.RetrieveFromKnowledgeBase(options.Service, options.KnowledgeBase, options.Query, parsedMessages, options.RetryPolicy, cancellationToken); + var result = await _searchService.RetrieveFromKnowledgeBase(options.Service, options.KnowledgeBase, options.Query, parsedMessages, cancellationToken); context.Response.Results = ResponseResult.Create(new(result), SearchJsonContext.Default.KnowledgeBaseRetrieveCommandResult); } catch (Exception ex) diff --git a/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeSourceGetCommand.cs b/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeSourceGetCommand.cs index 5e6d06ca83..90b642e5ed 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeSourceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Commands/Knowledge/KnowledgeSourceGetCommand.cs @@ -39,7 +39,7 @@ public override async Task ExecuteAsync(CommandContext context, { try { - var sources = await _searchService.ListKnowledgeSources(options.Service, options.KnowledgeSource, options.RetryPolicy, cancellationToken); + var sources = await _searchService.ListKnowledgeSources(options.Service, options.KnowledgeSource, cancellationToken); context.Response.Results = ResponseResult.Create(new(sources ?? []), SearchJsonContext.Default.KnowledgeSourceGetCommandResult); } catch (Exception ex) diff --git a/tools/Azure.Mcp.Tools.Search/src/Commands/Service/ServiceListCommand.cs b/tools/Azure.Mcp.Tools.Search/src/Commands/Service/ServiceListCommand.cs index 503320a8c7..d775da676a 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Commands/Service/ServiceListCommand.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Commands/Service/ServiceListCommand.cs @@ -36,7 +36,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(services ?? []), SearchJsonContext.Default.ServiceListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexGetOptions.cs b/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexGetOptions.cs index 4cd747c704..e00a27947c 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexGetOptions.cs @@ -13,6 +13,4 @@ public sealed class IndexGetOptions [Option(Description = SearchOptionDescriptions.Index)] public string? Index { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexQueryOptions.cs b/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexQueryOptions.cs index 9834601462..0081cf3c9e 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexQueryOptions.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexQueryOptions.cs @@ -16,6 +16,4 @@ public sealed class IndexQueryOptions [Option(Description = SearchOptionDescriptions.Index)] public required string Index { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseGetOptions.cs b/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseGetOptions.cs index ae02f95015..5329d03453 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseGetOptions.cs @@ -13,6 +13,4 @@ public sealed class KnowledgeBaseGetOptions [Option(Description = SearchOptionDescriptions.Service)] public required string Service { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseRetrieveOptions.cs b/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseRetrieveOptions.cs index 3f1ef8c5c9..c5d74fd16a 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseRetrieveOptions.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseRetrieveOptions.cs @@ -19,6 +19,4 @@ public sealed class KnowledgeBaseRetrieveOptions [Option(Description = SearchOptionDescriptions.Service)] public required string Service { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeSourceGetOptions.cs b/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeSourceGetOptions.cs index 5628897cd9..eb7b0cac75 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeSourceGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeSourceGetOptions.cs @@ -13,6 +13,4 @@ public sealed class KnowledgeSourceGetOptions [Option(Description = SearchOptionDescriptions.Service)] public required string Service { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Search/src/Options/Service/ServiceListOptions.cs b/tools/Azure.Mcp.Tools.Search/src/Options/Service/ServiceListOptions.cs index 67411411b2..25a2e6c101 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Options/Service/ServiceListOptions.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Options/Service/ServiceListOptions.cs @@ -17,6 +17,4 @@ public sealed class ServiceListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Search/src/Services/ISearchService.cs b/tools/Azure.Mcp.Tools.Search/src/Services/ISearchService.cs index c26ad84b31..fcc611b4fb 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Services/ISearchService.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Services/ISearchService.cs @@ -3,7 +3,6 @@ using System.Text.Json; using Azure.Mcp.Tools.Search.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Search.Services; @@ -13,32 +12,27 @@ Task> ListServices( string subscription, string? resourceGroup = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetIndexDetails( string serviceName, string? indexName, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListKnowledgeSources( string serviceName, string? knowledgeSourceName = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListKnowledgeBases( string serviceName, string? knowledgeBaseName = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> QueryIndex( string serviceName, string indexName, string searchText, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task RetrieveFromKnowledgeBase( @@ -46,6 +40,5 @@ Task RetrieveFromKnowledgeBase( string baseName, string? query, IEnumerable<(string role, string message)>? messages, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Search/src/Services/SearchService.cs b/tools/Azure.Mcp.Tools.Search/src/Services/SearchService.cs index cef7841305..e0aec5810f 100644 --- a/tools/Azure.Mcp.Tools.Search/src/Services/SearchService.cs +++ b/tools/Azure.Mcp.Tools.Search/src/Services/SearchService.cs @@ -16,7 +16,6 @@ using Azure.Search.Documents.KnowledgeBases.Models; using Azure.Search.Documents.Models; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; using Microsoft.Mcp.Core.Services.Caching; @@ -35,7 +34,6 @@ public async Task> ListServices( string subscription, string? resourceGroup = null, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -52,7 +50,7 @@ public async Task> ListServices( return cachedRgServices; } - var subForRg = await AzureService.GetSubscription(subscription, tenantId, retryPolicy, cancellationToken); + var subForRg = await AzureService.GetSubscription(subscription, tenantId, cancellationToken: cancellationToken); var rgResource = (await subForRg.GetResourceGroupAsync(resourceGroup, cancellationToken)).Value; var rgServices = new List(); await foreach (var service in rgResource.GetSearchServices().GetAllAsync(cancellationToken: cancellationToken)) @@ -77,7 +75,7 @@ public async Task> ListServices( return cachedServices; } - var subscriptionResource = await AzureService.GetSubscription(subscription, tenantId, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenantId, cancellationToken: cancellationToken); var services = new List(); await foreach (var service in subscriptionResource.GetSearchServicesAsync(cancellationToken: cancellationToken)) { @@ -95,7 +93,6 @@ public async Task> ListServices( public async Task> GetIndexDetails( string serviceName, string? indexName, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(serviceName), serviceName)); @@ -104,7 +101,7 @@ public async Task> GetIndexDetails( if (string.IsNullOrEmpty(indexName)) { - var searchClient = await GetSearchIndexClient(serviceName, retryPolicy, cancellationToken); + var searchClient = await GetSearchIndexClient(serviceName, cancellationToken); await foreach (var index in searchClient.GetIndexesAsync(cancellationToken: cancellationToken)) { indexes.Add(MapToIndexInfo(index)); @@ -113,7 +110,7 @@ public async Task> GetIndexDetails( } else { - var searchClient = await GetSearchIndexClient(serviceName, retryPolicy, cancellationToken); + var searchClient = await GetSearchIndexClient(serviceName, cancellationToken); var index = await searchClient.GetIndexAsync(indexName, cancellationToken: cancellationToken); indexes.Add(MapToIndexInfo(index.Value)); @@ -126,7 +123,6 @@ public async Task> QueryIndex( string serviceName, string indexName, string searchText, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -134,7 +130,7 @@ public async Task> QueryIndex( (nameof(indexName), indexName), (nameof(searchText), searchText)); - var searchClient = await GetSearchIndexClient(serviceName, retryPolicy, cancellationToken); + var searchClient = await GetSearchIndexClient(serviceName, cancellationToken); var indexDefinition = await searchClient.GetIndexAsync(indexName, cancellationToken: cancellationToken); var client = searchClient.GetSearchClient(indexName); @@ -157,13 +153,12 @@ public async Task> QueryIndex( public async Task> ListKnowledgeSources( string serviceName, string? knowledgeSourceName = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(serviceName), serviceName)); var sources = new List(); - var searchClient = await GetSearchIndexClient(serviceName, retryPolicy, cancellationToken); + var searchClient = await GetSearchIndexClient(serviceName, cancellationToken); if (string.IsNullOrEmpty(knowledgeSourceName)) { @@ -187,13 +182,12 @@ public async Task> ListKnowledgeSources( public async Task> ListKnowledgeBases( string serviceName, string? knowledgeBaseName = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(serviceName), serviceName)); var bases = new List(); - var searchClient = await GetSearchIndexClient(serviceName, retryPolicy, cancellationToken); + var searchClient = await GetSearchIndexClient(serviceName, cancellationToken); if (string.IsNullOrEmpty(knowledgeBaseName)) { @@ -222,12 +216,11 @@ public async Task RetrieveFromKnowledgeBase( string baseName, string? query, IEnumerable<(string role, string message)>? messages, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(serviceName), serviceName), (nameof(baseName), baseName)); - var searchClient = await GetSearchIndexClient(serviceName, retryPolicy, cancellationToken); + var searchClient = await GetSearchIndexClient(serviceName, cancellationToken); var knowledgeBase = await searchClient.GetKnowledgeBaseAsync(baseName, cancellationToken: cancellationToken); if (knowledgeBase?.Value == null) @@ -238,7 +231,6 @@ public async Task RetrieveFromKnowledgeBase( var clientOptions = AddDefaultPolicies(new SearchClientOptions()); clientOptions.Transport = new HttpClientTransport(AzureService.GetClient()); clientOptions.Audience = GetSearchAudience(); - ConfigureRetryPolicy(clientOptions, retryPolicy); var knowledgeBaseClient = new KnowledgeBaseRetrievalClient(searchClient.Endpoint, baseName, await GetCredential(null, cancellationToken), clientOptions); var useMinimalReasoning = knowledgeBase.Value.RetrievalReasoningEffort is KnowledgeRetrievalMinimalReasoningEffort; @@ -336,7 +328,7 @@ private static List FindVectorizableFields(SearchIndex indexDefinition, return vectorizableFields; } - private async Task GetSearchIndexClient(string serviceName, RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) + private async Task GetSearchIndexClient(string serviceName, CancellationToken cancellationToken = default) { ValidateServiceName(serviceName); var key = CacheKeyBuilder.Build(SearchServicesCacheKey, serviceName, AzureService.CloudConfiguration.CloudType.ToString()); @@ -348,7 +340,6 @@ private async Task GetSearchIndexClient(string serviceName, R var clientOptions = AddDefaultPolicies(new SearchClientOptions()); clientOptions.Transport = new HttpClientTransport(AzureService.GetClient()); clientOptions.Audience = GetSearchAudience(); - ConfigureRetryPolicy(clientOptions, retryPolicy); var endpoint = new Uri(GetSearchEndpoint(serviceName)); searchClient = new SearchIndexClient(endpoint, credential, clientOptions); diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexGetCommandTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexGetCommandTests.cs index f610709030..b50bdd22e0 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Search.Commands.Index; using Azure.Mcp.Tools.Search.Models; using Azure.Mcp.Tools.Search.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -27,7 +26,6 @@ public async Task ExecuteAsync_ReturnsIndexes_WhenIndexesExist() Service.GetIndexDetails( Arg.Is("service123"), Arg.Is(s => string.IsNullOrEmpty(s)), - Arg.Any(), Arg.Any()) .Returns(expectedIndexes); @@ -44,7 +42,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoIndexes() Service.GetIndexDetails( Arg.Any(), Arg.Is(s => string.IsNullOrEmpty(s)), - Arg.Any(), Arg.Any()) .Returns([]); @@ -64,7 +61,6 @@ public async Task ExecuteAsync_HandlesException() Service.GetIndexDetails( Arg.Is(serviceName), Arg.Is(s => string.IsNullOrEmpty(s)), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -87,7 +83,6 @@ public async Task ExecuteAsync_ReturnsIndexDefinition_WhenIndexExists() Service.GetIndexDetails( Arg.Is(serviceName), Arg.Is(indexName), - Arg.Any(), Arg.Any()) .Returns([expectedDefinition]); @@ -113,7 +108,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenDefinitionIsNull() Service.GetIndexDetails( Arg.Is(serviceName), Arg.Is(indexName), - Arg.Any(), Arg.Any()) .Returns([]); @@ -137,7 +131,6 @@ public async Task ExecuteAsync_HandlesServiceException() Service.GetIndexDetails( Arg.Is(serviceName), Arg.Is(indexName), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexQueryCommandTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexQueryCommandTests.cs index 36209c2d76..23e30c98f9 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexQueryCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Index/IndexQueryCommandTests.cs @@ -5,7 +5,6 @@ using System.Text.Json; using Azure.Mcp.Tools.Search.Commands.Index; using Azure.Mcp.Tools.Search.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -43,7 +42,6 @@ public async Task ExecuteAsync_ReturnsResults_WhenSearchSucceeds() Arg.Is(serviceName), Arg.Is(indexName), Arg.Is(queryText), - Arg.Any(), Arg.Any()) .Returns(expectedResults); @@ -73,7 +71,6 @@ public async Task ExecuteAsync_HandlesServiceException() Arg.Is(serviceName), Arg.Is(indexName), Arg.Is(queryText), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseGetCommandTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseGetCommandTests.cs index 3b47925a62..8bca4edcc0 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Search.Commands.Knowledge; using Azure.Mcp.Tools.Search.Models; using Azure.Mcp.Tools.Search.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -28,7 +27,6 @@ public async Task ExecuteAsync_ReturnsKnowledgeBases_WhenBasesExist() Service.ListKnowledgeBases( Arg.Is("service123"), Arg.Is((string?)null), - Arg.Any(), Arg.Any()) .Returns(expectedBases); @@ -53,7 +51,6 @@ public async Task ExecuteAsync_ReturnsSingleKnowledgeBase_WhenNameProvided() Service.ListKnowledgeBases( Arg.Is("service123"), Arg.Is("base1"), - Arg.Any(), Arg.Any()) .Returns([expectedBase]); @@ -71,7 +68,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoBases() Service.ListKnowledgeBases( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -91,7 +87,6 @@ public async Task ExecuteAsync_HandlesException() Service.ListKnowledgeBases( Arg.Is(serviceName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseRetrieveCommandTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseRetrieveCommandTests.cs index 0c18592e61..bb58d55ef4 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseRetrieveCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeBaseRetrieveCommandTests.cs @@ -4,7 +4,6 @@ using System.Net; using Azure.Mcp.Tools.Search.Commands.Knowledge; using Azure.Mcp.Tools.Search.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -23,7 +22,6 @@ public async Task ExecuteAsync_ReturnsResult_WhenSuccessful_WithQuery() Arg.Is("base1"), Arg.Is("life"), Arg.Is?>(m => m == null), - Arg.Any(), Arg.Any()) .Returns(json); @@ -45,7 +43,6 @@ public async Task ExecuteAsync_ReturnsResult_WhenSuccessful_WithMessages() Arg.Is("base1"), Arg.Is(q => q == null), Arg.Is?>(m => m != null && m.Count == 1 && m[0].role == "user"), - Arg.Any(), Arg.Any()) .Returns(json); @@ -99,7 +96,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Any?>(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test failure")); diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeSourceGetCommandTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeSourceGetCommandTests.cs index 7e674540cc..66d72603c5 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeSourceGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Knowledge/KnowledgeSourceGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Search.Commands.Knowledge; using Azure.Mcp.Tools.Search.Models; using Azure.Mcp.Tools.Search.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -28,7 +27,6 @@ public async Task ExecuteAsync_ReturnsKnowledgeSources_WhenSourcesExist() Service.ListKnowledgeSources( Arg.Is("service123"), Arg.Is((string?)null), - Arg.Any(), Arg.Any()) .Returns(expectedSources); @@ -47,7 +45,6 @@ public async Task ExecuteAsync_ReturnsSingleKnowledgeSource_WhenNameProvided() Service.ListKnowledgeSources( Arg.Is("service123"), Arg.Is("source1"), - Arg.Any(), Arg.Any()) .Returns([expectedSource]); @@ -65,7 +62,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoSources() Service.ListKnowledgeSources( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()).Returns([]); var response = await ExecuteCommandAsync("--service", "service123"); @@ -84,7 +80,6 @@ public async Task ExecuteAsync_HandlesException() Service.ListKnowledgeSources( Arg.Is(serviceName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/SearchServiceTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/SearchServiceTests.cs index 13aa8c6ab2..813eb868a7 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/SearchServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/SearchServiceTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Search.Services; using Azure.ResourceManager; using Azure.Search.Documents.KnowledgeBases.Models; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; using Microsoft.Mcp.Core.Services.Caching; using NSubstitute; @@ -48,7 +47,7 @@ public async Task ListServices_ReturnsCachedResult_WhenSubscriptionWideCacheHit( // Assert: result comes from cache and no ARM call is made Assert.Equal(cached, result); - await _azureService.DidNotReceive().GetSubscription(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await _azureService.DidNotReceive().GetSubscription(Arg.Any(), Arg.Any(), cancellationToken: Arg.Any()); } [Fact] diff --git a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/ServiceListCommandTests.cs b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/ServiceListCommandTests.cs index 94ee5834ce..14ee2721c8 100644 --- a/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/ServiceListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Search/tests/Azure.Mcp.Tools.Search.Tests/Service/ServiceListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Search.Commands; using Azure.Mcp.Tools.Search.Commands.Service; using Azure.Mcp.Tools.Search.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -24,7 +23,6 @@ public async Task ExecuteAsync_ReturnsServices_WhenServicesExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedServices); @@ -45,7 +43,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoServices() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -69,7 +66,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -87,7 +83,7 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( { // Arrange const string resourceGroup = "test-rg"; - Service.ListServices(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListServices(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -95,6 +91,6 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( // Assert Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).ListServices(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListServices(Arg.Any(), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueueDetailsCommand.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueueDetailsCommand.cs index d6d93db1c4..feb98b1420 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueueDetailsCommand.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueueDetailsCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Namespace, options.Queue, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(details), ServiceBusJsonContext.Default.QueueDetailsCommandResult); diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueuePeekCommand.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueuePeekCommand.cs index 4211ad370d..fee039d390 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueuePeekCommand.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Queue/QueuePeekCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Queue, options.MaxMessages ?? 1, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(messages ?? []), ServiceBusJsonContext.Default.QueuePeekCommandResult); diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionDetailsCommand.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionDetailsCommand.cs index 35a4199783..918c3b75e4 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionDetailsCommand.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionDetailsCommand.cs @@ -40,7 +40,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Topic, options.SubscriptionName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(details), ServiceBusJsonContext.Default.SubscriptionDetailsCommandResult); diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionPeekCommand.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionPeekCommand.cs index 78ee1e51d6..43f37936f3 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionPeekCommand.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/SubscriptionPeekCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SubscriptionName, options.MaxMessages ?? 1, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(messages ?? []), ServiceBusJsonContext.Default.SubscriptionPeekCommandResult); diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/TopicDetailsCommand.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/TopicDetailsCommand.cs index f086ba4948..3f7c7db5e4 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/TopicDetailsCommand.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Commands/Topic/TopicDetailsCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Namespace, options.Topic, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(details), ServiceBusJsonContext.Default.TopicDetailsCommandResult); diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Queue/BaseQueueOptions.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Queue/BaseQueueOptions.cs index 1dacb51f1e..58aa3774ae 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Queue/BaseQueueOptions.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Queue/BaseQueueOptions.cs @@ -23,6 +23,4 @@ public class BaseQueueOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Topic/BaseTopicOptions.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Topic/BaseTopicOptions.cs index 9a4562ee0c..b9fe871b4f 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Topic/BaseTopicOptions.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Options/Topic/BaseTopicOptions.cs @@ -23,6 +23,4 @@ public class BaseTopicOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs index 122df0e301..aae9448553 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Tools.ServiceBus.Models; using Azure.Messaging.ServiceBus; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ServiceBus.Services; @@ -16,7 +15,6 @@ public interface IServiceBusService /// The topic name containing the subscription /// The subscription name to get details for /// Optional tenant ID - /// Optional retry policy /// Subscription details /// When the service request fails Task GetSubscriptionDetails( @@ -24,7 +22,6 @@ Task GetSubscriptionDetails( string topicName, string subscriptionName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -34,14 +31,12 @@ Task GetSubscriptionDetails( /// The queue name to get details for /// Subscription ID or name /// Optional tenant ID - /// Optional retry policy /// Queue details /// When the service request fails Task GetQueueDetails( string namespaceName, string queueName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -50,14 +45,12 @@ Task GetQueueDetails( /// The Service Bus namespace name /// The topic name to get details for /// Optional tenant ID - /// Optional retry policy /// Topic details /// When the service request fails Task GetTopicDetails( string namespaceName, string topicName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -68,7 +61,6 @@ Task GetTopicDetails( /// Maximum number of messages to peek (default: 1) /// Subscription ID or name /// Optional tenant ID - /// Optional retry policy /// List of peeked messages /// When the service request fails Task> PeekQueueMessages( @@ -76,7 +68,6 @@ Task> PeekQueueMessages( string queueName, int maxMessages, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -88,7 +79,6 @@ Task> PeekQueueMessages( /// Maximum number of messages to peek (default: 1) /// Subscription ID or name /// Optional tenant ID - /// Optional retry policy /// List of peeked messages /// When the service request fails Task> PeekSubscriptionMessages( @@ -97,6 +87,5 @@ Task> PeekSubscriptionMessages( string subscriptionName, int maxMessages, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Services/ServiceBusService.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Services/ServiceBusService.cs index 74e838eb62..c4124fe32a 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/src/Services/ServiceBusService.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Services/ServiceBusService.cs @@ -7,7 +7,6 @@ using Azure.Messaging.ServiceBus; using Azure.Messaging.ServiceBus.Administration; using Microsoft.Mcp.Core.Helpers; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ServiceBus.Services; @@ -34,11 +33,10 @@ private void ValidateNamespace(string namespaceName) private async Task CreateAdministrationClient( string namespaceName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var credential = await GetCredential(tenantId, cancellationToken); - var options = ConfigureRetryPolicy(AddDefaultPolicies(new ServiceBusAdministrationClientOptions()), retryPolicy); + var options = AddDefaultPolicies(new ServiceBusAdministrationClientOptions()); options.Transport = new HttpClientTransport(AzureService.GetClient()); return new ServiceBusAdministrationClient(namespaceName, credential, options); } @@ -47,11 +45,10 @@ public async Task GetQueueDetails( string namespaceName, string queueName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateNamespace(namespaceName); - var client = await CreateAdministrationClient(namespaceName, tenantId, retryPolicy, cancellationToken); + var client = await CreateAdministrationClient(namespaceName, tenantId, cancellationToken); var runtimeProperties = (await client.GetQueueRuntimePropertiesAsync(queueName, cancellationToken)).Value; var properties = (await client.GetQueueAsync(queueName, cancellationToken)).Value; @@ -85,11 +82,10 @@ public async Task GetSubscriptionDetails( string topicName, string subscriptionName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateNamespace(namespaceName); - var client = await CreateAdministrationClient(namespaceName, tenantId, retryPolicy, cancellationToken); + var client = await CreateAdministrationClient(namespaceName, tenantId, cancellationToken); var runtimeProperties = (await client.GetSubscriptionRuntimePropertiesAsync(topicName, subscriptionName, cancellationToken)).Value; var properties = (await client.GetSubscriptionAsync(topicName, subscriptionName, cancellationToken)).Value; @@ -116,11 +112,10 @@ public async Task GetTopicDetails( string namespaceName, string topicName, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateNamespace(namespaceName); - var client = await CreateAdministrationClient(namespaceName, tenantId, retryPolicy, cancellationToken); + var client = await CreateAdministrationClient(namespaceName, tenantId, cancellationToken); var runtimeProperties = (await client.GetTopicRuntimePropertiesAsync(topicName, cancellationToken)).Value; var properties = (await client.GetTopicAsync(topicName, cancellationToken)).Value; @@ -144,7 +139,6 @@ public async Task> PeekQueueMessages( string queueName, int maxMessages, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateNamespace(namespaceName); @@ -165,7 +159,6 @@ public async Task> PeekSubscriptionMessages( string subscriptionName, int maxMessages, string? tenantId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateNamespace(namespaceName); diff --git a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Queue/QueueDetailsCommandTests.cs b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Queue/QueueDetailsCommandTests.cs index 1c1fd7943f..8f29f3c34d 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Queue/QueueDetailsCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Queue/QueueDetailsCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ServiceBus.Models; using Azure.Mcp.Tools.ServiceBus.Services; using Azure.Messaging.ServiceBus; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -42,7 +41,6 @@ public async Task ExecuteAsync_ReturnsQueueDetails() Arg.Is(NamespaceName), Arg.Is(QueueName), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedDetails); @@ -69,7 +67,6 @@ public async Task ExecuteAsync_HandlesQueueNotFound() Arg.Is(NamespaceName), Arg.Is(QueueName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(serviceBusException); @@ -94,7 +91,6 @@ public async Task ExecuteAsync_HandlesGenericException() Arg.Is(NamespaceName), Arg.Is(QueueName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -130,7 +126,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string args, bool sho Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedDetails); } diff --git a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/SubscriptionDetailsCommandTests.cs b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/SubscriptionDetailsCommandTests.cs index 9aeccbfb35..f505247df3 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/SubscriptionDetailsCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/SubscriptionDetailsCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ServiceBus.Models; using Azure.Mcp.Tools.ServiceBus.Services; using Azure.Messaging.ServiceBus; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -43,7 +42,6 @@ public async Task ExecuteAsync_ReturnsSubscriptionDetails() Arg.Is(TopicName), Arg.Is(SubscriptionName), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedDetails); @@ -72,7 +70,6 @@ public async Task ExecuteAsync_HandlesSubscriptionNotFound() Arg.Is(TopicName), Arg.Is(SubscriptionName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(serviceBusException); @@ -99,7 +96,6 @@ public async Task ExecuteAsync_HandlesGenericException() Arg.Is(TopicName), Arg.Is(SubscriptionName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -138,7 +134,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string args, bool sho Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedDetails); } diff --git a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/TopicDetailsCommandTests.cs b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/TopicDetailsCommandTests.cs index 8fe226c199..6c1d0185be 100644 --- a/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/TopicDetailsCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ServiceBus/tests/Azure.Mcp.Tools.ServiceBus.Tests/Topic/TopicDetailsCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ServiceBus.Models; using Azure.Mcp.Tools.ServiceBus.Services; using Azure.Messaging.ServiceBus; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -42,7 +41,6 @@ public async Task ExecuteAsync_ReturnsTopicDetails() Arg.Is(NamespaceName), Arg.Is(TopicName), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedDetails); @@ -69,7 +67,6 @@ public async Task ExecuteAsync_HandlesTopicNotFound() Arg.Is(NamespaceName), Arg.Is(TopicName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(serviceBusException); @@ -94,7 +91,6 @@ public async Task ExecuteAsync_HandlesGenericException() Arg.Is(NamespaceName), Arg.Is(TopicName), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -130,7 +126,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string args, bool sho Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedDetails); } diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeGetCommand.cs b/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeGetCommand.cs index 8d2525d93d..85782e0c3e 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeGetCommand.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeGetCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Cluster, options.Node, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new([node]), ServiceFabricJsonContext.Default.ManagedClusterNodeGetCommandResult); @@ -53,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Cluster, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(nodes ?? []), ServiceFabricJsonContext.Default.ManagedClusterNodeGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeTypeRestartCommand.cs b/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeTypeRestartCommand.cs index 05fd40c8bb..54428aaf30 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeTypeRestartCommand.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeTypeRestartCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Nodes, options.UpdateType ?? Models.UpdateType.Default, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeGetOptions.cs b/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeGetOptions.cs index b006d25346..56ba607fc1 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeGetOptions.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeGetOptions.cs @@ -23,6 +23,4 @@ public sealed class ManagedClusterNodeGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeTypeRestartOptions.cs b/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeTypeRestartOptions.cs index 0ed6ca52c9..d9422fe418 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeTypeRestartOptions.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeTypeRestartOptions.cs @@ -30,6 +30,4 @@ public sealed class ManagedClusterNodeTypeRestartOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/IServiceFabricService.cs b/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/IServiceFabricService.cs index 670e0084ad..446fa05c28 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/IServiceFabricService.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/IServiceFabricService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.ServiceFabric.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ServiceFabric.Services; @@ -13,7 +12,6 @@ Task> ListManagedClusterNodes( string resourceGroup, string clusterName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task GetManagedClusterNode( @@ -22,7 +20,6 @@ Task GetManagedClusterNode( string clusterName, string nodeName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task RestartManagedClusterNodes( @@ -33,6 +30,5 @@ Task RestartManagedClusterNodes( string[] nodes, UpdateType updateType = UpdateType.Default, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/ServiceFabricService.cs b/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/ServiceFabricService.cs index da8d5ce4db..20db219a34 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/ServiceFabricService.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/src/Services/ServiceFabricService.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.ServiceFabric.Commands; using Azure.Mcp.Tools.ServiceFabric.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.ServiceFabric.Services; @@ -23,7 +22,6 @@ public async Task> ListManagedClusterNodes( string resourceGroup, string clusterName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -31,7 +29,7 @@ public async Task> ListManagedClusterNodes( (nameof(resourceGroup), resourceGroup), (nameof(clusterName), clusterName)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var subscriptionId = subscriptionResource.Id.SubscriptionId; var token = await GetArmAccessTokenAsync(tenant, cancellationToken); @@ -69,7 +67,6 @@ public async Task GetManagedClusterNode( string clusterName, string nodeName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -78,7 +75,7 @@ public async Task GetManagedClusterNode( (nameof(clusterName), clusterName), (nameof(nodeName), nodeName)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var subscriptionId = subscriptionResource.Id.SubscriptionId; var token = await GetArmAccessTokenAsync(tenant, cancellationToken); @@ -104,7 +101,6 @@ public async Task RestartManagedClusterNodes( string[] nodes, UpdateType updateType = UpdateType.Default, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -119,7 +115,7 @@ public async Task RestartManagedClusterNodes( throw new ArgumentException("At least one node name must be specified.", nameof(nodes)); } - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var subscriptionId = subscriptionResource.Id.SubscriptionId; var token = await GetArmAccessTokenAsync(tenant, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeGetCommandTests.cs b/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeGetCommandTests.cs index a56d0a19e9..9abec2f93b 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.ServiceFabric.Commands; using Azure.Mcp.Tools.ServiceFabric.Commands.ManagedCluster; using Azure.Mcp.Tools.ServiceFabric.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -40,7 +39,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -50,7 +48,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new Models.ManagedClusterNode()); } @@ -112,7 +109,6 @@ public async Task ExecuteAsync_ReturnsNodesList() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedNodes); @@ -128,7 +124,6 @@ await Service.Received(1).ListManagedClusterNodes( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, ServiceFabricJsonContext.Default.ManagedClusterNodeGetCommandResult); @@ -172,7 +167,6 @@ public async Task ExecuteAsync_ReturnsSingleNodeWhenNodeNameProvided() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedNode); @@ -187,7 +181,6 @@ public async Task ExecuteAsync_ReturnsSingleNodeWhenNodeNameProvided() await Service.Received(1).GetManagedClusterNode( "sub1", "rg1", "cluster1", "primary_0", Arg.Any(), - Arg.Any(), Arg.Any()); await Service.DidNotReceive().ListManagedClusterNodes( @@ -195,7 +188,6 @@ await Service.DidNotReceive().ListManagedClusterNodes( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, ServiceFabricJsonContext.Default.ManagedClusterNodeGetCommandResult); @@ -214,7 +206,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -239,7 +230,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -265,7 +255,6 @@ public async Task ExecuteAsync_HandlesServiceErrorsForSingleNode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new HttpRequestException("Not found", null, HttpStatusCode.NotFound)); @@ -290,7 +279,6 @@ public async Task ExecuteAsync_ReturnsEmptyListWhenNoNodes() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); diff --git a/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeTypeRestartCommandTests.cs b/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeTypeRestartCommandTests.cs index 19dbfd0b58..c2a022e80e 100644 --- a/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeTypeRestartCommandTests.cs +++ b/tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.Tests/ManagedCluster/ManagedClusterNodeTypeRestartCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.ServiceFabric.Commands.ManagedCluster; using Azure.Mcp.Tools.ServiceFabric.Models; using Azure.Mcp.Tools.ServiceFabric.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new RestartNodeResponse { StatusCode = 202 }); } @@ -87,7 +85,6 @@ public async Task ExecuteAsync_ReturnsRestartResponse() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResponse); @@ -109,7 +106,6 @@ await Service.Received(1).RestartManagedClusterNodes( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); var result = ValidateAndDeserializeResponse(response, ServiceFabricJsonContext.Default.ManagedClusterNodeTypeRestartCommandResult); @@ -131,7 +127,6 @@ public async Task ExecuteAsync_PassesUpdateTypeToService() Arg.Any(), Arg.Is(UpdateType.ByUpgradeDomain), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new RestartNodeResponse { StatusCode = 202 }); @@ -154,7 +149,6 @@ await Service.Received(1).RestartManagedClusterNodes( Arg.Any(), Arg.Is(UpdateType.ByUpgradeDomain), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -170,7 +164,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new RestartNodeResponse { StatusCode = 202 }); @@ -200,7 +193,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -230,7 +222,6 @@ public async Task ExecuteAsync_HandlesNotFoundError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new HttpRequestException("Not found", null, HttpStatusCode.NotFound)); @@ -259,7 +250,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new RestartNodeResponse { StatusCode = 202 }); @@ -283,7 +273,6 @@ await Service.Received(1).RestartManagedClusterNodes( Arg.Is(n => n.Length == 2 && n[0] == "Worker_0" && n[1] == "Worker_1"), Arg.Is(UpdateType.ByUpgradeDomain), Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.SignalR/src/Commands/Runtime/RuntimeGetCommand.cs b/tools/Azure.Mcp.Tools.SignalR/src/Commands/Runtime/RuntimeGetCommand.cs index c64da38c95..1e790cb461 100644 --- a/tools/Azure.Mcp.Tools.SignalR/src/Commands/Runtime/RuntimeGetCommand.cs +++ b/tools/Azure.Mcp.Tools.SignalR/src/Commands/Runtime/RuntimeGetCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.SignalR, options.Tenant, - options.RetryPolicy, cancellationToken); _logger.LogInformation("Found {Count} SignalR service(s) in subscription {SubscriptionId}", diff --git a/tools/Azure.Mcp.Tools.SignalR/src/Options/Runtime/RuntimeGetOptions.cs b/tools/Azure.Mcp.Tools.SignalR/src/Options/Runtime/RuntimeGetOptions.cs index a78fd61b78..858b6d9700 100644 --- a/tools/Azure.Mcp.Tools.SignalR/src/Options/Runtime/RuntimeGetOptions.cs +++ b/tools/Azure.Mcp.Tools.SignalR/src/Options/Runtime/RuntimeGetOptions.cs @@ -23,6 +23,4 @@ public sealed class RuntimeGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.SignalR/src/Services/ISignalRService.cs b/tools/Azure.Mcp.Tools.SignalR/src/Services/ISignalRService.cs index 7c9bb3373e..67cf1f68a1 100644 --- a/tools/Azure.Mcp.Tools.SignalR/src/Services/ISignalRService.cs +++ b/tools/Azure.Mcp.Tools.SignalR/src/Services/ISignalRService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.SignalR.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.SignalR.Services; @@ -16,6 +15,5 @@ Task> GetRuntimeAsync( string? resourceGroup, string? signalRName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.SignalR/src/Services/SignalRService.cs b/tools/Azure.Mcp.Tools.SignalR/src/Services/SignalRService.cs index 43eb8c196f..2024227613 100644 --- a/tools/Azure.Mcp.Tools.SignalR/src/Services/SignalRService.cs +++ b/tools/Azure.Mcp.Tools.SignalR/src/Services/SignalRService.cs @@ -7,7 +7,6 @@ using Azure.ResourceManager.SignalR; using Azure.ResourceManager.SignalR.Models; using Microsoft.Mcp.Core.Models.Identity; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Caching; namespace Azure.Mcp.Tools.SignalR.Services; @@ -28,11 +27,10 @@ public async Task> GetRuntimeAsync( string? resourceGroup, string? signalRName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken: cancellationToken); var runtimes = new List(); if (string.IsNullOrEmpty(signalRName)) { diff --git a/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.Tests/Runtime/RuntimeGetCommandTest.cs b/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.Tests/Runtime/RuntimeGetCommandTest.cs index 7d3ee8b9f1..19a2731a2c 100644 --- a/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.Tests/Runtime/RuntimeGetCommandTest.cs +++ b/tools/Azure.Mcp.Tools.SignalR/tests/Azure.Mcp.Tools.SignalR.Tests/Runtime/RuntimeGetCommandTest.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SignalR.Commands.Runtime; using Azure.Mcp.Tools.SignalR.Models; using Azure.Mcp.Tools.SignalR.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -80,7 +79,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(runtimes); } @@ -110,7 +108,6 @@ public async Task ExecuteAsync_ReturnsEmptyWhenNoRuntimes() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -132,7 +129,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -155,7 +151,6 @@ public async Task ExecuteAsync_Handles404NotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -176,7 +171,6 @@ public async Task ExecuteAsync_Handles403Forbidden() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(forbiddenException); diff --git a/tools/Azure.Mcp.Tools.Speech/src/Commands/Stt/SttRecognizeCommand.cs b/tools/Azure.Mcp.Tools.Speech/src/Commands/Stt/SttRecognizeCommand.cs index ed0dcf7faa..c9638a344f 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Commands/Stt/SttRecognizeCommand.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Commands/Stt/SttRecognizeCommand.cs @@ -120,7 +120,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Phrases, options.Format, options.Profanity, - options.RetryPolicy, cancellationToken); _logger.LogInformation( diff --git a/tools/Azure.Mcp.Tools.Speech/src/Commands/Tts/TtsSynthesizeCommand.cs b/tools/Azure.Mcp.Tools.Speech/src/Commands/Tts/TtsSynthesizeCommand.cs index 7c0dbdfc71..012ae59548 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Commands/Tts/TtsSynthesizeCommand.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Commands/Tts/TtsSynthesizeCommand.cs @@ -100,7 +100,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Voice, options.Format, options.EndpointId, - options.RetryPolicy, cancellationToken); _logger.LogInformation( diff --git a/tools/Azure.Mcp.Tools.Speech/src/Options/BaseSpeechOptions.cs b/tools/Azure.Mcp.Tools.Speech/src/Options/BaseSpeechOptions.cs index d90c4d40e1..97f1ba3054 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Options/BaseSpeechOptions.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Options/BaseSpeechOptions.cs @@ -10,6 +10,4 @@ public abstract class BaseSpeechOptions [Option(Description = "The Azure AI Services endpoint URL (e.g., https://your-service.cognitiveservices.azure.com/).")] public required string Endpoint { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/ISpeechService.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/ISpeechService.cs index e594f3fbe0..07ee582df5 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/ISpeechService.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/ISpeechService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Speech.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Speech.Services; @@ -15,7 +14,6 @@ Task RecognizeSpeechFromFile( string[]? phrases = null, string? format = null, string? profanity = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task SynthesizeSpeechToFile( @@ -26,6 +24,5 @@ Task SynthesizeSpeechToFile( string? voice = null, string? format = null, string? endpointId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/FastTranscriptionRecognizer.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/FastTranscriptionRecognizer.cs index 773e384f33..e7a543efa4 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/FastTranscriptionRecognizer.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/FastTranscriptionRecognizer.cs @@ -9,7 +9,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Speech.Models.FastTranscription; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.Speech.Services.Recognizers; @@ -29,7 +28,6 @@ public async Task RecognizeAsync( string? language = null, string[]? phrases = null, string? profanity = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(endpoint), endpoint), (nameof(filePath), filePath)); @@ -49,11 +47,8 @@ public async Task RecognizeAsync( throw new InvalidOperationException($"Audio file is too large ({fileInfo.Length / (1024.0 * 1024):F1} MB). Fast Transcription supports files up to 300 MB."); } - // Apply retry policy configuration - var maxRetries = retryPolicy?.MaxRetries ?? 3; - var delaySeconds = retryPolicy?.DelaySeconds ?? 1.0; - var maxDelaySeconds = retryPolicy?.MaxDelaySeconds ?? 30.0; - var isExponentialBackoff = retryPolicy?.Mode == RetryMode.Exponential; + const int maxRetries = 3; + const double delaySeconds = 1.0; Exception? lastException = null; @@ -165,12 +160,8 @@ public async Task RecognizeAsync( // Calculate delay for next attempt if (attempt < maxRetries) { - var delay = isExponentialBackoff - ? Math.Min(delaySeconds * Math.Pow(2, attempt), maxDelaySeconds) - : delaySeconds; - - _logger.LogDebug("Waiting {DelaySeconds} seconds before retry attempt {NextAttempt}", delay, attempt + 2); - await Task.Delay(TimeSpan.FromSeconds(delay), cancellationToken); + _logger.LogDebug("Waiting {DelaySeconds} seconds before retry attempt {NextAttempt}", delaySeconds, attempt + 2); + await Task.Delay(TimeSpan.FromSeconds(delaySeconds), cancellationToken); } } catch (Exception ex) diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs index efa938e98c..666e867444 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Speech.Models.FastTranscription; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Speech.Services.Recognizers; @@ -19,7 +18,6 @@ public interface IFastTranscriptionRecognizer /// Speech recognition language /// Optional phrases to improve recognition accuracy /// Profanity filtering option - /// Optional retry policy for resilience /// Continuous recognition result converted from Fast Transcription response Task RecognizeAsync( string endpoint, @@ -27,6 +25,5 @@ Task RecognizeAsync( string? language = null, string[]? phrases = null, string? profanity = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IRealtimeTranscriptionRecognizer.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IRealtimeTranscriptionRecognizer.cs index 55605415f9..e0c2595af2 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IRealtimeTranscriptionRecognizer.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IRealtimeTranscriptionRecognizer.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Speech.Models.Realtime; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Speech.Services.Recognizers; @@ -21,7 +20,6 @@ public interface IRealtimeTranscriptionRecognizer /// Optional phrases to improve recognition accuracy /// Output format (simple or detailed) /// Profanity filtering option (masked, removed, or raw) - /// Optional retry policy for resilience /// A cancellation token. /// Continuous recognition result containing full text and individual segments Task RecognizeAsync( @@ -31,6 +29,5 @@ Task RecognizeAsync( string[]? phrases = null, string? format = null, string? profanity = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/RealtimeTranscriptionRecognizer.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/RealtimeTranscriptionRecognizer.cs index 6f89390e09..fbf7dfac81 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/RealtimeTranscriptionRecognizer.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/RealtimeTranscriptionRecognizer.cs @@ -8,7 +8,6 @@ using Microsoft.CognitiveServices.Speech; using Microsoft.CognitiveServices.Speech.Audio; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; using SdkSpeechRecognitionResult = Microsoft.CognitiveServices.Speech.SpeechRecognitionResult; @@ -30,7 +29,6 @@ public async Task RecognizeAsync( string[]? phrases = null, string? format = null, string? profanity = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(endpoint), endpoint), (nameof(filePath), filePath)); @@ -49,11 +47,8 @@ public async Task RecognizeAsync( throw new FileNotFoundException($"Audio file not found: {filePath}"); } - // Apply retry policy configuration - var maxRetries = retryPolicy?.MaxRetries ?? 3; - var delaySeconds = retryPolicy?.DelaySeconds ?? 1.0; - var maxDelaySeconds = retryPolicy?.MaxDelaySeconds ?? 30.0; - var isExponentialBackoff = retryPolicy?.Mode == RetryMode.Exponential; + const int maxRetries = 3; + const double delaySeconds = 1.0; Exception? lastException = null; @@ -225,12 +220,8 @@ public async Task RecognizeAsync( // Calculate delay for next attempt if (attempt < maxRetries) { - var delay = isExponentialBackoff - ? Math.Min(delaySeconds * Math.Pow(2, attempt), maxDelaySeconds) - : delaySeconds; - - _logger.LogDebug("Waiting {DelaySeconds} seconds before retry attempt {NextAttempt}", delay, attempt + 2); - await Task.Delay(TimeSpan.FromSeconds(delay), cancellationToken); + _logger.LogDebug("Waiting {DelaySeconds} seconds before retry attempt {NextAttempt}", delaySeconds, attempt + 2); + await Task.Delay(TimeSpan.FromSeconds(delaySeconds), cancellationToken); } } catch (Exception ex) diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/SpeechService.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/SpeechService.cs index ba519fd6a2..51805d4cd4 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/SpeechService.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/SpeechService.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Speech.Services.Recognizers; using Azure.Mcp.Tools.Speech.Services.Synthesizers; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Speech.Services; @@ -32,7 +31,6 @@ public class SpeechService( /// Optional phrases to improve recognition accuracy (ignored for Fast Transcription) /// Output format (simple or detailed) /// Profanity filtering option (masked, removed, or raw) - /// Optional retry policy for resilience /// Cancellation token to cancel the operation /// Continuous recognition result containing full text and individual segments public async Task RecognizeSpeechFromFile( @@ -42,7 +40,6 @@ public async Task RecognizeSpeechFromFile( string[]? phrases = null, string? format = null, string? profanity = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(endpoint), endpoint), (nameof(filePath), filePath)); @@ -64,7 +61,7 @@ public async Task RecognizeSpeechFromFile( try { var fastResult = await _fastTranscriptionRecognizer.RecognizeAsync( - endpoint, filePath, locale, phrases, profanity, retryPolicy, cancellationToken); + endpoint, filePath, locale, phrases, profanity, cancellationToken); // Convert to unified result return SpeechRecognitionResult.FromFastTranscriptionResult(fastResult); @@ -79,7 +76,7 @@ public async Task RecognizeSpeechFromFile( // Use Realtime Transcription as fallback or primary choice _logger.LogInformation("Using Realtime Transcription for language '{Language}' with file '{FilePath}'", language, filePath); var realtimeResult = await _realtimeTranscriptionRecognizer.RecognizeAsync( - endpoint, filePath, locale, phrases, format, profanity, retryPolicy, cancellationToken); + endpoint, filePath, locale, phrases, format, profanity, cancellationToken); // Convert to unified result return SpeechRecognitionResult.FromRealtimeResult(realtimeResult); @@ -102,7 +99,6 @@ public async Task RecognizeSpeechFromFile( /// Voice name to use (e.g., en-US-JennyNeural). If not specified, default voice for language is used /// Output audio format (default: Riff24Khz16BitMonoPcm) /// Optional endpoint ID for custom voice model - /// Optional retry policy for resilience /// Cancellation token to cancel the operation /// Synthesis result with file information public async Task SynthesizeSpeechToFile( @@ -113,7 +109,6 @@ public async Task SynthesizeSpeechToFile( string? voice = null, string? format = null, string? endpointId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { return await _speechSynthesizer.SynthesizeToFileAsync( @@ -124,7 +119,6 @@ public async Task SynthesizeSpeechToFile( voice, format, endpointId, - retryPolicy, cancellationToken); } } diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/IRealtimeTtsSynthesizer.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/IRealtimeTtsSynthesizer.cs index fe186d9284..0aa092b466 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/IRealtimeTtsSynthesizer.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/IRealtimeTtsSynthesizer.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Speech.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Speech.Services.Synthesizers; @@ -21,7 +20,6 @@ public interface IRealtimeTtsSynthesizer /// Voice name to use (e.g., en-US-JennyNeural) /// Output audio format (default: Riff24Khz16BitMonoPcm) /// Optional endpoint ID for custom voice model - /// Optional retry policy for resilience /// A cancellation token. /// Synthesis result with file information Task SynthesizeToFileAsync( @@ -32,6 +30,5 @@ Task SynthesizeToFileAsync( string? voice = null, string? format = null, string? endpointId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/RealtimeTtsSynthesizer.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/RealtimeTtsSynthesizer.cs index ebc5eafa2b..42f287a8a6 100644 --- a/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/RealtimeTtsSynthesizer.cs +++ b/tools/Azure.Mcp.Tools.Speech/src/Services/Synthesizers/RealtimeTtsSynthesizer.cs @@ -6,7 +6,6 @@ using Microsoft.CognitiveServices.Speech; using Microsoft.CognitiveServices.Speech.Audio; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.Speech.Services.Synthesizers; @@ -29,7 +28,6 @@ public async Task SynthesizeToFileAsync( string? voice = null, string? format = null, string? endpointId = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(endpoint), endpoint), (nameof(text), text), (nameof(outputFilePath), outputFilePath)); diff --git a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/SpeechCommandTests.cs b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/SpeechCommandTests.cs index 1fea0cf786..74f31c9d04 100644 --- a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/SpeechCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/SpeechCommandTests.cs @@ -449,44 +449,6 @@ public async Task SpeechToText_WithBrokenFile_ShouldHandleGracefully() } } - [LiveTestOnly] - [Fact] - public async Task SpeechToText_ShouldHandleRetryPolicyCorrectly() - { - // Arrange - var testAudioFile = Path.Join(AppContext.BaseDirectory, "TestResources", "test-audio.wav"); - Assert.True(File.Exists(testAudioFile), $"Test audio file not found at: {testAudioFile}"); - - var aiServicesEndpoint = $"https://{Settings.ResourceBaseName}.cognitiveservices.azure.com/"; - var expectedText = "My voice is my passport. Verify me."; - - // Act - var result = await CallToolAsync( - "speech_stt_recognize", - new() - { - { "subscription", Settings.SubscriptionId }, - { "endpoint", aiServicesEndpoint }, - { "file", testAudioFile }, - { "language", "en-US" }, - { "retry-max-retries", 3 }, - { "retry-delay", 1000 } - }); - - // Assert - Assert.NotNull(result); - using var doc = JsonDocument.Parse(result.Value.GetRawText()); - var inner = doc.RootElement.GetProperty("result").GetRawText(); - var resultObj = JsonSerializer.Deserialize(inner); - - // STRICT REQUIREMENT: Speech recognition must return a result - Assert.NotNull(resultObj); - Assert.Equal(RecognizerType.Fast, resultObj.RecognizerType); - Assert.NotNull(resultObj.FastTranscriptionResult); - Assert.Null(resultObj.RealtimeContinuousResult); - Assert.Equal(expectedText, resultObj.FastTranscriptionResult.CombinedPhrases?.FirstOrDefault()?.Text); - } - [LiveTestOnly] [Fact] public async Task SpeechToText_RecognizeCompressedAudioWithRealtimeTranscription_ShouldFailWithoutGStreamer() diff --git a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Stt/SttRecognizeCommandTests.cs b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Stt/SttRecognizeCommandTests.cs index 6af9af596f..f9d1a6152b 100644 --- a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Stt/SttRecognizeCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Stt/SttRecognizeCommandTests.cs @@ -15,7 +15,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Mcp.Core.Commands; using Microsoft.Mcp.Core.Models.Command; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -88,7 +87,6 @@ private void SetupFastTranscriptionMock(string expectedText = "Hello world") Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(fastResult); } @@ -111,7 +109,6 @@ private void SetupRealtimeTranscriptionMock(string expectedText = "Hello world", Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(realtimeResult); } @@ -142,7 +139,6 @@ private void SetupRealtimeTranscriptionDetailedMock(string expectedText = "Hello Arg.Any(), "detailed", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(realtimeResult); } @@ -245,7 +241,6 @@ await _fastTranscriptionRecognizer.Received(1).RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); await _realtimeTranscriptionRecognizer.DidNotReceive().RecognizeAsync( @@ -255,7 +250,6 @@ await _realtimeTranscriptionRecognizer.DidNotReceive().RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); Assert.NotNull(result.Result.FastTranscriptionResult); @@ -270,7 +264,6 @@ await _realtimeTranscriptionRecognizer.Received(1).RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); await _fastTranscriptionRecognizer.DidNotReceive().RecognizeAsync( @@ -279,7 +272,6 @@ await _fastTranscriptionRecognizer.DidNotReceive().RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); Assert.NotNull(result.Result.RealtimeContinuousResult); @@ -323,7 +315,6 @@ public async Task ExecuteAsync_FastRecognizerFails_ShouldFallbackToRealtimeRecog Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Access denied")); @@ -343,7 +334,6 @@ await _fastTranscriptionRecognizer Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); // 2. Realtime recognizer was called as a fallback @@ -356,7 +346,6 @@ await _realtimeTranscriptionRecognizer Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); Assert.Equal(HttpStatusCode.OK, response.Status); @@ -377,7 +366,6 @@ public async Task ExecuteAsync_HandleServiceErrorWhenRealtimeTranscription() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Access denied")); @@ -394,7 +382,6 @@ await _fastTranscriptionRecognizer Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); // 2. Realtime recognizer was called and failed @@ -407,7 +394,6 @@ await _realtimeTranscriptionRecognizer Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); Assert.Equal(HttpStatusCode.Unauthorized, response.Status); @@ -492,7 +478,6 @@ await _fastTranscriptionRecognizer.Received(1).RecognizeAsync( Arg.Any(), Arg.Any(), profanityOption, - Arg.Any(), Arg.Any()); } @@ -518,7 +503,6 @@ public async Task ExecuteAsync_WithPhraseHints_ShouldPassToService() Arg.Any(), Arg.Do(phrases => capturedPhrases = phrases), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(fastResult); @@ -552,7 +536,6 @@ await _fastTranscriptionRecognizer.Received(1).RecognizeAsync( phrases.Contains("Azure") && phrases.Contains("cognitive services")), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -580,31 +563,6 @@ await _fastTranscriptionRecognizer.Received(1).RecognizeAsync( language, Arg.Any(), Arg.Any(), - Arg.Any(), - Arg.Any()); - } - - [Fact] - public async Task ExecuteAsync_WithRetryPolicy_ShouldPassToService() - { - // Arrange - var testFile = await CreateTestFileAsync("test-audio-retry.wav"); - SetupFastTranscriptionMock("Hello with retry"); - - // Act - var response = await ExecuteCommandAsync($"--endpoint {_knownEndpoint} --file {testFile} --retry-max-retries 5"); - - // Assert - Assert.Equal(HttpStatusCode.OK, response.Status); - - // Verify the service was called with retry policy - await _fastTranscriptionRecognizer.Received(1).RecognizeAsync( - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Is(policy => policy.MaxRetries == 5), Arg.Any()); } @@ -635,7 +593,6 @@ public async Task ExecuteAsync_HandlesSpecificExceptions(string exceptionType, H Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exceptionToThrow); @@ -683,7 +640,6 @@ public async Task ExecuteAsync_WithEmptyAudioFile_ShouldHandleGracefully() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(realtimeResult); @@ -766,7 +722,6 @@ public async Task ExecuteAsync_WithSemicolonSeparatedPhrases_ShouldTreatAsOnePhr Arg.Any(), Arg.Do(phrases => capturedPhrases = phrases), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(fastResult); @@ -829,7 +784,6 @@ public async Task ExecuteAsync_WithCommaSeparatedPhrases_ShouldSplitIntoSeparate Arg.Any(), Arg.Do(phrases => capturedPhrases = phrases), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(fastResult); @@ -889,7 +843,6 @@ public async Task ExecuteAsync_WithMixedPhrasesSyntax_ShouldCombineCorrectly() Arg.Any(), Arg.Do(phrases => capturedPhrases = phrases), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(fastResult); @@ -929,8 +882,7 @@ await _fastTranscriptionRecognizer.Received(1).RecognizeAsync( phrases.Contains("cognitive services") && phrases.Contains("machine learning")), Arg.Any(), - Arg.Any(), - Arg.Any()); + Arg.Any()); } finally { @@ -977,7 +929,6 @@ await _fastTranscriptionRecognizer.Received(1).RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } finally @@ -1019,7 +970,6 @@ public async Task ExecuteAsync_WithDifferentAudioFormatsAndRealtimeTranscription Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(realtimeResult); @@ -1045,7 +995,6 @@ await _realtimeTranscriptionRecognizer.Received(1).RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } finally @@ -1084,7 +1033,6 @@ await _realtimeTranscriptionRecognizer.DidNotReceive().RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); await _fastTranscriptionRecognizer.DidNotReceive().RecognizeAsync( @@ -1093,7 +1041,6 @@ await _fastTranscriptionRecognizer.DidNotReceive().RecognizeAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } finally diff --git a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Tts/TtsSynthesizeCommandTests.cs b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Tts/TtsSynthesizeCommandTests.cs index c4afc4c8cb..44457b66eb 100644 --- a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Tts/TtsSynthesizeCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Tts/TtsSynthesizeCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.Speech.Commands.Tts; using Azure.Mcp.Tools.Speech.Models; using Azure.Mcp.Tools.Speech.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -62,7 +61,6 @@ public async Task ExecuteAsync_WithValidParameters_ShouldSucceed() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -118,7 +116,6 @@ public async Task ExecuteAsync_WithAllOptionalParameters_ShouldPassThemCorrectly Arg.Is(voice), Arg.Is(format), Arg.Is(endpointId), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -145,7 +142,6 @@ await Service.Received(1).SynthesizeSpeechToFile( voice, format, endpointId, - Arg.Any(), Arg.Any()); } finally @@ -173,7 +169,6 @@ public async Task ExecuteAsync_ServiceThrowsException_ShouldHandleGracefully() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Synthesis failed")); @@ -214,7 +209,6 @@ public async Task ExecuteAsync_UnauthorizedException_ShouldReturnUnauthorizedSta Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new UnauthorizedAccessException("Access denied")); @@ -276,7 +270,6 @@ await Service.Received(1).SynthesizeSpeechToFile( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs index 8f0a84ff72..20b3fee575 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseCreateCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ElasticPoolName, options.ZoneRedundant, options.ReadScale, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(database), SqlJsonContext.Default.DatabaseCreateResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseDeleteCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseDeleteCommand.cs index 84b1b9d4c7..b7ecbd2325 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseDeleteCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(deleted, options.Database!), SqlJsonContext.Default.DatabaseDeleteResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseGetCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseGetCommand.cs index 25a1237ea5..7d5a39550f 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseGetCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Database, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( @@ -59,7 +58,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Server, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create( diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseRenameCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseRenameCommand.cs index 2f55e80675..9a6407c58d 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseRenameCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseRenameCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.NewDatabaseName, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(database), SqlJsonContext.Default.DatabaseRenameResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseUpdateCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseUpdateCommand.cs index af83a90ecf..8840a02cf4 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Database/DatabaseUpdateCommand.cs @@ -52,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ElasticPoolName, options.ZoneRedundant, options.ReadScale, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(database), SqlJsonContext.Default.DatabaseUpdateResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/ElasticPool/ElasticPoolListCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/ElasticPool/ElasticPoolListCommand.cs index 775e6672cc..ceb9050b21 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/ElasticPool/ElasticPoolListCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/ElasticPool/ElasticPoolListCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Server, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(elasticPools ?? []), SqlJsonContext.Default.ElasticPoolListResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/EntraAdmin/EntraAdminListCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/EntraAdmin/EntraAdminListCommand.cs index fbeb508901..20136c0a50 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/EntraAdmin/EntraAdminListCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/EntraAdmin/EntraAdminListCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Server, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(administrators ?? []), SqlJsonContext.Default.EntraAdminListResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleCreateCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleCreateCommand.cs index f49196c379..653227e373 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleCreateCommand.cs @@ -95,7 +95,6 @@ public override async Task ExecuteAsync(CommandContext context, options.FirewallRuleName, options.StartIpAddress, options.EndIpAddress, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(firewallRule), SqlJsonContext.Default.FirewallRuleCreateResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleDeleteCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleDeleteCommand.cs index 24c72f1ba8..5a8ac59fc8 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleDeleteCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Subscription!, options.FirewallRuleName, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(deleted, options.FirewallRuleName!), SqlJsonContext.Default.FirewallRuleDeleteResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleListCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleListCommand.cs index b22ba44190..df11364e70 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleListCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/FirewallRule/FirewallRuleListCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Server, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(firewallRules ?? []), SqlJsonContext.Default.FirewallRuleListResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs index bddde472d9..c91334ef7b 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs @@ -49,7 +49,6 @@ public override async Task ExecuteAsync(CommandContext context, options.AdministratorPassword, options.Version, options.PublicNetworkAccess, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(server), SqlJsonContext.Default.ServerCreateResult); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerDeleteCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerDeleteCommand.cs index d6979697ee..d9f81e23e5 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerDeleteCommand.cs @@ -52,7 +52,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Server, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); if (deleted) diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerGetCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerGetCommand.cs index 35bb9c77e9..14d86cc19e 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerGetCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Server, options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create([server], SqlJsonContext.Default.ListSqlServer); @@ -56,7 +55,6 @@ public override async Task ExecuteAsync(CommandContext context, var servers = await _sqlService.ListServersAsync( options.ResourceGroup, options.Subscription!, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(servers ?? [], SqlJsonContext.Default.ListSqlServer); diff --git a/tools/Azure.Mcp.Tools.Sql/src/Options/BaseSqlOptions.cs b/tools/Azure.Mcp.Tools.Sql/src/Options/BaseSqlOptions.cs index ea401d977d..67a94fb9c8 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Options/BaseSqlOptions.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Options/BaseSqlOptions.cs @@ -14,6 +14,4 @@ public class BaseSqlOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Subscription)] public string? Subscription { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/ISqlService.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/ISqlService.cs index 0b6e51c2ad..aa82c5da22 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Services/ISqlService.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Services/ISqlService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Options.Database; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Sql.Services; @@ -16,7 +15,6 @@ public interface ISqlService /// The name of the database /// The resource group name /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// The SQL database information /// Thrown when the database is not found @@ -25,7 +23,6 @@ Task GetDatabaseAsync( string databaseName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -43,7 +40,6 @@ Task GetDatabaseAsync( /// Optional elastic pool name to assign the database to /// Optional zone redundancy setting /// Optional read scale setting - /// Optional retry policy options /// Cancellation token /// The created SQL database information Task CreateDatabaseAsync( @@ -59,7 +55,6 @@ Task CreateDatabaseAsync( string? elasticPoolName = null, bool? zoneRedundant = null, DatabaseReadScale? readScale = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -77,7 +72,6 @@ Task CreateDatabaseAsync( /// Optional elastic pool name to assign the database to /// Optional zone redundancy setting /// Optional read scale setting - /// Optional retry policy options /// Cancellation token /// The updated SQL database information Task UpdateDatabaseAsync( @@ -93,7 +87,6 @@ Task UpdateDatabaseAsync( string? elasticPoolName = null, bool? zoneRedundant = null, DatabaseReadScale? readScale = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -104,7 +97,6 @@ Task UpdateDatabaseAsync( /// The desired new database name /// The resource group name /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// The renamed SQL database information Task RenameDatabaseAsync( @@ -113,7 +105,6 @@ Task RenameDatabaseAsync( string newDatabaseName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -122,14 +113,12 @@ Task RenameDatabaseAsync( /// The name of the SQL server /// The name of the resource group /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// A list of SQL databases Task> ListDatabasesAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -138,14 +127,12 @@ Task> ListDatabasesAsync( /// The name of the SQL server /// The name of the resource group /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// A list of SQL server Entra administrators Task> GetEntraAdministratorsAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -154,14 +141,12 @@ Task> GetEntraAdministratorsAsync( /// The name of the SQL server /// The name of the resource group /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// A list of SQL elastic pools Task> GetElasticPoolsAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -170,14 +155,12 @@ Task> GetElasticPoolsAsync( /// The name of the SQL server /// The name of the resource group /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// A list of SQL server firewall rules Task> ListFirewallRulesAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -189,7 +172,6 @@ Task> ListFirewallRulesAsync( /// The name of the firewall rule /// The start IP address of the firewall rule range /// The end IP address of the firewall rule range - /// Optional retry policy options /// Cancellation token /// The created SQL server firewall rule Task CreateFirewallRuleAsync( @@ -199,7 +181,6 @@ Task CreateFirewallRuleAsync( string firewallRuleName, string startIpAddress, string endIpAddress, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -209,7 +190,6 @@ Task CreateFirewallRuleAsync( /// The name of the resource group /// The subscription ID or name /// The name of the firewall rule to delete - /// Optional retry policy options /// Cancellation token /// True if the firewall rule was successfully deleted Task DeleteFirewallRuleAsync( @@ -217,7 +197,6 @@ Task DeleteFirewallRuleAsync( string resourceGroup, string subscription, string firewallRuleName, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -227,7 +206,6 @@ Task DeleteFirewallRuleAsync( /// The name of the database to delete /// The resource group name /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// True if the database was successfully deleted Task DeleteDatabaseAsync( @@ -235,7 +213,6 @@ Task DeleteDatabaseAsync( string databaseName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -249,7 +226,6 @@ Task DeleteDatabaseAsync( /// The administrator password for the SQL server /// The version of SQL Server to create (optional, defaults to latest) /// Whether public network access is enabled (optional) - /// Optional retry policy options /// Cancellation token /// The created SQL server information Task CreateServerAsync( @@ -261,7 +237,6 @@ Task CreateServerAsync( string administratorPassword, string? version, string? publicNetworkAccess, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -270,7 +245,6 @@ Task CreateServerAsync( /// The name of the SQL server /// The name of the resource group /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// The SQL server information /// Thrown when the server is not found @@ -278,7 +252,6 @@ Task GetServerAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -286,13 +259,11 @@ Task GetServerAsync( /// /// The name of the resource group /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// A list of SQL servers Task> ListServersAsync( string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); /// @@ -301,13 +272,11 @@ Task> ListServersAsync( /// The name of the SQL server /// The name of the resource group /// The subscription ID or name - /// Optional retry policy options /// Cancellation token /// True if the server was successfully deleted Task DeleteServerAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs index 598857f2c7..161d525c94 100644 --- a/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs +++ b/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs @@ -9,7 +9,6 @@ using Azure.ResourceManager.Sql; using Azure.ResourceManager.Sql.Models; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using DatabaseReadScaleOption = Azure.Mcp.Tools.Sql.Options.Database.DatabaseReadScale; using SdkDatabaseReadScale = Azure.ResourceManager.Sql.Models.DatabaseReadScale; @@ -26,17 +25,15 @@ public class SqlService(IAzureService azureService, ILogger logger) /// behavior for ID-based callers. /// /// The subscription ID or name - /// Optional retry policy configuration /// Token to observe for cancellation requests /// The resolved subscription ID private async Task ResolveSubscriptionIdAsync( string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { return AzureService.IsSubscriptionId(subscription) ? subscription - : await AzureService.GetSubscriptionIdByName(subscription, null, retryPolicy, cancellationToken); + : await AzureService.GetSubscriptionIdByName(subscription, null, cancellationToken); } /// @@ -45,17 +42,15 @@ private async Task ResolveSubscriptionIdAsync( /// The name of the SQL server /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration /// Token to observe for cancellation requests /// The SQL Server resource private async Task GetSqlServerResourceAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { - var subscriptionResource = await AzureService.GetSubscription(subscription, null, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, null, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); return await resourceGroupResource.Value.GetSqlServers().GetAsync(serverName, cancellationToken: cancellationToken); @@ -68,7 +63,6 @@ private async Task GetSqlServerResourceAsync( /// The name of the database to retrieve /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// The SQL database if found, otherwise throws KeyNotFoundException /// Thrown when the specified database is not found @@ -78,7 +72,6 @@ public async Task GetDatabaseAsync( string databaseName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -89,8 +82,8 @@ public async Task GetDatabaseAsync( try { - var subscriptionId = await ResolveSubscriptionIdAsync(subscription, retryPolicy, cancellationToken); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscriptionId, retryPolicy, cancellationToken); + var subscriptionId = await ResolveSubscriptionIdAsync(subscription, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscriptionId, cancellationToken); var databaseResource = await sqlServerResource.GetSqlDatabases().GetAsync(databaseName, cancellationToken); return ConvertToSqlDatabaseModel(databaseResource.Value); @@ -116,7 +109,6 @@ public async Task GetDatabaseAsync( /// Optional elastic pool name to assign the database to /// Optional zone redundancy setting /// Optional read scale setting - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// The created SQL database information /// Thrown when required parameters are null or empty @@ -133,7 +125,6 @@ public async Task CreateDatabaseAsync( string? elasticPoolName = null, bool? zoneRedundant = null, DatabaseReadScaleOption? readScale = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -142,7 +133,7 @@ public async Task CreateDatabaseAsync( (nameof(subscription), subscription), (nameof(databaseName), databaseName)); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var databaseData = new SqlDatabaseData(sqlServerResource.Data.Location); // Configure SKU if provided @@ -220,7 +211,6 @@ public async Task CreateDatabaseAsync( /// Optional elastic pool name to assign the database to /// Optional zone redundancy setting /// Optional read scale setting - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// The updated SQL database information /// Thrown when required parameters are null or empty @@ -237,7 +227,6 @@ public async Task UpdateDatabaseAsync( string? elasticPoolName = null, bool? zoneRedundant = null, DatabaseReadScaleOption? readScale = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -246,7 +235,7 @@ public async Task UpdateDatabaseAsync( (nameof(subscription), subscription), (nameof(databaseName), databaseName)); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var databaseResource = await sqlServerResource.GetSqlDatabases().GetAsync(databaseName, cancellationToken); var databaseData = databaseResource.Value.Data; @@ -324,7 +313,6 @@ public async Task UpdateDatabaseAsync( /// The desired new database name /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// The renamed SQL database information /// Thrown when required parameters are null or empty @@ -334,7 +322,6 @@ public async Task RenameDatabaseAsync( string newDatabaseName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -344,9 +331,9 @@ public async Task RenameDatabaseAsync( (nameof(subscription), subscription), (nameof(newDatabaseName), newDatabaseName)); - var subscriptionResource = await AzureService.GetSubscription(subscription, null, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, null, cancellationToken); var subscriptionId = subscriptionResource.Data.SubscriptionId; - var armClient = await CreateArmClientAsync(null, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(null, null, null, cancellationToken); var currentDatabaseId = SqlDatabaseResource.CreateResourceIdentifier( subscriptionId, resourceGroup, @@ -377,7 +364,6 @@ public async Task RenameDatabaseAsync( /// The name of the SQL server to list databases from /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// A list of SQL databases on the specified server /// Thrown when required parameters are null or empty @@ -385,7 +371,6 @@ public async Task> ListDatabasesAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -393,8 +378,8 @@ public async Task> ListDatabasesAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionId = await ResolveSubscriptionIdAsync(subscription, retryPolicy, cancellationToken); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscriptionId, retryPolicy, cancellationToken); + var subscriptionId = await ResolveSubscriptionIdAsync(subscription, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscriptionId, cancellationToken); var databases = new List(); await foreach (var database in sqlServerResource.GetSqlDatabases().GetAllAsync(cancellationToken: cancellationToken)) @@ -416,7 +401,6 @@ public async Task> ListDatabasesAsync( /// The name of the SQL server to get administrators for /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// A list of Entra ID administrators configured for the SQL server /// Thrown when required parameters are null or empty @@ -424,7 +408,6 @@ public async Task> GetEntraAdministratorsAsync string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -432,7 +415,7 @@ public async Task> GetEntraAdministratorsAsync (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var administrators = new List(); await foreach (var admin in sqlServerResource.GetSqlServerAzureADAdministrators().GetAllAsync(cancellationToken)) @@ -463,7 +446,6 @@ public async Task> GetEntraAdministratorsAsync /// The name of the SQL server to get elastic pools from /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// A list of elastic pools configured on the SQL server /// Thrown when required parameters are null or empty @@ -471,7 +453,6 @@ public async Task> GetElasticPoolsAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -479,8 +460,8 @@ public async Task> GetElasticPoolsAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionId = await ResolveSubscriptionIdAsync(subscription, retryPolicy, cancellationToken); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscriptionId, retryPolicy, cancellationToken); + var subscriptionId = await ResolveSubscriptionIdAsync(subscription, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscriptionId, cancellationToken); var elasticPools = new List(); await foreach (var elasticPool in sqlServerResource.GetElasticPools().GetAllAsync(cancellationToken: cancellationToken)) @@ -502,7 +483,6 @@ public async Task> GetElasticPoolsAsync( /// The name of the SQL server to get firewall rules for /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// A list of firewall rules configured on the SQL server /// Thrown when required parameters are null or empty @@ -510,7 +490,6 @@ public async Task> ListFirewallRulesAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -518,7 +497,7 @@ public async Task> ListFirewallRulesAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var firewallRules = new List(); await foreach (var firewallRule in sqlServerResource.GetSqlFirewallRules().GetAllAsync(cancellationToken)) @@ -549,7 +528,6 @@ public async Task> ListFirewallRulesAsync( /// The name of the firewall rule to create /// The start IP address of the firewall rule range /// The end IP address of the firewall rule range - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// The created firewall rule /// Thrown when required parameters are null or empty @@ -560,7 +538,6 @@ public async Task CreateFirewallRuleAsync( string firewallRuleName, string startIpAddress, string endIpAddress, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -571,7 +548,7 @@ public async Task CreateFirewallRuleAsync( (nameof(startIpAddress), startIpAddress), (nameof(endIpAddress), endIpAddress)); - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var firewallRuleData = new SqlFirewallRuleData() { StartIPAddress = startIpAddress, @@ -603,7 +580,6 @@ public async Task CreateFirewallRuleAsync( /// The name of the resource group containing the server /// The subscription ID or name /// The name of the firewall rule to delete - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// True if the firewall rule was successfully deleted /// Thrown when required parameters are null or empty @@ -612,7 +588,6 @@ public async Task DeleteFirewallRuleAsync( string resourceGroup, string subscription, string firewallRuleName, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -623,7 +598,7 @@ public async Task DeleteFirewallRuleAsync( try { - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var firewallRuleResource = await sqlServerResource.GetSqlFirewallRules().GetAsync(firewallRuleName, cancellationToken); var deleteOperation = await firewallRuleResource.Value.DeleteAsync(WaitUntil.Started, cancellationToken); @@ -657,7 +632,6 @@ public async Task DeleteFirewallRuleAsync( /// The administrator password for the SQL server /// The version of SQL Server to create (optional, defaults to latest) /// Whether public network access is enabled (optional) - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// The created SQL server /// Thrown when required parameters are null or empty @@ -670,7 +644,6 @@ public async Task CreateServerAsync( string administratorPassword, string? version, string? publicNetworkAccess, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { ValidateRequiredParameters( @@ -682,7 +655,7 @@ public async Task CreateServerAsync( (nameof(administratorPassword), administratorPassword)); // Resolve the subscription (supports both subscription IDs and names) before navigating to the resource group - var subscriptionResource = await AzureService.GetSubscription(subscription, null, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, null, cancellationToken); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serverData = new SqlServerData(location) { @@ -725,7 +698,6 @@ public async Task CreateServerAsync( /// The name of the SQL server /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// The SQL server if found, otherwise throws KeyNotFoundException /// Thrown when the specified server is not found @@ -734,7 +706,6 @@ public async Task GetServerAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -742,7 +713,7 @@ public async Task GetServerAsync( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var server = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var server = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var tags = server.Data.Tags?.ToDictionary() ?? []; return new( @@ -763,21 +734,19 @@ public async Task GetServerAsync( /// /// The name of the resource group containing the servers /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// A list of SQL servers found in the specified resource group /// Thrown when required parameters are null or empty public async Task> ListServersAsync( string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( (nameof(resourceGroup), resourceGroup), (nameof(subscription), subscription)); - var subscriptionResource = await AzureService.GetSubscription(subscription, null, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(subscription, null, cancellationToken); ResourceManager.Resources.ResourceGroupResource resourceGroupResource; @@ -808,7 +777,6 @@ public async Task DeleteServerAsync( string serverName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -818,7 +786,7 @@ public async Task DeleteServerAsync( try { - var serverResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var serverResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var operation = await serverResource.DeleteAsync(WaitUntil.Started, cancellationToken); await WaitForLroCompletionAsync(operation, cancellationToken); @@ -841,7 +809,6 @@ public async Task DeleteServerAsync( /// The name of the database to delete /// The name of the resource group containing the server /// The subscription ID or name - /// Optional retry policy configuration for resilient operations /// Token to observe for cancellation requests /// True if the database was successfully deleted /// Thrown when required parameters are null or empty @@ -850,7 +817,6 @@ public async Task DeleteDatabaseAsync( string databaseName, string resourceGroup, string subscription, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -861,7 +827,7 @@ public async Task DeleteDatabaseAsync( try { - var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, retryPolicy, cancellationToken); + var sqlServerResource = await GetSqlServerResourceAsync(serverName, resourceGroup, subscription, cancellationToken); var databaseResource = await sqlServerResource.GetSqlDatabases().GetAsync(databaseName, cancellationToken); var deleteOperation = await databaseResource.Value.DeleteAsync(WaitUntil.Started, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseCreateCommandTests.cs index cf6c26c7f9..e3983cd96b 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Options.Database; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -59,7 +58,6 @@ public async Task ExecuteAsync_WithValidParameters_CreatesDatabase() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -112,7 +110,6 @@ public async Task ExecuteAsync_WithOptionalParameters_CreatesDatabase() Arg.Any(), Arg.Is(true), Arg.Is(DatabaseReadScale.Disabled), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -171,7 +168,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -206,7 +202,6 @@ public async Task ExecuteAsync_HandlesDatabaseAlreadyExists() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -240,7 +235,6 @@ public async Task ExecuteAsync_HandlesServerNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -274,7 +268,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(authException); @@ -308,7 +301,6 @@ public async Task ExecuteAsync_HandlesInvalidConfiguration() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(badRequestException); @@ -366,7 +358,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string commandArgs, b Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); } @@ -424,7 +415,6 @@ public async Task ExecuteAsync_WithNullSku_CreatesDatabase() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -455,7 +445,6 @@ await Service.Received(1).CreateDatabaseAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -494,7 +483,6 @@ public async Task ExecuteAsync_WithBasicSku_CreatesBasicDatabase() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -527,7 +515,6 @@ await Service.Received(1).CreateDatabaseAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -566,7 +553,6 @@ public async Task ExecuteAsync_WithStandardSku_CreatesStandardDatabase() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -599,7 +585,6 @@ await Service.Received(1).CreateDatabaseAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -638,7 +623,6 @@ public async Task ExecuteAsync_WithPremiumSku_CreatesPremiumDatabase() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -671,7 +655,6 @@ await Service.Received(1).CreateDatabaseAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseDeleteCommandTests.cs index 41b7a89ae5..9e9484c0c2 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseDeleteCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Sql.Commands.Database; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -75,7 +73,6 @@ public async Task ExecuteAsync_DeletesDatabaseSuccessfully() "db1", "rg1", "sub1", - Arg.Any(), Arg.Any()) .Returns(true); @@ -98,7 +95,6 @@ public async Task ExecuteAsync_IdempotentWhenDatabaseMissing() "missingdb", "rg1", "sub1", - Arg.Any(), Arg.Any()) .Returns(false); @@ -121,7 +117,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -145,7 +140,6 @@ public async Task ExecuteAsync_Handles404Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestFailed); @@ -168,7 +162,6 @@ public async Task ExecuteAsync_Handles403Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestFailed); @@ -195,7 +188,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -210,36 +202,6 @@ await Service.Received(1).DeleteDatabaseAsync( database, resourceGroup, subscription, - Arg.Any(), - Arg.Any()); - } - - [Fact] - public async Task ExecuteAsync_WithRetryPolicyOptions() - { - Service.DeleteDatabaseAsync( - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) - .Returns(true); - - var response = await ExecuteCommandAsync( - "--subscription", "sub1", - "--resource-group", "rg1", - "--server", "server1", - "--database", "db1", - "--retry-max-retries", "5"); - - Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).DeleteDatabaseAsync( - "server1", - "db1", - "rg1", - "sub1", - Arg.Is(r => r != null && r.MaxRetries == 5), Arg.Any()); } @@ -256,7 +218,6 @@ public async Task ExecuteAsync_HandlesVariousDatabaseNames(string dbName) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -272,7 +233,6 @@ await Service.Received(1).DeleteDatabaseAsync( dbName, "rg1", "sub1", - Arg.Any(), Arg.Any()); } @@ -285,7 +245,6 @@ public async Task ExecuteAsync_HandlesArgumentException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(argumentException); @@ -307,7 +266,6 @@ public async Task ExecuteAsync_VerifiesResultContainsExpectedData() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseGetCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseGetCommandTests.cs index 1234eefa47..0eee223f61 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.Database; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -34,7 +33,6 @@ public async Task ExecuteAsync_WithDatabaseName_ReturnsSingleDatabase() Arg.Is("testdb"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -50,8 +48,8 @@ public async Task ExecuteAsync_WithDatabaseName_ReturnsSingleDatabase() Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); Assert.Equal("Success", response.Message); - await Service.Received(1).GetDatabaseAsync("server1", "testdb", "rg", "sub", Arg.Any(), Arg.Any()); - await Service.DidNotReceive().ListDatabasesAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).GetDatabaseAsync("server1", "testdb", "rg", "sub", Arg.Any()); + await Service.DidNotReceive().ListDatabasesAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -64,7 +62,6 @@ public async Task ExecuteAsync_WithoutDatabaseName_ReturnsAllDatabases() Arg.Is("server1"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any()) .Returns(mockDatabases); @@ -79,8 +76,8 @@ public async Task ExecuteAsync_WithoutDatabaseName_ReturnsAllDatabases() Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); Assert.Equal("Success", response.Message); - await Service.Received(1).ListDatabasesAsync("server1", "rg", "sub", Arg.Any(), Arg.Any()); - await Service.DidNotReceive().GetDatabaseAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListDatabasesAsync("server1", "rg", "sub", Arg.Any()); + await Service.DidNotReceive().GetDatabaseAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -91,7 +88,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -117,7 +113,6 @@ public async Task ExecuteAsync_HandlesNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -142,7 +137,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(authException); @@ -169,10 +163,10 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string commandArgs, b if (shouldSucceed) { Service - .ListDatabasesAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .ListDatabasesAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new List()); Service - .GetDatabaseAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .GetDatabaseAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(CreateMockDatabase("db1")); } diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseRenameCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseRenameCommandTests.cs index b4f84afa34..638f5a02f9 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseRenameCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseRenameCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.Database; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -51,7 +50,6 @@ public async Task ExecuteAsync_WithValidParameters_RenamesDatabase() Arg.Is("newdb"), // Verify new-database-name is correctly bound (not null) Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -74,7 +72,6 @@ await Service.Received(1).RenameDatabaseAsync( "newdb", "rg", "sub", - Arg.Any(), Arg.Any()); } @@ -118,7 +115,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string commandArgs, b Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); } @@ -152,7 +148,6 @@ public async Task ExecuteAsync_HandlesDatabaseNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -180,7 +175,6 @@ public async Task ExecuteAsync_HandlesConflictWhenNewNameExists() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -209,7 +203,6 @@ public async Task ExecuteAsync_HandlesBadRequest() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(badRequestException); @@ -236,7 +229,6 @@ public async Task ExecuteAsync_HandlesGeneralException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Unexpected error")); @@ -282,7 +274,6 @@ public async Task ExecuteAsync_WithSubscriptionFromEnvironment_Succeeds() Arg.Is("newdb"), Arg.Is("rg"), Arg.Is("env-sub-id"), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseUpdateCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseUpdateCommandTests.cs index 9b6e1454da..6f29bccde4 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseUpdateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Database/DatabaseUpdateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Options.Database; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -59,7 +58,6 @@ public async Task ExecuteAsync_WithValidParameters_UpdatesDatabase() Arg.Any(), Arg.Is(true), Arg.Is(DatabaseReadScale.Disabled), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -118,7 +116,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -153,7 +150,6 @@ public async Task ExecuteAsync_HandlesDatabaseNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -187,7 +183,6 @@ public async Task ExecuteAsync_HandlesInvalidConfiguration() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(badRequestException); @@ -248,7 +243,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string commandArgs, b Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); } @@ -306,7 +300,6 @@ public async Task ExecuteAsync_WithMinimumRequiredParameters_Succeeds() Arg.Is((string?)null), // ElasticPoolName Arg.Is((bool?)null), // ZoneRedundant Arg.Is((DatabaseReadScale?)null), // ReadScale - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -337,7 +330,6 @@ await Service.Received(1).UpdateDatabaseAsync( (string?)null, // ElasticPoolName (bool?)null, // ZoneRedundant (DatabaseReadScale?)null, // ReadScale - Arg.Any(), Arg.Any()); } @@ -381,7 +373,6 @@ public async Task ExecuteAsync_WithOptionalParameters_Succeeds(string commandArg Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -429,7 +420,6 @@ public async Task ExecuteAsync_WithSubscriptionFromEnvironment_Succeeds() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -463,7 +453,6 @@ public async Task ExecuteAsync_WithInvalidServerName_HandlesServiceError() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Invalid server name")); @@ -497,7 +486,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(authException); @@ -548,7 +536,6 @@ public async Task ExecuteAsync_UpdateFromBasicToStandard_Succeeds() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -602,7 +589,6 @@ public async Task ExecuteAsync_UpdateFromStandardToBasic_Succeeds() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -656,7 +642,6 @@ public async Task ExecuteAsync_UpdateFromBasicToPremium_Succeeds() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -710,7 +695,6 @@ public async Task ExecuteAsync_UpdateFromStandardToPremium_Succeeds() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -764,7 +748,6 @@ public async Task ExecuteAsync_UpdateFromPremiumToStandard_Succeeds() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); @@ -818,7 +801,6 @@ public async Task ExecuteAsync_UpdateFromPremiumToBasic_Succeeds() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockDatabase); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/ElasticPool/ElasticPoolListCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/ElasticPool/ElasticPoolListCommandTests.cs index 1de705a8ca..02d39691d5 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/ElasticPool/ElasticPoolListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/ElasticPool/ElasticPoolListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.ElasticPool; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -52,7 +51,6 @@ public async Task ExecuteAsync_WithValidParameters_ReturnsElasticPools() Arg.Is("server1"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any()) .Returns(mockElasticPools); @@ -79,7 +77,6 @@ public async Task ExecuteAsync_WithEmptyList_ReturnsEmptyResults() Arg.Is("server1"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any()) .Returns(mockElasticPools); @@ -104,7 +101,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -129,7 +125,6 @@ public async Task ExecuteAsync_HandlesRequestFailedException_NotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -153,7 +148,6 @@ public async Task ExecuteAsync_HandlesRequestFailedException_Forbidden() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -183,7 +177,6 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string args, bool sho Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new List()); } diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/EntraAdmin/EntraAdminListCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/EntraAdmin/EntraAdminListCommandTests.cs index 654f162808..e96f8936a2 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/EntraAdmin/EntraAdminListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/EntraAdmin/EntraAdminListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.EntraAdmin; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -38,7 +37,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); } @@ -73,7 +71,6 @@ public async Task ExecuteAsync_ReturnsAdministratorsSuccessfully() "testserver", "testrg", "testsub", - Arg.Any(), Arg.Any()) .Returns(administrators); @@ -97,7 +94,6 @@ public async Task ExecuteAsync_ReturnsEmptyListWhenNoAdministrators() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -121,7 +117,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -146,7 +141,6 @@ public async Task ExecuteAsync_Handles404Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -170,7 +164,6 @@ public async Task ExecuteAsync_Handles403Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleCreateCommandTests.cs index 3d95b3a22a..cf78ff1330 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.FirewallRule; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -50,7 +49,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedFirewallRule); } @@ -88,7 +86,6 @@ public async Task ExecuteAsync_CreatesFirewallRuleSuccessfully() "TestRule", "192.168.1.1", "192.168.1.255", - Arg.Any(), Arg.Any()) .Returns(expectedFirewallRule); @@ -118,7 +115,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -149,7 +145,6 @@ public async Task ExecuteAsync_Handles404Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -179,7 +174,6 @@ public async Task ExecuteAsync_Handles403Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -209,7 +203,6 @@ public async Task ExecuteAsync_Handles409Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -239,7 +232,6 @@ public async Task ExecuteAsync_HandlesArgumentException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(argumentException); @@ -282,7 +274,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedFirewallRule); @@ -303,55 +294,6 @@ await Service.Received(1).CreateFirewallRuleAsync( ruleName, startIp, endIp, - Arg.Any(), - Arg.Any()); - } - - [Fact] - public async Task ExecuteAsync_WithRetryPolicyOptions() - { - // Arrange - var expectedFirewallRule = new SqlServerFirewallRule( - "TestRule", - "/subscriptions/testsub/resourceGroups/testrg/providers/Microsoft.Sql/servers/testserver/firewallRules/TestRule", - "Microsoft.Sql/servers/firewallRules", - "192.168.1.1", - "192.168.1.255"); - - Service.CreateFirewallRuleAsync( - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) - .Returns(expectedFirewallRule); - - // Act - var response = await ExecuteCommandAsync( - "--subscription", "testsub", - "--resource-group", "testrg", - "--server", "testserver", - "--firewall-rule-name", "TestRule", - "--start-ip-address", "192.168.1.1", - "--end-ip-address", "192.168.1.255", - "--retry-max-retries", "3"); - - // Assert - Assert.Equal(HttpStatusCode.OK, response.Status); - Assert.NotNull(response.Results); - - // Verify the service was called with retry policy - await Service.Received(1).CreateFirewallRuleAsync( - "testserver", - "testrg", - "testsub", - "TestRule", - "192.168.1.1", - "192.168.1.255", - Arg.Is(r => r != null && r.MaxRetries == 3), Arg.Any()); } @@ -376,7 +318,6 @@ public async Task ExecuteAsync_HandlesVariousIPFormats(string startIp, string en Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedFirewallRule); @@ -419,7 +360,7 @@ public async Task ExecuteAsync_RejectsInvalidIpAddressFormat(string startIp, str Assert.Contains("IP address format", response.Message); // Verify service was never called due to validation failure - await Service.DidNotReceive().CreateFirewallRuleAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.DidNotReceive().CreateFirewallRuleAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Theory] @@ -442,7 +383,7 @@ public async Task ExecuteAsync_RejectsDangerousIpRanges(string startIp, string e Assert.Contains("security", response.Message); // Verify service was never called due to validation failure - await Service.DidNotReceive().CreateFirewallRuleAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.DidNotReceive().CreateFirewallRuleAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleDeleteCommandTests.cs index 83f5114b58..ff6ec96b42 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleDeleteCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Sql.Commands.FirewallRule; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -76,7 +74,6 @@ public async Task ExecuteAsync_DeletesFirewallRuleSuccessfully() "testrg", "testsub", "TestRule", - Arg.Any(), Arg.Any()) .Returns(true); @@ -102,7 +99,6 @@ public async Task ExecuteAsync_HandlesIdempotentDelete_WhenRuleDoesNotExist() "testrg", "testsub", "NonExistentRule", - Arg.Any(), Arg.Any()) .Returns(false); @@ -128,7 +124,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -155,7 +150,6 @@ public async Task ExecuteAsync_Handles404Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -181,7 +175,6 @@ public async Task ExecuteAsync_Handles403Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -211,7 +204,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -228,42 +220,6 @@ await Service.Received(1).DeleteFirewallRuleAsync( resourceGroup, subscription, ruleName, - Arg.Any(), - Arg.Any()); - } - - [Fact] - public async Task ExecuteAsync_WithRetryPolicyOptions() - { - // Arrange - Service.DeleteFirewallRuleAsync( - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) - .Returns(true); - - // Act - var response = await ExecuteCommandAsync( - "--subscription", "testsub", - "--resource-group", "testrg", - "--server", "testserver", - "--firewall-rule-name", "TestRule", - "--retry-max-retries", "3"); - - // Assert - Assert.Equal(HttpStatusCode.OK, response.Status); - Assert.NotNull(response.Results); - - // Verify the service was called with retry policy - await Service.Received(1).DeleteFirewallRuleAsync( - "testserver", - "testrg", - "testsub", - "TestRule", - Arg.Is(r => r != null && r.MaxRetries == 3), Arg.Any()); } @@ -281,7 +237,6 @@ public async Task ExecuteAsync_HandlesVariousRuleNames(string ruleName) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -302,7 +257,6 @@ await Service.Received(1).DeleteFirewallRuleAsync( "testrg", "testsub", ruleName, - Arg.Any(), Arg.Any()); } @@ -316,7 +270,6 @@ public async Task ExecuteAsync_HandlesArgumentException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(argumentException); @@ -342,7 +295,6 @@ public async Task ExecuteAsync_VerifiesResultContainsExpectedData() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleListCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleListCommandTests.cs index 199a6a66cc..35dc099ab4 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/FirewallRule/FirewallRuleListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.FirewallRule; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,7 +38,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); } @@ -75,7 +73,6 @@ public async Task ExecuteAsync_ReturnsFirewallRulesSuccessfully() "testserver", "testrg", "testsub", - Arg.Any(), Arg.Any()) .Returns(firewallRules); @@ -99,7 +96,6 @@ public async Task ExecuteAsync_ReturnsEmptyListWhenNoFirewallRules() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -123,7 +119,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -148,7 +143,6 @@ public async Task ExecuteAsync_Handles404Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -172,7 +166,6 @@ public async Task ExecuteAsync_Handles403Error() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -199,7 +192,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -214,45 +206,7 @@ await Service.Received(1).ListFirewallRulesAsync( serverName, resourceGroup, subscription, - Arg.Any(), Arg.Any()); } - [Fact] - public async Task ExecuteAsync_WithRetryPolicyOptions() - { - // Arrange - var firewallRules = new List - { - new("TestRule", "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.Sql/servers/server/firewallRules/TestRule", - "Microsoft.Sql/servers/firewallRules", "10.0.0.1", "10.0.0.10") - }; - - Service.ListFirewallRulesAsync( - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) - .Returns(firewallRules); - - // Act - var response = await ExecuteCommandAsync( - "--subscription", "testsub", - "--resource-group", "testrg", - "--server", "testserver", - "--retry-max-retries", "3"); - - // Assert - Assert.Equal(HttpStatusCode.OK, response.Status); - Assert.NotNull(response.Results); - - // Verify the service was called with retry policy - await Service.Received(1).ListFirewallRulesAsync( - "testserver", - "testrg", - "testsub", - Arg.Is(r => r != null && r.MaxRetries == 3), - Arg.Any()); - } } diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerCreateCommandTests.cs index 6dcc5d7104..132bfb6f2f 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.Server; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -60,7 +59,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedServer); } @@ -106,7 +104,6 @@ public async Task ExecuteAsync_CreatesServerSuccessfully() "Password123!", Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedServer); @@ -133,7 +130,6 @@ await Service.Received(1).CreateServerAsync( "Password123!", Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -163,7 +159,6 @@ public async Task ExecuteAsync_WithOptionalParameters_PassesAllParameters() "Password123!", "12.0", "Disabled", - Arg.Any(), Arg.Any()) .Returns(expectedServer); @@ -191,7 +186,6 @@ await Service.Received(1).CreateServerAsync( "Password123!", "12.0", "Disabled", - Arg.Any(), Arg.Any()); } @@ -222,7 +216,6 @@ public async Task ExecuteAsync_WithoutPublicNetworkAccess_PassesNullToService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedServer); @@ -249,7 +242,6 @@ await Service.Received(1).CreateServerAsync( "Password123!", Arg.Is(v => v == null), // version not specified Arg.Is(p => p == null), // publicNetworkAccess not specified; service defaults to Disabled - Arg.Any(), Arg.Any()); } @@ -266,7 +258,6 @@ public async Task ExecuteAsync_WithInvalidPublicNetworkAccess_ReturnsBadRequest( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Invalid value 'Enabeld' for public-network-access. Allowed values are 'Enabled' or 'Disabled'.", "publicNetworkAccess")); @@ -298,7 +289,6 @@ public async Task ExecuteAsync_WhenServiceThrowsException_ReturnsErrorResponse() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -331,7 +321,6 @@ public async Task ExecuteAsync_WhenServerAlreadyExists_Returns409StatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerDeleteCommandTests.cs index 08ce675fa6..fca2355679 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerDeleteCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.Sql.Commands.Server; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -39,7 +38,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); } @@ -82,7 +80,6 @@ public async Task ExecuteAsync_WhenServerDeletedSuccessfully_ReturnsSuccess() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(true); @@ -96,7 +93,7 @@ public async Task ExecuteAsync_WhenServerDeletedSuccessfully_ReturnsSuccess() // Assert Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); - await Service.Received(1).DeleteServerAsync("testserver", "rg", "sub", Arg.Any(), Arg.Any()); + await Service.Received(1).DeleteServerAsync("testserver", "rg", "sub", Arg.Any()); } [Fact] @@ -107,7 +104,6 @@ public async Task ExecuteAsync_WhenServerNotFound_Returns404() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(false); @@ -131,7 +127,6 @@ public async Task ExecuteAsync_WhenServiceThrowsException_ReturnsErrorResponse() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -157,7 +152,6 @@ public async Task ExecuteAsync_WhenServerNotFoundFromAzure_Returns404StatusCode( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); @@ -183,7 +177,6 @@ public async Task ExecuteAsync_WhenUnauthorized_Returns403StatusCode() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(requestException); diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerGetCommandTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerGetCommandTests.cs index 3960f8c05b..8c04148898 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Server/ServerGetCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Commands.Server; using Azure.Mcp.Tools.Sql.Models; using Azure.Mcp.Tools.Sql.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -34,7 +33,6 @@ public async Task ExecuteAsync_WithServerName_ReturnsSingleServer() Arg.Is("server1"), Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any()) .Returns(mockServer); @@ -49,8 +47,8 @@ public async Task ExecuteAsync_WithServerName_ReturnsSingleServer() Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); Assert.Equal("Success", response.Message); - await Service.Received(1).GetServerAsync("server1", "rg", "sub", Arg.Any(), Arg.Any()); - await Service.DidNotReceive().ListServersAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).GetServerAsync("server1", "rg", "sub", Arg.Any()); + await Service.DidNotReceive().ListServersAsync(Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -62,7 +60,6 @@ public async Task ExecuteAsync_WithoutServerName_ReturnsAllServers() Service.ListServersAsync( Arg.Is("rg"), Arg.Is("sub"), - Arg.Any(), Arg.Any()) .Returns(mockServers); @@ -74,8 +71,8 @@ public async Task ExecuteAsync_WithoutServerName_ReturnsAllServers() Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); Assert.Equal("Success", response.Message); - await Service.Received(1).ListServersAsync("rg", "sub", Arg.Any(), Arg.Any()); - await Service.DidNotReceive().GetServerAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListServersAsync("rg", "sub", Arg.Any()); + await Service.DidNotReceive().GetServerAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -85,7 +82,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Service.ListServersAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -107,7 +103,6 @@ public async Task ExecuteAsync_HandlesNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -130,7 +125,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Service.ListServersAsync( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(authException); @@ -153,10 +147,10 @@ public async Task ExecuteAsync_ValidatesRequiredParameters(string commandArgs, b if (shouldSucceed) { Service - .ListServersAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .ListServersAsync(Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); Service - .GetServerAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .GetServerAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(CreateMockServer("server1")); } diff --git a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Services/SqlServiceTests.cs b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Services/SqlServiceTests.cs index 38186f1cd1..4a67f38398 100644 --- a/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Services/SqlServiceTests.cs +++ b/tools/Azure.Mcp.Tools.Sql/tests/Azure.Mcp.Tools.Sql.Tests/Services/SqlServiceTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Sql.Services; using Azure.ResourceManager; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -50,7 +49,6 @@ public SqlServiceTests() _azureService.GetSubscription( Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException(SubscriptionResolvedMessage)); @@ -61,7 +59,7 @@ public SqlServiceTests() public async Task GetServerAsync_ResolvesSubscriptionThroughAzureService() { var ex = await Assert.ThrowsAsync(() => - _service.GetServerAsync("server1", "rg", SubscriptionName, null, TestContext.Current.CancellationToken)); + _service.GetServerAsync("server1", "rg", SubscriptionName, TestContext.Current.CancellationToken)); Assert.Equal(SubscriptionResolvedMessage, ex.Message); await AssertSubscriptionResolvedAsync(); @@ -71,7 +69,7 @@ public async Task GetServerAsync_ResolvesSubscriptionThroughAzureService() public async Task ListServersAsync_ResolvesSubscriptionThroughAzureService() { var ex = await Assert.ThrowsAsync(() => - _service.ListServersAsync("rg", SubscriptionName, null, TestContext.Current.CancellationToken)); + _service.ListServersAsync("rg", SubscriptionName, TestContext.Current.CancellationToken)); Assert.Equal(SubscriptionResolvedMessage, ex.Message); await AssertSubscriptionResolvedAsync(); @@ -89,9 +87,7 @@ public async Task CreateServerAsync_ResolvesSubscriptionThroughAzureService() "admin", "P@ssw0rd!", null, - null, - null, - TestContext.Current.CancellationToken)); + null, TestContext.Current.CancellationToken)); Assert.Equal(SubscriptionResolvedMessage, ex.Message); await AssertSubscriptionResolvedAsync(); @@ -106,9 +102,7 @@ public async Task RenameDatabaseAsync_ResolvesSubscriptionThroughAzureService() "olddb", "newdb", "rg", - SubscriptionName, - null, - TestContext.Current.CancellationToken)); + SubscriptionName, TestContext.Current.CancellationToken)); Assert.Equal(SubscriptionResolvedMessage, ex.Message); await AssertSubscriptionResolvedAsync(); @@ -118,37 +112,36 @@ private Task AssertSubscriptionResolvedAsync() => _azureService.Received(1).GetSubscription( SubscriptionName, Arg.Any(), - Arg.Any(), Arg.Any()); [Fact] public async Task ListDatabasesAsync_WithSubscriptionName_ResolvesNameToId() { _azureService.IsSubscriptionId(SubscriptionName).Returns(false); - _azureService.GetSubscriptionIdByName(SubscriptionName, Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscriptionIdByName(SubscriptionName, Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException(ResolveSentinel)); var exception = await Assert.ThrowsAsync( - () => _service.ListDatabasesAsync(ServerName, ResourceGroup, SubscriptionName, null, TestContext.Current.CancellationToken)); + () => _service.ListDatabasesAsync(ServerName, ResourceGroup, SubscriptionName, TestContext.Current.CancellationToken)); Assert.Equal(ResolveSentinel, exception.Message); await _azureService.Received(1).GetSubscriptionIdByName( - SubscriptionName, Arg.Any(), Arg.Any(), Arg.Any()); + SubscriptionName, Arg.Any(), Arg.Any()); } [Fact] public async Task GetElasticPoolsAsync_WithSubscriptionName_ResolvesNameToId() { _azureService.IsSubscriptionId(SubscriptionName).Returns(false); - _azureService.GetSubscriptionIdByName(SubscriptionName, Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscriptionIdByName(SubscriptionName, Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException(ResolveSentinel)); var exception = await Assert.ThrowsAsync( - () => _service.GetElasticPoolsAsync(ServerName, ResourceGroup, SubscriptionName, null, TestContext.Current.CancellationToken)); + () => _service.GetElasticPoolsAsync(ServerName, ResourceGroup, SubscriptionName, TestContext.Current.CancellationToken)); Assert.Equal(ResolveSentinel, exception.Message); await _azureService.Received(1).GetSubscriptionIdByName( - SubscriptionName, Arg.Any(), Arg.Any(), Arg.Any()); + SubscriptionName, Arg.Any(), Arg.Any()); } [Fact] @@ -159,7 +152,7 @@ public async Task ListDatabasesAsync_WithSubscriptionId_SkipsNameLookup() try { - await _service.ListDatabasesAsync(ServerName, ResourceGroup, SubscriptionId, null, canceled); + await _service.ListDatabasesAsync(ServerName, ResourceGroup, SubscriptionId, canceled); } catch { @@ -167,7 +160,7 @@ public async Task ListDatabasesAsync_WithSubscriptionId_SkipsNameLookup() } await _azureService.DidNotReceive().GetSubscriptionIdByName( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -178,7 +171,7 @@ public async Task GetElasticPoolsAsync_WithSubscriptionId_SkipsNameLookup() try { - await _service.GetElasticPoolsAsync(ServerName, ResourceGroup, SubscriptionId, null, canceled); + await _service.GetElasticPoolsAsync(ServerName, ResourceGroup, SubscriptionId, canceled); } catch { @@ -186,22 +179,22 @@ public async Task GetElasticPoolsAsync_WithSubscriptionId_SkipsNameLookup() } await _azureService.DidNotReceive().GetSubscriptionIdByName( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] public async Task GetDatabaseAsync_WithSubscriptionName_ResolvesNameToId() { _azureService.IsSubscriptionId(SubscriptionName).Returns(false); - _azureService.GetSubscriptionIdByName(SubscriptionName, Arg.Any(), Arg.Any(), Arg.Any()) + _azureService.GetSubscriptionIdByName(SubscriptionName, Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException(ResolveSentinel)); var exception = await Assert.ThrowsAsync( - () => _service.GetDatabaseAsync(ServerName, DatabaseName, ResourceGroup, SubscriptionName, null, TestContext.Current.CancellationToken)); + () => _service.GetDatabaseAsync(ServerName, DatabaseName, ResourceGroup, SubscriptionName, TestContext.Current.CancellationToken)); Assert.Equal(ResolveSentinel, exception.Message); await _azureService.Received(1).GetSubscriptionIdByName( - SubscriptionName, Arg.Any(), Arg.Any(), Arg.Any()); + SubscriptionName, Arg.Any(), Arg.Any()); } [Fact] @@ -212,7 +205,7 @@ public async Task GetDatabaseAsync_WithSubscriptionId_SkipsNameLookup() try { - await _service.GetDatabaseAsync(ServerName, DatabaseName, ResourceGroup, SubscriptionId, null, canceled); + await _service.GetDatabaseAsync(ServerName, DatabaseName, ResourceGroup, SubscriptionId, canceled); } catch { @@ -220,7 +213,7 @@ public async Task GetDatabaseAsync_WithSubscriptionId_SkipsNameLookup() } await _azureService.DidNotReceive().GetSubscriptionIdByName( - Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + Arg.Any(), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsGetCommand.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsGetCommand.cs index 480f016293..8f3269fea0 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsGetCommand.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsGetCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Agent, options.Tenant, - options.RetryPolicy, cancellationToken); if (agent is null) diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsListCommand.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsListCommand.cs index 3230362370..de8f723793 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsListCommand.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/src/Commands/Agents/AgentsListCommand.cs @@ -41,7 +41,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(agents), SreAgentJsonContext.Default.AgentsListCommandResult); diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentCommandHelpers.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentCommandHelpers.cs index 641ea09aec..b395562319 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentCommandHelpers.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/src/Commands/SreAgentCommandHelpers.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.SreAgent.Commands; @@ -17,7 +16,6 @@ public static async Task ResolveAgentEndpointAsync( string? resourceGroup, string agentName, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { var agent = await sreAgentService.GetAgentAsync( @@ -25,7 +23,6 @@ public static async Task ResolveAgentEndpointAsync( resourceGroup, agentName, tenant, - retryPolicy, cancellationToken); if (agent is null) @@ -55,7 +52,6 @@ public static Task ResolveAgentEndpointAsync( options.ResourceGroup, options.Agent, options.Tenant, - options.RetryPolicy, cancellationToken); } @@ -78,7 +74,6 @@ public static async Task ResolveAgentResourceGroupAsync( options.Subscription!, options.Agent, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsListOptions.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsListOptions.cs index 61e7c5ff75..586524d533 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsListOptions.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsListOptions.cs @@ -17,6 +17,4 @@ public sealed class AgentsListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Options/BaseSreAgentOptions.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Options/BaseSreAgentOptions.cs index 288e5b5ae4..789c9cead7 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/src/Options/BaseSreAgentOptions.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/src/Options/BaseSreAgentOptions.cs @@ -20,6 +20,4 @@ public class BaseSreAgentOptions : ISubscriptionOption [Option(Description = OptionDescriptions.ResourceGroup)] public string? ResourceGroup { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs index bcbef0cc3a..d6a20f7315 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options.Threads; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.SreAgent.Services; @@ -16,7 +15,6 @@ Task> ListAgentsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -27,7 +25,6 @@ Task> ListAgentsAsync( string? resourceGroup = null, string agentName = "", string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #region Agents + Skills (sub-agent A) @@ -93,7 +90,6 @@ Task ResolveAgentResourceGroupAsync( string subscription, string agentName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task TestConnectorAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Services/SreAgentService.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Services/SreAgentService.cs index d3d2c03596..bf1aa4603e 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/src/Services/SreAgentService.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/src/Services/SreAgentService.cs @@ -11,7 +11,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options.Threads; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.SreAgent.Services; /// @@ -60,7 +59,6 @@ public async Task> ListAgentsAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -69,7 +67,7 @@ public async Task> ListAgentsAsync( SreAgentResourceType, resourceGroup, subscription, - retryPolicy, + null, ConvertToSreAgentResource, tenant: tenant, cancellationToken: cancellationToken); @@ -82,7 +80,6 @@ public async Task> ListAgentsAsync( string? resourceGroup = null, string agentName = "", string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ArgumentException.ThrowIfNullOrWhiteSpace(subscription); @@ -92,7 +89,7 @@ public async Task> ListAgentsAsync( SreAgentResourceType, resourceGroup, subscription, - retryPolicy, + null, ConvertToSreAgentResource, additionalFilter: $"name =~ '{EscapeKqlString(agentName)}'", tenant: tenant, @@ -242,7 +239,6 @@ public async Task ResolveAgentResourceGroupAsync( string subscription, string agentName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ArgumentException.ThrowIfNullOrWhiteSpace(subscription); @@ -252,7 +248,7 @@ public async Task ResolveAgentResourceGroupAsync( SreAgentResourceType, resourceGroup: null, subscription: subscription, - retryPolicy: retryPolicy, + retryPolicy: null, converter: ConvertToSreAgentResource, additionalFilter: $"name =~ '{EscapeKqlString(agentName)}'", tenant: tenant, diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsCreateCommandTests.cs index 8d41ee1b03..ea1a7dc97a 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Agents; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateSubAgentAsync( @@ -74,7 +73,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS [Fact] public async Task ExecuteAsync_DeserializationValidation() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); var testAgent = new SreSubAgent { Name = "testsubagent", Properties = new SreSubAgentProperties { Instructions = "test" } }; @@ -96,7 +95,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateSubAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) @@ -111,7 +110,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateSubAgentAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsDeleteCommandTests.cs index 11ac53c756..9ebd656a83 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Agents; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.DeleteSubAgentAsync( @@ -71,7 +70,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS [Fact] public async Task ExecuteAsync_DeserializationValidation() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); var deleteResult = new SreAgentDeleteResult("testsubagent", "Agent", true); @@ -93,7 +92,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.DeleteSubAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) @@ -108,7 +107,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.DeleteSubAgentAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsGetCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsGetCommandTests.cs index f1105dc559..a78361eb9b 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Agents; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -42,7 +41,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); } @@ -62,7 +61,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS public async Task ExecuteAsync_DeserializationValidation() { var testAgent = new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai", Location = "eastus2" }; - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(testAgent); var response = await ExecuteCommandAsync("--subscription", "sub", "--agent", "myagent"); @@ -76,7 +75,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); var response = await ExecuteCommandAsync("--subscription", "sub", "--agent", "myagent"); @@ -88,7 +87,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent" }); var response = await ExecuteCommandAsync("--subscription", "sub", "--agent", "myagent"); @@ -99,7 +98,6 @@ await Service.Received(1).GetAgentAsync( Arg.Any(), "myagent", Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsListCommandTests.cs index 23a89ab178..e8198acfc9 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Agents; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -35,7 +34,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new List { new() { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" } }); } @@ -63,7 +61,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -76,7 +73,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task ExecuteAsync_EmptyList_ReturnsEmptyResults() { - Service.ListAgentsAsync("sub", null, Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListAgentsAsync("sub", null, Arg.Any(), Arg.Any()) .Returns(new List()); var response = await ExecuteCommandAsync("--subscription", "sub"); @@ -88,12 +85,12 @@ public async Task ExecuteAsync_EmptyList_ReturnsEmptyResults() [Fact] public async Task ExecuteAsync_PassesResourceGroupAndTenant() { - Service.ListAgentsAsync("sub", "rg", "tenant", Arg.Any(), Arg.Any()) + Service.ListAgentsAsync("sub", "rg", "tenant", Arg.Any()) .Returns(new List()); var response = await ExecuteCommandAsync("--subscription", "sub", "--resource-group", "rg", "--tenant", "tenant"); Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).ListAgentsAsync("sub", "rg", "tenant", Arg.Any(), Arg.Any()); + await Service.Received(1).ListAgentsAsync("sub", "rg", "tenant", Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsCreateCommandTests.cs index 9bb2d9c34f..f18344bd71 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Agents; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateAgentToolAsync( @@ -73,7 +72,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS [Fact] public async Task ExecuteAsync_DeserializationValidation() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); var testTool = new SreAgentTool { Name = "testtool", Properties = new SreAgentToolProperties { Type = "KustoTool" } }; @@ -95,7 +94,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateAgentToolAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) @@ -110,7 +109,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateAgentToolAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsGetCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsGetCommandTests.cs index 2c282d7945..0063e0a8a6 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Agents/AgentsToolsGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Agents; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -43,7 +42,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.GetAgentToolAsync( @@ -69,7 +68,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS [Fact] public async Task ExecuteAsync_DeserializationValidation() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); var testTool = new SreAgentTool { Name = "testtool", Properties = new SreAgentToolProperties { Type = "KustoTool" } }; @@ -91,7 +90,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.GetAgentToolAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) @@ -106,7 +105,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.GetAgentToolAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsCreateCommandTests.cs index b62717c59b..570878b5da 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsCreateCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.CommonPrompts; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.CreateOrUpdateCommonPromptAsync( @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.CreateOrUpdateCommonPromptAsync( @@ -104,7 +101,6 @@ public async Task ExecuteAsync_PassesNameAndContent() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.CreateOrUpdateCommonPromptAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsDeleteCommandTests.cs index 886f4761d9..3a468fdd6f 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.CommonPrompts; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.DeleteCommonPromptAsync( @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.DeleteCommonPromptAsync( @@ -103,7 +100,6 @@ public async Task ExecuteAsync_RequiresConfirmFlag() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); @@ -122,7 +118,6 @@ public async Task ExecuteAsync_DeletesWhenConfirmed() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.DeleteCommonPromptAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsGetCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsGetCommandTests.cs index 732c76c58e..b3d2023dc6 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.CommonPrompts; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.GetCommonPromptAsync( @@ -78,7 +76,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.GetCommonPromptAsync( @@ -102,7 +99,6 @@ public async Task ExecuteAsync_ReturnsPromptContent() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.GetCommonPromptAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsListCommandTests.cs index 54f5a15f7f..2251877aaa 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/CommonPrompts/CommonPromptsListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.CommonPrompts; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ListCommonPromptsAsync( @@ -77,7 +75,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ListCommonPromptsAsync( @@ -101,7 +98,6 @@ public async Task ExecuteAsync_PassesSearchFilter() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ListCommonPromptsAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateKustoCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateKustoCommandTests.cs index d113ed63a2..a44f190561 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateKustoCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateKustoCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Connectors; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -50,7 +49,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( @@ -84,7 +82,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( @@ -112,7 +109,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( @@ -139,7 +135,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateMcpCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateMcpCommandTests.cs index b7c970db09..28fd0a610d 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateMcpCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsCreateMcpCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Connectors; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -49,7 +48,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( @@ -83,7 +81,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( @@ -111,7 +108,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( @@ -138,7 +134,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.CreateOrUpdateConnectorAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsDeleteCommandTests.cs index 41f9f90287..bc8fe36ba9 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Connectors; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteConnectorAsync( @@ -81,7 +79,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteConnectorAsync( @@ -108,7 +105,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteConnectorAsync( @@ -134,7 +130,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteConnectorAsync("sub", "rg", "agent1", "connector1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsGetCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsGetCommandTests.cs index a97ec67bc3..f3272b22d2 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Connectors; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetConnectorAsync( @@ -81,7 +79,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetConnectorAsync( @@ -108,7 +105,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetConnectorAsync( @@ -134,7 +130,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetConnectorAsync("sub", "rg", "agent1", "connector1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsListCommandTests.cs index f7d883550c..0747fc2c97 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Connectors; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListConnectorsAsync( @@ -79,7 +77,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListConnectorsAsync( @@ -105,7 +102,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListConnectorsAsync( @@ -130,7 +126,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListConnectorsAsync("sub", "rg", "agent1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsTestCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsTestCommandTests.cs index 49586f16b6..81f5c43e72 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsTestCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Connectors/ConnectorsTestCommandTests.cs @@ -47,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.TestConnectorAsync( @@ -78,7 +77,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.TestConnectorAsync( @@ -103,7 +101,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.TestConnectorAsync( @@ -127,7 +124,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.TestConnectorAsync("https://agent1.azuresre.ai", "connector1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesAddCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesAddCommandTests.cs index 53857d38ae..bdae0c77f9 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesAddCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesAddCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Docs; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.UploadMemoryAsync( @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.UploadMemoryAsync( @@ -104,7 +101,6 @@ public async Task ExecuteAsync_UploadsMemoryWithContent() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.UploadMemoryAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesDeleteCommandTests.cs index e3046724cc..2663f6469e 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Docs; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.DeleteMemoryAsync( @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.DeleteMemoryAsync( @@ -103,7 +100,6 @@ public async Task ExecuteAsync_RequiresConfirmFlag() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); @@ -122,7 +118,6 @@ public async Task ExecuteAsync_DeletesWhenConfirmed() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.DeleteMemoryAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesListCommandTests.cs index 952028155b..434fe13aa5 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Docs; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ListMemoriesAsync( @@ -74,7 +72,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ListMemoriesAsync( @@ -97,7 +94,6 @@ public async Task ExecuteAsync_ReturnsDocumentList() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ListMemoriesAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesReindexCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesReindexCommandTests.cs index 6fd5302b7a..697337f633 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesReindexCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesReindexCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Docs; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ReindexMemoriesAsync( @@ -74,7 +72,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ReindexMemoriesAsync( @@ -97,7 +94,6 @@ public async Task ExecuteAsync_TriggersReindex() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.ReindexMemoriesAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesSearchCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesSearchCommandTests.cs index 80a092ff7c..bfe767c041 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesSearchCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Docs/MemoriesSearchCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Docs; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.SearchMemoriesAsync( @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.SearchMemoriesAsync( @@ -104,7 +101,6 @@ public async Task ExecuteAsync_PassesQueryAndReturnsResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://myagent.azuresre.ai" }); Service.SearchMemoriesAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksDeleteCommandTests.cs index 5b13491f86..9c193bfbf0 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksDeleteCommandTests.cs @@ -47,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteHookAsync( @@ -78,7 +77,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteHookAsync( @@ -103,7 +101,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteHookAsync( @@ -127,7 +124,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeleteHookAsync("https://agent1.azuresre.ai", "hook1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksGetCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksGetCommandTests.cs index b7172e5280..c8fc9928dc 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksGetCommandTests.cs @@ -47,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetHookAsync( @@ -78,7 +77,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetHookAsync( @@ -103,7 +101,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetHookAsync( @@ -127,7 +124,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.GetHookAsync("https://agent1.azuresre.ai", "hook1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksListCommandTests.cs index bd0d215ea5..6bd9be0e6c 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksListCommandTests.cs @@ -46,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListHooksAsync( @@ -76,7 +75,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListHooksAsync( @@ -100,7 +98,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListHooksAsync( @@ -123,7 +120,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListHooksAsync("https://agent1.azuresre.ai", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadActivateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadActivateCommandTests.cs index b8e8487331..b1ced1ae21 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadActivateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadActivateCommandTests.cs @@ -48,7 +48,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ActivateThreadHookAsync( @@ -80,7 +79,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ActivateThreadHookAsync( @@ -106,7 +104,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ActivateThreadHookAsync( @@ -131,7 +128,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ActivateThreadHookAsync("https://agent1.azuresre.ai", "thread1", "hook1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadDeactivateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadDeactivateCommandTests.cs index 24cb116aa0..62fc4c36e0 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadDeactivateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadDeactivateCommandTests.cs @@ -48,7 +48,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeactivateThreadHookAsync( @@ -80,7 +79,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeactivateThreadHookAsync( @@ -106,7 +104,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeactivateThreadHookAsync( @@ -131,7 +128,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.DeactivateThreadHookAsync("https://agent1.azuresre.ai", "thread1", "hook1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadListCommandTests.cs index ee5c09d324..82ddc5e4ee 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Hooks/HooksThreadListCommandTests.cs @@ -47,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListThreadHooksAsync( @@ -78,7 +77,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListThreadHooksAsync( @@ -103,7 +101,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListThreadHooksAsync( @@ -127,7 +124,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); Service.ListThreadHooksAsync("https://agent1.azuresre.ai", "thread1", null, Arg.Any()) diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsActiveListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsActiveListCommandTests.cs index 22bdad4e44..932341bfd7 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsActiveListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsActiveListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -101,7 +98,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -125,7 +121,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsCreateCommandTests.cs index 2d5b59117e..e7e4e586a6 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -80,7 +78,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -105,7 +102,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -130,7 +126,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansCreateCommandTests.cs index e8460a2bc8..5148cccb03 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -49,7 +48,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -81,7 +79,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -102,7 +99,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -127,7 +123,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansListCommandTests.cs index 75d30f2886..1a067cc19e 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsPlansListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -76,7 +74,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -97,7 +94,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -120,7 +116,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupPagerdutyCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupPagerdutyCommandTests.cs index b899d5cb8d..e214ad3897 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupPagerdutyCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupPagerdutyCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,10 +47,9 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns("rg"); Service.GetConnectorAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(); @@ -80,10 +78,9 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns("rg"); Service.GetConnectorAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(); @@ -105,10 +102,9 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns("rg"); Service.GetConnectorAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(); @@ -130,10 +126,9 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync("sub", "agent1", "tenant1", Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync("sub", "agent1", "tenant1", Arg.Any()) .Returns("rg"); Service.GetConnectorAsync("sub", "rg", "agent1", Arg.Any(), "tenant1", Arg.Any()) .ThrowsAsync(); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupServicenowCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupServicenowCommandTests.cs index 77c5603403..d0af8f1f28 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupServicenowCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Incidents/IncidentsSetupServicenowCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,10 +47,9 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns("rg"); Service.GetConnectorAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(); @@ -80,10 +78,9 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns("rg"); Service.GetConnectorAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(); @@ -105,10 +102,9 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns("rg"); Service.GetConnectorAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(); @@ -130,10 +126,9 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); - Service.ResolveAgentResourceGroupAsync("sub", "agent1", "tenant1", Arg.Any(), Arg.Any()) + Service.ResolveAgentResourceGroupAsync("sub", "agent1", "tenant1", Arg.Any()) .Returns("rg"); Service.GetConnectorAsync("sub", "rg", "agent1", Arg.Any(), "tenant1", Arg.Any()) .ThrowsAsync(); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksCreateCommandTests.cs index ba533d9f3e..5ccced0349 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -104,7 +101,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -129,7 +125,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksDeleteCommandTests.cs index 959541d4b0..3bf63f0dd6 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -78,7 +76,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -103,7 +100,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -128,7 +124,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksGetCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksGetCommandTests.cs index 813d4bb849..fabeae0c78 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -102,7 +99,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -127,7 +123,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksListCommandTests.cs index 76756d9c3b..3a48de09f9 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -101,7 +98,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -125,7 +121,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksPauseCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksPauseCommandTests.cs index ba181a9fc8..bfec490f63 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksPauseCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksPauseCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -102,7 +99,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -127,7 +123,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksResumeCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksResumeCommandTests.cs index e39e4992e5..4f2d534a2a 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksResumeCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/ScheduledTasks/ScheduledTasksResumeCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -102,7 +99,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -127,7 +123,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsCreateCommandTests.cs index eba6e8c87d..3650b7b6f5 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Skills; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateSkillAsync( @@ -71,7 +70,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS [Fact] public async Task ExecuteAsync_DeserializationValidation() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); var testSkill = new SreSkill { Name = "testskill", Properties = new SreSkillProperties { SkillContent = "test content" } }; @@ -93,7 +92,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateSkillAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) @@ -108,7 +107,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.CreateSkillAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsDeleteCommandTests.cs index 183a3681de..12641cd05d 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Skills; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -44,7 +43,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.DeleteSkillAsync( @@ -70,7 +69,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS [Fact] public async Task ExecuteAsync_DeserializationValidation() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); var deleteResult = new SreAgentDeleteResult("testskill", "Skill", true); @@ -92,7 +91,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.DeleteSkillAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) @@ -107,7 +106,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.DeleteSkillAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsListCommandTests.cs index cd90c37954..48cc290aa4 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Skills/SkillsListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Skills; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -41,7 +40,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS { if (shouldSucceed) { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.ListSkillsAsync( @@ -66,7 +65,7 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS [Fact] public async Task ExecuteAsync_DeserializationValidation() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); var skills = new List @@ -88,7 +87,7 @@ public async Task ExecuteAsync_DeserializationValidation() [Fact] public async Task ExecuteAsync_HandlesServiceErrors() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.ListSkillsAsync(Arg.Any(), Arg.Any(), Arg.Any()) @@ -103,7 +102,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() [Fact] public async Task BindOptions_BindsOptionsCorrectly() { - Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAgentAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "myagent", Endpoint = "https://test.azuresre.ai" }); Service.ListSkillsAsync( diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsCreateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsCreateCommandTests.cs index 141321b85f..e57c09ce26 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Threads; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -92,7 +90,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -133,7 +130,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -158,7 +154,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsDeleteCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsDeleteCommandTests.cs index 7298979660..bdd1417bc1 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsDeleteCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsDeleteCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Threads; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -77,7 +75,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -106,7 +103,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -131,7 +127,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsGetCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsGetCommandTests.cs index cc30dbd9bc..e07e0accdc 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Threads; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -83,7 +81,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -116,7 +113,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -141,7 +137,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateCommandTests.cs index 9519777422..8b1858ef68 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Threads; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -49,7 +48,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -94,7 +92,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -134,7 +131,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -159,7 +155,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateYoloCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateYoloCommandTests.cs index cd5d233c7d..cf1ab1ce84 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateYoloCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsInvestigateYoloCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Threads; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -49,7 +48,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -101,7 +99,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -148,7 +145,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -173,7 +169,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsListCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsListCommandTests.cs index 64d92c488e..52ec9782d9 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsListCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Threads; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -81,7 +79,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -112,7 +109,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -136,7 +132,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsSendMessageCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsSendMessageCommandTests.cs index 6047b7504f..ba8c3c321e 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsSendMessageCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Threads/ThreadsSendMessageCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Commands.Threads; using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -48,7 +47,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -94,7 +92,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -136,7 +133,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); @@ -162,7 +158,6 @@ public async Task BindOptions_BindsOptionsCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "test-agent", Endpoint = "https://test.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Workflows/WorkflowsApplyCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Workflows/WorkflowsApplyCommandTests.cs index 7e362e8bc3..fd657b62df 100644 --- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Workflows/WorkflowsApplyCommandTests.cs +++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/Workflows/WorkflowsApplyCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.SreAgent.Models; using Azure.Mcp.Tools.SreAgent.Options; using Azure.Mcp.Tools.SreAgent.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -45,7 +44,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -106,7 +103,6 @@ public async Task ExecuteAsync_DeserializationValidation() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); @@ -133,7 +129,6 @@ public async Task BindOptions_BindsOptionsCorrectly() null, "agent1", "tenant1", - Arg.Any(), Arg.Any()) .Returns(new SreAgentResource { Name = "agent1", Endpoint = "https://agent1.azuresre.ai" }); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountCreateCommand.cs b/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountCreateCommand.cs index 02a727eb3e..b39ec4bb0b 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountCreateCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.AccessTier, options.EnableHierarchicalNamespace, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new AccountCreateCommandResult(account), StorageJsonContext.Default.AccountCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountGetCommand.cs b/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountGetCommand.cs index a949c4c37e..378428da53 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Commands/Account/AccountGetCommand.cs @@ -38,7 +38,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new AccountGetCommandResult(accounts?.Results ?? [], accounts?.AreResultsTruncated ?? false), StorageJsonContext.Default.AccountGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobGetCommand.cs b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobGetCommand.cs index d64c1e9f09..fc9e7a9ef8 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobGetCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Prefix, options.Tenant, - options.RetryPolicy, cancellationToken ); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobUploadCommand.cs b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobUploadCommand.cs index af341f9f9c..46655647d0 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobUploadCommand.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/BlobUploadCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.LocalFilePath, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(result, StorageJsonContext.Default.BlobUploadResult); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerCreateCommand.cs b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerCreateCommand.cs index c248c86ae6..11104ccada 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerCreateCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Container, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new ContainerCreateCommandResult(containerInfo), StorageJsonContext.Default.ContainerCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerGetCommand.cs b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerGetCommand.cs index 01d991661b..0e80eb4d55 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerGetCommand.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Commands/Blob/Container/ContainerGetCommand.cs @@ -49,7 +49,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Prefix, options.Tenant, - options.RetryPolicy, cancellationToken ); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Commands/Table/TableListCommand.cs b/tools/Azure.Mcp.Tools.Storage/src/Commands/Table/TableListCommand.cs index 0b9f031833..2ac64e3b80 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Commands/Table/TableListCommand.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Commands/Table/TableListCommand.cs @@ -37,7 +37,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Account, options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new TableListCommandResult(tables ?? []), StorageJsonContext.Default.TableListCommandResult); diff --git a/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountCreateOptions.cs b/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountCreateOptions.cs index 02435384f2..df57ea4b78 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountCreateOptions.cs @@ -32,6 +32,4 @@ public class AccountCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountGetOptions.cs b/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountGetOptions.cs index 16e316b954..567f46559a 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountGetOptions.cs @@ -20,6 +20,4 @@ public class AccountGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobGetOptions.cs b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobGetOptions.cs index 503c9c8836..6de1ebc83d 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobGetOptions.cs @@ -26,6 +26,4 @@ public class BlobGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobUploadOptions.cs b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobUploadOptions.cs index 25826c5ca6..24fdc6a07f 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobUploadOptions.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobUploadOptions.cs @@ -26,6 +26,4 @@ public class BlobUploadOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerCreateOptions.cs b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerCreateOptions.cs index 12dee5018d..bf769cf259 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerCreateOptions.cs @@ -20,6 +20,4 @@ public class ContainerCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerGetOptions.cs b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerGetOptions.cs index 37a61e533c..be68355b8d 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerGetOptions.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerGetOptions.cs @@ -23,6 +23,4 @@ public class ContainerGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Options/Table/TableListOptions.cs b/tools/Azure.Mcp.Tools.Storage/src/Options/Table/TableListOptions.cs index 881559996f..8177563075 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Options/Table/TableListOptions.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Options/Table/TableListOptions.cs @@ -17,6 +17,4 @@ public class TableListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Services/IStorageService.cs b/tools/Azure.Mcp.Tools.Storage/src/Services/IStorageService.cs index 9606ce78d5..567ef8a59e 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Services/IStorageService.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Services/IStorageService.cs @@ -3,7 +3,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.Storage.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Storage.Services; @@ -14,7 +13,6 @@ Task> GetAccountDetails( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateStorageAccount( @@ -26,7 +24,6 @@ Task CreateStorageAccount( string? accessTier = null, bool? enableHierarchicalNamespace = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetBlobDetails( @@ -36,7 +33,6 @@ Task> GetBlobDetails( string subscription, string? prefix = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> GetContainerDetails( @@ -45,7 +41,6 @@ Task> GetContainerDetails( string subscription, string? prefix = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task CreateContainer( @@ -53,7 +48,6 @@ Task CreateContainer( string container, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task UploadBlob( @@ -63,13 +57,11 @@ Task UploadBlob( string localFilePath, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListTables( string account, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs b/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs index 0a7047aeba..37de53b9d6 100644 --- a/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs +++ b/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs @@ -12,7 +12,6 @@ using Azure.ResourceManager; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Core.Services.Azure.Authentication; namespace Azure.Mcp.Tools.Storage.Services; @@ -33,7 +32,6 @@ public async Task> GetAccountDetails( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); @@ -47,7 +45,7 @@ public async Task> GetAccountDetails( "Microsoft.Storage/storageAccounts", resourceGroup, subscription, - retryPolicy, + null, ConvertToAccountInfoModel, tenant: tenant, cancellationToken: cancellationToken); @@ -58,7 +56,7 @@ public async Task> GetAccountDetails( "Microsoft.Storage/storageAccounts", resourceGroup: resourceGroup, subscription: subscription, - retryPolicy: retryPolicy, + retryPolicy: null, converter: ConvertToAccountInfoModel, additionalFilter: $"name =~ '{EscapeKqlString(account)}'", tenant: tenant, @@ -77,7 +75,6 @@ public async Task CreateStorageAccount( string? accessTier = null, bool? enableHierarchicalNamespace = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -87,13 +84,13 @@ public async Task CreateStorageAccount( (nameof(subscription), subscription)); // Create ArmClient for deployments - ArmClient armClient = await CreateArmClientWithApiVersionAsync("Microsoft.Storage/storageAccounts", "2024-01-01", tenant, retryPolicy, cancellationToken); + ArmClient armClient = await CreateArmClientWithApiVersionAsync("Microsoft.Storage/storageAccounts", "2024-01-01", tenant, null, cancellationToken); // Resolve subscription display name to GUID (consistent with all other storage operations). // Skip resolution when subscription is already a GUID to avoid an unnecessary round-trip. var subscriptionId = AzureService.IsSubscriptionId(subscription) ? subscription - : (await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken)).Data.SubscriptionId; + : (await AzureService.GetSubscription(subscription, tenant, cancellationToken)).Data.SubscriptionId; // Prepare data ResourceIdentifier accountId = new($"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Storage/storageAccounts/{account}"); @@ -158,7 +155,6 @@ public async Task CreateStorageAccount( string subscription, string? prefix = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -166,7 +162,7 @@ public async Task CreateStorageAccount( (nameof(container), container), (nameof(subscription), subscription)); - var blobServiceClient = await CreateBlobServiceClient(account, tenant, retryPolicy, cancellationToken); + var blobServiceClient = await CreateBlobServiceClient(account, tenant, cancellationToken); var containerClient = blobServiceClient.GetBlobContainerClient(container); var blobInfos = new List(); @@ -238,12 +234,11 @@ public async Task> GetContainerDetails( string subscription, string? prefix = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(account), account), (nameof(subscription), subscription)); - var blobServiceClient = await CreateBlobServiceClient(account, tenant, retryPolicy, cancellationToken); + var blobServiceClient = await CreateBlobServiceClient(account, tenant, cancellationToken); var containers = new List(); if (string.IsNullOrEmpty(container)) @@ -297,7 +292,6 @@ public async Task CreateContainer( string container, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -305,7 +299,7 @@ public async Task CreateContainer( (nameof(container), container), (nameof(subscription), subscription)); - var blobServiceClient = await CreateBlobServiceClient(account, tenant, retryPolicy, cancellationToken); + var blobServiceClient = await CreateBlobServiceClient(account, tenant, cancellationToken); var containerClient = blobServiceClient.GetBlobContainerClient(container); await containerClient.CreateAsync(PublicAccessType.None, cancellationToken: cancellationToken); @@ -330,11 +324,10 @@ public async Task CreateContainer( private async Task CreateBlobServiceClient( string account, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { var uri = GetBlobEndpoint(account); - var options = ConfigureRetryPolicy(AddDefaultPolicies(new BlobClientOptions()), retryPolicy); + var options = AddDefaultPolicies(new BlobClientOptions()); options.Transport = new HttpClientTransport(AzureService.GetClient()); return new BlobServiceClient(new(uri), await GetCredential(tenant, cancellationToken), options); } @@ -371,7 +364,6 @@ public async Task UploadBlob( string localFilePath, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -386,7 +378,7 @@ public async Task UploadBlob( throw new FileNotFoundException($"Local file not found: {localFilePath}"); } - var blobServiceClient = await CreateBlobServiceClient(account, tenant, retryPolicy, cancellationToken); + var blobServiceClient = await CreateBlobServiceClient(account, tenant, cancellationToken); var blobContainerClient = blobServiceClient.GetBlobContainerClient(container); var blobClient = blobContainerClient.GetBlobClient(blob); @@ -426,10 +418,9 @@ private async Task CreateTableServiceClient( string account, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var options = ConfigureRetryPolicy(AddDefaultPolicies(new TableClientOptions()), retryPolicy); + var options = AddDefaultPolicies(new TableClientOptions()); options.Transport = new HttpClientTransport(AzureService.GetClient()); var defaultUri = GetTableEndpoint(account); return new TableServiceClient(new(defaultUri), await GetCredential(tenant, cancellationToken), options); @@ -439,7 +430,6 @@ public async Task> ListTables( string account, string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(account), account), (nameof(subscription), subscription)); @@ -451,7 +441,6 @@ public async Task> ListTables( account, subscription, tenant, - retryPolicy, cancellationToken); await foreach (var table in tableServiceClient.QueryAsync(cancellationToken: cancellationToken)) diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountCreateCommandTests.cs index 8f04b09172..dca7305c5c 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Storage.Commands.Account; using Azure.Mcp.Tools.Storage.Models; using Azure.Mcp.Tools.Storage.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -66,7 +65,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccount); } @@ -103,7 +101,6 @@ public async Task ExecuteAsync_HandlesStorageAccountNameAlreadyExists() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(conflictException); @@ -134,7 +131,6 @@ public async Task ExecuteAsync_HandlesResourceGroupNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(notFoundException); @@ -165,7 +161,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(authException); @@ -194,7 +189,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(Task.FromException(new Exception("Test error"))); @@ -243,7 +237,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() "Cool", true, null, - Arg.Any(), Arg.Any()) .Returns(expectedAccount); @@ -268,7 +261,6 @@ await Service.Received(1).CreateStorageAccount( "Cool", true, null, - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountGetCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountGetCommandTests.cs index 7d73d26567..5d5d8857b5 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Account/AccountGetCommandTests.cs @@ -8,7 +8,6 @@ using Azure.Mcp.Tools.Storage.Commands.Account; using Azure.Mcp.Tools.Storage.Models; using Azure.Mcp.Tools.Storage.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -33,7 +32,6 @@ public async Task ExecuteAsync_NoParameters_ReturnsSubscriptions() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccounts); @@ -59,7 +57,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoAccounts() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); @@ -84,7 +81,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(subscription), Arg.Any(), null, - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -124,7 +120,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccount); } @@ -160,7 +155,6 @@ public async Task ExecuteAsync_ReturnsAccountDetails_WhenAccountExists() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedAccount); @@ -184,7 +178,7 @@ public async Task ExecuteAsync_HandlesServiceErrors() var subscription = "sub123"; Service.GetAccountDetails( - Arg.Is(account), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(account), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -204,7 +198,7 @@ public async Task ExecuteAsync_HandlesNotFound() var subscription = "sub123"; Service.GetAccountDetails( - Arg.Is(account), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(account), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Storage account not found")); // Act @@ -223,7 +217,7 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() var subscription = "sub123"; Service.GetAccountDetails( - Arg.Is(account), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Arg.Is(account), Arg.Is(subscription), Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Forbidden, "Authorization failed")); // Act @@ -240,7 +234,7 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( // Arrange const string resourceGroup = "test-rg"; const string subscription = "sub123"; - Service.GetAccountDetails(Arg.Any(), Arg.Is(subscription), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()) + Service.GetAccountDetails(Arg.Any(), Arg.Is(subscription), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()) .Returns(new ResourceQueryResults([], false)); // Act @@ -248,6 +242,6 @@ public async Task ExecuteAsync_WithResourceGroup_ForwardsResourceGroupToService( // Assert Assert.Equal(HttpStatusCode.OK, response.Status); - await Service.Received(1).GetAccountDetails(Arg.Any(), Arg.Is(subscription), Arg.Is(resourceGroup), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).GetAccountDetails(Arg.Any(), Arg.Is(subscription), Arg.Is(resourceGroup), Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobGetCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobGetCommandTests.cs index 4bf44072bd..dd3cf71587 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Storage.Commands.Blob; using Azure.Mcp.Tools.Storage.Models; using Azure.Mcp.Tools.Storage.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -36,7 +35,6 @@ public async Task ExecuteAsync_NoParameters_ReturnsBlobs() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedBlobs); @@ -69,7 +67,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoBlobs() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -101,7 +98,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -154,7 +150,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedBlobs); } @@ -193,7 +188,6 @@ public async Task ExecuteAsync_ReturnsBlobDetails_WhenBlobExists() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([expected]); @@ -230,7 +224,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -263,7 +256,6 @@ public async Task ExecuteAsync_HandlesNotFound() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Blob not found")); @@ -295,7 +287,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Forbidden, "Authorization failed")); diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobUploadCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobUploadCommandTests.cs index 9d456319d3..0dfe1a4575 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobUploadCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/BlobUploadCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Storage.Commands.Blob; using Azure.Mcp.Tools.Storage.Models; using Azure.Mcp.Tools.Storage.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -43,7 +42,6 @@ public async Task ExecuteAsync_UploadsBlob_WhenValidParametersProvided() Arg.Is(localFilePath), Arg.Is(subscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); @@ -75,7 +73,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -115,7 +112,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedResult); } diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerCreateCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerCreateCommandTests.cs index d2c0a7f2ea..20a3b43918 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerCreateCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerCreateCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Storage.Commands.Blob.Container; using Azure.Mcp.Tools.Storage.Models; using Azure.Mcp.Tools.Storage.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -47,7 +46,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expected); } @@ -79,7 +77,6 @@ public async Task ExecuteAsync_HandlesContainerAlreadyExists() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Conflict, "Container already exists")); @@ -103,7 +100,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Forbidden, "Authorization failed")); @@ -127,7 +123,6 @@ public async Task ExecuteAsync_HandlesStorageAccountNotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Storage account not found")); @@ -151,7 +146,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -183,7 +177,6 @@ public async Task ExecuteAsync_CallsServiceWithCorrectParameters() container, subscription, Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expected); @@ -200,7 +193,6 @@ await Service.Received(1).CreateContainer( container, subscription, Arg.Any(), - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerGetCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerGetCommandTests.cs index 1c882593ea..6b7298dda0 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerGetCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Blob/Container/ContainerGetCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Storage.Commands.Blob.Container; using Azure.Mcp.Tools.Storage.Models; using Azure.Mcp.Tools.Storage.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -34,7 +33,6 @@ public async Task ExecuteAsync_NoParameters_ReturnsContainers() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedContainers); @@ -62,7 +60,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoContainers() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -89,7 +86,6 @@ public async Task ExecuteAsync_HandlesException() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); @@ -132,7 +128,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedContainers); } @@ -169,7 +164,6 @@ public async Task ExecuteAsync_ReturnsContainerDetails_WhenContainerExists() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([expected]); @@ -203,7 +197,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -233,7 +226,6 @@ public async Task ExecuteAsync_HandlesNotFound() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Container not found")); @@ -262,7 +254,6 @@ public async Task ExecuteAsync_HandlesAuthorizationFailure() Arg.Is(subscription), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Forbidden, "Authorization failed")); diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/StorageCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/StorageCommandTests.cs index 02406cac4e..e84c1a24a3 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/StorageCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/StorageCommandTests.cs @@ -318,8 +318,7 @@ public async Task Should_list_containers() { { "subscription", Settings.SubscriptionName }, { "tenant", Settings.TenantId }, - { "account", Settings.ResourceBaseName }, - { "retry-max-retries", 0 } + { "account", Settings.ResourceBaseName } }); var actual = result.AssertProperty("containers"); @@ -337,8 +336,7 @@ public async Task Should_list_containers_with_prefix() { "subscription", Settings.SubscriptionName }, { "tenant", Settings.TenantId }, { "account", Settings.ResourceBaseName }, - { "prefix", "ba" }, - { "retry-max-retries", 0 } + { "prefix", "ba" } }); var actual = result.AssertProperty("containers"); diff --git a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Table/TableListCommandTests.cs b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Table/TableListCommandTests.cs index 5701a2ff09..0cacd9a9e7 100644 --- a/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Table/TableListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Storage/tests/Azure.Mcp.Tools.Storage.Tests/Table/TableListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Storage.Commands; using Azure.Mcp.Tools.Storage.Services; using Azure.Mcp.Tools.Storage.Table.Commands; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -28,7 +27,6 @@ public async Task ExecuteAsync_ReturnsStorageTables() Arg.Is(_knownStorageAccount), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(expectedTables); @@ -51,7 +49,6 @@ public async Task ExecuteAsync_ReturnsEmpty_WhenNoStorageTables() Arg.Is(_knownStorageAccount), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -89,7 +86,6 @@ public async Task ExecuteAsync_HandlesStorageException() Arg.Is(_knownStorageAccount), Arg.Is(_knownSubscription), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception(expectedError)); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointCreateCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointCreateCommand.cs index 14c58c95ef..7fa4314969 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointCreateCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.StorageAccountResourceId, options.AzureFileShareName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(endpoint), StorageSyncJsonContext.Default.CloudEndpointCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointDeleteCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointDeleteCommand.cs index 697569e95d..29102943a4 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointDeleteCommand.cs @@ -42,7 +42,6 @@ await _service.DeleteCloudEndpointAsync( options.SyncGroupName, options.CloudEndpointName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Message = "Cloud endpoint deleted successfully"; diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointGetCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointGetCommand.cs index c9172188fd..df8b5a266d 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointGetCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointGetCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SyncGroupName, options.CloudEndpointName, options.Tenant, - options.RetryPolicy, cancellationToken); if (endpoint == null) @@ -71,7 +70,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.SyncGroupName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(endpoints ?? []), StorageSyncJsonContext.Default.CloudEndpointGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointTriggerChangeDetectionCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointTriggerChangeDetectionCommand.cs index c85999acba..3b48719bf5 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointTriggerChangeDetectionCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointTriggerChangeDetectionCommand.cs @@ -45,7 +45,6 @@ await _service.TriggerChangeDetectionAsync( options.ChangeDetectionMode, options.Paths, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Message = "Change detection triggered successfully"; diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerGetCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerGetCommand.cs index 2ff42d8146..d568af8f83 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerGetCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerGetCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.ServerId, options.Tenant, - options.RetryPolicy, cancellationToken); if (server == null) @@ -69,7 +68,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(servers ?? []), StorageSyncJsonContext.Default.RegisteredServerGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUnregisterCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUnregisterCommand.cs index 45407fc50b..67444b70db 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUnregisterCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUnregisterCommand.cs @@ -41,7 +41,6 @@ await _service.UnregisterServerAsync( options.Name, options.ServerId, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Message = "Server unregistered successfully"; diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUpdateCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUpdateCommand.cs index 495c2d3fed..0d01c4c84a 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUpdateCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ServerId, null, // TODO (alzimmer): Doesn't appear this command actually updates anything. options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(server), StorageSyncJsonContext.Default.RegisteredServerUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointCreateCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointCreateCommand.cs index b6bcd6e748..bf03b4d019 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointCreateCommand.cs @@ -49,7 +49,6 @@ public override async Task ExecuteAsync(CommandContext context, options.TierFilesOlderThanDays, options.LocalCacheMode, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(endpoint), StorageSyncJsonContext.Default.ServerEndpointCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointDeleteCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointDeleteCommand.cs index 375e124da1..9172ca4b23 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointDeleteCommand.cs @@ -42,7 +42,6 @@ await _service.DeleteServerEndpointAsync( options.SyncGroupName, options.ServerEndpointName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Message = "Server endpoint deleted successfully"; diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointGetCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointGetCommand.cs index 2aabab2f81..ddc123f9e9 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointGetCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointGetCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.SyncGroupName, options.ServerEndpointName, options.Tenant, - options.RetryPolicy, cancellationToken); if (endpoint == null) @@ -71,7 +70,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.SyncGroupName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(endpoints ?? []), StorageSyncJsonContext.Default.ServerEndpointGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointUpdateCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointUpdateCommand.cs index 98091aa55d..b9474cdceb 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointUpdateCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.TierFilesOlderThanDays, options.LocalCacheMode, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(endpoint), StorageSyncJsonContext.Default.ServerEndpointUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceCreateCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceCreateCommand.cs index b924bc1f04..446a064558 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceCreateCommand.cs @@ -43,7 +43,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Location, options.Tags?.Split(' ', StringSplitOptions.RemoveEmptyEntries).Select(tag => tag.Split('=', 2)).ToDictionary(kv => kv[0], kv => kv[1]), options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(service), StorageSyncJsonContext.Default.StorageSyncServiceCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceDeleteCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceDeleteCommand.cs index b4b52f233c..e310364c8d 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceDeleteCommand.cs @@ -40,7 +40,6 @@ await _service.DeleteStorageSyncServiceAsync( options.ResourceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Message = "Storage sync service deleted successfully"; diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceGetCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceGetCommand.cs index f2dea6a693..3d51cb85fe 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceGetCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceGetCommand.cs @@ -55,7 +55,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup!, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); if (service == null) @@ -77,7 +76,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(services ?? []), StorageSyncJsonContext.Default.StorageSyncServiceGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceUpdateCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceUpdateCommand.cs index a7849e0eda..422d981f0f 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceUpdateCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceUpdateCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Tags?.Split(' ', StringSplitOptions.RemoveEmptyEntries).Select(tag => tag.Split('=', 2)).ToDictionary(kv => kv[0], kv => kv[1]), options.IdentityType, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(service), StorageSyncJsonContext.Default.StorageSyncServiceUpdateCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupCreateCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupCreateCommand.cs index 8fa3a3eaa0..823dba2a8c 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupCreateCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupCreateCommand.cs @@ -42,7 +42,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.SyncGroupName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(syncGroup), StorageSyncJsonContext.Default.SyncGroupCreateCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupDeleteCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupDeleteCommand.cs index 1297f8dcab..4e676a2993 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupDeleteCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupDeleteCommand.cs @@ -41,7 +41,6 @@ await _service.DeleteSyncGroupAsync( options.Name, options.SyncGroupName, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Message = "Sync group deleted successfully"; diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupGetCommand.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupGetCommand.cs index b224c6930e..61b07d0ea9 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupGetCommand.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupGetCommand.cs @@ -46,7 +46,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Name, options.SyncGroupName, options.Tenant, - options.RetryPolicy, cancellationToken); if (syncGroup == null) @@ -69,7 +68,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Name, options.Tenant, - options.RetryPolicy, cancellationToken); context.Response.Results = ResponseResult.Create(new(syncGroups ?? []), StorageSyncJsonContext.Default.SyncGroupGetCommandResult); diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointCreateOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointCreateOptions.cs index 0f8e6f00c5..02826675c8 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointCreateOptions.cs @@ -50,6 +50,4 @@ public sealed class CloudEndpointCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointDeleteOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointDeleteOptions.cs index f3ba0e0561..de7ba434de 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointDeleteOptions.cs @@ -38,6 +38,4 @@ public sealed class CloudEndpointDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointGetOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointGetOptions.cs index 56333c426a..53b6e9a5bc 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointGetOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointGetOptions.cs @@ -38,6 +38,4 @@ public sealed class CloudEndpointGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointTriggerChangeDetectionOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointTriggerChangeDetectionOptions.cs index 715e19e860..187d6d1fcb 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointTriggerChangeDetectionOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointTriggerChangeDetectionOptions.cs @@ -56,6 +56,4 @@ public sealed class CloudEndpointTriggerChangeDetectionOptions : ISubscriptionOp [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerGetOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerGetOptions.cs index 697bdf96e6..5b588c7839 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerGetOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerGetOptions.cs @@ -32,6 +32,4 @@ public sealed class RegisteredServerGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUnregisterOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUnregisterOptions.cs index 8902db548d..e59941dd6f 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUnregisterOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUnregisterOptions.cs @@ -32,6 +32,4 @@ public sealed class RegisteredServerUnregisterOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUpdateOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUpdateOptions.cs index af166f02b6..924d88939b 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUpdateOptions.cs @@ -32,6 +32,4 @@ public sealed class RegisteredServerUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointCreateOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointCreateOptions.cs index 4fc6abe26e..e54dc70860 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointCreateOptions.cs @@ -74,6 +74,4 @@ public sealed class ServerEndpointCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointDeleteOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointDeleteOptions.cs index 1a51762558..e2e2c4aef0 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointDeleteOptions.cs @@ -38,6 +38,4 @@ public sealed class ServerEndpointDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointGetOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointGetOptions.cs index d470d01a73..0c79961d79 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointGetOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointGetOptions.cs @@ -38,6 +38,4 @@ public sealed class ServerEndpointGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointUpdateOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointUpdateOptions.cs index 8c9b85a938..a5ee7399bd 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointUpdateOptions.cs @@ -62,6 +62,4 @@ public sealed class ServerEndpointUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceCreateOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceCreateOptions.cs index 8852f45c95..df9c95f43e 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceCreateOptions.cs @@ -38,6 +38,4 @@ public sealed class StorageSyncServiceCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceDeleteOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceDeleteOptions.cs index 440a1ccc36..732bfb9353 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceDeleteOptions.cs @@ -26,6 +26,4 @@ public sealed class StorageSyncServiceDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceGetOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceGetOptions.cs index e427544211..77a4f004bf 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceGetOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceGetOptions.cs @@ -26,6 +26,4 @@ public sealed class StorageSyncServiceGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceUpdateOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceUpdateOptions.cs index de16045881..f86eaf4352 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceUpdateOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceUpdateOptions.cs @@ -44,6 +44,4 @@ public sealed class StorageSyncServiceUpdateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupCreateOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupCreateOptions.cs index 4b4ec0a95c..52b165a285 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupCreateOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupCreateOptions.cs @@ -32,6 +32,4 @@ public sealed class SyncGroupCreateOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupDeleteOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupDeleteOptions.cs index 57bc8460ae..0226cc7d5e 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupDeleteOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupDeleteOptions.cs @@ -32,6 +32,4 @@ public sealed class SyncGroupDeleteOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupGetOptions.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupGetOptions.cs index 607b504716..3ba798a52b 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupGetOptions.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupGetOptions.cs @@ -32,6 +32,4 @@ public sealed class SyncGroupGetOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Services/IStorageSyncService.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Services/IStorageSyncService.cs index dcf54f843b..c98f997a60 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Services/IStorageSyncService.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Services/IStorageSyncService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.StorageSync.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.StorageSync.Services; @@ -21,7 +20,6 @@ Task> ListStorageSyncServicesAsync( string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -32,7 +30,6 @@ Task> ListStorageSyncServicesAsync( string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -45,7 +42,6 @@ Task CreateStorageSyncServiceAsync( string location, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -59,7 +55,6 @@ Task UpdateStorageSyncServiceAsync( Dictionary? tags = null, string? identityType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -70,7 +65,6 @@ Task DeleteStorageSyncServiceAsync( string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #endregion @@ -85,7 +79,6 @@ Task> ListSyncGroupsAsync( string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -97,7 +90,6 @@ Task> ListSyncGroupsAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -109,7 +101,6 @@ Task CreateSyncGroupAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -121,7 +112,6 @@ Task DeleteSyncGroupAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #endregion @@ -137,7 +127,6 @@ Task> ListCloudEndpointsAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -150,7 +139,6 @@ Task> ListCloudEndpointsAsync( string syncGroupName, string cloudEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -165,7 +153,6 @@ Task CreateCloudEndpointAsync( string storageAccountResourceId, string azureFileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -178,7 +165,6 @@ Task DeleteCloudEndpointAsync( string syncGroupName, string cloudEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -194,7 +180,6 @@ Task TriggerChangeDetectionAsync( string? changeDetectionMode = null, IList? paths = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #endregion @@ -210,7 +195,6 @@ Task> ListServerEndpointsAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -223,7 +207,6 @@ Task> ListServerEndpointsAsync( string syncGroupName, string serverEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -242,7 +225,6 @@ Task CreateServerEndpointAsync( int? tierFilesOlderThanDays = null, string? localCacheMode = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -259,7 +241,6 @@ Task UpdateServerEndpointAsync( int? tierFilesOlderThanDays = null, string? localCacheMode = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -272,7 +253,6 @@ Task DeleteServerEndpointAsync( string syncGroupName, string serverEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #endregion @@ -287,7 +267,6 @@ Task> ListRegisteredServersAsync( string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -299,7 +278,6 @@ Task> ListRegisteredServersAsync( string storageSyncServiceName, string registeredServerId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -311,7 +289,6 @@ Task RegisterServerAsync( string storageSyncServiceName, string registeredServerId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -323,7 +300,6 @@ Task UnregisterServerAsync( string storageSyncServiceName, string registeredServerId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); /// @@ -336,7 +312,6 @@ Task UpdateServerAsync( string registeredServerId, Dictionary? properties = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); #endregion diff --git a/tools/Azure.Mcp.Tools.StorageSync/src/Services/StorageSyncService.cs b/tools/Azure.Mcp.Tools.StorageSync/src/Services/StorageSyncService.cs index bf1ebadffa..bd94edad02 100644 --- a/tools/Azure.Mcp.Tools.StorageSync/src/Services/StorageSyncService.cs +++ b/tools/Azure.Mcp.Tools.StorageSync/src/Services/StorageSyncService.cs @@ -8,7 +8,6 @@ using Azure.ResourceManager.StorageSync; using Azure.ResourceManager.StorageSync.Models; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.StorageSync.Services; @@ -24,12 +23,11 @@ public async Task> ListStorageSyncServicesAsy string subscription, string? resourceGroup = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters((nameof(subscription), subscription)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var services = new List(); @@ -72,7 +70,6 @@ public async Task> ListStorageSyncServicesAsy string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -83,7 +80,7 @@ public async Task> ListStorageSyncServicesAsy try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -106,7 +103,6 @@ public async Task CreateStorageSyncServiceAsync( string location, Dictionary? tags = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -115,7 +111,7 @@ public async Task CreateStorageSyncServiceAsync( (nameof(storageSyncServiceName), storageSyncServiceName), (nameof(location), location)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -150,7 +146,6 @@ public async Task UpdateStorageSyncServiceAsync( Dictionary? tags = null, string? identityType = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -158,7 +153,7 @@ public async Task UpdateStorageSyncServiceAsync( (nameof(resourceGroup), resourceGroup), (nameof(storageSyncServiceName), storageSyncServiceName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -201,7 +196,6 @@ public async Task DeleteStorageSyncServiceAsync( string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -209,7 +203,7 @@ public async Task DeleteStorageSyncServiceAsync( (nameof(resourceGroup), resourceGroup), (nameof(storageSyncServiceName), storageSyncServiceName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -228,7 +222,6 @@ public async Task> ListSyncGroupsAsync( string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -236,7 +229,7 @@ public async Task> ListSyncGroupsAsync( (nameof(resourceGroup), resourceGroup), (nameof(storageSyncServiceName), storageSyncServiceName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -256,7 +249,6 @@ public async Task> ListSyncGroupsAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -267,7 +259,7 @@ public async Task> ListSyncGroupsAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -288,7 +280,6 @@ public async Task CreateSyncGroupAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -297,7 +288,7 @@ public async Task CreateSyncGroupAsync( (nameof(storageSyncServiceName), storageSyncServiceName), (nameof(syncGroupName), syncGroupName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -315,7 +306,6 @@ public async Task DeleteSyncGroupAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -324,7 +314,7 @@ public async Task DeleteSyncGroupAsync( (nameof(storageSyncServiceName), storageSyncServiceName), (nameof(syncGroupName), syncGroupName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -343,7 +333,6 @@ public async Task> ListCloudEndpointsAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -352,7 +341,7 @@ public async Task> ListCloudEndpointsAsync( (nameof(storageSyncServiceName), storageSyncServiceName), (nameof(syncGroupName), syncGroupName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -374,7 +363,6 @@ public async Task> ListCloudEndpointsAsync( string syncGroupName, string cloudEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -386,7 +374,7 @@ public async Task> ListCloudEndpointsAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -411,7 +399,6 @@ public async Task CreateCloudEndpointAsync( string storageAccountResourceId, string azureFileShareName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -423,7 +410,7 @@ public async Task CreateCloudEndpointAsync( (nameof(storageAccountResourceId), storageAccountResourceId), (nameof(azureFileShareName), azureFileShareName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); // Get subscription data to access tenant ID @@ -465,7 +452,6 @@ public async Task DeleteCloudEndpointAsync( string syncGroupName, string cloudEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -475,7 +461,7 @@ public async Task DeleteCloudEndpointAsync( (nameof(syncGroupName), syncGroupName), (nameof(cloudEndpointName), cloudEndpointName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -498,7 +484,6 @@ public async Task TriggerChangeDetectionAsync( string? changeDetectionMode = null, IList? paths = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -509,7 +494,7 @@ public async Task TriggerChangeDetectionAsync( (nameof(cloudEndpointName), cloudEndpointName), (nameof(directoryPath), directoryPath)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -549,7 +534,6 @@ public async Task> ListServerEndpointsAsync( string storageSyncServiceName, string syncGroupName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -558,7 +542,7 @@ public async Task> ListServerEndpointsAsync( (nameof(storageSyncServiceName), storageSyncServiceName), (nameof(syncGroupName), syncGroupName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -580,7 +564,6 @@ public async Task> ListServerEndpointsAsync( string syncGroupName, string serverEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -592,7 +575,7 @@ public async Task> ListServerEndpointsAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -621,7 +604,6 @@ public async Task CreateServerEndpointAsync( int? tierFilesOlderThanDays = null, string? localCacheMode = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -633,7 +615,7 @@ public async Task CreateServerEndpointAsync( (nameof(serverResourceId), serverResourceId), (nameof(serverLocalPath), serverLocalPath)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -681,7 +663,6 @@ public async Task UpdateServerEndpointAsync( int? tierFilesOlderThanDays = null, string? localCacheMode = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -691,7 +672,7 @@ public async Task UpdateServerEndpointAsync( (nameof(syncGroupName), syncGroupName), (nameof(serverEndpointName), serverEndpointName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -730,7 +711,6 @@ public async Task DeleteServerEndpointAsync( string syncGroupName, string serverEndpointName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -740,7 +720,7 @@ public async Task DeleteServerEndpointAsync( (nameof(syncGroupName), syncGroupName), (nameof(serverEndpointName), serverEndpointName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -759,7 +739,6 @@ public async Task> ListRegisteredServersAsync( string resourceGroup, string storageSyncServiceName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -767,7 +746,7 @@ public async Task> ListRegisteredServersAsync( (nameof(resourceGroup), resourceGroup), (nameof(storageSyncServiceName), storageSyncServiceName)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -787,7 +766,6 @@ public async Task> ListRegisteredServersAsync( string storageSyncServiceName, string registeredServerId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -801,7 +779,7 @@ public async Task> ListRegisteredServersAsync( try { - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -822,7 +800,6 @@ public async Task RegisterServerAsync( string storageSyncServiceName, string registeredServerId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -834,7 +811,7 @@ public async Task RegisterServerAsync( // Validate registeredServerId is a valid GUID var serverGuid = CheckGuid(registeredServerId, nameof(registeredServerId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -855,7 +832,6 @@ public async Task UpdateServerAsync( string registeredServerId, Dictionary? properties = null, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -867,7 +843,7 @@ public async Task UpdateServerAsync( // Validate registeredServerId is a valid GUID var serverGuid = CheckGuid(registeredServerId, nameof(registeredServerId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); @@ -889,7 +865,6 @@ public async Task UnregisterServerAsync( string storageSyncServiceName, string registeredServerId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { ValidateRequiredParameters( @@ -901,7 +876,7 @@ public async Task UnregisterServerAsync( // Validate registeredServerId is a valid GUID var serverGuid = CheckGuid(registeredServerId, nameof(registeredServerId)); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, null, cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, null, cancellationToken); var subscriptionResource = armClient.GetSubscriptionResource(SubscriptionResource.CreateResourceIdentifier(subscription)); var resourceGroupResource = await subscriptionResource.GetResourceGroupAsync(resourceGroup, cancellationToken); var serviceResource = await resourceGroupResource.Value.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/Hostpool/HostpoolListCommand.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/Hostpool/HostpoolListCommand.cs index d13a996205..26d1ec6674 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/Hostpool/HostpoolListCommand.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/Hostpool/HostpoolListCommand.cs @@ -44,7 +44,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.ResourceGroup, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -52,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, hostpools = await _virtualDesktopService.ListHostpoolsAsync( options.Subscription!, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostListCommand.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostListCommand.cs index 11375f3bb7..00fd0e9832 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostListCommand.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostListCommand.cs @@ -45,7 +45,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.HostpoolResourceId, options.Tenant, - options.RetryPolicy, cancellationToken); } else if (!string.IsNullOrEmpty(options.ResourceGroup)) @@ -55,7 +54,6 @@ public override async Task ExecuteAsync(CommandContext context, options.ResourceGroup, options.Hostpool!, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -64,7 +62,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Subscription!, options.Hostpool!, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostUserSessionListCommand.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostUserSessionListCommand.cs index 0f07f8422d..9fb398fd7c 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostUserSessionListCommand.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/SessionHost/SessionHostUserSessionListCommand.cs @@ -47,7 +47,6 @@ public override async Task ExecuteAsync(CommandContext context, options.HostpoolResourceId, options.Sessionhost, options.Tenant, - options.RetryPolicy, cancellationToken); } else if (!string.IsNullOrEmpty(options.ResourceGroup)) @@ -58,7 +57,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Hostpool!, options.Sessionhost, options.Tenant, - options.RetryPolicy, cancellationToken); } else @@ -68,7 +66,6 @@ public override async Task ExecuteAsync(CommandContext context, options.Hostpool!, options.Sessionhost, options.Tenant, - options.RetryPolicy, cancellationToken); } diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/BaseHostPoolOptions.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/BaseHostPoolOptions.cs index 56ac27b552..7f8a396ad0 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/BaseHostPoolOptions.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/BaseHostPoolOptions.cs @@ -24,6 +24,4 @@ public class BaseHostPoolOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/HostpoolListOptions.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/HostpoolListOptions.cs index 5f0b5c0c9a..caf2df9388 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/HostpoolListOptions.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/HostpoolListOptions.cs @@ -17,6 +17,4 @@ public sealed class HostpoolListOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/IVirtualDesktopService.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/IVirtualDesktopService.cs index 9bb17e0d1f..d53bb599a0 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/IVirtualDesktopService.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/IVirtualDesktopService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.VirtualDesktop.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.VirtualDesktop.Services; @@ -11,28 +10,24 @@ public interface IVirtualDesktopService Task> ListHostpoolsAsync( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListHostpoolsByResourceGroupAsync( string subscription, string resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListSessionHostsAsync( string subscription, string hostPoolName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListSessionHostsByResourceIdAsync( string subscription, string hostPoolResourceId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListSessionHostsByResourceGroupAsync( @@ -40,7 +35,6 @@ Task> ListSessionHostsByResourceGroupAsync( string resourceGroup, string hostPoolName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListUserSessionsAsync( @@ -48,7 +42,6 @@ Task> ListUserSessionsAsync( string hostPoolName, string sessionHostName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListUserSessionsByResourceIdAsync( @@ -56,7 +49,6 @@ Task> ListUserSessionsByResourceIdAsync( string hostPoolResourceId, string sessionHostName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); Task> ListUserSessionsByResourceGroupAsync( @@ -65,6 +57,5 @@ Task> ListUserSessionsByResourceGroupAsync( string hostPoolName, string sessionHostName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/VirtualDesktopService.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/VirtualDesktopService.cs index ef7b58c28b..b7b99a91c1 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/VirtualDesktopService.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/src/Services/VirtualDesktopService.cs @@ -4,7 +4,6 @@ using Azure.Mcp.Core.Services.Azure; using Azure.Mcp.Tools.VirtualDesktop.Models; using Azure.ResourceManager.DesktopVirtualization; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.VirtualDesktop.Services; @@ -15,10 +14,9 @@ public class VirtualDesktopService(IAzureService azureService) : IVirtualDesktop public async Task> ListHostpoolsAsync( string subscription, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var hostpools = new List(); await foreach (HostPoolResource resource in sub.GetHostPoolsAsync(cancellationToken)) { @@ -31,10 +29,9 @@ public async Task> ListHostpoolsByResourceGroupAsync( string subscription, string resourceGroup, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var hostpools = new List(); var resourceGroupResource = await sub.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -49,10 +46,9 @@ public async Task> ListSessionHostsAsync( string subscription, string hostPoolName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var sessionHosts = new List(); await foreach (HostPoolResource resource in sub.GetHostPoolsAsync(cancellationToken)) @@ -77,10 +73,9 @@ public async Task> ListUserSessionsAsync( string hostPoolName, string sessionHostName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var userSessions = new List(); await foreach (HostPoolResource resource in sub.GetHostPoolsAsync(cancellationToken)) @@ -111,10 +106,9 @@ public async Task> ListSessionHostsByResourceIdAsync( string subscription, string hostPoolResourceId, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var sessionHosts = new List(); var armClient = sub.GetCachedClient(client => client); @@ -132,10 +126,9 @@ public async Task> ListUserSessionsByResourceIdAsync( string hostPoolResourceId, string sessionHostName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var userSessions = new List(); var armClient = sub.GetCachedClient(client => client); @@ -160,10 +153,9 @@ public async Task> ListSessionHostsByResourceGroupAsy string resourceGroup, string hostPoolName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var sessionHosts = new List(); var resourceGroupResource = await sub.GetResourceGroupAsync(resourceGroup, cancellationToken); @@ -183,10 +175,9 @@ public async Task> ListUserSessionsByResourceGroupAsy string hostPoolName, string sessionHostName, string? tenant = null, - RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default) { - var sub = await _azureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken); + var sub = await _azureService.GetSubscription(subscription, tenant, cancellationToken); var userSessions = new List(); var resourceGroupResource = await sub.GetResourceGroupAsync(resourceGroup, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/Hostpool/HostpoolListCommandTests.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/Hostpool/HostpoolListCommandTests.cs index b5cd3226fe..e59d140928 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/Hostpool/HostpoolListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/Hostpool/HostpoolListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.VirtualDesktop.Commands.Hostpool; using Azure.Mcp.Tools.VirtualDesktop.Models; using Azure.Mcp.Tools.VirtualDesktop.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -40,9 +39,9 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS new() { Name = "hostpool1" }, new() { Name = "hostpool2" } }.AsReadOnly(); - Service.ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any()) .Returns(hostpools); - Service.ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(hostpools); } @@ -66,9 +65,9 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS public async Task ExecuteAsync_ReturnsEmptyResult_WhenNoHostpools() { // Arrange - Service.ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); - Service.ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act @@ -83,7 +82,7 @@ public async Task ExecuteAsync_ReturnsEmptyResult_WhenNoHostpools() public async Task ExecuteAsync_HandlesServiceErrors() { // Arrange - Service.ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); // Act @@ -104,7 +103,7 @@ public async Task ExecuteAsync_ReturnsHostpools_WhenSuccessful() new() { Name = "hostpool1" }, new() { Name = "hostpool2" } }.AsReadOnly(); - Service.ListHostpoolsAsync("test-sub", null, Arg.Any(), Arg.Any()) + Service.ListHostpoolsAsync("test-sub", null, Arg.Any()) .Returns(expectedHostpools); // Act @@ -114,7 +113,7 @@ public async Task ExecuteAsync_ReturnsHostpools_WhenSuccessful() Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); - await Service.Received(1).ListHostpoolsAsync("test-sub", null, Arg.Any(), Arg.Any()); + await Service.Received(1).ListHostpoolsAsync("test-sub", null, Arg.Any()); } [Fact] @@ -126,7 +125,7 @@ public async Task ExecuteAsync_CallsAzureService_WhenResourceGroupProvided() new() { Name = "hostpool1" }, new() { Name = "hostpool2" } }.AsReadOnly(); - Service.ListHostpoolsByResourceGroupAsync("test-sub", "test-rg", null, Arg.Any(), Arg.Any()) + Service.ListHostpoolsByResourceGroupAsync("test-sub", "test-rg", null, Arg.Any()) .Returns(expectedHostpools); // Act @@ -136,8 +135,8 @@ public async Task ExecuteAsync_CallsAzureService_WhenResourceGroupProvided() Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); - await Service.Received(1).ListHostpoolsByResourceGroupAsync("test-sub", "test-rg", null, Arg.Any(), Arg.Any()); - await Service.DidNotReceive().ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListHostpoolsByResourceGroupAsync("test-sub", "test-rg", null, Arg.Any()); + await Service.DidNotReceive().ListHostpoolsAsync(Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] @@ -149,7 +148,7 @@ public async Task ExecuteAsync_CallsAzureService_WhenNoResourceGroup() new() { Name = "hostpool1" }, new() { Name = "hostpool2" } }.AsReadOnly(); - Service.ListHostpoolsAsync("test-sub", null, Arg.Any(), Arg.Any()) + Service.ListHostpoolsAsync("test-sub", null, Arg.Any()) .Returns(expectedHostpools); // Act @@ -159,15 +158,15 @@ public async Task ExecuteAsync_CallsAzureService_WhenNoResourceGroup() Assert.Equal(HttpStatusCode.OK, response.Status); Assert.NotNull(response.Results); - await Service.Received(1).ListHostpoolsAsync("test-sub", null, Arg.Any(), Arg.Any()); - await Service.DidNotReceive().ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); + await Service.Received(1).ListHostpoolsAsync("test-sub", null, Arg.Any()); + await Service.DidNotReceive().ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()); } [Fact] public async Task ExecuteAsync_ReturnsEmptyResult_WhenNoHostpoolsInResourceGroup() { // Arrange - Service.ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + Service.ListHostpoolsByResourceGroupAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns([]); // Act diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostListCommandTests.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostListCommandTests.cs index 0ea806196a..319d658204 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostListCommandTests.cs @@ -5,7 +5,6 @@ using Azure.Mcp.Tests.Commands; using Azure.Mcp.Tools.VirtualDesktop.Commands.SessionHost; using Azure.Mcp.Tools.VirtualDesktop.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -50,7 +49,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockSessionHosts); @@ -58,7 +56,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockSessionHosts); @@ -67,7 +64,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(mockSessionHosts); } @@ -103,7 +99,6 @@ public async Task ExecuteAsync_WithValidInput_CallsServiceCorrectly() "sub123", "pool1", null, - Arg.Any(), Arg.Any()) .Returns(expectedSessionHosts); @@ -119,7 +114,6 @@ await Service.Received(1).ListSessionHostsAsync( "sub123", "pool1", null, - Arg.Any(), Arg.Any()); } @@ -138,7 +132,6 @@ public async Task ExecuteAsync_WithResourceId_CallsServiceCorrectly() "sub123", resourceId, null, - Arg.Any(), Arg.Any()) .Returns(expectedSessionHosts); @@ -154,14 +147,12 @@ await Service.Received(1).ListSessionHostsByResourceIdAsync( "sub123", resourceId, null, - Arg.Any(), Arg.Any()); await Service.DidNotReceive().ListSessionHostsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -180,7 +171,6 @@ public async Task ExecuteAsync_WithResourceGroup_CallsServiceCorrectly() "rg1", "pool1", null, - Arg.Any(), Arg.Any()) .Returns(expectedSessionHosts); @@ -197,7 +187,6 @@ await Service.Received(1).ListSessionHostsByResourceGroupAsync( "rg1", "pool1", null, - Arg.Any(), Arg.Any()); } @@ -209,7 +198,6 @@ public async Task ExecuteAsync_WithEmptyResults_ReturnsNullResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -217,7 +205,6 @@ public async Task ExecuteAsync_WithEmptyResults_ReturnsNullResults() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns([]); @@ -238,7 +225,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -246,7 +232,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); diff --git a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostUserSessionListCommandTests.cs b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostUserSessionListCommandTests.cs index 2241696913..7d0ef6915f 100644 --- a/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostUserSessionListCommandTests.cs +++ b/tools/Azure.Mcp.Tools.VirtualDesktop/tests/Azure.Mcp.Tools.VirtualDesktop.Tests/SessionHost/SessionHostUserSessionListCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.VirtualDesktop.Commands.SessionHost; using Azure.Mcp.Tools.VirtualDesktop.Models; using Azure.Mcp.Tools.VirtualDesktop.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -57,7 +56,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -66,7 +64,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -76,7 +73,6 @@ public async Task ExecuteAsync_ValidatesInputCorrectly(string args, bool shouldS Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); } @@ -130,7 +126,6 @@ public async Task ExecuteAsync_ReturnsUserSessionsSuccessfully() "test-hostpool", "test-sessionhost", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -150,7 +145,6 @@ await Service.Received(1).ListUserSessionsAsync( "test-hostpool", "test-sessionhost", null, - Arg.Any(), Arg.Any()); } @@ -177,7 +171,6 @@ public async Task ExecuteAsync_WithResourceId_CallsServiceCorrectly() resourceId, "test-sessionhost", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -197,7 +190,6 @@ await Service.Received(1).ListUserSessionsByResourceIdAsync( resourceId, "test-sessionhost", null, - Arg.Any(), Arg.Any()); await Service.DidNotReceive().ListUserSessionsAsync( @@ -205,7 +197,6 @@ await Service.DidNotReceive().ListUserSessionsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -232,7 +223,6 @@ public async Task ExecuteAsync_WithResourceGroup_CallsServiceCorrectly() "test-hostpool", "test-sessionhost", Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -254,7 +244,6 @@ await Service.Received(1).ListUserSessionsByResourceGroupAsync( "test-hostpool", "test-sessionhost", null, - Arg.Any(), Arg.Any()); await Service.DidNotReceive().ListUserSessionsAsync( @@ -262,7 +251,6 @@ await Service.DidNotReceive().ListUserSessionsAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); await Service.DidNotReceive().ListUserSessionsByResourceIdAsync( @@ -270,7 +258,6 @@ await Service.DidNotReceive().ListUserSessionsByResourceIdAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()); } @@ -285,7 +272,6 @@ public async Task ExecuteAsync_ReturnsEmptyResultsWhenNoUserSessions() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -294,7 +280,6 @@ public async Task ExecuteAsync_ReturnsEmptyResultsWhenNoUserSessions() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -319,7 +304,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -328,7 +312,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Test error")); @@ -354,7 +337,6 @@ public async Task ExecuteAsync_HandlesRequestFailedException_NotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exception); @@ -363,7 +345,6 @@ public async Task ExecuteAsync_HandlesRequestFailedException_NotFound() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exception); @@ -389,7 +370,6 @@ public async Task ExecuteAsync_HandlesRequestFailedException_Forbidden() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exception); @@ -398,7 +378,6 @@ public async Task ExecuteAsync_HandlesRequestFailedException_Forbidden() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .ThrowsAsync(exception); @@ -436,7 +415,6 @@ public async Task ExecuteAsync_WithTenantParameter() "test-hostpool", "test-sessionhost", "test-tenant", - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -445,7 +423,6 @@ public async Task ExecuteAsync_WithTenantParameter() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any()) .Returns(userSessions.AsReadOnly()); @@ -466,7 +443,6 @@ await Service.Received(1).ListUserSessionsAsync( "test-hostpool", "test-sessionhost", "test-tenant", - Arg.Any(), Arg.Any()); } } diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs index b3013f4aae..d817c4da9c 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs @@ -48,7 +48,6 @@ public override async Task ExecuteAsync(CommandContext context, * otherwise the workbook will display an error when opening. */ options.SourceId ?? "azure monitor", - options.RetryPolicy, options.Tenant, cancellationToken) ?? throw new InvalidOperationException("Failed to create workbook"); diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/DeleteWorkbooksCommand.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/DeleteWorkbooksCommand.cs index 59a292f5b4..5bb44f8816 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/DeleteWorkbooksCommand.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/DeleteWorkbooksCommand.cs @@ -51,7 +51,6 @@ public override async Task ExecuteAsync(CommandContext context, { var result = await _workbooksService.DeleteWorkbooksAsync( options.WorkbookIds, - options.RetryPolicy, options.Tenant, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ListWorkbooksCommand.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ListWorkbooksCommand.cs index 4c18cfcedf..3feb65e744 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ListWorkbooksCommand.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ListWorkbooksCommand.cs @@ -64,7 +64,6 @@ public override async Task ExecuteAsync(CommandContext context, options.MaxResults == null || options.MaxResults.Value < 1 ? 50 : Math.Min(options.MaxResults.Value, 1000), options.IncludeTotalCount ?? true, ParseOutputFormat(options.OutputFormat), - options.RetryPolicy, options.Tenant, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ShowWorkbooksCommand.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ShowWorkbooksCommand.cs index 7b13bedf8c..9f04c70d0e 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ShowWorkbooksCommand.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/ShowWorkbooksCommand.cs @@ -50,7 +50,6 @@ public override async Task ExecuteAsync(CommandContext context, { var result = await _workbooksService.GetWorkbooksAsync( options.WorkbookIds, - options.RetryPolicy, options.Tenant, cancellationToken); diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/UpdateWorkbooksCommand.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/UpdateWorkbooksCommand.cs index cf9c23e81e..8e011cc324 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/UpdateWorkbooksCommand.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/UpdateWorkbooksCommand.cs @@ -35,7 +35,6 @@ public override async Task ExecuteAsync(CommandContext context, options.WorkbookId, options.DisplayName, options.SerializedContent, - options.RetryPolicy, options.Tenant, cancellationToken) ?? throw new InvalidOperationException("Failed to update workbook"); diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/CreateWorkbookOptions.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/CreateWorkbookOptions.cs index e7c40a7e39..f2f6757335 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/CreateWorkbookOptions.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/CreateWorkbookOptions.cs @@ -26,6 +26,4 @@ public sealed class CreateWorkbookOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/DeleteWorkbookOptions.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/DeleteWorkbookOptions.cs index c9853ee70c..7a79ad7184 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/DeleteWorkbookOptions.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/DeleteWorkbookOptions.cs @@ -14,6 +14,4 @@ public sealed class DeleteWorkbookOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ListWorkbooksOptions.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ListWorkbooksOptions.cs index e8d51ae093..b20c6ee1b7 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ListWorkbooksOptions.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ListWorkbooksOptions.cs @@ -43,8 +43,6 @@ public sealed class ListWorkbooksOptions : ISubscriptionOption [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } /// /// Creates a WorkbookFilters object from the command options. diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ShowWorkbooksOptions.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ShowWorkbooksOptions.cs index 9fbbc1820d..621727342c 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ShowWorkbooksOptions.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ShowWorkbooksOptions.cs @@ -14,6 +14,4 @@ public sealed class ShowWorkbooksOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/UpdateWorkbooksOptions.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/UpdateWorkbooksOptions.cs index 378e86b07b..6ebf64bb7f 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/UpdateWorkbooksOptions.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/UpdateWorkbooksOptions.cs @@ -20,6 +20,4 @@ public sealed class UpdateWorkbooksOptions [Option(Description = OptionDescriptions.Tenant)] public string? Tenant { get; set; } - [OptionContainer(Prefix = "retry")] - public RetryPolicyOptions? RetryPolicy { get; set; } } diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Services/IWorkbooksService.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Services/IWorkbooksService.cs index bae695cc0f..980f3684b3 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Services/IWorkbooksService.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Services/IWorkbooksService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using Azure.Mcp.Tools.Workbooks.Models; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Workbooks.Services; @@ -19,7 +18,6 @@ Task ListWorkbooksAsync( int maxResults = 50, bool includeTotalCount = true, OutputFormat outputFormat = OutputFormat.Standard, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default); @@ -29,7 +27,6 @@ Task ListWorkbooksAsync( /// Task GetWorkbooksAsync( IReadOnlyList workbookIds, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default); @@ -42,7 +39,6 @@ Task GetWorkbooksAsync( string displayName, string serializedData, string sourceId, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default); @@ -53,7 +49,6 @@ Task GetWorkbooksAsync( string workbookId, string? displayName = null, string? serializedContent = null, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default); @@ -62,7 +57,6 @@ Task GetWorkbooksAsync( /// Task DeleteWorkbooksAsync( IReadOnlyList workbookIds, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default); } diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Services/WorkbooksService.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Services/WorkbooksService.cs index 564f0fbc0a..6932690ecf 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/src/Services/WorkbooksService.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/src/Services/WorkbooksService.cs @@ -10,7 +10,6 @@ using Azure.ResourceManager.ResourceGraph; using Azure.ResourceManager.ResourceGraph.Models; using Microsoft.Extensions.Logging; -using Microsoft.Mcp.Core.Options; namespace Azure.Mcp.Tools.Workbooks.Services; @@ -33,7 +32,6 @@ public async Task ListWorkbooksAsync( int maxResults = 50, bool includeTotalCount = true, OutputFormat outputFormat = OutputFormat.Standard, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default) { @@ -52,7 +50,7 @@ public async Task ListWorkbooksAsync( foreach (var sub in subscriptions) { // Resolve subscription name to ID if needed - var subscriptionResource = await AzureService.GetSubscription(sub, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(sub, tenant, cancellationToken); query.Subscriptions.Add(subscriptionResource.Data.SubscriptionId); } } @@ -79,7 +77,7 @@ public async Task ListWorkbooksAsync( int? totalCount = null; if (includeTotalCount) { - totalCount = await GetTotalCountAsync(subscriptions, resourceGroups, filters, tenant, retryPolicy, cancellationToken); + totalCount = await GetTotalCountAsync(subscriptions, resourceGroups, filters, tenant, cancellationToken); } return new(workbooks, totalCount, ContinuationToken: null); @@ -87,7 +85,6 @@ public async Task ListWorkbooksAsync( public async Task GetWorkbooksAsync( IReadOnlyList workbookIds, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default) { @@ -104,7 +101,7 @@ public async Task GetWorkbooksAsync( await _throttle.WaitAsync(cancellationToken); try { - var workbook = await GetSingleWorkbookAsync(id, retryPolicy, tenant, cancellationToken); + var workbook = await GetSingleWorkbookAsync(id, tenant, cancellationToken); if (workbook is null) { throw new InvalidOperationException($"Workbook with ID '{id}' was not found or returned null."); @@ -144,7 +141,6 @@ public async Task GetWorkbooksAsync( string displayName, string serializedData, string sourceId, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default) { @@ -157,7 +153,7 @@ public async Task GetWorkbooksAsync( ValidateSerializedData(serializedData); - var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, retryPolicy, cancellationToken) + var subscriptionResource = await AzureService.GetSubscription(subscription, tenant, cancellationToken) ?? throw new InvalidOperationException($"Subscription '{subscription}' not found"); var resourceGroupResource = await subscriptionResource.GetResourceGroups().GetAsync(resourceGroupName, cancellationToken); @@ -191,7 +187,6 @@ public async Task GetWorkbooksAsync( string workbookId, string? displayName = null, string? serializedContent = null, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default) { @@ -202,7 +197,7 @@ public async Task GetWorkbooksAsync( ValidateSerializedData(serializedContent); } - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); var workbookResourceId = new ResourceIdentifier(workbookId); var workbookResource = armClient.GetApplicationInsightsWorkbookResource(workbookResourceId) @@ -239,7 +234,6 @@ public async Task GetWorkbooksAsync( public async Task DeleteWorkbooksAsync( IReadOnlyList workbookIds, - RetryPolicyOptions? retryPolicy = null, string? tenant = null, CancellationToken cancellationToken = default) { @@ -256,7 +250,7 @@ public async Task DeleteWorkbooksAsync( await _throttle.WaitAsync(cancellationToken); try { - await DeleteSingleWorkbookAsync(id, retryPolicy, tenant, cancellationToken); + await DeleteSingleWorkbookAsync(id, tenant, cancellationToken); return (Id: id, Error: (WorkbookError?)null); } catch (Exception ex) @@ -289,13 +283,12 @@ public async Task DeleteWorkbooksAsync( private async Task GetSingleWorkbookAsync( string workbookId, - RetryPolicyOptions? retryPolicy, string? tenant, CancellationToken cancellationToken) { ValidateWorkbookId(workbookId); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); var workbookResourceId = new ResourceIdentifier(workbookId); var workbookResource = armClient.GetApplicationInsightsWorkbookResource(workbookResourceId) @@ -316,13 +309,12 @@ public async Task DeleteWorkbooksAsync( private async Task DeleteSingleWorkbookAsync( string workbookId, - RetryPolicyOptions? retryPolicy, string? tenant, CancellationToken cancellationToken) { ValidateWorkbookId(workbookId); - var armClient = await CreateArmClientAsync(tenant, retryPolicy, cancellationToken: cancellationToken); + var armClient = await CreateArmClientAsync(tenant, null, cancellationToken: cancellationToken); var workbookResourceId = new ResourceIdentifier(workbookId); var workbookResource = armClient.GetApplicationInsightsWorkbookResource(workbookResourceId) @@ -338,7 +330,6 @@ private async Task DeleteSingleWorkbookAsync( IReadOnlyList? resourceGroups, WorkbookFilters? filters, string? tenant, - RetryPolicyOptions? retryPolicy, CancellationToken cancellationToken) { try @@ -357,7 +348,7 @@ private async Task DeleteSingleWorkbookAsync( { foreach (var sub in subscriptions) { - var subscriptionResource = await AzureService.GetSubscription(sub, tenant, retryPolicy, cancellationToken); + var subscriptionResource = await AzureService.GetSubscription(sub, tenant, cancellationToken); query.Subscriptions.Add(subscriptionResource.Data.SubscriptionId); } } diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/CreateWorkbooksCommandTests.cs b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/CreateWorkbooksCommandTests.cs index 3442330bbf..707d593eed 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/CreateWorkbooksCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/CreateWorkbooksCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Workbooks.Commands.Workbooks; using Azure.Mcp.Tools.Workbooks.Models; using Azure.Mcp.Tools.Workbooks.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -69,7 +68,6 @@ public async Task ExecuteAsync_CreatesWorkbook_WhenValidParametersProvided() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(workbook); @@ -91,7 +89,6 @@ await Service.Received(1).CreateWorkbookAsync( "Test Workbook", """{"items":[{"type":"text","content":"Test content"}]}""", "azure monitor", - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -121,7 +118,6 @@ public async Task ExecuteAsync_UsesProvidedSourceId_WhenSpecified() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(workbook); @@ -141,7 +137,6 @@ await Service.Received(1).CreateWorkbookAsync( "Test Workbook", """{"items":[{"type":"text","content":"Test content"}]}""", "custom-source", - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -156,7 +151,6 @@ public async Task ExecuteAsync_ReturnsError_WhenServiceReturnsNull() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns((WorkbookInfo?)null); @@ -182,7 +176,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new InvalidOperationException("Service error")); @@ -223,7 +216,6 @@ public async Task ExecuteAsync_PassesCorrectParameters_ToService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(workbook); @@ -242,7 +234,6 @@ await Service.Received(1).CreateWorkbookAsync( "My Test Workbook", """{"version": "Notebook/1.0","items": [{"type": "1","content": "Hello World"}]}""", "azure monitor", - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -258,7 +249,6 @@ public async Task ExecuteAsync_PassesNullTenant_WhenTenantNotProvided() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(workbook); @@ -277,7 +267,6 @@ await Service.Received(1).CreateWorkbookAsync( "Test Workbook", """{"items":[]}""", "azure monitor", - Arg.Any(), Arg.Is(t => t == null), Arg.Any()); } @@ -371,7 +360,6 @@ public async Task ExecuteAsync_WithComplexSerializedContent_HandlesCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(workbook); @@ -388,49 +376,6 @@ public async Task ExecuteAsync_WithComplexSerializedContent_HandlesCorrectly() Assert.NotNull(result.Results); } - [Fact] - public async Task ExecuteAsync_WithRetryOptions_PassesCorrectParameters() - { - // Arrange - var workbook = new WorkbookInfo("test-id", null, null, null, null, null, null, null, null, null, null, null); - Service.CreateWorkbookAsync( - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) - .Returns(workbook); - - // Act - await ExecuteCommandAsync( - "--subscription", "test-sub", - "--resource-group", "test-rg", - "--display-name", "Test Workbook", - "--serialized-content", """{"items":[]}""", - "--retry-max-retries", "5", - "--retry-delay", "2.5", - "--retry-max-delay", "30", - "--retry-mode", "Exponential"); - - // Assert - await Service.Received(1).CreateWorkbookAsync( - "test-sub", - "test-rg", - "Test Workbook", - """{"items":[]}""", - "azure monitor", - Arg.Is(opts => - opts != null && - opts.MaxRetries == 5 && - opts.DelaySeconds == 2.5 && - opts.MaxDelaySeconds == 30), - Arg.Any(), - Arg.Any()); - } - [Fact] public async Task ExecuteAsync_HandlesExceptionCorrectly_WhenExceptionOccurs() { @@ -441,7 +386,6 @@ public async Task ExecuteAsync_HandlesExceptionCorrectly_WhenExceptionOccurs() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new ArgumentException("Invalid workbook data")); diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/DeleteWorkbooksCommandTests.cs b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/DeleteWorkbooksCommandTests.cs index 2da07d376f..f5a1b138d3 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/DeleteWorkbooksCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/DeleteWorkbooksCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Workbooks.Commands.Workbooks; using Azure.Mcp.Tools.Workbooks.Models; using Azure.Mcp.Tools.Workbooks.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -46,7 +45,6 @@ public async Task ExecuteAsync_ReturnsSuccess_WhenWorkbookDeletedSuccessfully() Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -73,7 +71,6 @@ public async Task ExecuteAsync_ReturnsBatchResults_WhenMultipleWorkbooksDeleted( Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -100,7 +97,6 @@ public async Task ExecuteAsync_ReturnsPartialResults_WhenSomeDeletionsFail() Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -129,7 +125,6 @@ public async Task ExecuteAsync_ReturnsError_WhenAllDeletionsFail() Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -152,7 +147,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); @@ -176,7 +170,6 @@ public async Task ExecuteAsync_PassesCorrectParameters_ToService() Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -187,7 +180,6 @@ public async Task ExecuteAsync_PassesCorrectParameters_ToService() // Assert await Service.Received(1).DeleteWorkbooksAsync( Arg.Is>(ids => ids.Contains(workbookId)), - Arg.Any(), Arg.Is("test-tenant"), Arg.Any()); } @@ -202,7 +194,6 @@ public async Task ExecuteAsync_PassesNullTenant_WhenTenantNotProvided() Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -213,7 +204,6 @@ public async Task ExecuteAsync_PassesNullTenant_WhenTenantNotProvided() // Assert await Service.Received(1).DeleteWorkbooksAsync( Arg.Is>(ids => ids.Contains(workbookId)), - Arg.Any(), Arg.Is(t => t == null), Arg.Any()); } @@ -239,7 +229,6 @@ public async Task ExecuteAsync_WithValidResourceId_ProcessesCorrectly() Service.DeleteWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -254,32 +243,4 @@ public async Task ExecuteAsync_WithValidResourceId_ProcessesCorrectly() Assert.Contains(validWorkbookId, result.Succeeded); } - [Fact] - public async Task ExecuteAsync_WithRetryPolicy_PassesRetryOptions() - { - // Arrange - var workbookId = "/subscriptions/sub1/resourceGroups/rg1/providers/microsoft.insights/workbooks/workbook1"; - - var batchResult = new WorkbookDeleteBatchResult([workbookId], []); - - Service.DeleteWorkbooksAsync( - Arg.Any>(), - Arg.Any(), - Arg.Any(), - Arg.Any()) - .Returns(batchResult); - - // Act - await ExecuteCommandAsync("--workbook-ids", workbookId, "--retry-max-retries", "5", "--retry-delay", "2"); - - // Assert - await Service.Received(1).DeleteWorkbooksAsync( - Arg.Is>(ids => ids.Contains(workbookId)), - Arg.Is(options => - options != null && - options.MaxRetries == 5 && - options.DelaySeconds == 2), - Arg.Any(), - Arg.Any()); - } } diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ListWorkbooksCommandTests.cs b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ListWorkbooksCommandTests.cs index dc4b049502..b13ca963bc 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ListWorkbooksCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ListWorkbooksCommandTests.cs @@ -7,7 +7,6 @@ using Azure.Mcp.Tools.Workbooks.Commands.Workbooks; using Azure.Mcp.Tools.Workbooks.Models; using Azure.Mcp.Tools.Workbooks.Services; -using Microsoft.Mcp.Core.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -90,7 +89,6 @@ public async Task ExecuteAsync_ReturnsWorkbooks_WhenWorkbooksExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -131,7 +129,6 @@ public async Task ExecuteAsync_ReturnsEmptyResults_WhenNoWorkbooksExist() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -159,7 +156,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); @@ -188,7 +184,6 @@ public async Task ExecuteAsync_PassesCorrectParameters_ToService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -207,7 +202,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Is("test-tenant"), Arg.Any()); } @@ -224,7 +218,6 @@ public async Task ExecuteAsync_PassesNullTenant_WhenTenantNotProvided() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -242,7 +235,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Is(t => t == null), Arg.Any()); } @@ -301,7 +293,6 @@ public async Task ExecuteAsync_WithComplexWorkbookData_SerializesCorrectly() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -354,7 +345,6 @@ public async Task ExecuteAsync_WithKindFilter_PassesCorrectFilter() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -377,7 +367,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -413,7 +402,6 @@ public async Task ExecuteAsync_WithCategoryFilter_PassesCorrectFilter() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -436,7 +424,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -473,7 +460,6 @@ public async Task ExecuteAsync_WithSourceIdFilter_PassesCorrectFilter() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -496,7 +482,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -533,7 +518,6 @@ public async Task ExecuteAsync_WithMultipleFilters_PassesCorrectFilters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -558,7 +542,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -594,7 +577,6 @@ public async Task ExecuteAsync_WithoutFilters_PassesEmptyFilters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -616,7 +598,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -635,7 +616,6 @@ public async Task ExecuteAsync_WithValidKind_AcceptsKindValue(string kind) Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -657,7 +637,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -678,7 +657,6 @@ public async Task ExecuteAsync_WithValidCategory_AcceptsCategoryValue(string cat Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -700,7 +678,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -736,7 +713,6 @@ public async Task ExecuteAsync_ReturnsTotalCount_WhenIncludeTotalCountTrue() Arg.Any(), Arg.Is(true), // includeTotalCount Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -764,7 +740,6 @@ public async Task ExecuteAsync_WithMaxResults_PassesMaxResultsToService() Arg.Is(25), // maxResults Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -782,7 +757,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Is(25), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -803,7 +777,6 @@ public async Task ExecuteAsync_WithOutputFormat_PassesCorrectFormat(string forma Arg.Any(), Arg.Any(), Arg.Is(expectedFormat), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -821,7 +794,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Is(expectedFormat), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -839,7 +811,6 @@ public async Task ExecuteAsync_WithNameContainsFilter_PassesCorrectFilter() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -857,7 +828,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -876,7 +846,6 @@ public async Task ExecuteAsync_WithModifiedAfterFilter_PassesCorrectFilter() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -894,7 +863,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -915,7 +883,6 @@ public async Task ExecuteAsync_WithVariousDateFormats_ParsesModifiedAfterCorrect Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -934,7 +901,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -952,7 +918,6 @@ public async Task ExecuteAsync_WithInvalidDateFormat_IgnoresModifiedAfterFilter( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -971,7 +936,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -992,7 +956,6 @@ public async Task ExecuteAsync_WithMaxResultsOverLimit_CapsAtMaximum(int request Arg.Is(expectedMaxResults), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -1010,7 +973,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Is(expectedMaxResults), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -1030,7 +992,6 @@ public async Task ExecuteAsync_WithZeroOrNegativeMaxResults_UsesDefaultValue(int Arg.Is(expectedMaxResults), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -1048,7 +1009,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Is(expectedMaxResults), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -1067,7 +1027,6 @@ public async Task ExecuteAsync_IncludeTotalCountDefaultsToTrue_WhenNotSpecified( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -1085,7 +1044,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Is(true), // Default should be true Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -1128,7 +1086,6 @@ public async Task ExecuteAsync_WithAllSemanticFilters_PassesAllFiltersCorrectly( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -1157,7 +1114,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -1181,7 +1137,6 @@ public async Task ExecuteAsync_WithOutputFormatCaseInsensitive_ParsesCorrectly(s Arg.Any(), Arg.Any(), Arg.Is(expectedFormat), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -1199,7 +1154,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Is(expectedFormat), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -1217,7 +1171,6 @@ public async Task ExecuteAsync_WithUnknownOutputFormat_DefaultsToStandard() Arg.Any(), Arg.Any(), Arg.Is(OutputFormat.Standard), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -1235,7 +1188,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Any(), Arg.Is(OutputFormat.Standard), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -1253,7 +1205,6 @@ public async Task ExecuteAsync_DefaultsToIncludeTotalCountTrue() Arg.Any(), Arg.Is(true), // should default to true Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); @@ -1269,7 +1220,6 @@ await Service.Received(1).ListWorkbooksAsync( Arg.Any(), Arg.Is(true), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()); } @@ -1289,7 +1239,6 @@ public async Task ExecuteAsync_ReturnsEmptyResults_WhenServiceReturnsNullTotalCo Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(listResult); diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ShowWorkbooksCommandTests.cs b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ShowWorkbooksCommandTests.cs index c0cef7c1a8..f214a03cfa 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ShowWorkbooksCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/ShowWorkbooksCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Workbooks.Commands.Workbooks; using Azure.Mcp.Tools.Workbooks.Models; using Azure.Mcp.Tools.Workbooks.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -69,7 +68,6 @@ public async Task ExecuteAsync_ReturnsWorkbook_WhenWorkbookExists() Service.GetWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -129,7 +127,6 @@ public async Task ExecuteAsync_ReturnsBatchResults_WhenMultipleWorkbooksRequeste Service.GetWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -172,7 +169,6 @@ public async Task ExecuteAsync_ReturnsPartialResults_WhenSomeWorkbooksNotFound() Service.GetWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -197,7 +193,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Service.GetWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); @@ -220,7 +215,6 @@ public async Task ExecuteAsync_PassesCorrectParameters_ToService() Service.GetWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -231,7 +225,6 @@ public async Task ExecuteAsync_PassesCorrectParameters_ToService() // Assert await Service.Received(1).GetWorkbooksAsync( Arg.Is>(ids => ids.Contains(workbookId)), - Arg.Any(), Arg.Is("test-tenant"), Arg.Any()); } @@ -245,7 +238,6 @@ public async Task ExecuteAsync_PassesNullTenant_WhenTenantNotProvided() Service.GetWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); @@ -256,7 +248,6 @@ public async Task ExecuteAsync_PassesNullTenant_WhenTenantNotProvided() // Assert await Service.Received(1).GetWorkbooksAsync( Arg.Is>(ids => ids.Contains(workbookId)), - Arg.Any(), Arg.Is(t => t == null), Arg.Any()); } @@ -332,7 +323,6 @@ public async Task ExecuteAsync_WithComplexWorkbookData_SerializesCorrectly() Service.GetWorkbooksAsync( Arg.Any>(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(batchResult); diff --git a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/UpdateWorkbooksCommandTests.cs b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/UpdateWorkbooksCommandTests.cs index a87b5c4993..d8f7466dc4 100644 --- a/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/UpdateWorkbooksCommandTests.cs +++ b/tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.Tests/UpdateWorkbooksCommandTests.cs @@ -6,7 +6,6 @@ using Azure.Mcp.Tools.Workbooks.Commands.Workbooks; using Azure.Mcp.Tools.Workbooks.Models; using Azure.Mcp.Tools.Workbooks.Services; -using Microsoft.Mcp.Core.Options; using Microsoft.Mcp.Tests.Client; using NSubstitute; using NSubstitute.ExceptionExtensions; @@ -69,7 +68,6 @@ public async Task ExecuteAsync_UpdatesWorkbook_WhenValidParametersProvided() Arg.Is(workbookId), Arg.Is("Updated Test Workbook"), Arg.Is("{\"version\":\"Notebook/1.0\",\"updated\":true}"), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(updatedWorkbook); @@ -112,7 +110,6 @@ public async Task ExecuteAsync_UpdatesOnlyDisplayName_WhenOnlyDisplayNameProvide Arg.Is(workbookId), Arg.Is("New Display Name Only"), Arg.Is((string?)null), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(updatedWorkbook); @@ -153,7 +150,6 @@ public async Task ExecuteAsync_UpdatesOnlySerializedContent_WhenOnlySerializedCo Arg.Is(workbookId), Arg.Is((string?)null), Arg.Is(newSerializedContent), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(updatedWorkbook); @@ -197,7 +193,6 @@ public async Task ExecuteAsync_PassesCorrectParameters_ToService() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(updatedWorkbook); @@ -213,7 +208,6 @@ await Service.Received(1).UpdateWorkbookAsync( Arg.Is(workbookId), Arg.Is(displayName), Arg.Is(serializedContent), - Arg.Any(), Arg.Is(t => t == null), Arg.Any()); } @@ -228,7 +222,6 @@ public async Task ExecuteAsync_ReturnsError_WhenServiceReturnsNull() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(Task.FromResult(null)); @@ -251,7 +244,6 @@ public async Task ExecuteAsync_HandlesServiceErrors() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(new Exception("Service error")); @@ -331,7 +323,6 @@ public async Task ExecuteAsync_WithComplexSerializedContent_HandlesCorrectly() Arg.Is(workbookId), Arg.Is("Updated Complex Workbook"), Arg.Is(complexSerializedData), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(updatedWorkbook); @@ -378,7 +369,6 @@ public async Task ExecuteAsync_WithTenant_PassesCorrectParameters() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .Returns(updatedWorkbook); @@ -394,58 +384,10 @@ await Service.Received(1).UpdateWorkbookAsync( Arg.Is(workbookId), Arg.Is("Test Workbook"), Arg.Is((string?)null), - Arg.Any(), Arg.Is(tenantId), Arg.Any()); } - [Fact] - public async Task ExecuteAsync_WithRetryOptions_PassesCorrectParameters() - { - // Arrange - var workbookId = "/subscriptions/sub1/resourceGroups/rg1/providers/microsoft.insights/workbooks/workbook1"; - - var updatedWorkbook = new WorkbookInfo( - WorkbookId: workbookId, - DisplayName: "Test Workbook", - Description: "Test Description", - Category: "workbook", - Location: "eastus", - Kind: "shared", - Tags: "{}", - SerializedData: "{\"version\":\"Notebook/1.0\"}", - Version: "1.0", - TimeModified: DateTimeOffset.UtcNow, - UserId: "user1", - SourceId: "azure monitor" - ); - - Service.UpdateWorkbookAsync( - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any(), - Arg.Any()) - .Returns(updatedWorkbook); - - // Act - await ExecuteCommandAsync( - "--workbook-id", workbookId, - "--display-name", "Test Workbook", - "--retry-max-retries", "5", - "--retry-delay", "2.5"); - - // Assert - await Service.Received(1).UpdateWorkbookAsync( - Arg.Is(workbookId), - Arg.Is("Test Workbook"), - Arg.Is((string?)null), - Arg.Is(x => x != null && x.MaxRetries == 5 && System.Math.Abs(x.DelaySeconds.GetValueOrDefault() - 2.5) < 1e-6), - Arg.Any(), - Arg.Any()); - } - [Fact] public async Task ExecuteAsync_HandlesExceptionCorrectly_WhenExceptionOccurs() { @@ -457,7 +399,6 @@ public async Task ExecuteAsync_HandlesExceptionCorrectly_WhenExceptionOccurs() Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()) .ThrowsAsync(exception); From 67db1260733b484a608f3f1b58391f6a31029407 Mon Sep 17 00:00:00 2001 From: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:12:48 -0400 Subject: [PATCH 2/2] Add CHANGELOG entry --- servers/Azure.Mcp.Server/changelog-entries/1787854358851.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 servers/Azure.Mcp.Server/changelog-entries/1787854358851.yaml diff --git a/servers/Azure.Mcp.Server/changelog-entries/1787854358851.yaml b/servers/Azure.Mcp.Server/changelog-entries/1787854358851.yaml new file mode 100644 index 0000000000..38bc0d0109 --- /dev/null +++ b/servers/Azure.Mcp.Server/changelog-entries/1787854358851.yaml @@ -0,0 +1,3 @@ +changes: + - section: "Breaking Changes" + description: "Removed retry parameters from all tools."