Skip to content

New powershell module for 'servicegroups'#29282

Open
meghanagupta95 wants to merge 10 commits intoAzure:mainfrom
meghanagupta95:meghanag/servicegroups
Open

New powershell module for 'servicegroups'#29282
meghanagupta95 wants to merge 10 commits intoAzure:mainfrom
meghanagupta95:meghanag/servicegroups

Conversation

@meghanagupta95
Copy link
Copy Markdown
Member

@meghanagupta95 meghanagupta95 commented Mar 18, 2026

Description

This PR adds a new module for the resource type 'ServiceGroups' using the code generation method. This is required as part of our move to public preview.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings March 18, 2026 14:25
@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds the initial scaffold for a new Azure PowerShell module Az.ServiceGroups, including module packaging, generated cmdlet help, AutoRest workspace, and Pester test stubs.

Changes:

  • Introduces the ServiceGroups module project, manifest, changelog, and solution entries.
  • Adds initial help markdown for cmdlets plus AutoRest-generated docs/examples structure.
  • Adds Pester test scaffolding and test utilities for record/playback workflows.

Reviewed changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/ServiceGroups/ServiceGroups/help/Update-AzServiceGroup.md Adds cmdlet help markdown for Update-AzServiceGroup (currently includes placeholders).
src/ServiceGroups/ServiceGroups/help/Remove-AzServiceGroup.md Adds cmdlet help markdown for Remove-AzServiceGroup (currently includes placeholders).
src/ServiceGroups/ServiceGroups/help/New-AzServiceGroup.md Adds cmdlet help markdown for New-AzServiceGroup (currently includes placeholders).
src/ServiceGroups/ServiceGroups/help/Get-AzServiceGroupAncestor.md Adds cmdlet help markdown for Get-AzServiceGroupAncestor (currently includes placeholders).
src/ServiceGroups/ServiceGroups/help/Get-AzServiceGroup.md Adds cmdlet help markdown for Get-AzServiceGroup (currently includes placeholders).
src/ServiceGroups/ServiceGroups/help/Az.ServiceGroups.md Adds module-level help index markdown (currently includes placeholders).
src/ServiceGroups/ServiceGroups/ServiceGroups.csproj Creates the module project and packages manifest + help assets.
src/ServiceGroups/ServiceGroups/Properties/AssemblyInfo.cs Adds assembly metadata/versioning for the new module.
src/ServiceGroups/ServiceGroups/ChangeLog.md Adds initial changelog with 0.1.0 entry.
src/ServiceGroups/ServiceGroups/Az.ServiceGroups.psd1 Adds module manifest including dependencies and exports.
src/ServiceGroups/ServiceGroups.sln Adds solution entries for ServiceGroups and its AutoRest project.
src/ServiceGroups/ServiceGroups.Autorest/utils/Unprotect-SecureString.ps1 Adds utility to convert SecureString to plaintext.
src/ServiceGroups/ServiceGroups.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 Adds helper to get subscription id safely for tests.
src/ServiceGroups/ServiceGroups.Autorest/test/utils.ps1 Adds Pester test utilities and env setup helpers.
src/ServiceGroups/ServiceGroups.Autorest/test/loadEnv.ps1 Adds env loader for record/playback tests.
src/ServiceGroups/ServiceGroups.Autorest/test/Update-AzServiceGroupsServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/Update-AzServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/Remove-AzServiceGroupsServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/Remove-AzServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/README.md Adds documentation for test modes and how to run tests.
src/ServiceGroups/ServiceGroups.Autorest/test/New-AzServiceGroupsServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/New-AzServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/Get-AzServiceGroupsServiceGroupAncestor.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/Get-AzServiceGroupsServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/Get-AzServiceGroupAncestor.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/test/Get-AzServiceGroup.Tests.ps1 Adds generated Pester stub (skipped).
src/ServiceGroups/ServiceGroups.Autorest/resources/README.md Adds AutoRest module resources folder guidance.
src/ServiceGroups/ServiceGroups.Autorest/how-to.md Adds contributor guidance for building/testing/packing the module.
src/ServiceGroups/ServiceGroups.Autorest/examples/Update-AzServiceGroupsServiceGroup.md Adds examples for update cmdlet (contains parameter-name mismatch).
src/ServiceGroups/ServiceGroups.Autorest/examples/Update-AzServiceGroup.md Adds example stub file (placeholders).
src/ServiceGroups/ServiceGroups.Autorest/examples/Remove-AzServiceGroupsServiceGroup.md Adds examples for remove cmdlet.
src/ServiceGroups/ServiceGroups.Autorest/examples/Remove-AzServiceGroup.md Adds example stub file (placeholders).
src/ServiceGroups/ServiceGroups.Autorest/examples/New-AzServiceGroupsServiceGroup.md Adds examples for new cmdlet (contains parameter-name mismatch).
src/ServiceGroups/ServiceGroups.Autorest/examples/New-AzServiceGroup.md Adds example stub file (placeholders).
src/ServiceGroups/ServiceGroups.Autorest/examples/Get-AzServiceGroupsServiceGroupAncestor.md Adds examples for ancestor listing.
src/ServiceGroups/ServiceGroups.Autorest/examples/Get-AzServiceGroupsServiceGroup.md Adds examples for get cmdlet.
src/ServiceGroups/ServiceGroups.Autorest/examples/Get-AzServiceGroupAncestor.md Adds example stub file (placeholders).
src/ServiceGroups/ServiceGroups.Autorest/examples/Get-AzServiceGroup.md Adds example stub file (placeholders).
src/ServiceGroups/ServiceGroups.Autorest/docs/Update-AzServiceGroup.md Adds generated docs markdown for update cmdlet (still placeholders for examples).
src/ServiceGroups/ServiceGroups.Autorest/docs/Remove-AzServiceGroup.md Adds generated docs markdown for remove cmdlet (still placeholders for examples).
src/ServiceGroups/ServiceGroups.Autorest/docs/README.md Adds generated docs folder guidance.
src/ServiceGroups/ServiceGroups.Autorest/docs/New-AzServiceGroup.md Adds generated docs markdown for new cmdlet (still placeholders for examples).
src/ServiceGroups/ServiceGroups.Autorest/docs/Get-AzServiceGroupAncestor.md Adds generated docs markdown for ancestor cmdlet (still placeholders for examples).
src/ServiceGroups/ServiceGroups.Autorest/docs/Get-AzServiceGroup.md Adds generated docs markdown for get cmdlet (still placeholders for examples).
src/ServiceGroups/ServiceGroups.Autorest/docs/Az.ServiceGroups.md Adds generated module index docs markdown.
src/ServiceGroups/ServiceGroups.Autorest/custom/README.md Adds guidance for implementing custom cmdlets.
src/ServiceGroups/ServiceGroups.Autorest/custom/Az.ServiceGroups.custom.psm1 Adds loader for private/internal assemblies and script cmdlets.
src/ServiceGroups/ServiceGroups.Autorest/UX/Microsoft.Management/serviceGroups.json Adds UX metadata for resourceType commands and examples.
src/ServiceGroups/ServiceGroups.Autorest/README.md Adds AutoRest config + module overview (dependency statement differs from manifest).
src/ServiceGroups/ServiceGroups.Autorest/Properties/AssemblyInfo.cs Adds AutoRest-generated assembly metadata for private assembly.
src/ServiceGroups/ServiceGroups.Autorest/.gitignore Adds ignore patterns for generated output folders/files.
src/ServiceGroups/ServiceGroups.Autorest/.gitattributes Sets text normalization defaults.
Comments suppressed due to low confidence (11)

src/ServiceGroups/ServiceGroups.Autorest/test/loadEnv.ps1:1

  • $envFilePath is computed to support loading env files from either the current folder or the parent folder, but the code reads from (Join-Path $PSScriptRoot $envFile) instead of $envFilePath. This will fail in the else branch (when env file is located in ..\). Use $envFilePath for Get-Content to match the earlier path resolution.
    src/ServiceGroups/ServiceGroups/Az.ServiceGroups.psd1:1
  • Exporting all variables and aliases ('*') can pollute the caller's session and make imports less predictable. For Az modules, it’s typically safer to export none (e.g., @()) unless the module intentionally defines public variables/aliases. Consider setting VariablesToExport and AliasesToExport to empty arrays (or explicitly enumerating intended exports).
    src/ServiceGroups/ServiceGroups/help/Az.ServiceGroups.md:1
  • This module-level help file still contains template placeholders. Since help\\*.md is configured to be copied to the output in ServiceGroups.csproj, these placeholders may ship and degrade the user experience. Replace placeholders with real values (or generate this file from the same source as ServiceGroups.Autorest/docs/Az.ServiceGroups.md) before release.
    src/ServiceGroups/ServiceGroups/help/Az.ServiceGroups.md:1
  • This module-level help file still contains template placeholders. Since help\\*.md is configured to be copied to the output in ServiceGroups.csproj, these placeholders may ship and degrade the user experience. Replace placeholders with real values (or generate this file from the same source as ServiceGroups.Autorest/docs/Az.ServiceGroups.md) before release.
    src/ServiceGroups/ServiceGroups/help/Update-AzServiceGroup.md:1
  • Cmdlet help contains placeholder examples/titles/descriptions. If these help files are intended to ship, replace placeholders with real examples (you already have non-placeholder examples under ServiceGroups.Autorest/examples for some cmdlets), or remove the empty example blocks entirely to avoid publishing unusable help content.
    src/ServiceGroups/ServiceGroups/help/New-AzServiceGroup.md:1
  • -ProgressAction description is still a template placeholder. Replace it with the standard Az help text for ProgressAction (or omit this parameter section if the help generator should provide standardized wording). This placeholder appears in multiple cmdlet help files in this PR.
    src/ServiceGroups/ServiceGroups.Autorest/utils/Unprotect-SecureString.ps1:1
  • This utility converts a SecureString into plaintext, which is inherently sensitive and easy to misuse (plaintext may linger in memory, logs, transcripts, etc.). If this is only needed for local testing, consider relocating it under a clearly test-only path and ensuring it is not packaged/shipped; also add explicit warnings in comments/help to discourage production use.
    src/ServiceGroups/ServiceGroups.Autorest/utils/Unprotect-SecureString.ps1:1
  • This utility converts a SecureString into plaintext, which is inherently sensitive and easy to misuse (plaintext may linger in memory, logs, transcripts, etc.). If this is only needed for local testing, consider relocating it under a clearly test-only path and ensuring it is not packaged/shipped; also add explicit warnings in comments/help to discourage production use.
    src/ServiceGroups/ServiceGroups/ChangeLog.md:1
  • The changelog format in the header comment suggests releases should be recorded as ## YYYY.MM.DD - Version X.Y.Z (Previous Release), but 0.1.0 is listed without a date. Consider updating the heading to match the documented format for consistency with tooling/readers that may parse changelogs.
    src/ServiceGroups/ServiceGroups/ServiceGroups.csproj:1
  • This project copies help\\*.md into the output, but the PR also introduces another set of generated documentation under ServiceGroups.Autorest/docs and examples under ServiceGroups.Autorest/examples. Right now the help markdown includes many placeholders while the AutoRest docs index is populated. To reduce duplication and prevent shipping inconsistent help, consider having a single source of truth for shipped help content (either generate/populate help\\*.md or wire packaging to use the generated docs consistently).
    src/ServiceGroups/ServiceGroups/ChangeLog.md:1
  • The PR description template is left unfilled (no target release selection, no summary), which makes it harder to validate whether Upcoming Release / versioning / packaging changes align with the intended release plan. Please update the PR description with the target release type and a brief summary of intended ship scope for this initial module drop.

You can also share your feedback on Copilot code review. Take the survey.

@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 18, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 18, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings March 19, 2026 17:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


You can also share your feedback on Copilot code review. Take the survey.

@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 19, 2026

/azp run

1 similar comment
@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Commenter does not have sufficient privileges for PR 29282 in repo Azure/azure-powershell

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings March 20, 2026 14:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Commenter does not have sufficient privileges for PR 29282 in repo Azure/azure-powershell

@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@meghanagupta95 meghanagupta95 marked this pull request as ready for review March 20, 2026 16:42
Copilot AI review requested due to automatic review settings March 20, 2026 16:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@meghanagupta95 meghanagupta95 changed the title New powershell module - initial changes New powershell module for 'servicegroups' Mar 20, 2026
@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 23, 2026

Hi @meghanagupta95, have you discussed with our team about onboarding to AzurePowerShell, currently we need to go through MCR to get new modules onboarded. And for the generated module, nothing under /generated folder should be committed in this PR. For your reference: https://eng.ms/docs/cloud-ai-platform/azure-core/azure-experiences-and-ecosystems/azure-portal-and-client-tools-ruhim/azure-cli-tools-azure-cli-powershell-and-terraform/azure-cli-tools/onboarding/azurepowershell/dev_guidance_codegen#code-review
image

@NoriZC NoriZC self-assigned this Mar 23, 2026
@github-actions
Copy link
Copy Markdown

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

@meghanagupta95
Copy link
Copy Markdown
Member Author

Hi @NoriZC thanks for the heads up. I'll create a new PR in the other repo for the module review.

@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 23, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Commenter does not have sufficient privileges for PR 29282 in repo Azure/azure-powershell

@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 26, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings March 27, 2026 03:10
@meghanagupta95
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Commenter does not have sufficient privileges for PR 29282 in repo Azure/azure-powershell

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comments suppressed due to low confidence (8)

src/ServiceGroups/ServiceGroups.Autorest/test/loadEnv.ps1:1

  • Line 27 reads from (Join-Path $PSScriptRoot $envFile) instead of $envFilePath. This breaks the fallback logic when the env file exists in the parent folder (..\$envFile) and can cause tests to load an empty/missing env. Read from $envFilePath consistently.
    src/ServiceGroups/ServiceGroups.Autorest/test/env.json:1
  • The committed test env file contains a concrete subscription id (and tenant id). Even if used only for playback, it's safer to use clearly non-production placeholder GUIDs and avoid committing potentially sensitive identifiers.
    src/ServiceGroups/ServiceGroups/help/Az.ServiceGroups.md:1
  • This help landing page still contains template placeholders (Module Guid / Download Help Link / Help Version). Since these help files are copied to output in ServiceGroups.csproj, these placeholders would ship as-is. Replace them with the actual values (matching the generated docs version under ServiceGroups.Autorest/docs/Az.ServiceGroups.md).
    tools/CreateMappings_rules.json:1
  • This PR is scoped to adding the ServiceGroups module, but this file also adds a NeonPostgres mapping and removes the EdgeMarketplace mapping (EdgeAction now jumps directly to ArtifactSigning). If those changes are unrelated to ServiceGroups, consider splitting them into a separate PR to avoid accidental mapping churn.
    tools/CreateMappings_rules.json:1
  • This PR is scoped to adding the ServiceGroups module, but this file also adds a NeonPostgres mapping and removes the EdgeMarketplace mapping (EdgeAction now jumps directly to ArtifactSigning). If those changes are unrelated to ServiceGroups, consider splitting them into a separate PR to avoid accidental mapping churn.
    tools/CreateMappings_rules.json:1
  • This PR is scoped to adding the ServiceGroups module, but this file also adds a NeonPostgres mapping and removes the EdgeMarketplace mapping (EdgeAction now jumps directly to ArtifactSigning). If those changes are unrelated to ServiceGroups, consider splitting them into a separate PR to avoid accidental mapping churn.
    src/ServiceGroups/ServiceGroups/ChangeLog.md:1
  • The changelog template indicates previous releases should use the '## YYYY.MM.DD - Version X.Y.Z' format, and upcoming changes should be listed under '## Upcoming Release'. For consistency with the repo convention, format the 0.1.0 entry with a date header (or move the initial entry under 'Upcoming Release' if this is the first unreleased introduction).
    src/ServiceGroups/ServiceGroups.Autorest/utils/Unprotect-SecureString.ps1:1
  • This utility explicitly converts SecureString to plaintext and returns it. If this file is ever packaged/imported beyond local dev/test, it can lead to accidental secret exposure (e.g., logs/pipeline). Consider moving it under a test-only folder, ensuring it’s excluded from packaging, and/or refactoring consumers to avoid producing plaintext whenever possible.

Comment on lines +457 to +461
"Content-Length": [ "404" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
"Content": "{\"error\":{\"code\":\"AuthorizationFailed\",\"message\":\"The client \u0027meghanagupta@microsoft.com\u0027 with object id \u00272c4638e2-9343-4565-be89-cbdad9762f57\u0027 does not have authorization to perform action \u0027Microsoft.Management/serviceGroups/read\u0027 over scope \u0027/providers/Microsoft.Management/serviceGroups/testsgdeletevice7mwf\u0027 or the scope is invalid. If access was recently granted, please refresh your credentials.\"}}",
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The recording includes PII (user email) and an AAD object id in the response body. Playback recordings should scrub/replace sensitive fields (e.g., replace the full message with a generic/filtered value) before committing.

Suggested change
"Content-Length": [ "404" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
"Content": "{\"error\":{\"code\":\"AuthorizationFailed\",\"message\":\"The client \u0027meghanagupta@microsoft.com\u0027 with object id \u00272c4638e2-9343-4565-be89-cbdad9762f57\u0027 does not have authorization to perform action \u0027Microsoft.Management/serviceGroups/read\u0027 over scope \u0027/providers/Microsoft.Management/serviceGroups/testsgdeletevice7mwf\u0027 or the scope is invalid. If access was recently granted, please refresh your credentials.\"}}",
"Content-Length": [ "136" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
"Content": "{\"error\":{\"code\":\"AuthorizationFailed\",\"message\":\"[Filtered sensitive error message]\"}}",

Copilot uses AI. Check for mistakes.
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

## Module Requirements
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This states Az.Accounts >= 2.7.5, but the module manifest requires Az.Accounts ModuleVersion = '5.3.3'. Update the README requirement to match the actual dependency declared in Az.ServiceGroups.psd1.

Suggested change
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 5.3.3

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants