Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - CloudService")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.1.1")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.2")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.1.2")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
54 changes: 35 additions & 19 deletions src/CloudService/CloudService.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ input-file:
title: CloudService
module-version: 0.1.0

identity-correction-for-post: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- where:
subject: ^CloudServiceOperatingSystemOSFamily$
Expand All @@ -71,8 +65,23 @@ directive:
set:
subject: CloudServiceOSVersion
- where:
variant: ^Restart$|^RestartViaIdentity$|^Reimage$|^ReimageViaIdentity$|^Rebuild$|^RebuildViaIdentity$
subject: ^CloudService$|^RebuildCloudService$
variant: ^Rebuild$|^RebuildViaIdentity$|^RebuildViaJsonFilePathViaJsonFilePath$|^RebuildViaJsonStringViaJsonString$
subject: RebuildCloudService
remove: true
- where:
subject: ^RebuildCloudService$
set:
subject: Rebuild
- where:
subject: Rebuild
hide: true
- where:
variant: ^Restart$|^RestartViaIdentity$|^Reimage$|^ReimageViaIdentity$
subject: ^CloudService$
remove: true
- where:
variant: ^RebuildViaIdentityRoleInstance$
subject: ^RebuildCloudServiceRoleInstance$
remove: true

- where:
Expand All @@ -88,27 +97,22 @@ directive:
subject: CloudServiceRoleInstanceReimage
verb: Invoke

- where:
subject: ^RebuildCloudService$
variant: ^RebuildExpanded$|^RebuildViaIdentityExpanded$
set:
subject: Rebuild
- where:
subject: ^RebuildCloudServiceRoleInstance$
variant: ^Rebuild$|^RebuildViaIdentity$
set:
subject: RoleInstanceRebuild

- where:
subject: ^CloudServiceUpdateDomain$
verb: Get
subject: ^CloudServicesUpdateDomain$
verb: Get|Update
remove: true
- where:
subject: ^WalkCloudServiceUpdateDomain$
variant: ^Walk$
subject: ^WalkCloudServicesUpdateDomain$
variant: ^Walk$|^WalkViaIdentity$|^WalkViaIdentityCloudService$|^WalkViaIdentityCloudServiceExpanded$|^WalkViaIdentityExpanded$|^WalkViaJsonFilePathViaJsonFilePath$|^WalkViaJsonStringViaJsonString$
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.

AutoRest README directive regex patterns include what look like duplicated parameter-set suffixes (e.g., RebuildViaJsonFilePathViaJsonFilePath, WalkViaJsonStringViaJsonString). These likely won't match the actual generated variant names (e.g., RebuildViaJsonFilePath, WalkViaJsonString), so the directives may not apply. Please verify/update the variant regexes to match the real parameter set names produced by the generator.

Suggested change
variant: ^Walk$|^WalkViaIdentity$|^WalkViaIdentityCloudService$|^WalkViaIdentityCloudServiceExpanded$|^WalkViaIdentityExpanded$|^WalkViaJsonFilePathViaJsonFilePath$|^WalkViaJsonStringViaJsonString$
variant: ^Walk$|^WalkViaIdentity$|^WalkViaIdentityCloudService$|^WalkViaIdentityCloudServiceExpanded$|^WalkViaIdentityExpanded$|^WalkViaJsonFilePath$|^WalkViaJsonString$

Copilot uses AI. Check for mistakes.
remove: true
- where:
subject: ^WalkCloudServiceUpdateDomain$
subject: ^WalkCloudServicesUpdateDomain$
set:
subject: UpdateDomain
verb: Set
Expand All @@ -119,7 +123,7 @@ directive:
remove: true
- where:
subject: ^CloudServiceRoleInstance$
verb: Remove
verb: Remove|Update
remove: true
- where:
variant: ^Delete$|^DeleteViaIdentity$
Expand Down Expand Up @@ -320,6 +324,18 @@ directive:
transform: >-
return "string"

- model-cmdlet:
- model-name: Extension
cmdlet-name: New-AzCloudServiceExtensionObject
- model-name: LoadBalancerConfiguration
cmdlet-name: New-AzCloudServiceLoadBalancerConfigurationObject
# - model-name: LoadBalancerFrontendIPConfiguration
# cmdlet-name: New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject
- model-name: CloudServiceRoleProfileProperties
cmdlet-name: New-AzCloudServiceRoleProfilePropertiesObject
# - model-name: CloudServiceVaultSecretGroup
# cmdlet-name: New-AzCloudServiceVaultSecretGroupObject

- where:
verb: Get|Update
subject: CloudService
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@

# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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
# is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them.
If you do not want to initialize storage resources, you can use Reimage Role Instances.
.Description
Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them.
If you do not want to initialize storage resources, you can use Reimage Role Instances.
.Example
$roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
.Example
Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "*"

.Inputs
Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity
.Outputs
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

INPUTOBJECT <ICloudServiceIdentity>: Identity Parameter
[CloudServiceName <String>]: Name of the cloud service.
[IPConfigurationName <String>]: The IP configuration name.
[Id <String>]: Resource identity path
[Location <String>]: Name of the location that the OS version pertains to.
[NetworkInterfaceName <String>]: The name of the network interface.
[OSFamilyName <String>]: Name of the OS family.
[OSVersionName <String>]: Name of the OS version.
[PublicIPAddressName <String>]: The name of the public IP Address.
[ResourceGroupName <String>]: Name of the resource group.
[RoleInstanceName <String>]: Name of the role instance.
[RoleName <String>]: Name of the role.
[SubscriptionId <String>]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
[UpdateDomain <Int32?>]: Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on.
.Link
https://learn.microsoft.com/powershell/module/az.cloudservice/invoke-azcloudservicerebuild
#>
function Invoke-AzCloudServiceRebuild {
[OutputType([System.Boolean])]
[CmdletBinding(DefaultParameterSetName = 'RebuildExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'RebuildExpanded', Mandatory)]
[Parameter(ParameterSetName = 'RebuildViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName = 'RebuildViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
[System.String]
# Name of the cloud service.
${CloudServiceName},

[Parameter(ParameterSetName = 'RebuildExpanded', Mandatory)]
[Parameter(ParameterSetName = 'RebuildViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName = 'RebuildViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
[System.String]
# Name of the resource group.
${ResourceGroupName},

[Parameter(ParameterSetName = 'RebuildExpanded')]
[Parameter(ParameterSetName = 'RebuildViaJsonFilePath')]
[Parameter(ParameterSetName = 'RebuildViaJsonString')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
[System.String]
# Subscription credentials which uniquely identify Microsoft Azure subscription.
# The subscription ID forms part of the URI for every service call.
${SubscriptionId},

[Parameter(ParameterSetName = 'RebuildViaIdentityExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
# Identity Parameter
${InputObject},

[Parameter(ParameterSetName = 'RebuildExpanded', Mandatory)]
[Parameter(ParameterSetName = 'RebuildViaIdentityExpanded', Mandatory)]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
[System.String[]]
# List of cloud service role instance names.
# Value of '*' will signify all role instances of the cloud service.
${RoleInstance},

[Parameter(ParameterSetName = 'RebuildViaJsonFilePath', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
[System.String]
# Path of Json file supplied to the Rebuild operation
${JsonFilePath},

[Parameter(ParameterSetName = 'RebuildViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
[System.String]
# Json string supplied to the Rebuild operation
${JsonString},

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
[System.Management.Automation.PSObject]
# The DefaultProfile parameter is not functional.
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
${DefaultProfile},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Run the command as a job
${AsJob},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
${Break},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be appended to the front of the pipeline
${HttpPipelineAppend},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Run the command asynchronously
${NoWait},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Returns true when the command succeeds
${PassThru},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[System.Uri]
# The URI for the proxy server to use
${Proxy},

[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[System.Management.Automation.PSCredential]
# Credentials for a proxy server to use for the remote call
${ProxyCredential},

[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)

process {
Az.CloudService.internal\Invoke-AzCloudServiceRebuild @PSBoundParameters
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Create a CloudService Resource
#>

function New-AzCloudService {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.ICloudService')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.ICloudService", "16.0.0", "9.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudService", DeprecatedOutputProperties = ("Zone, Extension, LoadBalancerConfiguration, Secret, Role"), NewOutputProperties = ("Zone, Extension, LoadBalancerConfiguration, Secret, Role will be changed from object to 'List'."))]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudService')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudService", "16.0.0", "9.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudService", DeprecatedOutputProperties = ("Zone, Extension, LoadBalancerConfiguration, Secret, Role"), NewOutputProperties = ("Zone, Extension, LoadBalancerConfiguration, Secret, Role will be changed from object to 'List'."))]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='quickCreateParameterSetWithoutStorage', Mandatory)]
Expand Down Expand Up @@ -87,7 +88,7 @@ function New-AzCloudService {
[Parameter(ParameterSetName='quickCreateParameterSetWithoutStorage', HelpMessage="Describes a cloud service extension profile.")]
[Parameter(ParameterSetName='quickCreateParameterSetWithStorage', HelpMessage="Describes a cloud service extension profile.")]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.ICloudServiceExtensionProfile]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceExtensionProfile]
# Describes a cloud service extension profile.
# To construct, see NOTES section for EXTENSIONPROFILE properties and create a hash table.
${ExtensionProfile},
Expand All @@ -105,16 +106,16 @@ function New-AzCloudService {
[Parameter(ParameterSetName='quickCreateParameterSetWithoutStorage')]
[Parameter(ParameterSetName='quickCreateParameterSetWithStorage')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.ICloudServiceTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceTags]))]
[System.Collections.Hashtable]
# Resource tags.
${Tag},

[Parameter(ParameterSetName='quickCreateParameterSetWithoutStorage', HelpMessage="Update mode for the cloud service.")]
[Parameter(ParameterSetName='quickCreateParameterSetWithStorage', HelpMessage="Update mode for the cloud service.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.CloudServiceUpgradeMode])]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.PSArgumentCompleterAttribute("Auto", "Manual", "Simultaneous")]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.CloudServiceUpgradeMode]
[System.String]
# Update mode for the cloud service.
# Role instances are allocated to update domains when the service is deployed.
# Updates can be initiated manually in each update domain or initiated automatically in all update domains.Possible Values are <br /><br />**Auto**<br /><br />**Manual** <br /><br />**Simultaneous**<br /><br />If not specified, the default value is Auto.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Create a in-memory object for Diagnostics Extension
#>

function New-AzCloudServiceDiagnosticsExtension {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.Extension')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.Extension", "16.0.0", "9.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension", DeprecatedOutputProperties = ("RolesAppliedTo System.String[]"), NewOutputProperties = ("RolesAppliedTo System.Collections.Generic.List`1[System.String]"))]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension", "16.0.0", "9.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension", DeprecatedOutputProperties = ("RolesAppliedTo System.String[]"), NewOutputProperties = ("RolesAppliedTo System.Collections.Generic.List`1[System.String]"))]
param(
[Parameter(HelpMessage="Name of Diagnostics Extension.", Mandatory)]
[string] $Name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ Create a in-memory object for Extension
Create a in-memory object for Extension
#>
function New-AzCloudServiceExtensionObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.Extension')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.Extension", "16.0.0", "9.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension", DeprecatedOutputProperties = ("RolesAppliedTo System.String[]"), NewOutputProperties = ("RolesAppliedTo System.Collections.Generic.List`1[System.String]"))]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension')]
[Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension", "16.0.0", "9.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension", DeprecatedOutputProperties = ("RolesAppliedTo System.String[]"), NewOutputProperties = ("RolesAppliedTo System.Collections.Generic.List`1[System.String]"))]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand Down Expand Up @@ -52,7 +53,7 @@ function New-AzCloudServiceExtensionObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20220904.Extension]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Extension]::New()

$Object.AutoUpgradeMinorVersion = $AutoUpgradeMinorVersion
$Object.Name = $Name
Expand Down
Loading