Skip to content

Onboard Az.DocumentDB (mongocluster) PowerShell module (preview 0.1.0) - #30071

Open
amatarritamicrosoft wants to merge 7 commits into
Azure:mainfrom
amatarritamicrosoft:users/amatarrita/documentdb-ps
Open

amatarritamicrosoft wants to merge 7 commits into
Azure:mainfrom
amatarritamicrosoft:users/amatarrita/documentdb-ps

Conversation

@amatarritamicrosoft

@amatarritamicrosoft amatarritamicrosoft commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ⚠️ Review suggested

Tests
⚠️ 36/36
️✔️Az.Accounts
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Az.ArtifactSigning
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Signature Check
⚠️PowerShell Core - Windows
Type Cmdlet Description Remediation
⚠️ Get-AzArtifactSigningAccount Get-AzArtifactSigningAccount Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzArtifactSigningAccount Get-AzArtifactSigningAccount changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzArtifactSigningCertificateProfile Get-AzArtifactSigningCertificateProfile Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzArtifactSigningCertificateProfile Get-AzArtifactSigningCertificateProfile changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️Windows PowerShell - Windows
Type Cmdlet Description Remediation
⚠️ Get-AzArtifactSigningAccount Get-AzArtifactSigningAccount Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzArtifactSigningAccount Get-AzArtifactSigningAccount changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Get-AzArtifactSigningCertificateProfile Get-AzArtifactSigningCertificateProfile Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue
⚠️ Get-AzArtifactSigningCertificateProfile Get-AzArtifactSigningCertificateProfile changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️File Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Az.DocumentDB
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help Example Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️File Change Check
⚠️PowerShell Core - Windows
Type Cmdlet Description Remediation
⚠️ AssemblyInfo.cs will be updated automatically. Please do not update it manually. Revert AssemblyInfo.cs to its last version.
⚠️Windows PowerShell - Windows
Type Cmdlet Description Remediation
⚠️ AssemblyInfo.cs will be updated automatically. Please do not update it manually. Revert AssemblyInfo.cs to its last version.
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows

Description

Onboards Az.DocumentDB (preview 0.1.0), a new Azure PowerShell module for Azure Cosmos DB for MongoDB (vCore) mongo clusters, generated via TypeSpec (typespec-powershell) and mirroring the Azure CLI az cosmosdb mongocluster command surface.

What's included

  • 18 cmdlets, including 5 hand-written custom cmdlets: New-AzDocumentDBReplica, Restore-AzDocumentDBMongoCluster, Reset-AzDocumentDBMongoClusterPassword, Switch-AzDocumentDBMongoCluster, and New-AzDocumentDBUser. User-assigned identities are managed through Update-AzDocumentDBMongoCluster.
  • 18 examples (one per exported cmdlet).
  • 9 integration-test scenarios passing in both Record and Playback modes (identity, promote, firewall, CRUD, CMK, replica, user, restore, properties).
  • tools/CreateMappings_rules.json entry (required for new modules).
  • tools/StaticAnalysis/Exceptions/Az.DocumentDB/SignatureIssues.csv for the read-only Get-* ConfirmImpact pattern accepted across existing modules.

Validation

  • Static analysis: clean (0 gating issues).
  • Recordings sanitized (test subscription, no real identifiers).

🚫 DO NOT MERGE - this PR is for review/validation only and should not be merged yet.

Assisted-By: GitHub Copilot

Add Az.DocumentDB for Azure Cosmos DB for MongoDB (vCore) mongo clusters,
generated via TypeSpec (typespec-powershell) and mirroring the Azure CLI
command surface. Includes 21 cmdlets with 8 hand-written custom cmdlets
(replica, restore, password reset, promote, user, and user-assigned
identity management), 21 examples, and 9 recorded integration-test
scenarios passing in both Record and Playback modes.

Also adds the DocumentDB entry to tools/CreateMappings_rules.json (required
for new modules) and a StaticAnalysis signature exceptions file for the
read-only Get-* ConfirmImpact pattern accepted across existing modules.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 46bb57cf-0490-4f99-a750-27ca921e5d89
Copilot AI lite review requested due to automatic review settings August 26, 2026 05:56
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

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 pull request onboards a new preview Azure PowerShell module, Az.DocumentDB (0.1.0), targeting Azure Cosmos DB for MongoDB (vCore) mongo clusters, including generated assets plus several custom wrapper cmdlets, documentation, UX metadata, and Pester-based scenario tests.

Changes:

  • Added the new src/DocumentDB module structure (manifest, csproj, help, custom cmdlets, UX metadata).
  • Added Pester scenario tests and recordings for key flows (CRUD, firewall, identity/CMK, replica, promote, restore, etc.).
  • Updated repo tooling to recognize the new module (CreateMappings rule) and added static analysis signature exceptions.

Reviewed changes

Copilot reviewed 101 out of 110 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/CreateMappings_rules.json Add DocumentDB module mapping
tools/StaticAnalysis/Exceptions/Az.DocumentDB/SignatureIssues.csv Static analysis signature exceptions
src/DocumentDB/DocumentDB.sln Module solution file
src/DocumentDB/DocumentDB/Az.DocumentDB.psd1 Module manifest (Az.DocumentDB)
src/DocumentDB/DocumentDB/ChangeLog.md Module changelog
src/DocumentDB/DocumentDB/DocumentDB.csproj Module build project
src/DocumentDB/DocumentDB/Properties/AssemblyInfo.cs Module assembly metadata
src/DocumentDB/DocumentDB/help/Add-AzDocumentDBMongoClusterIdentity.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Az.DocumentDB.md Module help landing page
src/DocumentDB/DocumentDB/help/Get-AzDocumentDBFirewallRule.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Get-AzDocumentDBMongoCluster.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Get-AzDocumentDBMongoClusterConnectionString.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Get-AzDocumentDBMongoClusterIdentity.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Get-AzDocumentDBReplica.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Invoke-AzDocumentDBPromoteMongoCluster.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/New-AzDocumentDBFirewallRule.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/New-AzDocumentDBMongoCluster.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/New-AzDocumentDBReplica.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/New-AzDocumentDBUser.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Remove-AzDocumentDBFirewallRule.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Remove-AzDocumentDBMongoCluster.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Remove-AzDocumentDBMongoClusterIdentity.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Remove-AzDocumentDBUser.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Reset-AzDocumentDBMongoClusterPassword.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Restore-AzDocumentDBMongoCluster.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Test-AzDocumentDBMongoClusterNameAvailability.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Update-AzDocumentDBFirewallRule.md Cmdlet help markdown
src/DocumentDB/DocumentDB/help/Update-AzDocumentDBMongoCluster.md Cmdlet help markdown
src/DocumentDB/DocumentDB.Autorest/.gitattributes Autorest directory attributes
src/DocumentDB/DocumentDB.Autorest/.gitignore Autorest directory ignores
src/DocumentDB/DocumentDB.Autorest/Properties/AssemblyInfo.cs Generated client assembly metadata
src/DocumentDB/DocumentDB.Autorest/README.md Module generator README
src/DocumentDB/DocumentDB.Autorest/UX/Microsoft.DocumentDB/mongoClusters-firewallRules.json UX metadata (firewall rules)
src/DocumentDB/DocumentDB.Autorest/UX/Microsoft.DocumentDB/mongoClusters-users.json UX metadata (users)
src/DocumentDB/DocumentDB.Autorest/UX/Microsoft.DocumentDB/mongoClusters.json UX metadata (clusters)
src/DocumentDB/DocumentDB.Autorest/custom/Add-AzDocumentDBMongoClusterIdentity.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/custom/Az.DocumentDB.custom.psm1 Custom module loader
src/DocumentDB/DocumentDB.Autorest/custom/Get-AzDocumentDBMongoClusterIdentity.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/custom/Invoke-AzDocumentDBPromoteMongoCluster.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/custom/New-AzDocumentDBReplica.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/custom/New-AzDocumentDBUser.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/custom/README.md Custom cmdlets documentation
src/DocumentDB/DocumentDB.Autorest/custom/Remove-AzDocumentDBMongoClusterIdentity.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/custom/Reset-AzDocumentDBMongoClusterPassword.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/custom/Restore-AzDocumentDBMongoCluster.ps1 Custom wrapper cmdlet
src/DocumentDB/DocumentDB.Autorest/docs/README.md Generated docs folder README
src/DocumentDB/DocumentDB.Autorest/examples/Add-AzDocumentDBMongoClusterIdentity.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Get-AzDocumentDBFirewallRule.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Get-AzDocumentDBMongoCluster.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Get-AzDocumentDBMongoClusterConnectionString.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Get-AzDocumentDBMongoClusterIdentity.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Get-AzDocumentDBReplica.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Get-AzDocumentDBUser.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Invoke-AzDocumentDBPromoteMongoCluster.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/New-AzDocumentDBFirewallRule.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/New-AzDocumentDBMongoCluster.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/New-AzDocumentDBReplica.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/New-AzDocumentDBUser.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Remove-AzDocumentDBFirewallRule.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Remove-AzDocumentDBMongoCluster.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Remove-AzDocumentDBMongoClusterIdentity.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Remove-AzDocumentDBUser.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Reset-AzDocumentDBMongoClusterPassword.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Restore-AzDocumentDBMongoCluster.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Test-AzDocumentDBMongoClusterNameAvailability.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Update-AzDocumentDBFirewallRule.md Example markdown
src/DocumentDB/DocumentDB.Autorest/examples/Update-AzDocumentDBMongoCluster.md Example markdown
src/DocumentDB/DocumentDB.Autorest/generate-info.json Generation metadata
src/DocumentDB/DocumentDB.Autorest/how-to.md Development how-to
src/DocumentDB/DocumentDB.Autorest/resources/README.md Resources folder README
src/DocumentDB/DocumentDB.Autorest/test/Add-AzDocumentDBMongoClusterIdentity.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/Add-AzDocumentDBMongoClusterIdentity.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/Get-AzDocumentDBMongoClusterIdentity.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Get-AzDocumentDbFirewallRule.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Get-AzDocumentDbMongoCluster.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Get-AzDocumentDbMongoClusterConnectionString.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Get-AzDocumentDbReplica.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Get-AzDocumentDbUser.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Invoke-AzDocumentDbPromoteMongoCluster.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/Invoke-AzDocumentDbPromoteMongoCluster.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDBMongoClusterCmk.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDBMongoClusterCmk.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDBReplica.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDBReplica.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDbFirewallRule.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDbFirewallRule.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDbMongoCluster.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDbMongoCluster.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDbUser.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/New-AzDocumentDbUser.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/README.md Test folder README
src/DocumentDB/DocumentDB.Autorest/test/Remove-AzDocumentDBMongoClusterIdentity.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Remove-AzDocumentDbFirewallRule.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Remove-AzDocumentDbMongoCluster.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Remove-AzDocumentDbUser.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Reset-AzDocumentDBMongoClusterPassword.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Restore-AzDocumentDBMongoCluster.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/Restore-AzDocumentDBMongoCluster.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/Test-AzDocumentDbMongoClusterNameAvailability.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Update-AzDocumentDbFirewallRule.Tests.ps1 Pester test stub
src/DocumentDB/DocumentDB.Autorest/test/Update-AzDocumentDbMongoCluster.Recording.json Pester recording
src/DocumentDB/DocumentDB.Autorest/test/Update-AzDocumentDbMongoCluster.Tests.ps1 Pester scenario test
src/DocumentDB/DocumentDB.Autorest/test/env.json Test environment data
src/DocumentDB/DocumentDB.Autorest/test/loadEnv.ps1 Test env loader script
src/DocumentDB/DocumentDB.Autorest/test/utils.ps1 Test utilities
src/DocumentDB/DocumentDB.Autorest/tsp-location.yaml Spec location + commit pin
src/DocumentDB/DocumentDB.Autorest/tspconfig.yaml TypeSpec emitter configuration
src/DocumentDB/DocumentDB.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 Test utility script
src/DocumentDB/DocumentDB.Autorest/utils/Unprotect-SecureString.ps1 SecureString utility script
Suppressed comments (2)

src/DocumentDB/DocumentDB/help/Az.DocumentDB.md:11

  • The module description is still a placeholder; this should be set to a real description (typically aligned with the module manifest Description) before publishing help.
    src/DocumentDB/DocumentDB.Autorest/UX/Microsoft.DocumentDB/mongoClusters-users.json:29
  • Same typo appears in the example description.
          "description": "Gets the defintion of a Mongo cluster user.",

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/DocumentDB/DocumentDB/help/Az.DocumentDB.md Outdated
Comment thread src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md Outdated
Comment thread src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md Outdated
Comment thread src/DocumentDB/DocumentDB/help/Az.DocumentDB.md Outdated
Comment thread src/DocumentDB/DocumentDB.Autorest/README.md
Comment thread src/DocumentDB/DocumentDB.Autorest/how-to.md
@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories:
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because Agent Assist cannot edit another user's text: none

Agent Assist does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

Copilot AI review requested due to automatic review settings August 27, 2026 02:54

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 101 out of 110 changed files in this pull request and generated 12 comments.

Suppressed comments (2)

src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md:41

  • Typo in description: "defintion" should be "definition".
    src/DocumentDB/DocumentDB.Autorest/UX/Microsoft.DocumentDB/mongoClusters-users.json:29
  • Typo in example description: "defintion" should be "definition".
          "description": "Gets the defintion of a Mongo cluster user.",

Comment thread src/DocumentDB/DocumentDB.Autorest/test/loadEnv.ps1
Comment thread src/DocumentDB/DocumentDB.Autorest/test/env.json Outdated
Comment thread src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md Outdated
Comment thread src/DocumentDB/DocumentDB/help/Az.DocumentDB.md Outdated
Comment thread src/DocumentDB/DocumentDB.Autorest/tspconfig.yaml
Copilot AI review requested due to automatic review settings August 27, 2026 03:39
…parity

Expose -PromoteOption (enum: Forced, required) so the promote command
surface matches the merged Azure CLI (az documentdb mongocluster replica
promote), which takes --source-cluster, --mode, and --promote-option. The
existing -SourceCluster safety check (reads the replica's actual source
and aborts on mismatch) is retained. -PromoteOption is parity-only (the
service applies the single 'Forced' value), so the recorded promote
scenario is unchanged and playback passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 46bb57cf-0490-4f99-a750-27ca921e5d89

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 101 out of 110 changed files in this pull request and generated no new comments.

Suppressed comments (10)

src/DocumentDB/DocumentDB.Autorest/test/loadEnv.ps1:27

  • $envFilePath is computed (including fallback to the parent folder), but the JSON is read from (Join-Path $PSScriptRoot $envFile) instead. This breaks playback/live runs when env.json is only present at the fallback path.
    src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md:11
  • Typo in SYNOPSIS: "defintion" should be "definition".
    src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md:41
  • Typo in DESCRIPTION: "defintion" should be "definition".
    src/DocumentDB/DocumentDB/help/Az.DocumentDB.md:6
  • The module help front-matter still contains placeholders (Module Guid, Download Help Link, Help Version, Locale). These should be populated so the published reference content is correct and consistent with other modules.
    src/DocumentDB/DocumentDB/help/Az.DocumentDB.md:34
  • Typo in cmdlet list entry: "defintion" should be "definition".
    src/DocumentDB/DocumentDB.Autorest/README.md:20
  • This line refers to AutoRest, but Az.DocumentDB is generated via TypeSpec per tspconfig.yaml and PR description. Update the wording so it stays accurate for this module.
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.

src/DocumentDB/DocumentDB/help/Az.DocumentDB.md:11

  • The module description is still a placeholder. This should be a real description (matching the pattern used by other Az.* modules).
    src/DocumentDB/DocumentDB.Autorest/UX/Microsoft.DocumentDB/mongoClusters-users.json:10
  • Typo in UX description: "defintion" should be "definition".
      "description": "Gets the defintion of a Mongo cluster user.",

src/DocumentDB/DocumentDB.Autorest/UX/Microsoft.DocumentDB/mongoClusters-users.json:29

  • Typo in UX example description: "defintion" should be "definition".
          "description": "Gets the defintion of a Mongo cluster user.",

src/DocumentDB/DocumentDB.Autorest/README.md:14

  • PR description says the module is generated via TypeSpec (typespec-powershell), but this README states it was generated via AutoRest. Please update the README generator note to match the actual generation toolchain for Az.DocumentDB.
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

Copilot AI review requested due to automatic review settings August 27, 2026 03:47
@amatarritamicrosoft
amatarritamicrosoft force-pushed the users/amatarrita/documentdb-ps branch from bdf4997 to 06db6c9 Compare August 27, 2026 03:47

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 101 out of 110 changed files in this pull request and generated 7 comments.

Suppressed comments (2)

src/DocumentDB/DocumentDB/help/Az.DocumentDB.md:6

  • This module-level help file still contains template placeholders for metadata (Module Guid/Download link/Help version/Locale). These should be populated so generated help is consistent with other Az modules.
    src/DocumentDB/DocumentDB/help/Az.DocumentDB.md:11
  • The module description is still the template placeholder. This should be replaced with a real user-facing description (typically aligned with the module manifest Description).

Comment thread src/DocumentDB/DocumentDB.Autorest/test/loadEnv.ps1
Comment thread src/DocumentDB/DocumentDB.Autorest/test/loadEnv.ps1
Comment thread src/DocumentDB/DocumentDB/help/Get-AzDocumentDBUser.md Outdated
Comment thread src/DocumentDB/DocumentDB/help/Az.DocumentDB.md Outdated
Comment thread src/DocumentDB/DocumentDB.Autorest/README.md
Comment thread src/DocumentDB/DocumentDB.Autorest/README.md
…ypo, help metadata

- Assign a fresh unique module GUID (was sharing Az.MongoDB's GUID
  accceef6-..., which can cause module discovery/import conflicts).
- Guard $cluster.IdentityUserAssignedIdentity before accessing .Keys in
  Add/Remove-AzDocumentDBMongoClusterIdentity, so assigning the first
  user-assigned identity to a cluster (property is null) no longer throws
  under StrictMode nor injects a spurious null key.
- Fix "defintion" -> "definition" typo in Get-AzDocumentDBUser help,
  UX metadata, and the module cmdlet list.
- Populate the module help landing front matter (Module Guid matches the
  manifest, Download Help Link, Help Version, Locale, Description).
- Document each tspconfig.yaml directive with an inline comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 46bb57cf-0490-4f99-a750-27ca921e5d89
Copilot AI review requested due to automatic review settings August 27, 2026 07:33

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 101 out of 110 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/DocumentDB/DocumentDB.Autorest/Properties/AssemblyInfo.cs:15

  • The file header mixes an MIT license notice with the standard Apache 2.0 header used across other *.Autorest/Properties/AssemblyInfo.cs files in this repo, and duplicates the copyright line. This is confusing from a licensing/attribution perspective and makes this file inconsistent with the rest of the generated modules.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");

@olivertowers

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Commenter does not have sufficient privileges for PR 30071 in repo Azure/azure-powershell

@amatarritamicrosoft

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Commenter does not have sufficient privileges for PR 30071 in repo Azure/azure-powershell

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: credential, database credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • src/DocumentDB/DocumentDB.Autorest/examples/Get-AzDocumentDBMongoClusterConnectionString.md:9 — possible database credential
  • src/DocumentDB/DocumentDB.Autorest/examples/New-AzDocumentDBMongoCluster.md:3 — possible credential

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

Remove the dedicated identity cmdlets and document the standard Get, modify, and Update workflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 46bb57cf-0490-4f99-a750-27ca921e5d89
@yonzhan

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: credential, database credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories:
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: database credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories:
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: database credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories:
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

Harden identity updates, preserve UTC restore times, and sanitize test credentials and recordings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 46bb57cf-0490-4f99-a750-27ca921e5d89
Copilot AI review requested due to automatic review settings September 7, 2026 18:56

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.

🔵 Needs a closer look

The new wrapper cmdlets have a couple of concrete robustness gaps (resource ID parsing and role input validation) and the onboarding currently triggers a persistent FileChangeAnalyzer warning via AssemblyInfo.cs.

Review details

Suppressed comments (3)

Previously missed (3) — in code that hasn't changed since the last review.

src/DocumentDB/DocumentDB.Autorest/custom/New-AzDocumentDBReplica.ps1:142

  • $sourceId is split and then indexed at fixed positions ($idSegments[1],[3],[7]) without validating the resource ID shape. If a caller passes an unexpected ARM ID (or any string starting with '/subscriptions/' that isn't a mongoClusters ID), this will throw an index error instead of a clear message.
    src/DocumentDB/DocumentDB.Autorest/custom/New-AzDocumentDBUser.ps1:147
  • -Role is documented as hashtables with 'Db' and 'Role' keys, but the code doesn't validate that shape. If a user passes a malformed hashtable/object, the cmdlet will silently send nulls in the JSON body and fail later with a harder-to-debug service error.
    src/DocumentDB/DocumentDB/Properties/AssemblyInfo.cs:28
  • This module introduces a new AssemblyInfo.cs, but the repo's FileChangeAnalyzer flags any changed AssemblyInfo.cs as an issue and recommends reverting it (per PR validation warning). To avoid carrying a persistent CI warning, consider moving these assembly attributes into the .csproj (or otherwise avoiding an AssemblyInfo.cs change) for the module.
  • Files reviewed: 110/119 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories:
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@necusjz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Use the approved Switch verb for the public cmdlet while preserving the existing promotion behavior and internal operation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 46bb57cf-0490-4f99-a750-27ca921e5d89
Copilot AI review requested due to automatic review settings September 9, 2026 16:46

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.

🔵 Needs a closer look

This is a large new-module onboarding PR with generated + custom surfaces, and there are unresolved inconsistencies between the described and exported cmdlet surface (manifest/exceptions/help).

Review details
  • Files reviewed: 110/119 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/DocumentDB/DocumentDB/Az.DocumentDB.psd1
Comment thread tools/StaticAnalysis/Exceptions/Az.DocumentDB/SignatureIssues.csv Outdated
Use secure password prompts in custom cmdlet help and remove obsolete identity signature exceptions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 46bb57cf-0490-4f99-a750-27ca921e5d89
Copilot AI review requested due to automatic review settings September 9, 2026 18:15

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.

🔵 Needs a closer look

There are a few concrete blockers/risks (unused plaintext SecureString helper, non-standard tsp debug setting, and onboarding warnings around AssemblyInfo.cs generation) that should be resolved before approval.

Review details

Suppressed comments (5)

Previously missed (5) — in code that hasn't changed since the last review.

src/DocumentDB/DocumentDB.Autorest/custom/Switch-AzDocumentDBMongoCluster.ps1:30

  • This cmdlet uses -MongoClusterName as the canonical parameter name and only provides -Name as an alias. In this same module, other cluster-scoped cmdlets use -Name as the canonical name (with MongoClusterName as an alias), and the help example already uses -Name.

To keep the command surface consistent and avoid confusing users (syntax shows -MongoClusterName but examples and other cmdlets use -Name), consider making Name the parameter name and using MongoClusterName as an alias instead.
src/DocumentDB/DocumentDB.Autorest/utils/Unprotect-SecureString.ps1:4

  • This utility converts SecureString values to plaintext. In addition to being a risky helper to ship, it is currently unused within the Az.DocumentDB module (no references found under src/DocumentDB), so it adds attack surface without benefit.

Please delete this script (or, if it’s intended only for test/recording sanitization, move it under the test tooling and ensure it is not packaged with the module).
src/DocumentDB/DocumentDB/Properties/AssemblyInfo.cs:28

  • PR validation is warning that AssemblyInfo.cs should not be updated manually. Since this file is newly added and contains explicit version attributes, it will continue to trigger that warning until the repo’s expected generation pattern is followed.

Please either remove this file (and rely on the SDK-style auto-generated assembly attributes / build tooling), or confirm the correct onboarding workflow for new modules so the file-change check no longer flags it.
src/DocumentDB/DocumentDB.Autorest/Properties/AssemblyInfo.cs:20

  • The header comment block is duplicated and includes both MIT and Apache license text (plus repeated copyright lines). This differs from other *.Autorest/Properties/AssemblyInfo.cs files and makes the file look accidentally concatenated.

Please keep a single standard Apache 2.0 header like other TypeSpec/AutoRest-generated modules (for example src/Carbon/Carbon.Autorest/Properties/AssemblyInfo.cs).
src/DocumentDB/DocumentDB.Autorest/tspconfig.yaml:7

  • tspconfig.yaml enables debug: true. Other TypeSpec-generated modules in this repo do not set debug mode (for example src/Relationships/Relationships.Autorest/tspconfig.yaml), and leaving it enabled can produce noisy output and non-standard generation artifacts.

Recommend setting this to false (or removing the option) for a clean, reproducible generation config.

  • Files reviewed: 110/119 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: credential, database credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@amatarritamicrosoft amatarritamicrosoft changed the title [Do Not Merge] Onboard Az.DocumentDB (mongocluster) PowerShell module (preview 0.1.0) Onboard Az.DocumentDB (mongocluster) PowerShell module (preview 0.1.0) Sep 11, 2026
@necusjz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

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.

5 participants