Add Garnet cache cluster PowerShell cmdlets for Az.CosmosDB (preview) - #29983
Open
Karthik chakravarthy (kcheekuri) wants to merge 8 commits into
Open
Conversation
Add PowerShell cmdlet support for Garnet cache cluster management under the Az.CosmosDB module, following the Managed Cassandra pattern. This includes: - New-AzCosmosDBGarnetCluster: Create a new Garnet cache cluster with conflict detection - Get-AzCosmosDBGarnetCluster: Get/List Garnet cluster(s) by name, resource group, subscription, ResourceId, or pipeline InputObject - Update-AzCosmosDBGarnetCluster: Update an existing cluster with GET-then-merge pattern and ResourceId/InputObject support - Remove-AzCosmosDBGarnetCluster: Delete a cluster with ResourceId, InputObject, AsJob, and PassThru support Supporting changes: - NewOrUpdateAzGarnetCluster shared base class for common parameters - PSGarnetClusterResource and PSGarnetClusterResourceProperties models in Models/Garnet/ subfolder - Garnet constants for help messages (including Location) - SDK autorest config updated to include 2026-04-01-preview openapi.json - Module manifest updated to export new cmdlets - ChangeLog updated Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix Tags not being passed in Update PATCH request (high severity bug) - Add UTF-8 BOM to all Garnet .cs files to match codebase convention - Use correct commit hash (2a96231) for 2026-04-01-preview Garnet spec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generated from garnet.json (extracted Garnet-only spec from 2026-04-01-preview openapi.json to avoid conflicts with existing swagger files). Generated files: - GarnetClustersOperations.cs (CRUD + List operations) - IGarnetClustersOperations.cs (interface) - 10 model classes (GarnetClusterResource, Properties, Patch, etc.) - CosmosDBManagementClient.cs updated with GarnetClusters property Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The GarnetClusterResourcePatch model only has Properties, no Tags. Tags can only be updated via PUT (CreateUpdate), not PATCH. Removed dead tagsDict code from Update cmdlet. Build verified: 0 errors, 0 warnings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- 4 help markdown files (Get, New, Update, Remove)\n- GarnetClusterTests.cs xUnit test runner\n- GarnetClusterTests.ps1 PowerShell test script\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ocal swagger - Remove unused 'using System;' and 'using Microsoft.Azure.Management.CosmosDB;' from New cmdlet - Move Tag parameter from base class to New cmdlet only (PATCH doesn't support tags) - Capitalize 'Resource ID' in help message constant - Remove local garnet.json; reference remote azure-rest-api-specs URL instead Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
6 tasks
Karthik chakravarthy (kcheekuri)
requested review from
pjohari-ms
and
a lite review from Copilot
August 10, 2026 17:06
Copilot started reviewing on behalf of
Karthik chakravarthy (kcheekuri)
August 10, 2026 17:07
View session
Member
|
/azp run |
Contributor
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds preview support in Az.CosmosDB for managing Azure Cosmos DB Garnet cache clusters via new PowerShell cmdlets, aligning with existing Managed Cassandra patterns.
Changes:
- Introduces 4 new cmdlets for Garnet cluster CRUD:
New-,Get-,Update-,Remove-AzCosmosDBGarnetCluster. - Adds PowerShell model wrappers plus help content and module index updates.
- Updates module exports + changelog, and adds scenario test scaffolding; includes management SDK regeneration artifacts.
Reviewed changes
Copilot reviewed 17 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/CosmosDB/CosmosDB/Models/Garnet/PSGarnetClusterResourceProperties.cs | Adds PS wrapper for Garnet cluster properties returned by the SDK. |
| src/CosmosDB/CosmosDB/Models/Garnet/PSGarnetClusterResource.cs | Adds PS wrapper for Garnet cluster resource (Id/Name/Location/Tags/Properties). |
| src/CosmosDB/CosmosDB/Helpers/Constants.cs | Adds help-message constants for new Garnet cmdlet parameters. |
| src/CosmosDB/CosmosDB/help/Update-AzCosmosDBGarnetCluster.md | Adds reference help for Update cmdlet (PATCH-able properties). |
| src/CosmosDB/CosmosDB/help/Remove-AzCosmosDBGarnetCluster.md | Adds reference help for Remove cmdlet (delete). |
| src/CosmosDB/CosmosDB/help/New-AzCosmosDBGarnetCluster.md | Adds reference help for New cmdlet (create). |
| src/CosmosDB/CosmosDB/help/Get-AzCosmosDBGarnetCluster.md | Adds reference help for Get cmdlet (get/list). |
| src/CosmosDB/CosmosDB/help/Az.CosmosDB.md | Updates module help index to include new Garnet cmdlets and description. |
| src/CosmosDB/CosmosDB/Garnet/UpdateAzCosmosDBGarnetCluster.cs | Implements Update cmdlet using the GarnetClusters PATCH API. |
| src/CosmosDB/CosmosDB/Garnet/RemoveAzCosmosDBGarnetCluster.cs | Implements Remove cmdlet using the GarnetClusters DELETE API. |
| src/CosmosDB/CosmosDB/Garnet/NewOrUpdateAzGarnetCluster.cs | Shared parameter base class for New/Update Garnet cmdlets. |
| src/CosmosDB/CosmosDB/Garnet/NewAzCosmosDBGarnetCluster.cs | Implements New cmdlet using the GarnetClusters PUT create/update API. |
| src/CosmosDB/CosmosDB/Garnet/GetAzCosmosDBGarnetCluster.cs | Implements Get cmdlet using GarnetClusters GET/list APIs. |
| src/CosmosDB/CosmosDB/ChangeLog.md | Adds upcoming-release entry advertising new Garnet cmdlets. |
| src/CosmosDB/CosmosDB/Az.CosmosDB.psd1 | Exports the new cmdlets from the Az.CosmosDB module manifest. |
| src/CosmosDB/CosmosDB.Test/ScenarioTests/GarnetClusterTests.ps1 | Adds scenario test script to exercise Garnet cmdlets across parameter sets. |
| src/CosmosDB/CosmosDB.Test/ScenarioTests/GarnetClusterTests.cs | Adds xUnit entry point for the Garnet scenario script (currently skipped). |
| src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedCassandraManagedServiceIdentityAutoGenerated.cs | SDK regeneration output (new model). |
| src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated3Exception.cs | SDK regeneration output (new error type). |
| src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated3.cs | SDK regeneration output (new error model). |
| src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated2.cs | SDK regeneration output (new error detail model). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
|
Karthik chakravarthy (@kcheekuri) Please fix the CI failures. |
- Remove ErrorDetailAutoGenerated2, ErrorResponseAutoGenerated3, and ManagedCassandraManagedServiceIdentityAutoGenerated (preview branch already has correct generated types) - Change test from Skip to LiveOnly trait (runs in live test environments) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/azp run |
Contributor
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Static analysis enforces singular noun naming for parameters. Renamed 'Extensions' to 'Extension' in New and Update cmdlets, base class, and corresponding help documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/azp run |
Contributor
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Add PowerShell cmdlets for Azure Cosmos DB Garnet cache cluster management (preview).
This PR introduces 4 new cmdlets following the existing Managed Cassandra pattern:
New-AzCosmosDBGarnetCluster— Create a new Garnet cache clusterGet-AzCosmosDBGarnetCluster— Get/list Garnet cache clusters (by name, resource group, or subscription)Update-AzCosmosDBGarnetCluster— Update an existing Garnet cache cluster (PATCH)Remove-AzCosmosDBGarnetCluster— Delete a Garnet cache clusterAPI Version:
2026-04-01-previewChanges include:
The Garnet SDK operations are already generated in the Az.CosmosDB-preview branch via the combined openapi.json from azure-rest-api-specs.
Checklist