Skip to content

Add Project and Cluster cmdlets to Az.MongoDB#29768

Open
sharmaanuj334 wants to merge 8 commits into
Azure:mainfrom
sharmaanuj334:feature/mongodb-projects-clusters
Open

Add Project and Cluster cmdlets to Az.MongoDB#29768
sharmaanuj334 wants to merge 8 commits into
Azure:mainfrom
sharmaanuj334:feature/mongodb-projects-clusters

Conversation

@sharmaanuj334

Copy link
Copy Markdown

Description

Adds Project and Cluster management cmdlets to the Az.MongoDB module:

  • Get-AzMongoDBProject - List/get MongoDB Atlas projects
  • New-AzMongoDBProject - Create a new MongoDB Atlas project
  • Remove-AzMongoDBProject - Delete a MongoDB Atlas project
  • Get-AzMongoDBCluster - List/get MongoDB Atlas clusters
  • New-AzMongoDBCluster - Create a new MongoDB Atlas cluster
  • Remove-AzMongoDBCluster - Delete a MongoDB Atlas cluster
  • Get-AzMongoDBProjectClusterTierRegion - List available cluster tiers and regions
  • Limit-AzMongoDBProject - Retrieve project resource limits

Changes

  • Updated AutoRest README.md with new commit ID and directives for Project/Cluster resources
  • Added examples for all new cmdlets
  • Added test implementations with recordings (Record + Playback verified)
  • Added UX metadata for new resource types
  • Updated ChangeLog.md
  • Updated module manifest and help documentation

Testing

  • All 8 tests pass in both Record and Playback modes
  • Recordings normalized with consistent subscription ID

Copilot AI review requested due to automatic review settings June 25, 2026 15:30
@azure-client-tools-bot-prd

Copy link
Copy Markdown
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the Az.MongoDB module (AutoRest-based) with new MongoDB Atlas Project and Cluster management cmdlets, along with corresponding help/docs/examples, UX metadata, and Pester test coverage plus recordings for non-destructive operations.

Changes:

  • Added new cmdlet surface area for MongoDB Atlas Projects/Clusters (Get/New/Remove) plus tier/region discovery and project limit querying.
  • Updated module packaging metadata (manifest export list, solution metadata, AutoRest config/tag) and UX command metadata for the new resource types.
  • Added Pester tests and recordings for Get/New/Limit/TierRegion scenarios, plus generated docs/help and examples for all cmdlets.

Reviewed changes

Copilot reviewed 59 out of 59 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/MongoDB/MongoDB/help/Remove-AzMongoDBProject.md New reference help for removing projects
src/MongoDB/MongoDB/help/Remove-AzMongoDBOrganization.md Formatting update to existing remove-organization help
src/MongoDB/MongoDB/help/Remove-AzMongoDBCluster.md New reference help for removing clusters
src/MongoDB/MongoDB/help/New-AzMongoDBProject.md New reference help for creating projects
src/MongoDB/MongoDB/help/New-AzMongoDBOrganization.md Synopsis/formatting improvements in existing help
src/MongoDB/MongoDB/help/New-AzMongoDBCluster.md New reference help for creating clusters
src/MongoDB/MongoDB/help/Limit-AzMongoDBProject.md New reference help for project limit querying
src/MongoDB/MongoDB/help/Get-AzMongoDBProjectClusterTierRegion.md New reference help for listing tier/region availability
src/MongoDB/MongoDB/help/Get-AzMongoDBProject.md New reference help for listing/getting projects
src/MongoDB/MongoDB/help/Get-AzMongoDBOrganization.md Formatting update to existing get-organization help
src/MongoDB/MongoDB/help/Get-AzMongoDBCluster.md New reference help for listing/getting clusters
src/MongoDB/MongoDB/help/Az.MongoDB.md Added the new cmdlets to the module help index
src/MongoDB/MongoDB/ChangeLog.md Release notes for the added cmdlets
src/MongoDB/MongoDB/Az.MongoDB.psd1 Export list updated for new cmdlets; dependency and metadata updates
src/MongoDB/MongoDB.sln Solution metadata updated (project GUID change)
src/MongoDB/MongoDB.Autorest/UX/MongoDB.Atlas/organizations.json UX metadata API version bumped for organizations
src/MongoDB/MongoDB.Autorest/UX/MongoDB.Atlas/organizations-projects.json New UX metadata for projects resource type and commands
src/MongoDB/MongoDB.Autorest/UX/MongoDB.Atlas/organizations-projects-clusters.json New UX metadata for clusters resource type and commands
src/MongoDB/MongoDB.Autorest/test/utils.ps1 Added env variables used by the new cmdlet tests
src/MongoDB/MongoDB.Autorest/test/Remove-AzMongoDBProject.Tests.ps1 New (currently skipped) Remove project test scaffold
src/MongoDB/MongoDB.Autorest/test/Remove-AzMongoDBCluster.Tests.ps1 New (currently skipped) Remove cluster test scaffold
src/MongoDB/MongoDB.Autorest/test/README.md Updated test folder documentation text
src/MongoDB/MongoDB.Autorest/test/New-AzMongoDBProject.Tests.ps1 New Pester test for creating projects
src/MongoDB/MongoDB.Autorest/test/New-AzMongoDBProject.Recording.json New recording for New-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/test/New-AzMongoDBCluster.Tests.ps1 New Pester test for creating clusters
src/MongoDB/MongoDB.Autorest/test/Limit-AzMongoDBProject.Tests.ps1 New Pester test for project limits
src/MongoDB/MongoDB.Autorest/test/Limit-AzMongoDBProject.Recording.json New recording for Limit-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/test/Get-AzMongoDBProjectClusterTierRegion.Tests.ps1 New Pester test for tier/region lookup
src/MongoDB/MongoDB.Autorest/test/Get-AzMongoDBProjectClusterTierRegion.Recording.json New recording for tier/region lookup
src/MongoDB/MongoDB.Autorest/test/Get-AzMongoDBProject.Tests.ps1 New Pester tests for list/get projects
src/MongoDB/MongoDB.Autorest/test/Get-AzMongoDBProject.Recording.json New recording for project list/get
src/MongoDB/MongoDB.Autorest/test/Get-AzMongoDBCluster.Tests.ps1 New Pester tests for list/get clusters
src/MongoDB/MongoDB.Autorest/test/Get-AzMongoDBCluster.Recording.json New recording for cluster list/get
src/MongoDB/MongoDB.Autorest/test/env.json Added env values used by new Project/Cluster tests
src/MongoDB/MongoDB.Autorest/resources/README.md Updated resources folder documentation text
src/MongoDB/MongoDB.Autorest/README.md AutoRest config updated (commit/tag/module-version) for new resources
src/MongoDB/MongoDB.Autorest/Properties/AssemblyInfo.cs Assembly version bumped to 0.1.1 (plus trailing whitespace)
src/MongoDB/MongoDB.Autorest/generate-info.json Regeneration id updated
src/MongoDB/MongoDB.Autorest/examples/Remove-AzMongoDBProject.md New example for Remove-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/examples/Remove-AzMongoDBCluster.md New example for Remove-AzMongoDBCluster
src/MongoDB/MongoDB.Autorest/examples/New-AzMongoDBProject.md New example for New-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/examples/New-AzMongoDBCluster.md New examples for New-AzMongoDBCluster
src/MongoDB/MongoDB.Autorest/examples/Limit-AzMongoDBProject.md New example for Limit-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/examples/Get-AzMongoDBProjectClusterTierRegion.md New example for tier/region lookup
src/MongoDB/MongoDB.Autorest/examples/Get-AzMongoDBProject.md New examples for project list/get
src/MongoDB/MongoDB.Autorest/examples/Get-AzMongoDBCluster.md New examples for cluster list/get
src/MongoDB/MongoDB.Autorest/docs/Remove-AzMongoDBProject.md Generated docs for Remove-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/docs/Remove-AzMongoDBCluster.md Generated docs for Remove-AzMongoDBCluster
src/MongoDB/MongoDB.Autorest/docs/README.md Docs folder README text updated
src/MongoDB/MongoDB.Autorest/docs/New-AzMongoDBProject.md Generated docs for New-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/docs/New-AzMongoDBCluster.md Generated docs for New-AzMongoDBCluster
src/MongoDB/MongoDB.Autorest/docs/Limit-AzMongoDBProject.md Generated docs for Limit-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/docs/Get-AzMongoDBProjectClusterTierRegion.md Generated docs for tier/region lookup
src/MongoDB/MongoDB.Autorest/docs/Get-AzMongoDBProject.md Generated docs for Get-AzMongoDBProject
src/MongoDB/MongoDB.Autorest/docs/Get-AzMongoDBCluster.md Generated docs for Get-AzMongoDBCluster
src/MongoDB/MongoDB.Autorest/docs/Az.MongoDB.md Generated cmdlet index updated (module GUID change)
src/MongoDB/MongoDB.Autorest/custom/README.md Custom folder docs updated (contains a broken relative link)
src/MongoDB/MongoDB.Autorest/custom/Az.MongoDB.custom.psm1 Custom module loader paths updated

Comment on lines +7 to +10
Current : 0
IsReached : False
Maximum : 1
Type : FREE
Comment on lines +45 to +48
Current : 0
IsReached : False
Maximum : 1
Type : FREE
Comment on lines +17 to +33
Describe 'Remove-AzMongoDBCluster' {
It 'Delete' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'DeleteViaIdentityProject' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'DeleteViaIdentityOrganization' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'DeleteViaIdentity' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}
}
Comment on lines +17 to +29
Describe 'Remove-AzMongoDBProject' {
It 'Delete' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'DeleteViaIdentityOrganization' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'DeleteViaIdentity' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}
}
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.MongoDB`.
- `Microsoft.Azure.PowerShell.Cmdlets.MongoDB.InternalExportAttribute`
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.MongoDB`. For more information, see [README.md](../internal/README.md) in the `../internal` folder.
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.MongoDB`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
Copilot AI review requested due to automatic review settings June 25, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 61 out of 61 changed files in this pull request and generated 9 comments.

Comment thread src/MongoDB/MongoDB.Autorest/custom/README.md Outdated
@@ -1,5 +1,5 @@
# Docs
This directory contains the documentation of the cmdlets for the `Az.MongoDB` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder.
This directory contains the documentation of the cmdlets for the `Az.MongoDB` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder.

## Details
The process of documentation generation loads `Az.MongoDB` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. No newline at end of file
The process of documentation generation loads `Az.MongoDB` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. No newline at end of file
@@ -1,5 +1,5 @@
# Test
This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets.
This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets.
@@ -1,5 +1,5 @@
# Resources
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder.
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder.

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '5.2.0'; })
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '5.5.0'; })

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is auto-generated boilerplate that appears identically in all AutoRest modules (e.g., src/Cdn/Cdn.Autorest/README.md also says Az.Accounts >= 2.7.5). The actual runtime dependency is declared in the .psd1 manifest (RequiredModules), which correctly requires 5.5.0. This README line is not user-facing documentation — it's part of the AutoRest configuration scaffold.

Comment on lines +44 to +46
# Use the 2026-03-01-preview tag which includes Organization, Project, and Cluster resources
tag: package-2026-03-01-preview
module-version: 1.1.0

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is expected and consistent with every other AutoRest module in the repo. For example, Az.Cdn has module-version: 0.1.0 in its AutoRest README but ModuleVersion = '6.0.2' in the .psd1. The module-version in the AutoRest configuration is a code-generation metadata field, not the shipped module version. These are intentionally decoupled.

Comment on lines +21 to +24
Remove-AzMongoDBProject -ResourceGroupName $env.ResourceGroupName `
-OrganizationName $env.OrganizationName `
-Name $env.ProjectName `
-WhatIf
Comment on lines +21 to +25
Remove-AzMongoDBCluster -ResourceGroupName $env.ResourceGroupName `
-OrganizationName $env.OrganizationName `
-ProjectName $env.ClusterTestProjectName `
-Name $env.ClusterName `
-WhatIf
Copilot AI review requested due to automatic review settings June 25, 2026 20:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 61 out of 61 changed files in this pull request and generated 5 comments.

Comment on lines +21 to +24
Remove-AzMongoDBProject -ResourceGroupName $env.ResourceGroupName `
-OrganizationName $env.OrganizationName `
-Name $env.ProjectName `
-WhatIf
Comment on lines +21 to +25
Remove-AzMongoDBCluster -ResourceGroupName $env.ResourceGroupName `
-OrganizationName $env.OrganizationName `
-ProjectName $env.ClusterTestProjectName `
-Name $env.ClusterName `
-WhatIf
Comment on lines +39 to +45
### Example 1: Remove a Project
```powershell
Remove-AzMongoDBProject -ResourceGroupName sharmaanuTest -OrganizationName KanedaTest -Name test-project-1
```

Deletes the MongoDB Atlas project.
The operation is asynchronous; all clusters under the project must be deleted first.
Comment on lines +45 to +51
### Example 1: Remove a Cluster
```powershell
Remove-AzMongoDBCluster -ResourceGroupName sharmaanuTest -OrganizationName KanedaTest -ProjectName test-project-1 -Name test-cluster-free
```

Deletes the MongoDB Atlas cluster.
The operation is asynchronous; the underlying partner cluster is also torn down.
Comment on lines +72 to +76
FunctionsToExport = 'Get-AzMongoDBCluster', 'Get-AzMongoDBOrganization',
'Get-AzMongoDBProject', 'Get-AzMongoDBProjectClusterTierRegion',
'Limit-AzMongoDBProject', 'New-AzMongoDBCluster',
'New-AzMongoDBOrganization', 'New-AzMongoDBProject',
'Remove-AzMongoDBCluster', 'Remove-AzMongoDBOrganization',

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

False positive. The module is built from src/MongoDB/MongoDB.Autorest/exports/ (which contains all 12 cmdlets including Project and Cluster), not from generated/MongoDB/. The generated/ copy is stale from a previous iteration and is not what the build system uses.

Proof:

PS> Get-ChildItem src/MongoDB/MongoDB.Autorest/exports -Filter "*.ps1" | Select Name
Get-AzMongoDBCluster.ps1
Get-AzMongoDBOrganization.ps1
Get-AzMongoDBProject.ps1
Get-AzMongoDBProjectClusterTierRegion.ps1
Limit-AzMongoDBProject.ps1
New-AzMongoDBCluster.ps1
New-AzMongoDBOrganization.ps1
New-AzMongoDBProject.ps1
Remove-AzMongoDBCluster.ps1
Remove-AzMongoDBOrganization.ps1
Remove-AzMongoDBProject.ps1

Copilot AI review requested due to automatic review settings June 25, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 58 out of 58 changed files in this pull request and generated 1 comment.

---
Module Name: Az.MongoDB
Module Guid: e8abde8d-9c45-4aea-9875-390bd042d9ea
Module Guid: 97fe2d21-7b64-4cee-b8b9-e39d12750776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants