-
Notifications
You must be signed in to change notification settings - Fork 545
Add Azure ManagedCleanroom toolset with first commands: collaborations list and collaboration create #2882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ShreyaSangwa
wants to merge
35
commits into
microsoft:main
Choose a base branch
from
ShreyaSangwa:cleanrooms
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,375
−1
Open
Add Azure ManagedCleanroom toolset with first commands: collaborations list and collaboration create #2882
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
6978d33
Add initial Azure ManagedCleanroom toolset with first commands: colla…
0d431c4
Fix review feedback for managedcleanroom list/create scope
1b4eb28
Revert unstable cleanroom package/version bumps
b3aef3a
Use vendored Cleanroom SDKs in ManagedCleanroom service
3b62db7
Rename changelog entry, update architecture docs, solution files, and…
e567734
Return immediately after ARM accepts collaboration create request
10135b1
Split IManagedCleanroomService into control-plane and data-plane inte…
6608cb5
Restore SDK-based list call and add RetryPolicy to data-plane interfa…
043e680
Rename command group from 'collaboration' to 'collaborationArm' for A…
8c6fd88
Refactor cleanroom options and align create semantics
b145dd5
Fix ManagedCleanroom list command test signature
eb54a81
Fix CI blockers for analyze and windows build
b3b64b8
Stabilize missing-subscription unit tests
c583bf2
Fix consolidated tool mappings and metadata
471c9e1
Fix cleanroom create response payload
9ef5037
Update tools/Azure.Mcp.Tools.ManagedCleanroom/src/Commands/ManagedCle…
ShreyaSangwa e01450d
ManagedCleanroom: align create command metadata and update vendored f…
9e4ef10
Fix OptionAttribute named arguments for cleanroom options
47b79eb
Resolve OptionAttribute PR conflict with main
b36d609
Align OptionAttribute with main and update managedcleanroom options
a8fe09e
Merge remote-tracking branch 'upstream/main' into cleanrooms
5c4a60c
Fix managedcleanroom retry option containers
ef6639c
Refactor ManagedCleanroom services by plane
42ce733
Update ManagedCleanroom architecture documentation
97fcbc1
Fix final newline formatting in ManagedCleanroom services
f334474
Fix consolidated tool metadata idempotency alignment
efa1aff
Fix Cosmos playback by removing eager account read
2fe1b7a
Add recorded tests for ManagedCleanroom collaborations list and creat…
45466f2
Remove unrelated Advisor test change from cleanrooms PR
ShreyaSangwa 8407f84
Merge branch 'microsoft:main' into cleanrooms
ShreyaSangwa a8a741f
Remove unrelated Cosmos change from cleanrooms PR
ShreyaSangwa 949618b
Remove unrelated Extension Azqr test change from cleanrooms PR
ShreyaSangwa adc8b6e
Update ManagedCleanroom assets.json with recording tag
ShreyaSangwa 2f3bdfc
Update ManagedCleanroom recorded test assets tag
ShreyaSangwa c962cba
Return raw ARM create output and align ManagedCleanroom playback asse…
ShreyaSangwa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
servers/Azure.Mcp.Server/changelog-entries/managedcleanroom-toolset.yaml
|
ShreyaSangwa marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| changes: | ||
| - section: "New Features" | ||
| description: "Added Azure Managed Cleanroom toolset with two commands for interacting with Azure Cleanroom: `managedcleanroom collaborations list` and `managedcleanroom collaboration create`." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
tools/Azure.Mcp.Tools.ManagedCleanroom/docs/architecture.md
|
ShreyaSangwa marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # Azure Managed Cleanroom MCP Toolset - Architecture | ||
|
ShreyaSangwa marked this conversation as resolved.
|
||
|
|
||
| ## Overview | ||
|
|
||
| `Azure.Mcp.Tools.ManagedCleanroom` currently provides an initial set of operations for interacting with Azure Managed Cleanroom services. The current implementation includes `collaborations list` (data plane) and `collaborationarm create` (control plane), with additional command groups planned. | ||
|
|
||
| Commands interact with: | ||
| - **Data Plane APIs**: Cleanroom Analytics Frontend for read operations (list collaborations, queries, datasets) | ||
| - **Control Plane APIs**: Azure Resource Manager (ARM) for write operations (create collaboration, manage resources) | ||
|
|
||
| --- | ||
|
|
||
| ## Command Surfaces | ||
|
|
||
| - **Management Plane Commands**: | ||
|
|
||
| | Command Group | Command | Status | | ||
| | --- | --- | --- | | ||
| | CollaborationArm | `collaborationarm create` | Completed | | ||
| | CollaborationArm | `collaborationarm get` | Pending | | ||
| | CollaborationArm | `collaborationarm add-collaborator` | Pending | | ||
| | CollaborationArm | `collaborationarm enable-workload` | Pending | | ||
| | CollaborationArm | `collaborationarm get-readonly-kubeconfig` | Pending | | ||
|
|
||
| - **Data Plane Commands**: | ||
|
|
||
| | Command Group | Command | Status | | ||
| | --- | --- | --- | | ||
| | Collaborations | `collaborations list` | Completed | | ||
| | Collaborations | `collaborations get` | Pending | | ||
| | Analytics | `analytics get` | Pending | | ||
| | Analytics | `analytics skr-policy` | Pending | | ||
| | OIDC | `oidc issuer-info` | Pending | | ||
| | OIDC | `oidc keys` | Pending | | ||
| | OIDC | `oidc set-issuer-url` | Pending | | ||
| | Invitations | `invitations list` | Pending | | ||
| | Invitations | `invitations accept` | Pending | | ||
| | Datasets | `datasets publish` | Pending | | ||
| | Datasets | `datasets get` | Pending | | ||
| | Datasets | `datasets list` | Pending | | ||
| | Consent | `consent put` | Pending | | ||
| | Queries | `queries publish` | Pending | | ||
| | Queries | `queries get` | Pending | | ||
| | Queries | `queries list` | Pending | | ||
| | Queries | `queries vote` | Pending | | ||
| | Queries | `queries run` | Pending | | ||
| | Queries | `queries runs` | Pending | | ||
| | Runs | `runs get` | Pending | | ||
| | Audit Events | `auditevents list` | Pending | | ||
|
|
||
| --- | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| Azure.Mcp.Tools.ManagedCleanroom/ | ||
| ├── src/ | ||
| │ ├── ManagedCleanroomSetup.cs # DI registration & command tree | ||
| │ ├── Commands/ | ||
| │ │ ├── ManagedCleanroomJsonContext.cs # AOT-safe JSON serialization | ||
| │ │ ├── Collaboration/ | ||
| │ │ │ ├── CollaborationCreateCommand.cs | ||
| │ │ │ └── [Other collaboration commands ] | ||
| │ │ ├── Collaborations/ | ||
| │ │ │ ├── CollaborationsListCommand.cs | ||
| │ │ │ └── [Other collaboration commands ] | ||
| │ │ ├── Analytics/ # Analytics operations | ||
| │ │ ├── Oidc/ # OIDC configuration | ||
| │ │ ├── Invitations/ # Invitation management | ||
| │ │ ├── Datasets/ # Dataset operations | ||
| │ │ ├── Consent/ # Consent documents | ||
| │ │ ├── Queries/ # Query operations | ||
| │ │ ├── Runs/ # Query run tracking | ||
| │ │ └── AuditEvents/ # Audit event listing | ||
| │ ├── Options/ | ||
| │ │ ├── ManagedCleanroomOptionDescriptions.cs | ||
| │ │ ├── Collaboration/ | ||
| │ │ │ └── [Options classes - mixed status] | ||
| │ │ └── [Options for all command groups] | ||
|
ShreyaSangwa marked this conversation as resolved.
|
||
| │ ├── Models/ | ||
| │ │ └── CollaborationCreateResult.cs | ||
| │ └── Services/ | ||
| │ ├── IManagedCleanroomServiceDataPlane.cs | ||
| │ ├── IManagedCleanroomServiceControlPlane.cs | ||
| │ ├── ManagedCleanroomDataPlaneService.cs | ||
| │ └── ManagedCleanroomControlPlaneService.cs | ||
| └── tests/ | ||
| └── Azure.Mcp.Tools.ManagedCleanroom.Tests/ | ||
| ├── CollaborationArm/ | ||
| │ ├── CollaborationCreateCommandTests.cs | ||
| │ └── [Other tests - ⏳] | ||
| ├── Collaborations/ | ||
| │ ├── CollaborationsListCommandTests.cs | ||
| │ └── [Other tests - ⏳] | ||
| └── [Tests for remaining command groups - ⏳] | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Implementation Notes | ||
|
|
||
| - **Completed**: `collaborations list`, `collaboration create` | ||
| - **Pending**: 25 additional commands across 9 command groups | ||
| - Commands span both data plane and control plane operations | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| TBD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.Runtime.CompilerServices; | ||
|
|
||
| [assembly: InternalsVisibleTo("Azure.Mcp.Tools.ManagedCleanroom.Tests")] |
20 changes: 20 additions & 0 deletions
20
tools/Azure.Mcp.Tools.ManagedCleanroom/src/Azure.Mcp.Tools.ManagedCleanroom.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <IsAotCompatible>true</IsAotCompatible> | ||
| <AzureSupportedClouds>AzureCloud</AzureSupportedClouds> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="..\..\..\core\Azure.Mcp.Core\src\Azure.Mcp.Core.csproj" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <!-- Cleanroom SDKs are temporarily vendored as NuGet packages until they are published. --> | ||
| <PackageReference Include="Azure.Cleanroom.Analytics.Frontend.Client" /> | ||
| <PackageReference Include="Azure.Core" VersionOverride="1.57.0" /> | ||
| <PackageReference Include="Azure.Identity" /> | ||
| <PackageReference Include="Azure.ResourceManager.CleanRoom" /> | ||
| <PackageReference Include="Azure.ResourceManager.Resources" /> | ||
| <PackageReference Include="Microsoft.Extensions.DependencyInjection" /> | ||
| <PackageReference Include="ModelContextProtocol" /> | ||
| <PackageReference Include="System.CommandLine" /> | ||
| </ItemGroup> | ||
| </Project> |
84 changes: 84 additions & 0 deletions
84
...re.Mcp.Tools.ManagedCleanroom/src/Commands/CollaborationArm/CollaborationCreateCommand.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.Net; | ||
| using System.Text.Json; | ||
| using Azure.Mcp.Core.Commands.Subscription; | ||
| using Azure.Mcp.Core.Services.Azure.Subscription; | ||
| using Azure.Mcp.Tools.ManagedCleanroom.Options.CollaborationArm; | ||
| using Azure.Mcp.Tools.ManagedCleanroom.Services; | ||
| using Microsoft.Extensions.Logging; | ||
| using Microsoft.Mcp.Core.Commands; | ||
| using Microsoft.Mcp.Core.Models.Command; | ||
|
|
||
| namespace Azure.Mcp.Tools.ManagedCleanroom.Commands.CollaborationArm; | ||
|
|
||
| [CommandMetadata( | ||
| Id = "e247b9e0-2d87-43a7-8e5d-57eea22237a3", | ||
| Name = "create", | ||
| Title = "Create Cleanroom Collaboration", | ||
| Description = """ | ||
| Creates an Azure Cleanroom collaboration ARM resource in the specified resource group and location. | ||
| Returns immediately once the request is accepted by ARM. Provisioning runs in the background and typically takes ~25 minutes. | ||
| You can check the status by asking to get the collaboration by name once the request is accepted. | ||
| """, | ||
| Destructive = false, | ||
| Idempotent = false, | ||
| OpenWorld = false, | ||
| ReadOnly = false, | ||
| Secret = false, | ||
| LocalRequired = false)] | ||
| public sealed class CollaborationCreateCommand( | ||
| ILogger<CollaborationCreateCommand> logger, | ||
| IManagedCleanroomServiceControlPlane service, | ||
| ISubscriptionResolver subscriptionResolver) | ||
| : SubscriptionCommand<CollaborationCreateOptions, JsonElement>(subscriptionResolver) | ||
| { | ||
| private readonly ILogger<CollaborationCreateCommand> _logger = logger; | ||
| private readonly IManagedCleanroomServiceControlPlane _service = service; | ||
|
|
||
| public override async Task<CommandResponse> ExecuteAsync( | ||
| CommandContext context, CollaborationCreateOptions options, CancellationToken cancellationToken) | ||
| { | ||
| try | ||
| { | ||
| var result = await _service.CreateCollaborationArmResourceAsync( | ||
| options.Name, | ||
| options.ResourceGroup, | ||
| options.Subscription!, | ||
| options.Location, | ||
| options.ResourceLocation, | ||
| options.Collaborators, | ||
| options.Tenant, | ||
| options.RetryPolicy, | ||
| cancellationToken).ConfigureAwait(false); | ||
|
|
||
| context.Response.Message = result.Message; | ||
| context.Response.Results = ResponseResult.Create( | ||
| result.Properties, | ||
| ManagedCleanroomJsonContext.Default.JsonElement); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| _logger.LogError(ex, | ||
| "Error creating cleanroom collaboration. Name: {Name}, ResourceGroup: {ResourceGroup}, Subscription: {Subscription}", | ||
| options.Name, options.ResourceGroup, options.Subscription); | ||
| HandleException(context, ex); | ||
| } | ||
|
|
||
| return context.Response; | ||
| } | ||
|
|
||
| protected override string GetErrorMessage(Exception ex) => ex switch | ||
| { | ||
| RequestFailedException reqEx when reqEx.Status == (int)HttpStatusCode.Conflict => | ||
| "A collaboration with this name already exists in the resource group.", | ||
| RequestFailedException reqEx when reqEx.Status == (int)HttpStatusCode.Forbidden => | ||
| $"Authorization failed creating the collaboration. Details: {reqEx.Message}", | ||
| RequestFailedException reqEx when reqEx.Status == (int)HttpStatusCode.NotFound => | ||
| "Requested resource was not found. Verify the resource group, subscription, and access.", | ||
| RequestFailedException reqEx => reqEx.Message, | ||
| _ => base.GetErrorMessage(ex) | ||
| }; | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.