Skip to content

upgrade websites module to autorest v4#28268

Open
Pan-Qi wants to merge 9 commits intomainfrom
bernard-migrate-websites-to-v4
Open

upgrade websites module to autorest v4#28268
Pan-Qi wants to merge 9 commits intomainfrom
bernard-migrate-websites-to-v4

Conversation

@Pan-Qi
Copy link
Copy Markdown
Contributor

@Pan-Qi Pan-Qi commented Jul 24, 2025

Description

Preannouncement PR:

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

@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.

@Pan-Qi Pan-Qi force-pushed the bernard-migrate-websites-to-v4 branch from bf40356 to 345bc0f Compare July 30, 2025 14:36
@Pan-Qi Pan-Qi marked this pull request as ready for review August 6, 2025 13:51
Copilot AI review requested due to automatic review settings August 6, 2025 13: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.

Pull Request Overview

This PR upgrades the Azure PowerShell Websites module to use AutoRest v4, introducing various new features and breaking changes.

  • Upgrades the code generator from AutoRest v3 to v4, bringing new parameter sets and parameter types
  • Updates cmdlet signatures, particularly for Static Web App cmdlets with new identity management parameters
  • Changes many API response models from versioned namespaces to unversioned interfaces

Reviewed Changes

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

File Description
tools/StaticAnalysis/Exceptions/Az.LoadTesting/BreakingChangeIssues.csv Documents breaking changes including type changes, removed parameters, and removed parameter sets
src/Websites/Websites/help/*.md Updates documentation for cmdlets with new parameter sets, type changes, and corrected descriptions
src/Websites/Websites/ChangeLog.md Documents the upgrade and breaking changes for New-AzStaticWebApp identity parameters
src/Websites/Websites/Az.Websites.psd1 Updates module metadata including required Az.Accounts version and file paths

### Example 2: Create or updates the app settings of a static site build by pipeline
```powershell
Get-AzStaticWebAppBuildAppSetting -ResourceGroupName resourceGroup -Name staticweb00 -EnvironmentName 'default' | New-AzStaticWebAppBuildAppSetting -AppSetting @{'buildsetting1' = 'someval'; 'buildsetting2' = 'someval2' }
Get-AzStaticWebAppBuildAppSetting -ResourceGroupName resourceGroup -Name taticweb00 -EnvironmentName 'default' | New-AzStaticWebAppBuildAppSetting -AppSetting @{'buildsetting1' = 'someval'; 'buildsetting2' = 'someval2' }
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

There's a typo in the example: 'taticweb00' should be 'staticweb00' to match the expected static web app naming convention.

Suggested change
Get-AzStaticWebAppBuildAppSetting -ResourceGroupName resourceGroup -Name taticweb00 -EnvironmentName 'default' | New-AzStaticWebAppBuildAppSetting -AppSetting @{'buildsetting1' = 'someval'; 'buildsetting2' = 'someval2' }
Get-AzStaticWebAppBuildAppSetting -ResourceGroupName resourceGroup -Name staticweb00 -EnvironmentName 'default' | New-AzStaticWebAppBuildAppSetting -AppSetting @{'buildsetting1' = 'someval'; 'buildsetting2' = 'someval2' }

Copilot uses AI. Check for mistakes.
@Pan-Qi Pan-Qi added the Contains Breaking Change This PR contains breaking change label Aug 14, 2025
@github-actions
Copy link
Copy Markdown

To the author of the pull request,
This PR was labeled "Breaking Change Release" because it contains breaking changes.

  • According to our policy, breaking changes can only take place during major release and they must be preannounced.
  • Please follow our guide on the detailed steps.
  • Required: Please fill in the task below to facilitate our contact,you will receive notifications related to breaking changes.

@isra-fel isra-fel added the autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 label Oct 2, 2025
@isra-fel
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@isra-fel
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@isra-fel isra-fel added this to the Az 16.0.0 (TBD) milestone Jan 29, 2026
@naveedaz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

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

@naveedaz
Copy link
Copy Markdown
Contributor

@mishapos and @skylathadani-ms can you guys review too?

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

Comment on lines 69 to 70
Get-AzStaticWebAppBuildAppSetting -ResourceGroupName resourceGroup -Name taticweb00 -EnvironmentName 'default' | New-AzStaticWebAppBuildAppSetting -AppSetting @{'buildsetting1' = 'someval'; 'buildsetting2' = 'someval2' }
```
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Example uses a likely typo in the static site name ("taticweb00"), which will cause copy/paste failures. Please correct it to the intended site name used elsewhere in the examples.

Copilot uses AI. Check for mistakes.
Comment on lines +11 to 12
Description for update a user entry with the listed roles

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The synopsis/description text is grammatically incorrect ("Description for update a user entry...") and reads like an unedited template. Please change it to a proper verb form (e.g., "Updates a user entry...") for the reference help.

Copilot uses AI. Check for mistakes.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Minor typo in the header comment: missing space after the period in "Code Generator.Changes". Please add the missing space to keep the generated header readable.

Suggested change
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// Code generated by Microsoft (R) AutoRest Code Generator. Changes may cause incorrect behavior and will be lost if the code

Copilot uses AI. Check for mistakes.
Comment on lines +330 to +333
Description for update a new static site in an existing resource group, or update an existing static site.

### [Update-AzStaticWebAppUser](Update-AzStaticWebAppUser.md)
Description for Updates a user entry with the listed roles
Description for update a user entry with the listed roles
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This synopsis line is grammatically incorrect and misleading ("update a new static site..."). Please adjust it to accurately describe the cmdlet (it updates an existing static site; it doesn't "update a new" one).

Copilot uses AI. Check for mistakes.
Comment on lines 55 to 57
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '4.2.0'; })
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '5.1.1'; })

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Module dependency versions are inconsistent across the Websites module artifacts: the manifest requires Az.Accounts 5.1.1, but the AutoRest README states 2.7.5+ and the .nuspec depends on 2.7.5. Please align these (and ensure the chosen minimum is reflected consistently in psd1, nuspec, and README) to avoid install/import mismatches for users.

Copilot uses AI. Check for mistakes.
- Additional information about change #1
-->
## Upcoming Release
* Improved user experience and consistency. This may introduce breaking changes. Please refer to [here](https://go.microsoft.com/fwlink/?linkid=2340249).
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The Upcoming Release entry is too generic for users and doesn't clearly describe the actual change (AutoRest v4 migration) or reference the related announcement PRs/issues. Please update the entry to explicitly state what's changing for Az.Websites users and include relevant issue/PR references.

Copilot uses AI. Check for mistakes.

### [New-AzStaticWebApp](New-AzStaticWebApp.md)
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Description for create a new static site in an existing resource group, or create an existing static site.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This description is grammatically incorrect and also changes the meaning: "or create an existing static site" should be "or update an existing static site". Please fix the synopsis/description text so it accurately reflects the cmdlet behavior.

Copilot uses AI. Check for mistakes.
@jsntcy
Copy link
Copy Markdown
Member

jsntcy commented Apr 1, 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 April 8, 2026 03:26
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 109 out of 109 changed files in this pull request and generated 19 comments.

Comment on lines 10 to 12
## SYNOPSIS
Description for Creates or updates the app settings of a static site.
Description for create the app settings of a static site.

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The SYNOPSIS text is grammatically incorrect ("Description for create …") and reads like a generation artifact. Please update it to a proper sentence (e.g., "Creates or updates the app settings of a static site.") to match the cmdlet behavior and the examples below.

Copilot uses AI. Check for mistakes.
Comment on lines 149 to +168
### [New-AzStaticWebApp](New-AzStaticWebApp.md)
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Description for create a new static site in an existing resource group, or create an existing static site.

### [New-AzStaticWebAppBuildAppSetting](New-AzStaticWebAppBuildAppSetting.md)
Description for Creates or updates the app settings of a static site build.
Description for create the app settings of a static site build.

### [New-AzStaticWebAppBuildFunctionAppSetting](New-AzStaticWebAppBuildFunctionAppSetting.md)
Description for Creates or updates the function app settings of a static site build.
Description for create the function app settings of a static site build.

### [New-AzStaticWebAppCustomDomain](New-AzStaticWebAppCustomDomain.md)
Description for Creates a new static site custom domain in an existing resource group and static site.
Description for create a new static site custom domain in an existing resource group and static site.

### [New-AzStaticWebAppFunctionAppSetting](New-AzStaticWebAppFunctionAppSetting.md)
Description for Creates or updates the function app settings of a static site.
Description for create the function app settings of a static site.

### [New-AzStaticWebAppSetting](New-AzStaticWebAppSetting.md)
Description for Creates or updates the app settings of a static site.
Description for create the app settings of a static site.

### [New-AzStaticWebAppUserRoleInvitationLink](New-AzStaticWebAppUserRoleInvitationLink.md)
Description for Creates an invitation link for a user with the role
Description for create an invitation link for a user with the role
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The cmdlet list entries for the Static Web App cmdlets contain incorrect/awkward descriptions (e.g., "create … or create an existing …" and missing punctuation). This reads like a generation artifact and is misleading (an existing static site is typically updated, not created). Please adjust these descriptions to accurate, grammatical summaries (e.g., "Creates a new static site, or updates an existing static site.").

Copilot uses AI. Check for mistakes.
Comment on lines 329 to +333
### [Update-AzStaticWebApp](Update-AzStaticWebApp.md)
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Description for update a new static site in an existing resource group, or update an existing static site.

### [Update-AzStaticWebAppUser](Update-AzStaticWebAppUser.md)
Description for Updates a user entry with the listed roles
Description for update a user entry with the listed roles
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The descriptions for Update-AzStaticWebApp and Update-AzStaticWebAppUser are grammatically incorrect ("update a new …") and misleading. Please update these entries to accurate summaries (e.g., "Creates a new … or updates an existing …" and "Updates a user entry …").

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 12
## SYNOPSIS
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Description for create a new static site in an existing resource group, or create an existing static site.

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The SYNOPSIS/DESCRIPTION text says "create … or create an existing …", which is grammatically incorrect and also misleading for users (existing resources are typically updated). Please revise to an accurate sentence (e.g., "Creates a new static site, or updates an existing static site.").

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 12
## SYNOPSIS
Description for Creates a new static site custom domain in an existing resource group and static site.
Description for create a new static site custom domain in an existing resource group and static site.

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The SYNOPSIS text is grammatically incorrect ("Description for create …"). Please update it to a proper sentence such as "Creates a new static site custom domain in an existing resource group and static site."

Copilot uses AI. Check for mistakes.
Comment on lines +202 to 209
# Remove variant
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^CreateViaIdentityExpanded$|^Create$|^CreateViaIdentity$|^Update$|^UpdateViaIdentity$
# We got to keep the Create variant of CustomDomain because it's special that it doesn't have a
# CreateExpanded variant, because the only parameters are all in URL rather than request body
subject: CustomDomain

remove: true
- where:
verb: Test
variant: ^Validate$|^ValidateViaIdentity$
# We got to keep the Create variant of CustomDomain because it's special that it doesn't have a
# CreateExpanded variant, because the only parameters are all in URL rather than request body
subject: CustomDomain
remove: true

- where:
variant: ^Create$|^CreateViaIdentity$|^Update$|^UpdateViaIdentity$
# We got to keep the Create variant of CustomDomain because it's special that it doesn't have a
# CreateExpanded variant, because the only parameters are all in URL rather than request body
subject: BuildAppSetting
remove: true

- where:
variant: ^Create$|^CreateViaIdentity$|^Update$|^UpdateViaIdentity$
# We got to keep the Create variant of CustomDomain because it's special that it doesn't have a
# CreateExpanded variant, because the only parameters are all in URL rather than request body
subject: FunctionAppSetting
remove: true

- where:
variant: ^Create$|^CreateViaIdentity$|^Update$|^UpdateViaIdentity$
# We got to keep the Create variant of CustomDomain because it's special that it doesn't have a
# CreateExpanded variant, because the only parameters are all in URL rather than request body
subject: Setting
subject: CustomDomain|BuildAppSetting|FunctionAppSetting|Setting|BuildFunctionAppSetting|UserRoleInvitationLink
variant: ^Create(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The comment says that for New-* cmdlets the CreateViaIdentityExpanded variant is removed, but the directives only remove CreateViaIdentityExpanded for CustomDomain and the generated help still includes CreateViaIdentityExpanded for other New-AzStaticWebApp* cmdlets (e.g., settings). Please align the comment with the actual directive behavior (or expand the directive if the intent is to remove these variants across the listed subjects).

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 12
## SYNOPSIS
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Description for update a new static site in an existing resource group, or update an existing static site.

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The SYNOPSIS is grammatically incorrect/misleading ("update a new static site…"). Please change it to an accurate description (e.g., "Updates an existing static site." or "Creates or updates a static site." depending on actual behavior).

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 12
## SYNOPSIS
Description for Updates a user entry with the listed roles
Description for update a user entry with the listed roles

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The SYNOPSIS is grammatically incorrect ("Description for update …"). Please update it to a proper sentence such as "Updates a user entry with the listed roles."

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
"Module","ClassName","Target","Severity","ProblemId","Description","Remediation"
"Az.Websites","Get-AzStaticWebApp","Get-AzStaticWebApp","0","3000","The type of property 'SkuCapability' of type 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20201201.IStaticSiteArmResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.ICapability' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.ICapability]'.","Change the type of property 'SkuCapability' back to 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.ICapability'."
"Az.Websites","Get-AzStaticWebApp","Get-AzStaticWebApp","0","3000","The type of property 'PrivateEndpointConnection' of type 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20201201.IStaticSiteArmResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.IResponseMessageEnvelopeRemotePrivateEndpointConnection' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.IResponseMessageEnvelopeRemotePrivateEndpointConnection]'.","Change the type of property 'PrivateEndpointConnection' back to 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.IResponseMessageEnvelopeRemotePrivateEndpointConnection'."
"Az.Websites","Get-AzStaticWebApp","Get-AzStaticWebApp","0","3000","The type of property 'UserProvidedFunctionApp' of type 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.Api20201201.IStaticSiteArmResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.IStaticSiteUserProvidedFunctionApp' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.IStaticSiteUserProvidedFunctionApp]'.","Change the type of property 'UserProvidedFunctionApp' back to 'Microsoft.Azure.PowerShell.Cmdlets.Websites.Models.IStaticSiteUserProvidedFunctionApp'."
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This exception file is under tools/StaticAnalysis/Exceptions/Az.LoadTesting/ but all entries are for "Module" = "Az.Websites". While the static analysis tooling may still pick it up, this placement is confusing and makes the Websites breaking-change exceptions hard to discover/maintain. Please move these entries into tools/StaticAnalysis/Exceptions/Az.Websites/BreakingChangeIssues.csv (the Az.Websites exceptions folder already exists).

Copilot uses AI. Check for mistakes.
Comment on lines 17 to 22
<#
.Synopsis
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Description for create a new static site in an existing resource group, or create an existing static site.
.Description
Description for Creates a new static site in an existing resource group, or updates an existing static site.
Description for create a new static site in an existing resource group, or create an existing static site.
.Example
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The comment-based help .Synopsis/.Description text is grammatically incorrect and misleading ("create … or create an existing …"). Please update it to an accurate sentence (e.g., "Creates a new static site, or updates an existing static site.") so Get-Help New-AzStaticWebApp reads correctly.

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

Labels

autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 Contains Breaking Change This PR contains breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants