diff --git a/ChangeLog.md b/ChangeLog.md
index c16f1ed66967..795e79877c72 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,90 @@
+## 5.2.0 - December 2020
+#### Az.Accounts
+* Managed to parse ExpiresOn time from raw token if could not get from underlying library
+* Improved warning message if Interactive authentication is unavailable
+
+#### Az.ApiManagement
+* [Breaking change] 'New-AzApiManagementProduct' by default has no subscription limit.
+
+#### Az.Compute
+* Edited Get-AzVm to filter by '-Name' prior to checking for throttling due to too many resources.
+* New cmdlet 'Start-AzVmssRollingExtensionUpgrade'.
+
+#### Az.ContainerRegistry
+* Supported parameter 'Name' for and value from pipeline input for 'Get-AzContainerRegistryUsage' [#13605]
+* Polished exceptions for 'Connect-AzContainerRegistry'
+
+#### Az.DataFactory
+* Updated ADF .Net SDK version to 4.13.0
+
+#### Az.HealthcareApis
+* Added support for customer managed keys
+
+#### Az.IotHub
+* Fixed an issue of SAS token.
+
+#### Az.KeyVault
+* Supported 'all' as an option when setting key vault access policies
+* Supported new version of SecretManagement module [#13366]
+* Supported ByteArray, String, PSCredential and Hashtable for 'SecretValue' in SecretManagementModule [#12190]
+* [Breaking change] redesigned the API surface of cmdlets related to managed HSM.
+
+#### Az.Monitor
+* Changed parameter 'Rule' of 'New-AzAutoscaleProfile' to accept empty list. [#12903]
+* Added new cmdlets to support creating diagnostic settings more flexible:
+ * 'Get-AzDiagnosticSettingCategory'
+ * 'New-AzDiagnosticSetting'
+ * 'New-AzDiagnosticDetailSetting'
+
+#### Az.RecoveryServices
+* Made help text and parameter set name changes to 'Restore-AzRecoveryServicesBackupItem' cmdlet.
+
+#### Az.Resources
+* Added '-Tag' parameter support to 'Set-AzTemplateSpec' and 'New-AzTemplateSpec'
+* Added Tag display support to default formatter for Template Specs
+
+#### Az.ServiceFabric
+* Added example to 'Set-AzServiceFabricSetting' with SettingsSectionDescription param
+* Updated application related cmdlets to call out that support is only for ARM deployed resources
+* Marked for deprecation cluster cert cmdlets 'Add-AzureRmServiceFabricClusterCertificate' and 'Remove-AzureRmServiceFabricClusterCertificate'
+
+#### Az.Sql
+* Added SecondaryType to the following:
+ - 'New-AzSqlDatabase'
+ - 'Set-AzSqlDatabase'
+ - 'New-AzSqlDatabaseSecondary'
+* Added HighAvailabilityReplicaCount to the following:
+ - 'New-AzSqlDatabase'
+ - 'Set-AzSqlDatabase'
+* Made ReadReplicaCount an alias of HighAvailabilityReplicaCount in the following:
+ - 'New-AzSqlDatabase'
+ - 'Set-AzSqlDatabase'
+
+#### Az.Storage
+* Supported upload Azure File size up to 4 TiB
+ - 'Set-AzStorageFileContent'
+* Upgraded Azure.Storage.Blobs to 12.7.0
+* Upgraded Azure.Storage.Files.Shares to 12.5.0
+* Upgraded Azure.Storage.Files.DataLake to 12.5.0
+
+#### Az.StorageSync
+* Added Sync tiering policy feature with download policy and local cache mode
+
+#### Az.Websites
+* Prevent duplicate access restriction rules
+
+### Thanks to our community contributors
+* Andrew Dawson (@dawsonar802), Update Get-AzKeyVaultCertificate.md - Get cert and save it as pfx section to work with PowerShell Core (#13557)
+* @iviark, Healthcare APIs Powershell BYOK Updates (#13518)
+* John Duckmanton (@johnduckmanton), Correct spelling of TagPatchOperation (#13508)
+* Michael James (@mikejwhat)
+ * Get-AzLogicAppRunHistory Help Tidy (#13513)
+* Richard de Zwart (@mountain65)
+ * Update Update-AzAppConfigurationStore.md (#13485)
+ * Update New-AzCosmosDBAccount.md (#13490)
+* @SteppingRazor, New-AzApiManagementProduct: Change SubscriptionsLimit parameter default value to None (#13457)
+* Steve Burkett (@SteveBurkettNZ), Fix Typo for WorkspaceResourceId parameter in example (#13589)
+
## 5.1.0 - November 2020
#### Az.Accounts
* Fixed an issue that TenantId may be not respected if using 'Connect-AzAccount -DeviceCode'[#13477]
diff --git a/documentation/azure-powershell-modules.md b/documentation/azure-powershell-modules.md
index 8a0e807f8d4a..6179dfd6431f 100644
--- a/documentation/azure-powershell-modules.md
+++ b/documentation/azure-powershell-modules.md
@@ -25,6 +25,7 @@ Billing | `Az.Billing`
Blockchain | `Az.Blockchain` | [![Blockchain]][BlockchainGallery]
Blueprints | `Az.Blueprint` | [![Blueprint]][BlueprintGallery]
Content Delivery Network | `Az.Cdn` | [![Cdn]][CdnGallery]
+Cloud Service | `Az.CloudService` | [![CloudService]][CloudServiceGallery]
Cognitive Services | `Az.CognitiveServices` | [![CognitiveServices]][CognitiveServicesGallery]
Compute | `Az.Compute` | [![Compute]][ComputeGallery]
Connected Kubernetes | `Az.ConnectedKubernetes` | [![ConnectedKubernetes]][ConnectedKubernetesGallery]
@@ -32,6 +33,7 @@ Connected Machine | `Az.ConnectedMachine`
Container Instance | `Az.ContainerInstance` | [![ContainerInstance]][ContainerInstanceGallery]
Container Registry | `Az.ContainerRegistry` | [![ContainerRegistry]][ContainerRegistryGallery]
Cosmos DB | `Az.CosmosDB` | [![CosmosDB]][CosmosDBGallery]
+Cost Management | `Az.CostManagement` | [![CostManagement]][CostManagementGallery]
Custom Resource Providers | `Az.CustomProviders` | [![CustomProviders]][CustomProvidersGallery]
Data Box | `Az.DataBox` | [![DataBox]][DataBoxGallery]
Data Box Edge (Stack Edge) | `Az.DataBoxEdge` | [![DataBoxEdge]][DataBoxEdgeGallery]
@@ -118,7 +120,7 @@ Time Series Insights | `Az.TimeSeriesInsights`
Traffic Manager | `Az.TrafficManager` | [![TrafficManager]][TrafficManagerGallery]
VMWare Virtual Stream | `Az.VMWare` | [![VMWare]][VMWareGallery]
Web App Service | `Az.Websites` | [![Websites]][WebsitesGallery]
-
+Windows Iot Services | `Az.WindowsIotServices` | [![WindowsIotServices]][WindowsIotServicesGallery]
@@ -139,6 +141,7 @@ Web App Service | `Az.Websites`
[Blockchain]: https://img.shields.io/powershellgallery/v/Az.Blockchain.svg?style=flat-square&label=Az.Blockchain
[Blueprint]: https://img.shields.io/powershellgallery/v/Az.Blueprint.svg?style=flat-square&label=Az.Blueprint
[Cdn]: https://img.shields.io/powershellgallery/v/Az.Cdn.svg?style=flat-square&label=Az.Cdn
+[CloudService]: https://img.shields.io/powershellgallery/v/Az.CloudService.svg?style=flat-square&label=Az.CloudService
[CognitiveServices]: https://img.shields.io/powershellgallery/v/Az.CognitiveServices.svg?style=flat-square&label=Az.CognitiveServices
[Compute]: https://img.shields.io/powershellgallery/v/Az.Compute.svg?style=flat-square&label=Az.Compute
[ConnectedKubernetes]: https://img.shields.io/powershellgallery/v/Az.ConnectedKubernetes.svg?style=flat-square&label=Az.ConnectedKubernetes
@@ -146,6 +149,7 @@ Web App Service | `Az.Websites`
[ContainerInstance]: https://img.shields.io/powershellgallery/v/Az.ContainerInstance.svg?style=flat-square&label=Az.ContainerInstance
[ContainerRegistry]: https://img.shields.io/powershellgallery/v/Az.ContainerRegistry.svg?style=flat-square&label=Az.ContainerRegistry
[CosmosDB]: https://img.shields.io/powershellgallery/v/Az.CosmosDB.svg?style=flat-square&label=Az.CosmosDB
+[CostManagement]: https://img.shields.io/powershellgallery/v/Az.CostManagement.svg?style=flat-square&label=Az.CostManagement
[CustomProviders]: https://img.shields.io/powershellgallery/v/Az.CustomProviders.svg?style=flat-square&label=Az.CustomProviders
[DataBox]: https://img.shields.io/powershellgallery/v/Az.DataBox.svg?style=flat-square&label=Az.DataBox
[DataBoxEdge]: https://img.shields.io/powershellgallery/v/Az.DataBoxEdge.svg?style=flat-square&label=Az.DataBoxEdge
@@ -232,6 +236,7 @@ Web App Service | `Az.Websites`
[TrafficManager]: https://img.shields.io/powershellgallery/v/Az.TrafficManager.svg?style=flat-square&label=Az.TrafficManager
[VMWare]: https://img.shields.io/powershellgallery/v/Az.VMWare.svg?style=flat-square&label=Az.VMWare
[Websites]: https://img.shields.io/powershellgallery/v/Az.Websites.svg?style=flat-square&label=Az.Websites
+[WindowsIotServices]: https://img.shields.io/powershellgallery/v/Az.WindowsIotServices.svg?style=flat-square&label=Az.WindowsIotServices
[AzGallery]: https://www.powershellgallery.com/packages/Az/
@@ -250,6 +255,7 @@ Web App Service | `Az.Websites`
[BlockchainGallery]: https://www.powershellgallery.com/packages/Az.Blockchain/
[BlueprintGallery]: https://www.powershellgallery.com/packages/Az.Blueprint/
[CdnGallery]: https://www.powershellgallery.com/packages/Az.Cdn/
+[CloudServiceGallery]: https://www.powershellgallery.com/packages/Az.CloudService/
[CognitiveServicesGallery]: https://www.powershellgallery.com/packages/Az.CognitiveServices/
[ComputeGallery]: https://www.powershellgallery.com/packages/Az.Compute/
[ConnectedKubernetesGallery]: https://www.powershellgallery.com/packages/Az.ConnectedKubernetes/
@@ -257,6 +263,7 @@ Web App Service | `Az.Websites`
[ContainerInstanceGallery]: https://www.powershellgallery.com/packages/Az.ContainerInstance/
[ContainerRegistryGallery]: https://www.powershellgallery.com/packages/Az.ContainerRegistry/
[CosmosDBGallery]: https://www.powershellgallery.com/packages/Az.CosmosDB/
+[CostManagementGallery]: https://www.powershellgallery.com/packages/Az.CostManagement/
[CustomProvidersGallery]: https://www.powershellgallery.com/packages/Az.CustomProviders/
[DataBoxGallery]: https://www.powershellgallery.com/packages/Az.DataBox/
[DataBoxEdgeGallery]: https://www.powershellgallery.com/packages/Az.DataBoxEdge/
@@ -342,4 +349,5 @@ Web App Service | `Az.Websites`
[TimeSeriesInsightsGallery]: https://www.powershellgallery.com/packages/Az.TimeSeriesInsights/
[TrafficManagerGallery]: https://www.powershellgallery.com/packages/Az.TrafficManager/
[VMWareGallery]: https://www.powershellgallery.com/packages/Az.VMWare/
-[WebsitesGallery]: https://www.powershellgallery.com/packages/Az.Websites/
\ No newline at end of file
+[WebsitesGallery]: https://www.powershellgallery.com/packages/Az.Websites/
+[WindowsIotServicesGallery]: https://www.powershellgallery.com/packages/Az.WindowsIotServices/
\ No newline at end of file
diff --git a/setup/generate.ps1 b/setup/generate.ps1
index b0364e47c074..22008fb72575 100644
--- a/setup/generate.ps1
+++ b/setup/generate.ps1
@@ -37,7 +37,7 @@ if( (-not (get-command -ea 0 light)) -or (-not (get-command -ea 0 heat)) -or (-n
$outputName ="Az-Cmdlets"
# generate the product name from the current month/year.
-$productName = "Microsoft Azure PowerShell - November 2020"
+$productName = "Microsoft Azure PowerShell - December 2020"
# where to put temp files
$tmp = Join-Path $env:temp azure-cmdlets-tmp
diff --git a/src/Accounts/Accounts/Az.Accounts.psd1 b/src/Accounts/Accounts/Az.Accounts.psd1
index 9ab029b524f3..43e7d7c1b5cb 100644
--- a/src/Accounts/Accounts/Az.Accounts.psd1
+++ b/src/Accounts/Accounts/Az.Accounts.psd1
@@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
-# Generated on: 11/18/2020
+# Generated on: 12/3/2020
#
@{
@@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
-ModuleVersion = '2.2.1'
+ModuleVersion = '2.2.2'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
@@ -143,7 +143,8 @@ PrivateData = @{
# IconUri = ''
# ReleaseNotes of this module
- ReleaseNotes = '* Fixed the issue that incorrectly use Task.Result causes unclear error message if browser is not avaialable for Interactive auth'
+ ReleaseNotes = '* Managed to parse ExpiresOn time from raw token if could not get from underlying library
+* Improved warning message if Interactive authentication is unavailable'
# Prerelease string of this module
# Prerelease = ''
diff --git a/src/Accounts/Accounts/ChangeLog.md b/src/Accounts/Accounts/ChangeLog.md
index 726fa1d21aa1..c61a19362c98 100644
--- a/src/Accounts/Accounts/ChangeLog.md
+++ b/src/Accounts/Accounts/ChangeLog.md
@@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
+
+## Version 2.2.2
* Managed to parse ExpiresOn time from raw token if could not get from underlying library
* Improved warning message if Interactive authentication is unavailable
diff --git a/src/Accounts/Accounts/Properties/AssemblyInfo.cs b/src/Accounts/Accounts/Properties/AssemblyInfo.cs
index f85b8a2d24c6..9bebd08bc252 100644
--- a/src/Accounts/Accounts/Properties/AssemblyInfo.cs
+++ b/src/Accounts/Accounts/Properties/AssemblyInfo.cs
@@ -43,8 +43,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.2.1")]
-[assembly: AssemblyFileVersion("2.2.1")]
+[assembly: AssemblyVersion("2.2.2")]
+[assembly: AssemblyFileVersion("2.2.2")]
#if !SIGN
[assembly: InternalsVisibleTo("Microsoft.Azure.PowerShell.Cmdlets.Accounts.Test")]
#endif
diff --git a/src/Accounts/Authentication/Properties/AssemblyInfo.cs b/src/Accounts/Authentication/Properties/AssemblyInfo.cs
index 08b9055fd15f..6e42c9900d69 100644
--- a/src/Accounts/Authentication/Properties/AssemblyInfo.cs
+++ b/src/Accounts/Authentication/Properties/AssemblyInfo.cs
@@ -43,5 +43,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.2.1")]
-[assembly: AssemblyFileVersion("2.2.1")]
+[assembly: AssemblyVersion("2.2.2")]
+[assembly: AssemblyFileVersion("2.2.2")]
diff --git a/src/Accounts/Authenticators/Properties/AssemblyInfo.cs b/src/Accounts/Authenticators/Properties/AssemblyInfo.cs
index 04401053172c..cbddae1960b5 100644
--- a/src/Accounts/Authenticators/Properties/AssemblyInfo.cs
+++ b/src/Accounts/Authenticators/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-// ----------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -48,5 +48,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.2.1")]
-[assembly: AssemblyFileVersion("2.2.1")]
\ No newline at end of file
+[assembly: AssemblyVersion("2.2.2")]
+[assembly: AssemblyFileVersion("2.2.2")]
diff --git a/src/Advisor/Advisor/Az.Advisor.psd1 b/src/Advisor/Advisor/Az.Advisor.psd1
index 44ce10cc5b90..40984391b67d 100644
--- a/src/Advisor/Advisor/Az.Advisor.psd1
+++ b/src/Advisor/Advisor/Az.Advisor.psd1
@@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.Advisor.dll'
diff --git a/src/Aks/Aks/Az.Aks.psd1 b/src/Aks/Aks/Az.Aks.psd1
index 8744237e2825..71fa7baffb5d 100644
--- a/src/Aks/Aks/Az.Aks.psd1
+++ b/src/Aks/Aks/Az.Aks.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'YamlDotNet.dll', 'AutoMapper.dll',
diff --git a/src/AlertsManagement/AlertsManagement/Az.AlertsManagement.psd1 b/src/AlertsManagement/AlertsManagement/Az.AlertsManagement.psd1
index 107f39018d1d..939c877bc211 100644
--- a/src/AlertsManagement/AlertsManagement/Az.AlertsManagement.psd1
+++ b/src/AlertsManagement/AlertsManagement/Az.AlertsManagement.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.AlertsManagement.dll'
diff --git a/src/AnalysisServices/AnalysisServices/Az.AnalysisServices.psd1 b/src/AnalysisServices/AnalysisServices/Az.AnalysisServices.psd1
index c9efce8da3ea..cd5f9c500994 100644
--- a/src/AnalysisServices/AnalysisServices/Az.AnalysisServices.psd1
+++ b/src/AnalysisServices/AnalysisServices/Az.AnalysisServices.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.Analysis.dll'
diff --git a/src/ApiManagement/ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs b/src/ApiManagement/ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs
index 590879718980..0f1cd4ab32f5 100644
--- a/src/ApiManagement/ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs
+++ b/src/ApiManagement/ApiManagement.ServiceManagement/Properties/AssemblyInfo.cs
@@ -42,5 +42,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0")]
-[assembly: AssemblyFileVersion("2.1.0")]
+[assembly: AssemblyVersion("2.2.0")]
+[assembly: AssemblyFileVersion("2.2.0")]
diff --git a/src/ApiManagement/ApiManagement/Az.ApiManagement.psd1 b/src/ApiManagement/ApiManagement/Az.ApiManagement.psd1
index 5ce6f55555ef..f4e61400006c 100644
--- a/src/ApiManagement/ApiManagement/Az.ApiManagement.psd1
+++ b/src/ApiManagement/ApiManagement/Az.ApiManagement.psd1
@@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
-# Generated on: 7/30/2020
+# Generated on: 12/3/2020
#
@{
@@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
-ModuleVersion = '2.1.0'
+ModuleVersion = '2.2.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'AutoMapper.dll', 'Microsoft.Azure.Management.ApiManagement.dll',
@@ -207,18 +207,7 @@ PrivateData = @{
# IconUri = ''
# ReleaseNotes of this module
- ReleaseNotes = '* Added new ''Add-AzApiManagementApiToGateway'' cmdlet.
-* Added new ''Get-AzApiManagementGateway'' cmdlet.
-* Added new ''Get-AzApiManagementGatewayHostnameConfiguration'' cmdlet.
-* Added new ''Get-AzApiManagementGatewayKey'' cmdlet.
-* Added new ''New-AzApiManagementGateway'' cmdlet.
-* Added new ''New-AzApiManagementGatewayHostnameConfiguration'' cmdlet.
-* Added new ''New-AzApiManagementResourceLocationObject'' cmdlet.
-* Added new ''Remove-AzApiManagementApiFromGateway'' cmdlet.
-* Added new ''Remove-AzApiManagementGateway'' cmdlet.
-* Added new ''Remove-AzApiManagementGatewayHostnameConfiguration'' cmdlet.
-* Added new ''Update-AzApiManagementGateway'' cmdlet.
-* Added new optional [-GatewayId] parameter to the ''Get-AzApiManagementApi'' cmdlet.'
+ ReleaseNotes = '* [Breaking change] ''New-AzApiManagementProduct'' by default has no subscription limit.'
# Prerelease string of this module
# Prerelease = ''
diff --git a/src/ApiManagement/ApiManagement/ChangeLog.md b/src/ApiManagement/ApiManagement/ChangeLog.md
index 5f075223e3b8..654387b11fb0 100644
--- a/src/ApiManagement/ApiManagement/ChangeLog.md
+++ b/src/ApiManagement/ApiManagement/ChangeLog.md
@@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
+
+## Version 2.2.0
* [Breaking change] `New-AzApiManagementProduct` by default has no subscription limit.
## Version 2.1.0
diff --git a/src/ApiManagement/ApiManagement/Properties/AssemblyInfo.cs b/src/ApiManagement/ApiManagement/Properties/AssemblyInfo.cs
index 28c28a971d9e..01e3ddb29519 100644
--- a/src/ApiManagement/ApiManagement/Properties/AssemblyInfo.cs
+++ b/src/ApiManagement/ApiManagement/Properties/AssemblyInfo.cs
@@ -41,5 +41,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0")]
-[assembly: AssemblyFileVersion("2.1.0")]
+[assembly: AssemblyVersion("2.2.0")]
+[assembly: AssemblyFileVersion("2.2.0")]
diff --git a/src/AppConfiguration/Az.AppConfiguration.psd1 b/src/AppConfiguration/Az.AppConfiguration.psd1
index a9f7a366c1ac..41e77346e211 100644
--- a/src/AppConfiguration/Az.AppConfiguration.psd1
+++ b/src/AppConfiguration/Az.AppConfiguration.psd1
@@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = './bin/Az.AppConfiguration.private.dll'
diff --git a/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1 b/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1
index 23f408f26381..b7bab810f69d 100644
--- a/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1
+++ b/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.ApplicationInsights.dll'
diff --git a/src/Attestation/Attestation/Az.Attestation.psd1 b/src/Attestation/Attestation/Az.Attestation.psd1
index 445943b34703..554ab5a9972d 100644
--- a/src/Attestation/Attestation/Az.Attestation.psd1
+++ b/src/Attestation/Attestation/Az.Attestation.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.Attestation.dll',
diff --git a/src/Automation/Automation/Az.Automation.psd1 b/src/Automation/Automation/Az.Automation.psd1
index 9f0824494497..8de14a81838c 100644
--- a/src/Automation/Automation/Az.Automation.psd1
+++ b/src/Automation/Automation/Az.Automation.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.Automation.dll'
diff --git a/src/Batch/Batch/Az.Batch.psd1 b/src/Batch/Batch/Az.Batch.psd1
index 0497b4f02fa5..e30de5934d67 100644
--- a/src/Batch/Batch/Az.Batch.psd1
+++ b/src/Batch/Batch/Az.Batch.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Batch.dll', 'Microsoft.Azure.Management.Batch.dll',
diff --git a/src/Billing/Billing/Az.Billing.psd1 b/src/Billing/Billing/Az.Billing.psd1
index 22c411d1c2eb..37dba82b1017 100644
--- a/src/Billing/Billing/Az.Billing.psd1
+++ b/src/Billing/Billing/Az.Billing.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.Billing.dll',
diff --git a/src/Blockchain/Az.Blockchain.psd1 b/src/Blockchain/Az.Blockchain.psd1
index 2a24391e8f5f..48b630bc4043 100644
--- a/src/Blockchain/Az.Blockchain.psd1
+++ b/src/Blockchain/Az.Blockchain.psd1
@@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = './bin/Az.Blockchain.private.dll'
diff --git a/src/Blueprint/Blueprint/Az.Blueprint.psd1 b/src/Blueprint/Blueprint/Az.Blueprint.psd1
index 13d2ccac1222..8879890927b8 100644
--- a/src/Blueprint/Blueprint/Az.Blueprint.psd1
+++ b/src/Blueprint/Blueprint/Az.Blueprint.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.Blueprint.dll'
diff --git a/src/Cdn/Cdn/Az.Cdn.psd1 b/src/Cdn/Cdn/Az.Cdn.psd1
index 5653100519ba..8b0b3ec2cd9a 100644
--- a/src/Cdn/Cdn/Az.Cdn.psd1
+++ b/src/Cdn/Cdn/Az.Cdn.psd1
@@ -53,7 +53,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
-RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.1'; })
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = 'Microsoft.Azure.Management.Cdn.dll'
diff --git a/src/CloudService/Az.CloudService.csproj b/src/CloudService/Az.CloudService.csproj
new file mode 100644
index 000000000000..ed08938f1b8a
--- /dev/null
+++ b/src/CloudService/Az.CloudService.csproj
@@ -0,0 +1,7 @@
+
+
+ CloudService
+
+
+
+
diff --git a/src/CloudService/Az.CloudService.format.ps1xml b/src/CloudService/Az.CloudService.format.ps1xml
new file mode 100644
index 000000000000..388b41a0ac03
--- /dev/null
+++ b/src/CloudService/Az.CloudService.format.ps1xml
@@ -0,0 +1,1015 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.CloudServiceIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.CloudServiceIdentity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CloudServiceName
+
+
+ ResourceGroupName
+
+
+ RoleInstanceName
+
+
+ RoleName
+
+
+ SubscriptionId
+
+
+ UpdateDomain
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudService
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ResourceGroupName
+
+
+ Name
+
+
+ Location
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultCertificate
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultCertificate
+
+
+
+
+
+
+
+
+
+
+
+ CertificateUrl
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ResourceInstanceViewStatus
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ResourceInstanceViewStatus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ DisplayStatus
+
+
+ Level
+
+
+ Message
+
+
+ Time
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstanceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstanceTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.StatusCodeCount
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.StatusCodeCount
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Count
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ApiError
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ApiError
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ApiErrorBase
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ApiErrorBase
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceExtensionProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceExtensionProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AutoUpgradeMinorVersion
+
+
+ ForceUpdateTag
+
+
+ ProtectedSetting
+
+
+ ProvisioningState
+
+
+ Publisher
+
+
+ RolesAppliedTo
+
+
+ Setting
+
+
+ Type
+
+
+ TypeHandlerVersion
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceInstanceView
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceInstanceView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Statuses
+
+
+ RoleInstanceStatusesSummary
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Configuration
+
+
+ ConfigurationUrl
+
+
+ PackageUrl
+
+
+ ProvisioningState
+
+
+ StartCloudService
+
+
+ UniqueId
+
+
+ UpgradeMode
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRole
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRole
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProfileProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProfileProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ SkuName
+
+
+ SkuTier
+
+
+ SkuCapacity
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProperties
+
+
+
+
+
+
+
+
+
+
+
+ UniqueId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleSku
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleSku
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Capacity
+
+
+ Name
+
+
+ Tier
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceUpdateTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceUpdateTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultAndSecretReference
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultAndSecretReference
+
+
+
+
+
+
+
+
+
+
+
+ SecretUrl
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Publisher
+
+
+ Type
+
+
+ TypeHandlerVersion
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.InnerError
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.InnerError
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Errordetail
+
+
+ Exceptiontype
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.InstanceSku
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.InstanceSku
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Tier
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerConfiguration
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerConfiguration
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ FrontendIPConfiguration
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfiguration
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfiguration
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfigurationProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfigurationProperties
+
+
+
+
+
+
+
+
+
+
+
+ PrivateIPAddress
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstance
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstance
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Location
+
+
+ SkuName
+
+
+ SkuTier
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstanceListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstanceListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstances
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstances
+
+
+
+
+
+
+
+
+
+
+
+ RoleInstance
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstanceView
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.RoleInstanceView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Statuses
+
+
+ PlatformFaultDomain
+
+
+ PlatformUpdateDomain
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.UpdateDomain
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.UpdateDomain
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.UpdateDomainListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.UpdateDomainListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CloudService/Az.CloudService.psd1 b/src/CloudService/Az.CloudService.psd1
new file mode 100644
index 000000000000..5776ae5906d6
--- /dev/null
+++ b/src/CloudService/Az.CloudService.psd1
@@ -0,0 +1,152 @@
+#
+# Module manifest for module 'Az.CloudService'
+#
+# Generated by: Microsoft Corporation
+#
+# Generated on: 2020-12-02
+#
+
+@{
+
+# Script module or binary module file associated with this manifest.
+RootModule = './Az.CloudService.psm1'
+
+# Version number of this module.
+ModuleVersion = '0.1.0'
+
+# Supported PSEditions
+CompatiblePSEditions = 'Core', 'Desktop'
+
+# ID used to uniquely identify this module
+GUID = 'a41eb61d-c5a1-4e9b-81a7-b8905fff7f2c'
+
+# Author of this module
+Author = 'Microsoft Corporation'
+
+# Company or vendor of this module
+CompanyName = 'Microsoft Corporation'
+
+# Copyright statement for this module
+Copyright = 'Microsoft Corporation. All rights reserved.'
+
+# Description of the functionality provided by this module
+Description = 'Microsoft Azure PowerShell: CloudService cmdlets'
+
+# Minimum version of the PowerShell engine required by this module
+PowerShellVersion = '5.1'
+
+# Name of the PowerShell host required by this module
+# PowerShellHostName = ''
+
+# Minimum version of the PowerShell host required by this module
+# PowerShellHostVersion = ''
+
+# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+DotNetFrameworkVersion = '4.7.2'
+
+# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+# ClrVersion = ''
+
+# Processor architecture (None, X86, Amd64) required by this module
+# ProcessorArchitecture = ''
+
+# Modules that must be imported into the global environment prior to importing this module
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
+
+# Assemblies that must be loaded prior to importing this module
+RequiredAssemblies = './bin/Az.CloudService.private.dll'
+
+# Script files (.ps1) that are run in the caller's environment prior to importing this module.
+# ScriptsToProcess = @()
+
+# Type files (.ps1xml) to be loaded when importing this module
+# TypesToProcess = @()
+
+# Format files (.ps1xml) to be loaded when importing this module
+FormatsToProcess = './Az.CloudService.format.ps1xml'
+
+# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
+# NestedModules = @()
+
+# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
+FunctionsToExport = 'Get-AzCloudService', 'Get-AzCloudServiceInstanceView',
+ 'Get-AzCloudServiceNetworkInterfaces',
+ 'Get-AzCloudServicePublicIPAddress',
+ 'Get-AzCloudServiceRoleInstance',
+ 'Get-AzCloudServiceRoleInstanceRemoteDesktopFile',
+ 'Get-AzCloudServiceRoleInstanceView',
+ 'Invoke-AzCloudServiceRebuild', 'Invoke-AzCloudServiceReimage',
+ 'Invoke-AzCloudServiceRoleInstanceRebuild',
+ 'Invoke-AzCloudServiceRoleInstanceReimage', 'New-AzCloudService',
+ 'New-AzCloudServiceDiagnosticsExtension',
+ 'New-AzCloudServiceExtensionObject',
+ 'New-AzCloudServiceLoadBalancerConfigurationObject',
+ 'New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject',
+ 'New-AzCloudServiceRemoteDesktopExtensionObject',
+ 'New-AzCloudServiceRoleProfilePropertiesObject',
+ 'New-AzCloudServiceVaultSecretGroupObject', 'Remove-AzCloudService',
+ 'Remove-AzCloudServiceRoleInstance', 'Restart-AzCloudService',
+ 'Restart-AzCloudServiceRoleInstance',
+ 'Set-AzCloudServiceUpdateDomain', 'Start-AzCloudService',
+ 'Stop-AzCloudService', 'Switch-AzCloudService',
+ 'Update-AzCloudService'
+
+# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
+CmdletsToExport = @()
+
+# Variables to export from this module
+# VariablesToExport = @()
+
+# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
+AliasesToExport = '*'
+
+# DSC resources to export from this module
+# DscResourcesToExport = @()
+
+# List of all modules packaged with this module
+# ModuleList = @()
+
+# List of all files packaged with this module
+# FileList = @()
+
+# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
+PrivateData = @{
+
+ PSData = @{
+
+ # Tags applied to this module. These help with module discovery in online galleries.
+ Tags = 'Azure','ResourceManager','ARM','PSModule','CloudService'
+
+ # A URL to the license for this module.
+ LicenseUri = 'https://aka.ms/azps-license'
+
+ # A URL to the main website for this project.
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+
+ # A URL to an icon representing this module.
+ # IconUri = ''
+
+ # ReleaseNotes of this module
+ ReleaseNotes = '* First preview release for module Az.CloudService.'
+
+ # Prerelease string of this module
+ # Prerelease = ''
+
+ # Flag to indicate whether the module requires explicit user acceptance for install/update/save
+ # RequireLicenseAcceptance = $false
+
+ # External dependent modules of this module
+ # ExternalModuleDependencies = @()
+
+ } # End of PSData hashtable
+
+ } # End of PrivateData hashtable
+
+# HelpInfo URI of this module
+# HelpInfoURI = ''
+
+# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
+# DefaultCommandPrefix = ''
+
+}
+
diff --git a/src/CloudService/Az.CloudService.psm1 b/src/CloudService/Az.CloudService.psm1
new file mode 100644
index 000000000000..e6461d60da98
--- /dev/null
+++ b/src/CloudService/Az.CloudService.psm1
@@ -0,0 +1,109 @@
+# region Generated
+ # ----------------------------------------------------------------------------------
+ #
+ # Copyright Microsoft Corporation
+ # 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.
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
+ if(-not $accountsModule) {
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.8.1' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.8.1 -Scope Global -PassThru
+ }
+ }
+ }
+
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'1.8.1') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
+
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.CloudService.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Module]::Instance
+
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
+
+ # Tweaks the pipeline per call
+ $instance.OnNewRequest = $VTable.OnNewRequest
+
+ # Gets shared parameter values
+ $instance.GetParameterValue = $VTable.GetParameterValue
+
+ # Allows shared module to listen to events from this module
+ $instance.EventListener = $VTable.EventListener
+
+ # Gets shared argument completers
+ $instance.ArgumentCompleter = $VTable.ArgumentCompleter
+
+ # The name of the currently selected Azure profile
+ $instance.ProfileName = $VTable.ProfileName
+
+
+ # Load the custom module
+ $customModulePath = Join-Path $PSScriptRoot './custom/Az.CloudService.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/CloudService/Changelog.md b/src/CloudService/Changelog.md
new file mode 100644
index 000000000000..d8b33fa77979
--- /dev/null
+++ b/src/CloudService/Changelog.md
@@ -0,0 +1,24 @@
+
+## Upcoming Release
+
+## Version 0.1.0
+* First preview release for module Az.CloudService
+
diff --git a/src/CloudService/CloudService.sln b/src/CloudService/CloudService.sln
new file mode 100644
index 000000000000..9d3a60369f26
--- /dev/null
+++ b/src/CloudService/CloudService.sln
@@ -0,0 +1,48 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{62843FE6-7575-4D88-B989-7DF7EEC0BC01}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{442C609B-A431-4A71-B289-08F0B63C83E5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{59E8F6B8-8F0E-403F-B88B-9736DBC396D9}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Az.CloudService", "Az.CloudService.csproj", "{1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {62843FE6-7575-4D88-B989-7DF7EEC0BC01}.Release|Any CPU.Build.0 = Release|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {442C609B-A431-4A71-B289-08F0B63C83E5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {59E8F6B8-8F0E-403F-B88B-9736DBC396D9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1C203C0C-E0FD-40D2-B79E-C6DA52E4E350}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {F9B3D96E-9680-40BE-A917-02EE655D6030}
+ EndGlobalSection
+EndGlobal
diff --git a/src/CloudService/Properties/AssemblyInfo.cs b/src/CloudService/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..3264b6b31b59
--- /dev/null
+++ b/src/CloudService/Properties/AssemblyInfo.cs
@@ -0,0 +1,28 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// 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.
+// ----------------------------------------------------------------------------------
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Microsoft Azure Powershell - CloudService")]
+[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
+[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
+[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
+
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(false)]
+[assembly: Guid("1fe4b4c7-44d2-4800-a935-733381e663ae")]
+[assembly: AssemblyVersion("0.1.0")]
+[assembly: AssemblyFileVersion("0.1.0")]
diff --git a/src/CloudService/build-module.ps1 b/src/CloudService/build-module.ps1
new file mode 100644
index 000000000000..2d0a1fe100e3
--- /dev/null
+++ b/src/CloudService/build-module.ps1
@@ -0,0 +1,153 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $Isolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.CloudService.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.CloudService.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.CloudService.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.CloudService'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: CloudService cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'readme.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.CloudService.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/CloudService/check-dependencies.ps1 b/src/CloudService/check-dependencies.ps1
new file mode 100644
index 000000000000..513c52ca2fb5
--- /dev/null
+++ b/src/CloudService/check-dependencies.ps1
@@ -0,0 +1,64 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.8.1'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and (-not (Test-Path -Path $resourceModule))) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest-beta .\readme.md --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/CloudService/custom/Az.CloudService.custom.psm1 b/src/CloudService/custom/Az.CloudService.custom.psm1
new file mode 100644
index 000000000000..885e17f69a30
--- /dev/null
+++ b/src/CloudService/custom/Az.CloudService.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.CloudService.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.CloudService.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/CloudService/custom/Get-AzCloudServiceNetworkInterface.ps1 b/src/CloudService/custom/Get-AzCloudServiceNetworkInterface.ps1
new file mode 100644
index 000000000000..d7b810756eb1
--- /dev/null
+++ b/src/CloudService/custom/Get-AzCloudServiceNetworkInterface.ps1
@@ -0,0 +1,81 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get the network interfaces of a cloud service.
+.Description
+Get the network interfaces of a cloud service.
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-AzCloudServiceNetworkInterfaces
+#>
+
+function Get-AzCloudServiceNetworkInterfaces {
+ param(
+ [Parameter(ParameterSetName="CloudServiceName", HelpMessage="Subscription.")]
+ [Parameter(ParameterSetName = "CloudService", HelpMessage="Subscription.")]
+ [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(Mandatory=$true, ParameterSetName="CloudServiceName", HelpMessage="ResourceGroupName.")]
+ [string] $ResourceGroupName,
+
+ [Parameter(Mandatory=$true, ParameterSetName="CloudServiceName", HelpMessage="CloudServiceName.")]
+ [string] $CloudServiceName,
+
+ [Parameter(ParameterSetName="CloudServiceName", HelpMessage="RoleInstanceName.")]
+ [Parameter(ParameterSetName = "CloudService", HelpMessage="RoleInstanceName.")]
+ [string] $RoleInstanceName,
+
+ [Parameter(Mandatory=$true, ParameterSetName="CloudService", HelpMessage="CloudService instance.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudService] $CloudService
+ )
+ process {
+ $ApiVersion = "2020-06-01"
+ if ($PSBoundParameters.ContainsKey("CloudService"))
+ {
+ $elements = $CloudService.Id.Split("/")
+ if (($elements.Count -lt 5) -or ("subscriptions" -ne $elements[1]) -or ("resourceGroups" -ne $elements[3]))
+ {
+ throw "CloudService.Id should match the format: /subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)"
+ }
+ $SubscriptionId = $elements[2]
+ $ResourceGroupName = $elements[4]
+ $CloudServiceName = $CloudService.Name
+ if ($Null -eq $CloudServiceName)
+ {
+ throw "CloudService.Name should not be Null"
+ }
+ }
+
+ # Create the URI as per the input
+ if ($PSBoundParameters.ContainsKey("RoleInstanceName"))
+ {
+ $uriToInvoke = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Compute/cloudServices/$CloudServiceName/roleInstances/$RoleInstanceName/networkInterfaces?api-version=$ApiVersion"
+ }
+ else
+ {
+ $uriToInvoke = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Compute/cloudServices/$CloudServiceName/networkInterfaces?api-version=$ApiVersion"
+ }
+
+ # Invoke and display the information
+ $result = Invoke-AzRestMethod -Method GET -Path $uriToInvoke
+ $result.Content
+ }
+}
diff --git a/src/CloudService/custom/Get-AzCloudServicePublicIPAddress.ps1 b/src/CloudService/custom/Get-AzCloudServicePublicIPAddress.ps1
new file mode 100644
index 000000000000..8546f65d25ae
--- /dev/null
+++ b/src/CloudService/custom/Get-AzCloudServicePublicIPAddress.ps1
@@ -0,0 +1,68 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get the public IP address of a cloud service.
+.Description
+Get the public IP address of a cloud service.
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-AzCloudServicePublicIPAddress
+#>
+function Get-AzCloudServicePublicIPAddress {
+ param(
+ [Parameter(HelpMessage="Subscription.")]
+ [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(Mandatory=$true, ParameterSetName="CloudServiceName", HelpMessage="ResourceGroupName.")]
+ [string] $ResourceGroupName,
+
+ [Parameter(Mandatory=$true, ParameterSetName="CloudServiceName", HelpMessage="CloudServiceName.")]
+ [string] $CloudServiceName,
+
+ [Parameter(Mandatory=$true, ParameterSetName="CloudService", HelpMessage="CloudService instance.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudService] $CloudService
+ )
+ process {
+ $ApiVersion = "2020-06-01"
+ if ($PSBoundParameters.ContainsKey("CloudService"))
+ {
+ $elements = $CloudService.Id.Split("/")
+ if (($elements.Count -lt 5) -or ("subscriptions" -ne $elements[1]) -or ("resourceGroups" -ne $elements[3]))
+ {
+ throw "CloudService.Id should match the format: /subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)"
+ }
+ $SubscriptionId = $elements[2]
+ $ResourceGroupName = $elements[4]
+ $CloudServiceName = $CloudService.Name
+ if ($Null -eq $CloudServiceName)
+ {
+ throw "CloudService.Name should not be Null"
+ }
+ }
+
+ # Create the URI as per the input
+ $uriToInvoke = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Compute/cloudServices/$CloudServiceName/publicIPAddresses?api-version=$ApiVersion"
+
+ # Invoke and display the information
+ $result = Az.Accounts\Invoke-AzRestMethod -Method GET -Path $uriToInvoke
+ $result.Content
+ }
+}
diff --git a/src/CloudService/custom/New-AzCloudServiceDiagnosticsExtension.ps1 b/src/CloudService/custom/New-AzCloudServiceDiagnosticsExtension.ps1
new file mode 100644
index 000000000000..755bcef2b1ca
--- /dev/null
+++ b/src/CloudService/custom/New-AzCloudServiceDiagnosticsExtension.ps1
@@ -0,0 +1,118 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Diagnostics Extension
+.Description
+Create a in-memory object for Diagnostics Extension
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/new-azcloudservicediagnosticsextension
+#>
+
+function New-AzCloudServiceDiagnosticsExtension {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension')]
+ param(
+ [Parameter(HelpMessage="Name of Diagnostics Extension.", Mandatory)]
+ [string] $Name,
+
+ [Parameter(HelpMessage="Subscription.")]
+ [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.
+ ${Subscription},
+
+ [Parameter(HelpMessage="Resource Group name of Cloud Service.", Mandatory)]
+ [string] $ResourceGroupName,
+
+ [Parameter(HelpMessage="Name of Cloud Service.", Mandatory)]
+ [string] $CloudServiceName,
+
+ [Parameter(HelpMessage="Specifies the configuration for Azure Diagnostics. You can download the schema by using the following command: (Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics').PublicConfigurationSchema | Out-File -Encoding utf8 -FilePath 'WadConfig.xsd'", Mandatory)]
+ [string] $DiagnosticsConfigurationPath,
+
+ [Parameter(HelpMessage="Name of the Storage Account.", Mandatory)]
+ [string] $StorageAccountName,
+
+ [Parameter(HelpMessage="Storage Account Key.", Mandatory)]
+ [string] $StorageAccountKey,
+
+ [Parameter(HelpMessage="Specifies the version of the extension.")]
+ [string] $TypeHandlerVersion,
+
+ [Parameter(HelpMessage="Roles applied to.")]
+ [string[]] $RolesAppliedTo,
+
+ [Parameter(HelpMessage="Auto upgrade minor version.")]
+ [Boolean] $AutoUpgradeMinorVersion
+ )
+
+ process {
+ $publisher = "Microsoft.Azure.Diagnostics"
+ $extensionType = "PaaSDiagnostics"
+
+ if (!(Test-Path $DiagnosticsConfigurationPath -PathType Leaf))
+ {
+ throw ("DiagnosticsConfigurationPath does not exits: " + $DiagnosticsConfigurationPath)
+ }
+
+ [xml]$diagnosticsConfigurationXml = Get-Content $DiagnosticsConfigurationPath
+
+ $storageAccount = $diagnosticsConfigurationXml.PublicConfig.ChildNodes | Where-Object { $_.Name -eq 'StorageAccount' }
+ if ($storageAccount)
+ {
+ Write-Host "Using StorageAccount information defined in diagnostics configuration file."
+ }
+ else
+ {
+ $storageAccount = $diagnosticsConfigurationXml.CreateElement('StorageAccount', $diagnosticsConfigurationXml.PublicConfig.NamespaceURI)
+ $storageAccount.InnerText = $StorageAccountName
+ $storageAccount = $diagnosticsConfigurationXml.PublicConfig.AppendChild($storageAccount)
+ }
+
+ $metrics = $diagnosticsConfigurationXml.PublicConfig.WadCfg.DiagnosticMonitorConfiguration.ChildNodes | Where-Object { $_.Name -eq 'Metrics' }
+ if ($metrics)
+ {
+ Write-Host "Using Metrics information defined in diagnostics configuration file."
+ }
+ else
+ {
+ $metrics = $diagnosticsConfigurationXml.CreateElement('Metrics', $diagnosticsConfigurationXml.PublicConfig.NamespaceURI)
+ $resourceId = "/subscriptions/$Subscription/resourceGroups/$ResourceGroupName/providers/Microsoft.Compute/cloudservices/$CloudServiceName"
+ $metrics.SetAttribute('resourceId', $resourceId)
+ $metrics = $diagnosticsConfigurationXml.PublicConfig.WadCfg.DiagnosticMonitorConfiguration.AppendChild($metrics)
+ }
+
+ $setting = $diagnosticsConfigurationXml.PublicConfig.OuterXml
+
+ $privateConfig = $diagnosticsConfigurationXml.ChildNodes | Where-Object { $_.Name -eq 'PrivateConfig' }
+ if ($privateConfig)
+ {
+ $protectedSetting = $privateConfig.OuterXml
+ Write-Host "Using PrivateConfig information defined in diagnostics configuration file."
+ }
+ else
+ {
+ $storageEndpoint = "https://core.windows.net"
+ $protectedSetting = ''
+ }
+
+ return New-AzCloudServiceExtensionObject -Name $Name -Publisher $publisher -Type $extensionType -TypeHandlerVersion $TypeHandlerVersion -Setting $setting -ProtectedSetting $protectedSetting -RolesAppliedTo $RolesAppliedTo -AutoUpgradeMinorVersion $AutoUpgradeMinorVersion
+ }
+}
diff --git a/src/CloudService/custom/New-AzCloudServiceExtensionObject.ps1 b/src/CloudService/custom/New-AzCloudServiceExtensionObject.ps1
new file mode 100644
index 000000000000..2c31c46ffd4a
--- /dev/null
+++ b/src/CloudService/custom/New-AzCloudServiceExtensionObject.ps1
@@ -0,0 +1,72 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Extension
+.Description
+Create a in-memory object for Extension
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceExtensionObject
+#>
+function New-AzCloudServiceExtensionObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(HelpMessage="Explicitly specify whether CRP can automatically upgrade typeHandlerVersion to higher minor versions when they become available.")]
+ [bool]
+ $AutoUpgradeMinorVersion,
+ [Parameter(HelpMessage="Name.")]
+ [string]
+ $Name,
+ [Parameter(HelpMessage="Protected settings for the extension which are encrypted before sent to the VM.")]
+ [string]
+ $ProtectedSetting,
+ [Parameter(HelpMessage="Publisher.")]
+ [string]
+ $Publisher,
+ [Parameter(HelpMessage="RolesAppliedTo.")]
+ [string[]]
+ $RolesAppliedTo,
+ [Parameter(HelpMessage="Public settings for the extension.")]
+ [string]
+ $Setting,
+ [Parameter(HelpMessage="Type.")]
+ [string]
+ $Type,
+ [Parameter(HelpMessage="TypeHandlerVersion.")]
+ [string]
+ $TypeHandlerVersion
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension]::New()
+
+ $Object.AutoUpgradeMinorVersion = $AutoUpgradeMinorVersion
+ $Object.Name = $Name
+ $Object.ProtectedSetting = $ProtectedSetting
+ $Object.Publisher = $Publisher
+ $Object.RolesAppliedTo = $RolesAppliedTo
+ $Object.Setting = $Setting
+ $Object.Type = $Type
+ $Object.TypeHandlerVersion = $TypeHandlerVersion
+ return $Object
+ }
+}
+
diff --git a/src/CloudService/custom/New-AzCloudServiceLoadBalancerConfigurationObject.ps1 b/src/CloudService/custom/New-AzCloudServiceLoadBalancerConfigurationObject.ps1
new file mode 100644
index 000000000000..2ab02322df5b
--- /dev/null
+++ b/src/CloudService/custom/New-AzCloudServiceLoadBalancerConfigurationObject.ps1
@@ -0,0 +1,48 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for LoadBalancerConfiguration
+.Description
+Create a in-memory object for LoadBalancerConfiguration
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerConfiguration
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceLoadBalancerConfigurationObject
+#>
+function New-AzCloudServiceLoadBalancerConfigurationObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerConfiguration')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(HelpMessage="FrontendIPConfiguration.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ILoadBalancerFrontendIPConfiguration[]]
+ $FrontendIPConfiguration,
+ [Parameter(HelpMessage="Name of LoadBalancerConfiguration.")]
+ [string]
+ $Name
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerConfiguration]::New()
+
+ $Object.FrontendIPConfiguration = $FrontendIPConfiguration
+ $Object.Name = $Name
+ return $Object
+ }
+}
+
diff --git a/src/CloudService/custom/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.ps1 b/src/CloudService/custom/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.ps1
new file mode 100644
index 000000000000..5257bfec269f
--- /dev/null
+++ b/src/CloudService/custom/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.ps1
@@ -0,0 +1,48 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for LoadBalancerFrontendIPConfiguration
+.Description
+Create a in-memory object for LoadBalancerFrontendIPConfiguration
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfiguration
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceLoadBalancerFrontendIPConfigurationObject
+#>
+function New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfiguration')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(HelpMessage="Name of FrontendIpConfigration.")]
+ [string]
+ $Name,
+ [Parameter(HelpMessage="Resource Id.")]
+ [string]
+ $PublicIPAddressId
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfiguration]::New()
+
+ $Object.Name = $Name
+ $Object.PublicIPAddressId = $PublicIPAddressId
+ return $Object
+ }
+}
+
diff --git a/src/CloudService/custom/New-AzCloudServiceRemoteDesktopExtensionObject.ps1 b/src/CloudService/custom/New-AzCloudServiceRemoteDesktopExtensionObject.ps1
new file mode 100644
index 000000000000..82eeab389eb1
--- /dev/null
+++ b/src/CloudService/custom/New-AzCloudServiceRemoteDesktopExtensionObject.ps1
@@ -0,0 +1,58 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Remote Desktop Extension
+.Description
+Create a in-memory object for Remote Desktop Extension
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-azcloudserviceremotedesktopextensionobject
+#>
+
+function New-AzCloudServiceRemoteDesktopExtensionObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension')]
+ param(
+ [Parameter(HelpMessage="Name of Remote Desktop Extension.", Mandatory)]
+ [string] $Name,
+
+ [Parameter(HelpMessage="Credential for Remote Desktop Extension.", Mandatory)]
+ [PSCredential] $Credential,
+
+ [Parameter(HelpMessage="Expiration for Remote Desktop Extension.")]
+ [DateTime] $Expiration,
+
+ [Parameter(HelpMessage="Remote Desktop Extension version.")]
+ [string] $TypeHandlerVersion,
+
+ [Parameter(HelpMessage="Roles applied to.")]
+ [string[]] $RolesAppliedTo,
+
+ [Parameter(HelpMessage="Auto upgrade minor version.")]
+ [Boolean] $AutoUpgradeMinorVersion
+ )
+
+ process {
+ $RDPPublisher = "Microsoft.Windows.Azure.Extensions"
+ $RDPExtensionType = "RDP"
+
+ $rdpSetting = "$($Credential.UserName)$Expiration";
+ $rdpProtectedSetting = "$($Credential.Password)";
+
+ return New-AzCloudServiceExtensionObject -Name $Name -Publisher $RDPPublisher -Type $RDPExtensionType -TypeHandlerVersion $TypeHandlerVersion -Setting $rdpSetting -ProtectedSetting $rdpProtectedSetting -RolesAppliedTo $RolesAppliedTo -AutoUpgradeMinorVersion $AutoUpgradeMinorVersion
+ }
+}
\ No newline at end of file
diff --git a/src/CloudService/custom/New-AzCloudServiceRoleProfilePropertiesObject.ps1 b/src/CloudService/custom/New-AzCloudServiceRoleProfilePropertiesObject.ps1
new file mode 100644
index 000000000000..0e1510a73e12
--- /dev/null
+++ b/src/CloudService/custom/New-AzCloudServiceRoleProfilePropertiesObject.ps1
@@ -0,0 +1,56 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for CloudServiceRoleProfileProperties
+.Description
+Create a in-memory object for CloudServiceRoleProfileProperties
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProfileProperties
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceRoleProfilePropertiesObject
+#>
+function New-AzCloudServiceRoleProfilePropertiesObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProfileProperties')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+
+ [Parameter(HelpMessage="Name of role profile.")]
+ [string]
+ $Name,
+ [Parameter(HelpMessage="Specifies the number of role instances in the cloud service.")]
+ [long]
+ $SkuCapacity,
+ [Parameter(HelpMessage="The sku name.")]
+ [string]
+ $SkuName,
+ [Parameter(HelpMessage="SkuTier.")]
+ [string]
+ $SkuTier
+ )
+
+ process {
+ $Object = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProfileProperties]::New()
+
+ $Object.Name = $Name
+ $Object.SkuCapacity = $SkuCapacity
+ $Object.SkuName = $SkuName
+ $Object.SkuTier = $SkuTier
+ return $Object
+ }
+}
+
diff --git a/src/CloudService/custom/New-AzCloudServiceVaultSecretGroupObject.ps1 b/src/CloudService/custom/New-AzCloudServiceVaultSecretGroupObject.ps1
new file mode 100644
index 000000000000..e91b288587b4
--- /dev/null
+++ b/src/CloudService/custom/New-AzCloudServiceVaultSecretGroupObject.ps1
@@ -0,0 +1,55 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Vault Secret Group
+.Description
+Create a in-memory object for Secret Group
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultSecretGroup
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceVaultSecretGroupObject
+#>
+
+function New-AzCloudServiceVaultSecretGroupObject {
+ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultSecretGroup')]
+ [CmdletBinding(PositionalBinding=$false)]
+ Param(
+ [Parameter(HelpMessage="Key Vault Resource Id.")]
+ [string]
+ $Id,
+
+ [Parameter(HelpMessage="This is the URL of a certificate that has been uploaded to Key Vault as a secret.")]
+ [string[]]
+ $CertificateUrl
+ )
+
+ process {
+ $certificateUrls = @()
+ ForEach ($url in $CertificateUrl)
+ {
+ $cloudServiceVaultCertificate = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultCertificate]::New()
+ $cloudServiceVaultCertificate.CertificateUrl = $url
+ $certificateUrls = $certificateUrls + $cloudServiceVaultCertificate
+ }
+
+ $cloudServiceVaultSecretGroup = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultSecretGroup]::New()
+ $cloudServiceVaultSecretGroup.SourceVaultId = $Id
+ $cloudServiceVaultSecretGroup.VaultCertificate = $certificateUrls
+
+ return $cloudServiceVaultSecretGroup
+ }
+}
diff --git a/src/CloudService/custom/Serialization/CloudService.cs b/src/CloudService/custom/Serialization/CloudService.cs
new file mode 100644
index 000000000000..4cc1936adaa7
--- /dev/null
+++ b/src/CloudService/custom/Serialization/CloudService.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json;
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview
+{
+ public partial class CloudService
+ {
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Origin(Microsoft.Azure.PowerShell.Cmdlets.CloudService.PropertyOrigin.Owned)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.FormatTable(Index = 0)]
+ public string ResourceGroupName
+ {
+ get {
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Compute/cloudServices/(?[^/]+)$").Match(this.Id);
+ if (!_match.Success) {
+ return null;
+ }
+ return _match.Groups["resourceGroupName"].Value;
+ }
+ }
+ }
+
+ public partial interface ICloudService
+ {
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"ResourceGroupName",
+ SerializedName = @"ResourceGroupName",
+ PossibleTypes = new [] { typeof(string) })]
+ string ResourceGroupName { get; }
+ }
+}
diff --git a/src/CloudService/custom/Serialization/CloudServiceTags.cs b/src/CloudService/custom/Serialization/CloudServiceTags.cs
new file mode 100644
index 000000000000..15db3d2243a9
--- /dev/null
+++ b/src/CloudService/custom/Serialization/CloudServiceTags.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json;
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview
+{
+ public partial class CloudServiceTags
+ {
+ public override string ToString()
+ {
+ return this.ToJsonString();
+ }
+ }
+}
diff --git a/src/CloudService/custom/Serialization/CloudServiceVaultCertificate.cs b/src/CloudService/custom/Serialization/CloudServiceVaultCertificate.cs
new file mode 100644
index 000000000000..b78f1bf8e2a0
--- /dev/null
+++ b/src/CloudService/custom/Serialization/CloudServiceVaultCertificate.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json;
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview
+{
+ public partial class CloudServiceVaultCertificate
+ {
+ public override string ToString()
+ {
+ return this.CertificateUrl;
+ }
+ }
+}
diff --git a/src/CloudService/custom/Serialization/GetAzCloudServiceRoleInstanceRemoteDesktopFile_Get.cs b/src/CloudService/custom/Serialization/GetAzCloudServiceRoleInstanceRemoteDesktopFile_Get.cs
new file mode 100644
index 000000000000..22ea78bc7d46
--- /dev/null
+++ b/src/CloudService/custom/Serialization/GetAzCloudServiceRoleInstanceRemoteDesktopFile_Get.cs
@@ -0,0 +1,42 @@
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.CloudService.Cmdlets
+{
+ public partial class GetAzCloudServiceRoleInstanceRemoteDesktopFile_Get
+ {
+ partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow)
+ {
+ global::System.Collections.ObjectModel.Collection paths;
+ try {
+ paths = this.SessionState.Path.GetResolvedProviderPathFromPSPath(OutFile, out var provider);
+ if (provider.Name != "FileSystem" || paths.Count == 0)
+ {
+ ThrowTerminatingError( new System.Management.Automation.ErrorRecord(new global::System.Exception("Invalid output path."),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OutFile) );
+ }
+ if (paths.Count > 1)
+ {
+ ThrowTerminatingError( new System.Management.Automation.ErrorRecord(new global::System.Exception("Multiple output paths not allowed."),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OutFile) );
+ }
+ } catch (global::System.Management.Automation.ItemNotFoundException) {
+ paths = new global::System.Collections.ObjectModel.Collection();
+ paths.Add(OutFile);
+ }
+ var path = global::System.IO.Path.GetFullPath(paths[0]);
+ using ( var stream = response.GetAwaiter().GetResult() )
+ {
+ using( var fileStream = global::System.IO.File.OpenWrite(path) )
+ {
+ stream.CopyTo(fileStream);
+ }
+ if (!path.Equals(paths[0]))
+ {
+ WriteObject($"OutFile: {path}");
+ }
+ }
+ if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
+ {
+ WriteObject(true);
+ }
+ returnNow = global::System.Threading.Tasks.Task.FromResult(true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/CloudService/custom/Serialization/ResourceInstanceViewStatus.cs b/src/CloudService/custom/Serialization/ResourceInstanceViewStatus.cs
new file mode 100644
index 000000000000..cb142c0a1f58
--- /dev/null
+++ b/src/CloudService/custom/Serialization/ResourceInstanceViewStatus.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json;
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview
+{
+ public partial class ResourceInstanceViewStatus
+ {
+ public override string ToString()
+ {
+ return this.DisplayStatus;
+ }
+ }
+}
diff --git a/src/CloudService/custom/Serialization/RoleInstanceTags.cs b/src/CloudService/custom/Serialization/RoleInstanceTags.cs
new file mode 100644
index 000000000000..5586d44f530c
--- /dev/null
+++ b/src/CloudService/custom/Serialization/RoleInstanceTags.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json;
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview
+{
+ public partial class RoleInstanceTags
+ {
+ public override string ToString()
+ {
+ return this.ToJsonString();
+ }
+ }
+}
diff --git a/src/CloudService/custom/Serialization/StatusCodeCount.cs b/src/CloudService/custom/Serialization/StatusCodeCount.cs
new file mode 100644
index 000000000000..0b55b653cc46
--- /dev/null
+++ b/src/CloudService/custom/Serialization/StatusCodeCount.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json;
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview
+{
+ public partial class StatusCodeCount
+ {
+ public override string ToString()
+ {
+ return this.ToJsonString();
+ }
+ }
+}
diff --git a/src/CloudService/custom/Switch-AzCloudService.ps1 b/src/CloudService/custom/Switch-AzCloudService.ps1
new file mode 100644
index 000000000000..5abe6bde1dd8
--- /dev/null
+++ b/src/CloudService/custom/Switch-AzCloudService.ps1
@@ -0,0 +1,261 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Swaps VIPs between two cloud service (extended support) load balancers.
+.Description
+Swaps VIPs between two cloud service (extended support) load balancers.
+
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/Switch-AzCloudService
+
+#>
+function Switch-AzCloudService {
+ [OutputType([System.Boolean])]
+ [CmdletBinding(DefaultParameterSetName='CloudServiceName', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='High')]
+ param(
+
+ [Parameter(ParameterSetName='CloudService')]
+ [Parameter(ParameterSetName='CloudServiceName')]
+ [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(Mandatory=$true, ParameterSetName="CloudService")]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudService]
+ ${CloudService},
+
+ [Parameter(Mandatory=$true, ParameterSetName="CloudServiceName")]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory=$true, ParameterSetName="CloudServiceName")]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ ${CloudServiceName},
+
+ [Parameter()]
+ [switch]
+ ${Async},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+ )
+
+ process {
+ $ApiVersion = "2020-06-01"
+ if (-not $PSBoundParameters.ContainsKey("SubscriptionId")) {
+ $SubscriptionId = (Get-AzContext).Subscription.Id
+ }
+
+ # Fetch the services to ensure that we have the latest information
+ if ($PSBoundParameters.ContainsKey("CloudService")) {
+ $CloudServiceName = $CloudService.Name
+ $ResourceGroupName = $CloudService.ResourceGroupName
+ }
+
+ $SourceCloudService = Get-AzCloudService -SubscriptionId $SubscriptionId -Name $CloudServiceName -ResourceGroupName $ResourceGroupName
+
+ # Check that both have swappable property set.
+ if ([string]::IsNullOrEmpty($SourceCloudService.NetworkProfile.SwappableCloudService.Id)) {
+ throw "SwappableCloudServiceId is not set on the source cloud service $($SourceCloudService.Name)"
+ }
+
+ # Check that Public IPs counts are correct for source
+ $validSourceIP = ValidateCloudServicePublicIPAddress($SourceCloudService)
+ if ($validSourceIP -eq $false) {
+ throw "Specified source cloud service must have a single public IP address specified in its FrontendIpConfigurations."
+ }
+
+ # Parse target cloud service fields
+ $elements = $SourceCloudService.NetworkProfile.SwappableCloudService.Id.Split("/")
+ if (($elements.Count -lt 9) -or ("subscriptions" -ne $elements[1]) -or ("resourceGroups" -ne $elements[3]) -or ("cloudServices" -ne $elements[7]))
+ {
+ throw "SourceCloudService.NetworkProfile.SwappableCloudService.Id should match the format: /subscriptions/(?[^/]+)/resourceGroups/(?[^/]+/providers/Microsoft.Compute/cloudServices/(?[^/]+))"
+ }
+ $TargetSubscriptionId = $elements[2]
+ $TargetResourceGroupName = $elements[4]
+ $TargetCloudServiceName = $elements[8]
+
+ # Fetch the target cloud service
+ $TargetCloudService = Get-AzCloudService -SubscriptionId $TargetSubscriptionId -Name $TargetCloudServiceName -ResourceGroupName $TargetResourceGroupName
+
+ # Check that Public IPs counts are correct for target
+ $validTargetIP = ValidateCloudServicePublicIPAddress($TargetCloudService)
+ if ($validTargetIP -eq $false) {
+ throw "Specified target cloud service must have a single public IP address specified in its FrontendIpConfigurations."
+ }
+
+ # Get the LBs and FrontEndIpConfigs to create the request body
+ $sourceLB = GetCloudServiceLoadBalancer($SubscriptionId, $ResourceGroupName, $SourceCloudService.NetworkProfile.LoadBalancerConfiguration[0].Name, $ApiVersion)
+ $validSourceLB = ValidateLoadBalancerFrontEndIPConfiguration($sourceLB)
+ if ($validSourceLB -eq $false) {
+ throw "Source loadbBalancer must have a single value in its FrontendIpConfigurations."
+ }
+
+ $targetLB = GetCloudServiceLoadBalancer($TargetSubscriptionId, $TargetResourceGroupName, $TargetCloudService.NetworkProfile.LoadBalancerConfiguration[0].Name, $ApiVersion)
+ $validTargetLB = ValidateLoadBalancerFrontEndIPConfiguration($targetLB)
+ if ($validTargetLB -eq $false) {
+ throw "Target loadbBalancer must have a single value in its FrontendIpConfigurations."
+ }
+
+ # Construct the request body
+ $requestBody = GetVIPSwapRequestBody
+ $requestBody = $requestBody -replace "#LBFE1#", $sourceLB.properties.frontendIPConfigurations[0].Id
+ $requestBody = $requestBody -replace "#PIP2#", $TargetCloudService.NetworkProfile.LoadBalancerConfiguration[0].FrontendIPConfiguration[0].PublicIPAddressId
+ $requestBody = $requestBody -replace "#LBFE2#", $targetLB.properties.frontendIPConfigurations[0].Id
+ $requestBody = $requestBody -replace "#PIP1#", $SourceCloudService.NetworkProfile.LoadBalancerConfiguration[0].FrontendIPConfiguration[0].PublicIPAddressId
+
+ # Set up API URI and Headers
+ $uriToInvoke = "/subscriptions/$SubscriptionId/providers/Microsoft.Network/locations/$($SourceCloudService.Location)/setLoadBalancerFrontendPublicIpAddresses?api-version=$ApiVersion"
+
+ # Display the information about the VIP swap being made
+ Write-Host "Performing switch cloud service (VIP swap) action between $($SourceCloudService.Name) and $($TargetCloudService.Name)
+
+Request URI : $uriToInvoke
+POST
+
+Request Body :
+$requestBody"
+
+ # Invoke the VIP swap API
+ if ($PSCmdlet.ShouldProcess($SourceCloudService.Name + " <=> " + $TargetCloudService.Name,'VIP swap')) {
+ $result = Invoke-AzRestMethod -Method POST -Path $uriToInvoke -Payload $requestBody
+
+ if ($Async.IsPresent) {
+ Write-Host "Query the Azure-AsyncOperation URI from the response for operation progress"
+ return $result
+ }
+ else {
+ if ($result.StatusCode -eq 202) {
+ QueryVipSwapOperation($result)
+ }
+ else {
+ return $result
+ }
+ }
+ }
+ }
+}
+
+function QueryVipSwapOperation($result) {
+
+ $uri = [System.Uri]($result.Headers.GetValues('Azure-AsyncOperation')[0]);
+ $uriToInvoke = $uri.PathAndQuery
+ $retryLimit = 100
+ $retry = 0
+
+ while ($retry -lt $retryLimit) {
+ $statusResult = Invoke-AzRestMethod -Method GET -Path $uriToInvoke
+ if ($statusResult.StatusCode -eq 200) {
+ $status = $statusResult.Content | ConvertFrom-Json
+ if (-not $status.status.Equals("InProgress",[System.StringComparison]::OrdinalIgnoreCase)) {
+ return $statusResult
+ }
+
+ $retry++
+ Write-Progress -Activity "Performing VIP swap" -PercentComplete $retry -CurrentOperation "Status : InProgress"
+
+ Start-Sleep -Seconds 10
+ }
+ }
+}
+
+function ValidateLoadBalancerFrontEndIPConfiguration($lb) {
+
+ if ($lb.properties.frontendIPConfigurations.Count -eq 1) {
+ if (-not [string]::IsNullOrEmpty($lb.properties.frontendIPConfigurations[0].Id)) {
+ return $true;
+ }
+ }
+
+ return $false;
+}
+
+function ValidateCloudServicePublicIPAddress($cs) {
+
+ if ($cs.NetworkProfile.LoadBalancerConfiguration.Count -eq 1) {
+ if ($cs.NetworkProfile.LoadBalancerConfiguration[0].FrontendIPConfiguration.Count -eq 1) {
+ if (-not [string]::IsNullOrEmpty($cs.NetworkProfile.LoadBalancerConfiguration[0].FrontendIPConfiguration[0].PublicIPAddressId)) {
+ return $true;
+ }
+ }
+ }
+
+ return $false;
+}
+
+function GetCloudServiceLoadBalancer($parameters) {
+
+ # Set up API URI and Headers
+ $uriToInvoke = "/subscriptions/" + $parameters[0] + "/resourceGroups/" + $parameters[1] + "/providers/Microsoft.Network/loadBalancers/" + $parameters[2] + "?api-version=" + $parameters[3]
+ $lbResponse = Invoke-AzRestMethod -Method GET -Path $uriToInvoke
+ if ($lbResponse.StatusCode -ne 200) {
+ throw $lbResponse.Content
+ }
+
+ $lb = $lbResponse.Content | ConvertFrom-Json
+ return $lb
+}
+
+function GetVIPSwapRequestBody() {
+
+ return @"
+{
+ "frontendIPConfigurations": [
+ {
+ "id": "#LBFE1#",
+ "properties": {
+ "publicIPAddress": {
+ "id": "#PIP2#"
+ }
+ }
+ },
+ {
+ "id": "#LBFE2#",
+ "properties": {
+ "publicIPAddress": {
+ "id": "#PIP1#"
+ }
+ }
+ }
+ ]
+}
+"@
+}
+
diff --git a/src/CloudService/custom/readme.md b/src/CloudService/custom/readme.md
new file mode 100644
index 000000000000..c7a11b7717c3
--- /dev/null
+++ b/src/CloudService/custom/readme.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.CloudService` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.CloudService.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.CloudService` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.CloudService.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.CloudService.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.CloudService`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.CloudService`.
+- `Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.CloudService`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/CloudService/examples/Get-AzCloudService.md b/src/CloudService/examples/Get-AzCloudService.md
new file mode 100644
index 000000000000..56fac51e0b3c
--- /dev/null
+++ b/src/CloudService/examples/Get-AzCloudService.md
@@ -0,0 +1,47 @@
+### Example 1: Get all cloud service under a resource group
+
+```powershell
+PS C:\> Get-AzCloudService -ResourceGroupName "ContosOrg"
+
+ResourceGroupName Name Location ProvisioningState
+----------------- ---- -------- -----------------
+ContosOrg ContosoCS eastus2euap Succeeded
+ContosOrg ContosoCSTest eastus2euap Failed
+```
+
+This command gets all cloud services in resource group named ContosOrg
+
+### Example 2: Get cloud service
+
+```powershell
+PS C:\> Get-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+ResourceGroupName Name Location ProvisioningState
+----------------- ---- -------- -----------------
+ContosOrg ContosoCS eastus2euap Succeeded
+
+PS C:\> $cloudService = Get-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+PS C:\> $cloudService | Format-List
+ResourceGroupName : ContosOrg
+Configuration : xxxxxxxx
+ConfigurationUrl :
+ExtensionProfile : xxxxxxxx
+Id : xxxxxxxx
+Location : East US
+Name : ContosoCS
+NetworkProfile : xxxxxxxx
+OSProfile : xxxxxxxx
+PackageUrl : xxxxxxxx
+ProvisioningState : Succeeded
+RoleProfile : xxxxxxxx
+StartCloudService :
+Tag : {
+ "Owner": "Contos"
+ }
+Type : Microsoft.Compute/cloudServices
+UniqueId : xxxxxxxx
+UpgradeMode : Auto
+
+```
+
+This command gets cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Get-AzCloudServiceInstanceView.md b/src/CloudService/examples/Get-AzCloudServiceInstanceView.md
new file mode 100644
index 000000000000..41b8f56676f1
--- /dev/null
+++ b/src/CloudService/examples/Get-AzCloudServiceInstanceView.md
@@ -0,0 +1,52 @@
+### Example 1: Get cloud service instance view
+
+```powershell
+PS C:\>$cloudServiceInstanceView = Get-AzCloudServiceInstanceView -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+PS C:\>$cloudServiceInstanceView
+RoleInstanceStatusesSummary Statuses
+--------------------------- --------
+{{ProvisioningState/succeeded : 4}, {PowerState/started : 4}} {Provisioning succeeded, Started, Current Upgrade Domain of cloud service is -1., Max Upgrade Domain of cloud service is 1.}
+
+PS C:\>$cloudServiceInstanceView.ToJsonString()
+{
+ "roleInstance": {
+ "statusesSummary": [
+ {
+ "code": "ProvisioningState/succeeded",
+ "count": 4
+ },
+ {
+ "code": "PowerState/started",
+ "count": 4
+ }
+ ]
+ },
+ "statuses": [
+ {
+ "code": "ProvisioningState/succeeded",
+ "displayStatus": "Provisioning succeeded",
+ "level": "Info",
+ "time": "2020-10-28T13:26:48.8109686Z"
+ },
+ {
+ "code": "PowerState/started",
+ "displayStatus": "Started",
+ "level": "Info",
+ "time": "2020-10-28T13:26:48.8109686Z"
+ },
+ {
+ "code": "CurrentUpgradeDomain/-1",
+ "displayStatus": "Current Upgrade Domain of cloud service is -1.",
+ "level": "Info"
+ },
+ {
+ "code": "MaxUpgradeDomain/1",
+ "displayStatus": "Max Upgrade Domain of cloud service is 1.",
+ "level": "Info"
+ }
+ ]
+}
+```
+
+This cmdlet gets the instance view of the cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Get-AzCloudServiceNetworkInterfaces.md b/src/CloudService/examples/Get-AzCloudServiceNetworkInterfaces.md
new file mode 100644
index 000000000000..ca788eb60051
--- /dev/null
+++ b/src/CloudService/examples/Get-AzCloudServiceNetworkInterfaces.md
@@ -0,0 +1,25 @@
+### Example 1: Get network interfaces by a cloud service name
+```powershell
+PS C:\> Get-AzCloudServiceNetworkInterfaces -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+
+```
+
+Gets all the network interfaces for a given cloud service name.
+
+### Example 2: Get network interfaces by a cloud service object
+```powershell
+PS C:\> $cs = Get-AzCloudService -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+PS C:\> Get-AzCloudServiceNetworkInterfaces -CloudService $cs
+
+```
+
+Gets all the network interfaces for a given cloud service object.
+
+### Example 3: Get network interfaces by a cloud service object and role instance name.
+```powershell
+PS C:\> Get-AzCloudServiceNetworkInterfaces -CloudService $cs -RoleInstanceName WebRole1_IN_0
+
+```
+
+Gets all the network interfaces for a given cloud service object and role instance name.
+
diff --git a/src/CloudService/examples/Get-AzCloudServicePublicIPAddress.md b/src/CloudService/examples/Get-AzCloudServicePublicIPAddress.md
new file mode 100644
index 000000000000..014cfe35e3dc
--- /dev/null
+++ b/src/CloudService/examples/Get-AzCloudServicePublicIPAddress.md
@@ -0,0 +1,17 @@
+### Example 1: Get instance level public IP addresses for a given cloud service name.
+```powershell
+PS C:\> Get-AzCloudServicePublicIPAddress -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+
+```
+
+Gets the instance level public IP addresses for a given cloud service name.
+
+### Example 2: Get instance level public IP addresses for a given cloud service object.
+```powershell
+PS C:\> $cs = Get-AzCloudService -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+PS C:\> Get-AzCloudServicePublicIPAddress -CloudService $cs
+
+```
+
+Gets the instance level public IP addresses for a given cloud service object.
+
diff --git a/src/CloudService/examples/Get-AzCloudServiceRoleInstance.md b/src/CloudService/examples/Get-AzCloudServiceRoleInstance.md
new file mode 100644
index 000000000000..bb237b2fff71
--- /dev/null
+++ b/src/CloudService/examples/Get-AzCloudServiceRoleInstance.md
@@ -0,0 +1,28 @@
+### Example 1: Get all role instances
+
+```powershell
+PS C:\> Get-AzCloudServiceRoleInstance -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+Name Location SkuName SkuTier
+---- -------- ------- -------
+ContosoFrontEnd_IN_0 eastus2euap Standard_D1_v2 Standard
+ContosoFrontEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+ContosoBackEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+ContosoBackEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+
+```
+
+This command gets the properties of all role instances of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
+
+### Example 2: Get properties for single role instance
+
+```powershell
+PS C:\> Get-AzCloudServiceRoleInstance -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+Name Location SkuName SkuTier
+---- -------- ------- -------
+ContosoFrontEnd_IN_0 eastus2euap Standard_D1_v2 Standard
+
+```
+
+This command gets the properties of the role instance named ContosoFrontEnd_IN_0 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Get-AzCloudServiceRoleInstanceRemoteDesktopFile.md b/src/CloudService/examples/Get-AzCloudServiceRoleInstanceRemoteDesktopFile.md
new file mode 100644
index 000000000000..0fc8d0989e58
--- /dev/null
+++ b/src/CloudService/examples/Get-AzCloudServiceRoleInstanceRemoteDesktopFile.md
@@ -0,0 +1,5 @@
+### Example 1: Get an RDP file
+```powershell
+PS C:\> Get-AzCloudServiceRoleInstanceRemoteDesktopFile -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0" -OutFile "C:\temp\ContosoFrontEnd_IN_0.rdp"
+```
+This command gets an RDP file for the role instance named ContosoFrontEnd\_IN\_0 of cloud Service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Get-AzCloudServiceRoleInstanceView.md b/src/CloudService/examples/Get-AzCloudServiceRoleInstanceView.md
new file mode 100644
index 000000000000..d4103954601a
--- /dev/null
+++ b/src/CloudService/examples/Get-AzCloudServiceRoleInstanceView.md
@@ -0,0 +1,12 @@
+### Example 1: Get instance view details for cloud service role instance
+
+```powershell
+PS C:\> Get-AzCloudServiceRoleInstanceView -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+Statuses PlatformFaultDomain PlatformUpdateDomain
+-------- ------------------- --------------------
+{RoleStateStarted} 0 0
+
+```
+
+This cmdlet gets the instance view of the role instance named ContosoFrontEnd_IN_0 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Invoke-AzCloudServiceRebuild.md b/src/CloudService/examples/Invoke-AzCloudServiceRebuild.md
new file mode 100644
index 000000000000..d5fac637b385
--- /dev/null
+++ b/src/CloudService/examples/Invoke-AzCloudServiceRebuild.md
@@ -0,0 +1,16 @@
+### Example 1: Rebuild role instances of cloud service
+
+```powershell
+PS C:\> $roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
+PS C:\> Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
+```
+
+This command rebuilds 2 role instances ContosoFrontEnd_IN_0 and ContosoBackEnd_IN_1 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
+
+### Example 2: Rebuild all roles of cloud service
+
+```powershell
+PS C:\> Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "*"
+```
+
+This command rebuilds all role instances of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Invoke-AzCloudServiceReimage.md b/src/CloudService/examples/Invoke-AzCloudServiceReimage.md
new file mode 100644
index 000000000000..efab6ff9392a
--- /dev/null
+++ b/src/CloudService/examples/Invoke-AzCloudServiceReimage.md
@@ -0,0 +1,16 @@
+### Example 1: Reimage role instances of cloud service
+
+```powershell
+PS C:\> $roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
+PS C:\> Invoke-AzCloudServiceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
+```
+
+This command reimages 2 role instances ContosoFrontEnd_IN_0 and ContosoBackEnd_IN_1 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
+
+### Example 2: Reimage all roles of cloud service
+
+```powershell
+PS C:\> Invoke-AzCloudServiceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "*"
+```
+
+This command reimages all role instances of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Invoke-AzCloudServiceRoleInstanceRebuild.md b/src/CloudService/examples/Invoke-AzCloudServiceRoleInstanceRebuild.md
new file mode 100644
index 000000000000..8f2c0844a9f6
--- /dev/null
+++ b/src/CloudService/examples/Invoke-AzCloudServiceRoleInstanceRebuild.md
@@ -0,0 +1,7 @@
+### Example 1: Rebuild role instance of a cloud service
+
+```powershell
+PS C:\> Invoke-AzCloudServiceRoleInstanceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+```
+
+This command reimages role instance named ContosoFrontEnd_IN_0 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Invoke-AzCloudServiceRoleInstanceReimage.md b/src/CloudService/examples/Invoke-AzCloudServiceRoleInstanceReimage.md
new file mode 100644
index 000000000000..c7a6976473ea
--- /dev/null
+++ b/src/CloudService/examples/Invoke-AzCloudServiceRoleInstanceReimage.md
@@ -0,0 +1,7 @@
+### Example 1: Reimage role instance of a cloud service
+
+```powershell
+PS C:\> Invoke-AzCloudServiceRoleInstanceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+```
+
+This command reimages role instance named ContosoFrontEnd_IN_0 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/New-AzCloudService.md b/src/CloudService/examples/New-AzCloudService.md
new file mode 100644
index 000000000000..01906317c931
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudService.md
@@ -0,0 +1,152 @@
+### Example 1: Create new cloud service with single role
+
+```powershell
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile
+```
+
+Above set of commands creates a cloud service with single role
+
+### Example 2: Create new cloud service with single role and RDP extension
+
+```powershell
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosoOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Create RDP extension object
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $extension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+PS C:\> $extensionProfile = @{extension = @($extension)}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -ExtensionProfile $extensionProfile
+```
+
+Above set of commands creates a cloud service with single role and RDP extension
+
+### Example 3: Create new cloud service with single role and certificate from key vault
+
+```powershell
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create OS profile object
+$keyVault = Get-AzKeyVault -ResourceGroupName ContosOrg -VaultName ContosKeyVault
+$certificate=Get-AzKeyVaultCertificate -VaultName ContosKeyVault -Name ContosCert
+$secretGroup = New-AzCloudServiceVaultSecretGroupObject -Id $keyVault.ResourceId -CertificateUrl $certificate.SecretId
+$osProfile = @{secret = @($secretGroup)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -OSProfile $osProfile
+```
+
+Above set of commands creates a cloud service with single role and certificate from key vault.
+
+### Example 4: Create new cloud service with multiple roles and extensions
+
+```powershell
+# Create role profile object
+PS C:\> $role1 = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $role2 = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoBackend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role1, $role2)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Create RDP extension object
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $rdpExtension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+
+# Create Geneva extension object
+PS C:\> $genevaExtension = New-AzCloudServiceExtensionObject -Name GenevaExtension -Publisher Microsoft.Azure.Geneva -Type GenevaMonitoringPaaS -TypeHandlerVersion "2.14.0.2"
+PS C:\> $extensionProfile = @{extension = @($rdpExtension, $genevaExtension)}
+
+# Add tags
+$tag=@{"Owner" = "Contoso"}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -ExtensionProfile $extensionProfile `
+ -Tag $tag
+```
+
+Above set of commands creates a cloud service with single role and certificate from key vault.
diff --git a/src/CloudService/examples/New-AzCloudServiceDiagnosticsExtension.md b/src/CloudService/examples/New-AzCloudServiceDiagnosticsExtension.md
new file mode 100644
index 000000000000..00068fbb2518
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudServiceDiagnosticsExtension.md
@@ -0,0 +1,9 @@
+### Example 1: Create diagnostics extension object
+
+```powershell
+PS C:\> $storageAccountKey = Get-AzStorageAccountKey -ResourceGroupName "ContosOrg" -Name "ContosSA"
+PS C:\> $configFile = ""
+PS C:\> $extension = New-AzCloudServiceDiagnosticsExtension -Name "WADExtension" -ResourceGroupName "ContosOrg" -CloudServiceName "ContosCS" -StorageAccountName "ContosSA" -StorageAccountKey $storageAccountKey[0].Value -DiagnosticsConfigurationPath $configFile -TypeHandlerVersion "1.5" -AutoUpgradeMinorVersion $true
+```
+
+This command creates diagnostics extension object which is used for creating or updating a cloud service. For more details see New-AzCloudService.
diff --git a/src/CloudService/examples/New-AzCloudServiceExtensionObject.md b/src/CloudService/examples/New-AzCloudServiceExtensionObject.md
new file mode 100644
index 000000000000..fc68448de782
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudServiceExtensionObject.md
@@ -0,0 +1,7 @@
+### Example 1: Create Geneva extension object
+
+```powershell
+PS C:\> $extension = New-AzCloudServiceExtensionObject -Name "GenevaExtension" -Publisher "Microsoft.Azure.Geneva" -Type "GenevaMonitoringPaaS" -TypeHandlerVersion "2.14.0.2"
+```
+
+This command creates Geneva extension object which is used for creating or updating a cloud service. For more details see New-AzCloudService.
diff --git a/src/CloudService/examples/New-AzCloudServiceLoadBalancerConfigurationObject.md b/src/CloudService/examples/New-AzCloudServiceLoadBalancerConfigurationObject.md
new file mode 100644
index 000000000000..4a4976945c09
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudServiceLoadBalancerConfigurationObject.md
@@ -0,0 +1,9 @@
+### Example 1: Create load balancer configuration object
+
+```powershell
+PS C:\> $publicIP = Get-AzPublicIpAddress -ResourceGroupName 'ContosoOrg' -Name 'ContosoPublicIP'
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIP.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+```
+
+This command creates load balancer configuration object which is used for creating or updating a cloud service. For more details see New-AzCloudService.
diff --git a/src/CloudService/examples/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.md b/src/CloudService/examples/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.md
new file mode 100644
index 000000000000..e9ebb4190672
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.md
@@ -0,0 +1,9 @@
+### Example 1: Create load balancer frontend IP configuration object
+
+```powershell
+PS C:\> $publicIP = Get-AzPublicIpAddress -ResourceGroupName 'ContosoOrg' -Name 'ContosoPublicIP'
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+```
+
+This command creates load balancer frontend IP configuration object which is used for creating or updating a cloud service. For more details see New-AzCloudService.
diff --git a/src/CloudService/examples/New-AzCloudServiceRemoteDesktopExtensionObject.md b/src/CloudService/examples/New-AzCloudServiceRemoteDesktopExtensionObject.md
new file mode 100644
index 000000000000..8d350a7a5848
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudServiceRemoteDesktopExtensionObject.md
@@ -0,0 +1,9 @@
+### Example 1: Create remote desktop extension object
+
+```powershell
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $extension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+```
+
+This command creates remote desktop extension object which is used for creating or updating a cloud service. For more details see New-AzCloudService.
diff --git a/src/CloudService/examples/New-AzCloudServiceRoleProfilePropertiesObject.md b/src/CloudService/examples/New-AzCloudServiceRoleProfilePropertiesObject.md
new file mode 100644
index 000000000000..7b9a3aca9dc1
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudServiceRoleProfilePropertiesObject.md
@@ -0,0 +1,7 @@
+### Example 1: Create role profile properties object
+
+```powershell
+$role = New-AzCloudServiceRoleProfilePropertiesObject -Name 'WebRole' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+```
+
+This command creates role profile properties object which is used for creating or updating a cloud service. For more details see New-AzCloudService.
diff --git a/src/CloudService/examples/New-AzCloudServiceVaultSecretGroupObject.md b/src/CloudService/examples/New-AzCloudServiceVaultSecretGroupObject.md
new file mode 100644
index 000000000000..ba4082640d05
--- /dev/null
+++ b/src/CloudService/examples/New-AzCloudServiceVaultSecretGroupObject.md
@@ -0,0 +1,9 @@
+### Example 1: Create vault secret group object
+
+```powershell
+$keyVault = Get-AzKeyVault -VaultName 'ContosoKeyVault'
+$certificate = Get-AzKeyVaultCertificate -VaultName 'ContosoKeyVault' -Name 'ContosoCert'
+$secretGroup = New-AzCloudServiceVaultSecretGroupObject -Id $keyVault.ResourceId -CertificateUrl $certificate.SecretId
+```
+
+This command creates vault secret group object which is used for creating or updating a cloud service. For more details see New-AzCloudService.
diff --git a/src/CloudService/examples/Remove-AzCloudService.md b/src/CloudService/examples/Remove-AzCloudService.md
new file mode 100644
index 000000000000..c749cda3af41
--- /dev/null
+++ b/src/CloudService/examples/Remove-AzCloudService.md
@@ -0,0 +1,7 @@
+### Example 1: Remove a cloud service
+
+```powershell
+PS C:\> Remove-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
+```
+
+This command removes the cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Remove-AzCloudServiceRoleInstance.md b/src/CloudService/examples/Remove-AzCloudServiceRoleInstance.md
new file mode 100644
index 000000000000..66f252731911
--- /dev/null
+++ b/src/CloudService/examples/Remove-AzCloudServiceRoleInstance.md
@@ -0,0 +1,7 @@
+### Example 1: Remove a cloud service role instance
+
+```powershell
+PS C:\> Remove-AzCloudServiceInstance -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "ContosoFrontEnd_IN_0"
+```
+
+This command removes the role instance named ContosoFrontEnd_IN_0 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Restart-AzCloudService.md b/src/CloudService/examples/Restart-AzCloudService.md
new file mode 100644
index 000000000000..a17a25022cdb
--- /dev/null
+++ b/src/CloudService/examples/Restart-AzCloudService.md
@@ -0,0 +1,16 @@
+### Example 1: Restart role instances of cloud service
+
+```powershell
+PS C:\> $roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
+PS C:\> Restart-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
+```
+
+This command restarts 2 role instances ContosoFrontEnd_IN_0 and ContosoBackEnd_IN_1 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
+
+### Example 2: Restart all roles of cloud service
+
+```powershell
+PS C:\> Restart-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "*"
+```
+
+This command restarts all role instances of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Restart-AzCloudServiceRoleInstance.md b/src/CloudService/examples/Restart-AzCloudServiceRoleInstance.md
new file mode 100644
index 000000000000..79f18767eeee
--- /dev/null
+++ b/src/CloudService/examples/Restart-AzCloudServiceRoleInstance.md
@@ -0,0 +1,7 @@
+### Example 1: Restart role instance of a cloud service
+
+```powershell
+PS C:\> Restart-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+```
+
+This command restarts role instance named ContosoFrontEnd_IN_0 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Set-AzCloudServiceUpdateDomain.md b/src/CloudService/examples/Set-AzCloudServiceUpdateDomain.md
new file mode 100644
index 000000000000..d7eee18f2b72
--- /dev/null
+++ b/src/CloudService/examples/Set-AzCloudServiceUpdateDomain.md
@@ -0,0 +1,7 @@
+### Example 1: Update role instance in update domain
+
+```powershell
+PS C:\> Set-AzCloudServiceUpdateDomain -CloudServiceName "ContosoCS" -ResourceGroupName "ContosOrg" -UpdateDomain 0
+```
+
+This command updates role instances in update domain 0 of cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/examples/Start-AzCloudService.md b/src/CloudService/examples/Start-AzCloudService.md
new file mode 100644
index 000000000000..26ecb224e865
--- /dev/null
+++ b/src/CloudService/examples/Start-AzCloudService.md
@@ -0,0 +1,7 @@
+### Example 1: Start cloud service
+
+```powershell
+PS C:\> Start-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+```
+
+This command starts all the role instances that belong to the the cloud service named ContosoCS.
diff --git a/src/CloudService/examples/Stop-AzCloudService.md b/src/CloudService/examples/Stop-AzCloudService.md
new file mode 100644
index 000000000000..aeb92687912f
--- /dev/null
+++ b/src/CloudService/examples/Stop-AzCloudService.md
@@ -0,0 +1,7 @@
+### Example 1: Stop cloud service
+
+```powershell
+PS C:\> Stop-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+```
+
+This command stops all the role instances that belong to the the cloud service named ContosoCS.
diff --git a/src/CloudService/examples/Switch-AzCloudService.md b/src/CloudService/examples/Switch-AzCloudService.md
new file mode 100644
index 000000000000..8308c0075e14
--- /dev/null
+++ b/src/CloudService/examples/Switch-AzCloudService.md
@@ -0,0 +1,17 @@
+### Example 1: Switch cloud service using name
+```powershell
+PS C:\> Switch-AzCloudService -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+
+```
+
+Above command invokes the vipswap operation on the Cloud service with name 'BService' and will perform the operation once the user confirms the action on the confirmation prompt. 'BService' with be swapped with its swappable cloud service.
+
+### Example 2: Switch cloud service using cloud service object
+```powershell
+PS C:\> $cs = Get-AzCloudService -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+PS C:\> Switch-AzCloudService -CloudService $cs
+
+```
+
+Above command invokes the vipswap operation on the Cloud service with name 'BService' and will perform the operation once the user confirms the action on the confirmation prompt. 'BService' with be swapped with its swappable cloud service.
+
diff --git a/src/CloudService/examples/Update-AzCloudService.md b/src/CloudService/examples/Update-AzCloudService.md
new file mode 100644
index 000000000000..36ef0f9af194
--- /dev/null
+++ b/src/CloudService/examples/Update-AzCloudService.md
@@ -0,0 +1,62 @@
+### Example 1: Add RDP extension to existing cloud service
+
+```powershell
+# Create RDP extension object
+PS C:\> $rdpExtension = New-AzCloudServiceRemoteDesktopExtensionObject -Name "RDPExtension" -Credential $credential -Expiration $expiration -TypeHandlerVersion "1.2.1"
+# Get existing cloud service
+PS C:\> $cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
+# Add RDP extension to existing cloud service extension object
+PS C:\> $cloudService.ExtensionProfile.Extension = $cloudService.ExtensionProfile.Extension + $rdpExtension
+# Update cloud service
+PS C:\> $cloudService | Update-AzCloudService
+```
+
+Above set of commands adds a RDP extension to already existing cloud service named ContosoCS that belongs to the resource group named ContosOrg.
+
+### Example 2: Remove all extensions from cloud service
+
+```powershell
+# Get existing cloud service
+PS C:\> $cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
+# Set extension to empty list
+PS C:\> $cloudService.ExtensionProfile.Extension = @()
+# Update cloud service
+PS C:\> $cloudService | Update-AzCloudService
+```
+
+Above set of commands removes all extensions from existing cloud service named ContosoCS that belongs to the resource group named ContosOrg.
+
+### Example 3: Remove RDP extension from cloud service
+
+```powershell
+# Get existing cloud service
+PS C:\> $cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
+# Remove extension by name RDPExtension
+PS C:\> $cloudService.ExtensionProfile.Extension = $cloudService.ExtensionProfile.Extension | Where-Object { $_.Name -ne "RDPExtension" }
+# Update cloud service
+PS C:\> $cloudService | Update-AzCloudService
+```
+
+Above set of commands removes RDP extension from existing cloud service named ContosoCS that belongs to the resource group named ContosOrg.
+
+### Example 4: Scale-Out / Scale-In role instances
+
+```powershell
+# Get existing cloud service
+PS C:\> $cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
+
+# Scale-out all role instance count by 1
+PS C:\> $cloudService.RoleProfile.Role | ForEach-Object {$_.SkuCapacity += 1}
+
+# Scale-in ContosoFrontend role instance count by 1
+PS C:\> $role = $cloudService.RoleProfile.Role | Where-Object {$_.Name -eq "ContosoFrontend"}
+PS C:\> $role.SkuCapacity -= 1
+
+# Update cloud service configuration as per the new role instance count
+PS C:\> $cloudService.Configuration = $configuration
+
+# Update cloud service
+PS C:\> $cloudService | Update-AzCloudService
+```
+
+Above set of commands shows how to scale-out and scale-in role instance count for cloud service named ContosoCS that belongs to the resource group named ContosOrg.
diff --git a/src/CloudService/export-surface.ps1 b/src/CloudService/export-surface.ps1
new file mode 100644
index 000000000000..f0f359e6f0e4
--- /dev/null
+++ b/src/CloudService/export-surface.ps1
@@ -0,0 +1,40 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.CloudService.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.CloudService'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/CloudService/exports/Get-AzCloudService.ps1 b/src/CloudService/exports/Get-AzCloudService.ps1
new file mode 100644
index 000000000000..78ffb8dfb9e0
--- /dev/null
+++ b/src/CloudService/exports/Get-AzCloudService.ps1
@@ -0,0 +1,201 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Display information about a cloud service.
+.Description
+Display information about a cloud service.
+.Example
+PS C:\> Get-AzCloudService -ResourceGroupName "ContosOrg"
+
+ResourceGroupName Name Location ProvisioningState
+----------------- ---- -------- -----------------
+ContosOrg ContosoCS eastus2euap Succeeded
+ContosOrg ContosoCSTest eastus2euap Failed
+.Example
+PS C:\> Get-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+ResourceGroupName Name Location ProvisioningState
+----------------- ---- -------- -----------------
+ContosOrg ContosoCS eastus2euap Succeeded
+
+PS C:\> $cloudService = Get-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+PS C:\> $cloudService | Format-List
+ResourceGroupName : ContosOrg
+Configuration : xxxxxxxx
+ConfigurationUrl :
+ExtensionProfile : xxxxxxxx
+Id : xxxxxxxx
+Location : East US
+Name : ContosoCS
+NetworkProfile : xxxxxxxx
+OSProfile : xxxxxxxx
+PackageUrl : xxxxxxxx
+ProvisioningState : Succeeded
+RoleProfile : xxxxxxxx
+StartCloudService :
+Tag : {
+ "Owner": "Contos"
+ }
+Type : Microsoft.Compute/cloudServices
+UniqueId : xxxxxxxx
+UpgradeMode : Auto
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudService
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudservice
+#>
+function Get-AzCloudService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudService])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('CloudServiceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [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='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudService_Get';
+ GetViaIdentity = 'Az.CloudService.private\Get-AzCloudService_GetViaIdentity';
+ List = 'Az.CloudService.private\Get-AzCloudService_List';
+ List1 = 'Az.CloudService.private\Get-AzCloudService_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Get-AzCloudServiceInstanceView.ps1 b/src/CloudService/exports/Get-AzCloudServiceInstanceView.ps1
new file mode 100644
index 000000000000..8cc41e3e89bf
--- /dev/null
+++ b/src/CloudService/exports/Get-AzCloudServiceInstanceView.ps1
@@ -0,0 +1,183 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets the status of a cloud service.
+.Description
+Gets the status of a cloud service.
+.Example
+PS C:\>$cloudServiceInstanceView = Get-AzCloudServiceInstanceView -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+PS C:\>$cloudServiceInstanceView
+RoleInstanceStatusesSummary Statuses
+--------------------------- --------
+{{ProvisioningState/succeeded : 4}, {PowerState/started : 4}} {Provisioning succeeded, Started, Current Upgrade Domain of cloud service is -1., Max Upgrade Domain of cloud service is 1.}
+
+PS C:\>$cloudServiceInstanceView.ToJsonString()
+{
+ "roleInstance": {
+ "statusesSummary": [
+ {
+ "code": "ProvisioningState/succeeded",
+ "count": 4
+ },
+ {
+ "code": "PowerState/started",
+ "count": 4
+ }
+ ]
+ },
+ "statuses": [
+ {
+ "code": "ProvisioningState/succeeded",
+ "displayStatus": "Provisioning succeeded",
+ "level": "Info",
+ "time": "2020-10-28T13:26:48.8109686Z"
+ },
+ {
+ "code": "PowerState/started",
+ "displayStatus": "Started",
+ "level": "Info",
+ "time": "2020-10-28T13:26:48.8109686Z"
+ },
+ {
+ "code": "CurrentUpgradeDomain/-1",
+ "displayStatus": "Current Upgrade Domain of cloud service is -1.",
+ "level": "Info"
+ },
+ {
+ "code": "MaxUpgradeDomain/1",
+ "displayStatus": "Max Upgrade Domain of cloud service is 1.",
+ "level": "Info"
+ }
+ ]
+}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceInstanceView
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceinstanceview
+#>
+function Get-AzCloudServiceInstanceView {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceInstanceView])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${CloudServiceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceInstanceView_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Get-AzCloudServiceNetworkInterfaces.ps1 b/src/CloudService/exports/Get-AzCloudServiceNetworkInterfaces.ps1
new file mode 100644
index 000000000000..3e3ec4fba839
--- /dev/null
+++ b/src/CloudService/exports/Get-AzCloudServiceNetworkInterfaces.ps1
@@ -0,0 +1,157 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get the network interfaces of a cloud service.
+.Description
+Get the network interfaces of a cloud service.
+.Example
+PS C:\> Get-AzCloudServiceNetworkInterfaces -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+
+.Example
+PS C:\> $cs = Get-AzCloudService -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+PS C:\> Get-AzCloudServiceNetworkInterfaces -CloudService $cs
+
+.Example
+PS C:\> Get-AzCloudServiceNetworkInterfaces -CloudService $cs -RoleInstanceName WebRole1_IN_0
+
+
+.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.
+
+CLOUDSERVICE : CloudService instance.
+ Location : Resource location.
+ [Configuration ]: Specifies the XML service configuration (.cscfg) for the cloud service.
+ [ConfigurationUrl ]: Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a write-only property and is not returned in GET calls.
+ [ExtensionProfile ]: Describes a cloud service extension profile.
+ [Extension ]: List of extensions for the cloud service.
+ [AutoUpgradeMinorVersion ]: Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available.
+ [ForceUpdateTag ]: Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension without changing any of the public or protected settings. If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not
+ [Name ]: The name of the extension.
+ [ProtectedSetting ]: Protected settings for the extension which are encrypted before sent to the role instance.
+ [ProtectedSettingFromKeyVaultSecretUrl ]:
+ [Publisher ]: The name of the extension handler publisher.
+ [RolesAppliedTo ]: Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied to all roles in the cloud service.
+ [Setting ]: Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension.
+ [SourceVaultId ]: Resource Id
+ [Type ]: Specifies the type of the extension.
+ [TypeHandlerVersion ]: Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor version of the specified major version is selected. If a major version number and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role instance.
+ [NetworkProfile ]: Network Profile for the cloud service.
+ [LoadBalancerConfiguration ]: The list of load balancer configurations for the cloud service.
+ [FrontendIPConfiguration ]: List of IP
+ [Name ]:
+ [PrivateIPAddress ]: The private IP address referenced by the cloud service.
+ [PublicIPAddressId ]: Resource Id
+ [SubnetId ]: Resource Id
+ [Name ]: Resource Name
+ [SwappableCloudService ]:
+ [Id ]: Resource Id
+ [OSProfile ]: Describes the OS profile for the cloud service.
+ [Secret ]: Specifies set of certificates that should be installed onto the role instances.
+ [SourceVaultId ]: Resource Id
+ [VaultCertificate ]: The list of key vault references in SourceVault which contain certificates.
+ [CertificateUrl ]: This is the URL of a certificate that has been uploaded to Key Vault as a secret.
+ [PackageUrl ]: Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a write-only property and is not returned in GET calls.
+ [RoleProfile ]: Describes the role profile for the cloud service.
+ [Role ]: List of roles for the cloud service.
+ [Name ]: Resource name.
+ [SkuCapacity ]: Specifies the number of role instances in the cloud service.
+ [SkuName ]: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete and recreate the cloud service or move back to the old sku.
+ [SkuTier ]: Specifies the tier of the cloud service. Possible Values are
**Standard**
**Basic**
+ [StartCloudService ]: (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. If false, the service model is still deployed, but the code is not run immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs charges, even if it is poweredoff.
+ [Tag ]: Resource tags.
+ [(Any) ]: This indicates any property can be added to this object.
+ [UpgradeMode ]: 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
**Auto**
**Manual**
**Simultaneous**
If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If set to Auto, the update is automatically applied to each update domain in sequence.
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-AzCloudServiceNetworkInterfaces
+#>
+function Get-AzCloudServiceNetworkInterfaces {
+[CmdletBinding(DefaultParameterSetName='CloudServiceName', PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='CloudService', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudService]
+ # CloudService instance.
+ # To construct, see NOTES section for CLOUDSERVICE properties and create a hash table.
+ ${CloudService},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # RoleInstanceName.
+ ${RoleInstanceName},
+
+ [Parameter(ParameterSetName='CloudServiceName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # ResourceGroupName.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='CloudServiceName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # CloudServiceName.
+ ${CloudServiceName}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ CloudService = 'Az.CloudService.custom\Get-AzCloudServiceNetworkInterfaces';
+ CloudServiceName = 'Az.CloudService.custom\Get-AzCloudServiceNetworkInterfaces';
+ }
+ if (('CloudService', 'CloudServiceName') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Get-AzCloudServicePublicIPAddress.ps1 b/src/CloudService/exports/Get-AzCloudServicePublicIPAddress.ps1
new file mode 100644
index 000000000000..bdff2148da06
--- /dev/null
+++ b/src/CloudService/exports/Get-AzCloudServicePublicIPAddress.ps1
@@ -0,0 +1,148 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Get the public IP address of a cloud service.
+.Description
+Get the public IP address of a cloud service.
+.Example
+PS C:\> Get-AzCloudServicePublicIPAddress -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+
+.Example
+PS C:\> $cs = Get-AzCloudService -ResourceGroupName "BRGThree" -CloudServiceName BService -SubscriptionId 1133e0eb-b53c-1234-b478-2eac8f04afca
+PS C:\> Get-AzCloudServicePublicIPAddress -CloudService $cs
+
+
+.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.
+
+CLOUDSERVICE : CloudService instance.
+ Location : Resource location.
+ [Configuration ]: Specifies the XML service configuration (.cscfg) for the cloud service.
+ [ConfigurationUrl ]: Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a write-only property and is not returned in GET calls.
+ [ExtensionProfile ]: Describes a cloud service extension profile.
+ [Extension ]: List of extensions for the cloud service.
+ [AutoUpgradeMinorVersion ]: Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available.
+ [ForceUpdateTag ]: Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension without changing any of the public or protected settings. If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not
+ [Name ]: The name of the extension.
+ [ProtectedSetting ]: Protected settings for the extension which are encrypted before sent to the role instance.
+ [ProtectedSettingFromKeyVaultSecretUrl ]:
+ [Publisher ]: The name of the extension handler publisher.
+ [RolesAppliedTo ]: Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied to all roles in the cloud service.
+ [Setting ]: Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension.
+ [SourceVaultId ]: Resource Id
+ [Type ]: Specifies the type of the extension.
+ [TypeHandlerVersion ]: Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor version of the specified major version is selected. If a major version number and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role instance.
+ [NetworkProfile ]: Network Profile for the cloud service.
+ [LoadBalancerConfiguration ]: The list of load balancer configurations for the cloud service.
+ [FrontendIPConfiguration ]: List of IP
+ [Name ]:
+ [PrivateIPAddress ]: The private IP address referenced by the cloud service.
+ [PublicIPAddressId ]: Resource Id
+ [SubnetId ]: Resource Id
+ [Name ]: Resource Name
+ [SwappableCloudService ]:
+ [Id ]: Resource Id
+ [OSProfile ]: Describes the OS profile for the cloud service.
+ [Secret ]: Specifies set of certificates that should be installed onto the role instances.
+ [SourceVaultId ]: Resource Id
+ [VaultCertificate ]: The list of key vault references in SourceVault which contain certificates.
+ [CertificateUrl ]: This is the URL of a certificate that has been uploaded to Key Vault as a secret.
+ [PackageUrl ]: Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a write-only property and is not returned in GET calls.
+ [RoleProfile ]: Describes the role profile for the cloud service.
+ [Role ]: List of roles for the cloud service.
+ [Name ]: Resource name.
+ [SkuCapacity ]: Specifies the number of role instances in the cloud service.
+ [SkuName ]: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete and recreate the cloud service or move back to the old sku.
+ [SkuTier ]: Specifies the tier of the cloud service. Possible Values are
**Standard**
**Basic**
+ [StartCloudService ]: (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. If false, the service model is still deployed, but the code is not run immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs charges, even if it is poweredoff.
+ [Tag ]: Resource tags.
+ [(Any) ]: This indicates any property can be added to this object.
+ [UpgradeMode ]: 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
**Auto**
**Manual**
**Simultaneous**
If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If set to Auto, the update is automatically applied to each update domain in sequence.
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-AzCloudServicePublicIPAddress
+#>
+function Get-AzCloudServicePublicIPAddress {
+[CmdletBinding(DefaultParameterSetName='CloudServiceName', PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='CloudServiceName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # ResourceGroupName.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='CloudServiceName', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # CloudServiceName.
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='CloudService', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudService]
+ # CloudService instance.
+ # To construct, see NOTES section for CLOUDSERVICE properties and create a hash table.
+ ${CloudService}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ CloudServiceName = 'Az.CloudService.custom\Get-AzCloudServicePublicIPAddress';
+ CloudService = 'Az.CloudService.custom\Get-AzCloudServicePublicIPAddress';
+ }
+ if (('CloudServiceName', 'CloudService') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Get-AzCloudServiceRoleInstance.ps1 b/src/CloudService/exports/Get-AzCloudServiceRoleInstance.ps1
new file mode 100644
index 000000000000..154eea11eace
--- /dev/null
+++ b/src/CloudService/exports/Get-AzCloudServiceRoleInstance.ps1
@@ -0,0 +1,193 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a role instance from a cloud service.
+.Description
+Gets a role instance from a cloud service.
+.Example
+PS C:\> Get-AzCloudServiceRoleInstance -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+Name Location SkuName SkuTier
+---- -------- ------- -------
+ContosoFrontEnd_IN_0 eastus2euap Standard_D1_v2 Standard
+ContosoFrontEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+ContosoBackEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+ContosoBackEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+
+.Example
+PS C:\> Get-AzCloudServiceRoleInstance -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+Name Location SkuName SkuTier
+---- -------- ------- -------
+ContosoFrontEnd_IN_0 eastus2euap Standard_D1_v2 Standard
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstance
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceroleinstance
+#>
+function Get-AzCloudServiceRoleInstance {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstance])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [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='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.InstanceViewTypes])]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Query')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.InstanceViewTypes]
+ # The expand expression to apply to the operation.
+ ${Expand},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceRoleInstance_Get';
+ GetViaIdentity = 'Az.CloudService.private\Get-AzCloudServiceRoleInstance_GetViaIdentity';
+ List = 'Az.CloudService.private\Get-AzCloudServiceRoleInstance_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Get-AzCloudServiceRoleInstanceRemoteDesktopFile.ps1 b/src/CloudService/exports/Get-AzCloudServiceRoleInstanceRemoteDesktopFile.ps1
new file mode 100644
index 000000000000..ab25a13683d2
--- /dev/null
+++ b/src/CloudService/exports/Get-AzCloudServiceRoleInstanceRemoteDesktopFile.ps1
@@ -0,0 +1,157 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a remote desktop file for a role instance in a cloud service.
+.Description
+Gets a remote desktop file for a role instance in a cloud service.
+.Example
+PS C:\> Get-AzCloudServiceRoleInstanceRemoteDesktopFile -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0" -OutFile "C:\temp\ContosoFrontEnd_IN_0.rdp"
+
+.Outputs
+System.Boolean
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceroleinstanceremotedesktopfile
+#>
+function Get-AzCloudServiceRoleInstanceRemoteDesktopFile {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter()]
+ [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(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Path to write output file to
+ ${OutFile},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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]
+ # 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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceRoleInstanceRemoteDesktopFile_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Get-AzCloudServiceRoleInstanceView.ps1 b/src/CloudService/exports/Get-AzCloudServiceRoleInstanceView.ps1
new file mode 100644
index 000000000000..504aedefeab5
--- /dev/null
+++ b/src/CloudService/exports/Get-AzCloudServiceRoleInstanceView.ps1
@@ -0,0 +1,149 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Retrieves information about the run-time state of a role instance in a cloud service.
+.Description
+Retrieves information about the run-time state of a role instance in a cloud service.
+.Example
+PS C:\> Get-AzCloudServiceRoleInstanceView -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+Statuses PlatformFaultDomain PlatformUpdateDomain
+-------- ------------------- --------------------
+{RoleStateStarted} 0 0
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstanceView
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceroleinstanceview
+#>
+function Get-AzCloudServiceRoleInstanceView {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstanceView])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter()]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceRoleInstanceView_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Invoke-AzCloudServiceRebuild.ps1 b/src/CloudService/exports/Invoke-AzCloudServiceRebuild.ps1
new file mode 100644
index 000000000000..4e03655c708a
--- /dev/null
+++ b/src/CloudService/exports/Invoke-AzCloudServiceRebuild.ps1
@@ -0,0 +1,191 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.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
+PS C:\> $roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
+PS C:\> Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
+.Example
+PS C:\> 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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/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)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='RebuildExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='RebuildExpanded')]
+ [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
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(Mandatory)]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ RebuildExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceRebuild_RebuildExpanded';
+ RebuildViaIdentityExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceRebuild_RebuildViaIdentityExpanded';
+ }
+ if (('RebuildExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Invoke-AzCloudServiceReimage.ps1 b/src/CloudService/exports/Invoke-AzCloudServiceReimage.ps1
new file mode 100644
index 000000000000..1beee0e5fa1f
--- /dev/null
+++ b/src/CloudService/exports/Invoke-AzCloudServiceReimage.ps1
@@ -0,0 +1,190 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Description
+Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Example
+PS C:\> $roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
+PS C:\> Invoke-AzCloudServiceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
+.Example
+PS C:\> Invoke-AzCloudServiceReimage -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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/invoke-azcloudservicereimage
+#>
+function Invoke-AzCloudServiceReimage {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='ReimageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='ReimageExpanded', Mandatory)]
+ [Alias('CloudServiceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${Name},
+
+ [Parameter(ParameterSetName='ReimageExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ReimageExpanded')]
+ [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='ReimageViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(Mandatory)]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ ReimageExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceReimage_ReimageExpanded';
+ ReimageViaIdentityExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceReimage_ReimageViaIdentityExpanded';
+ }
+ if (('ReimageExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Invoke-AzCloudServiceRoleInstanceRebuild.ps1 b/src/CloudService/exports/Invoke-AzCloudServiceRoleInstanceRebuild.ps1
new file mode 100644
index 000000000000..7958382294ea
--- /dev/null
+++ b/src/CloudService/exports/Invoke-AzCloudServiceRoleInstanceRebuild.ps1
@@ -0,0 +1,187 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The Rebuild Role Instance asynchronous operation 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 Instance.
+.Description
+The Rebuild Role Instance asynchronous operation 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 Instance.
+.Example
+PS C:\> Invoke-AzCloudServiceRoleInstanceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/invoke-azcloudserviceroleinstancerebuild
+#>
+function Invoke-AzCloudServiceRoleInstanceRebuild {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Rebuild', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Rebuild', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='Rebuild', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Rebuild', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter(ParameterSetName='Rebuild')]
+ [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='RebuildViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Rebuild = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceRebuild_Rebuild';
+ RebuildViaIdentity = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceRebuild_RebuildViaIdentity';
+ }
+ if (('Rebuild') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/Invoke-AzCloudServiceRoleInstanceReimage.ps1 b/src/CloudService/exports/Invoke-AzCloudServiceRoleInstanceReimage.ps1
new file mode 100644
index 000000000000..f7ab5c43ee22
--- /dev/null
+++ b/src/CloudService/exports/Invoke-AzCloudServiceRoleInstanceReimage.ps1
@@ -0,0 +1,185 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Description
+The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Example
+PS C:\> Invoke-AzCloudServiceRoleInstanceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/invoke-azcloudserviceroleinstancereimage
+#>
+function Invoke-AzCloudServiceRoleInstanceReimage {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Reimage', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Reimage', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='Reimage', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Reimage', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter(ParameterSetName='Reimage')]
+ [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='ReimageViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Reimage = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceReimage_Reimage';
+ ReimageViaIdentity = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceReimage_ReimageViaIdentity';
+ }
+ if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudService.ps1 b/src/CloudService/exports/New-AzCloudService.ps1
new file mode 100644
index 000000000000..60e8239d17f5
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudService.ps1
@@ -0,0 +1,403 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or update a cloud service.
+Please note some properties can be set only during cloud service creation.
+.Description
+Create or update a cloud service.
+Please note some properties can be set only during cloud service creation.
+.Example
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile
+.Example
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosoOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Create RDP extension object
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $extension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+PS C:\> $extensionProfile = @{extension = @($extension)}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -ExtensionProfile $extensionProfile
+.Example
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create OS profile object
+$keyVault = Get-AzKeyVault -ResourceGroupName ContosOrg -VaultName ContosKeyVault
+$certificate=Get-AzKeyVaultCertificate -VaultName ContosKeyVault -Name ContosCert
+$secretGroup = New-AzCloudServiceVaultSecretGroupObject -Id $keyVault.ResourceId -CertificateUrl $certificate.SecretId
+$osProfile = @{secret = @($secretGroup)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -OSProfile $osProfile
+.Example
+# Create role profile object
+PS C:\> $role1 = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $role2 = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoBackend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role1, $role2)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Create RDP extension object
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $rdpExtension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+
+# Create Geneva extension object
+PS C:\> $genevaExtension = New-AzCloudServiceExtensionObject -Name GenevaExtension -Publisher Microsoft.Azure.Geneva -Type GenevaMonitoringPaaS -TypeHandlerVersion "2.14.0.2"
+PS C:\> $extensionProfile = @{extension = @($rdpExtension, $genevaExtension)}
+
+# Add tags
+$tag=@{"Owner" = "Contoso"}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -ExtensionProfile $extensionProfile `
+ -Tag $tag
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudService
+.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.
+
+EXTENSIONPROFILE : Describes a cloud service extension profile.
+ [Extension ]: List of extensions for the cloud service.
+ [AutoUpgradeMinorVersion ]: Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available.
+ [ForceUpdateTag ]: Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension without changing any of the public or protected settings. If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not
+ [Name ]: The name of the extension.
+ [ProtectedSetting ]: Protected settings for the extension which are encrypted before sent to the role instance.
+ [ProtectedSettingFromKeyVaultSecretUrl ]:
+ [Publisher ]: The name of the extension handler publisher.
+ [RolesAppliedTo ]: Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied to all roles in the cloud service.
+ [Setting ]: Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension.
+ [SourceVaultId ]: Resource Id
+ [Type ]: Specifies the type of the extension.
+ [TypeHandlerVersion ]: Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor version of the specified major version is selected. If a major version number and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role instance.
+
+NETWORKPROFILE : Network Profile for the cloud service.
+ [LoadBalancerConfiguration ]: The list of load balancer configurations for the cloud service.
+ [FrontendIPConfiguration ]: List of IP
+ [Name ]:
+ [PrivateIPAddress ]: The private IP address referenced by the cloud service.
+ [PublicIPAddressId ]: Resource Id
+ [SubnetId ]: Resource Id
+ [Name ]: Resource Name
+ [SwappableCloudService ]:
+ [Id ]: Resource Id
+
+OSPROFILE : Describes the OS profile for the cloud service.
+ [Secret ]: Specifies set of certificates that should be installed onto the role instances.
+ [SourceVaultId ]: Resource Id
+ [VaultCertificate ]: The list of key vault references in SourceVault which contain certificates.
+ [CertificateUrl ]: This is the URL of a certificate that has been uploaded to Key Vault as a secret.
+
+ROLEPROFILE : Describes the role profile for the cloud service.
+ [Role ]: List of roles for the cloud service.
+ [Name ]: Resource name.
+ [SkuCapacity ]: Specifies the number of role instances in the cloud service.
+ [SkuName ]: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete and recreate the cloud service or move back to the old sku.
+ [SkuTier ]: Specifies the tier of the cloud service. Possible Values are
**Standard**
**Basic**
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/new-azcloudservice
+#>
+function New-AzCloudService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudService])]
+[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Alias('CloudServiceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [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(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Resource location.
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Specifies the XML service configuration (.cscfg) for the cloud service.
+ ${Configuration},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Specifies a URL that refers to the location of the service configuration in the Blob service.
+ # The service package URL can be Shared Access Signature (SAS) URI from any storage account.This is a write-only property and is not returned in GET calls.
+ ${ConfigurationUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceExtensionProfile]
+ # Describes a cloud service extension profile.
+ # To construct, see NOTES section for EXTENSIONPROFILE properties and create a hash table.
+ ${ExtensionProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceNetworkProfile]
+ # Network Profile for the cloud service.
+ # To construct, see NOTES section for NETWORKPROFILE properties and create a hash table.
+ ${NetworkProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceOSProfile]
+ # Describes the OS profile for the cloud service.
+ # To construct, see NOTES section for OSPROFILE properties and create a hash table.
+ ${OSProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Specifies a URL that refers to the location of the service package in the Blob service.
+ # The service package URL can be Shared Access Signature (SAS) URI from any storage account.This is a write-only property and is not returned in GET calls.
+ ${PackageUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceRoleProfile]
+ # Describes the role profile for the cloud service.
+ # To construct, see NOTES section for ROLEPROFILE properties and create a hash table.
+ ${RoleProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # (Optional) Indicates whether to start the cloud service immediately after it is created.
+ # The default value is `true`.If false, the service model is still deployed, but the code is not run immediately.
+ # Instead, the service is PoweredOff until you call Start, at which time the service will be started.
+ # A deployed service still incurs charges, even if it is poweredoff.
+ ${StartCloudService},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceTags]))]
+ [System.Collections.Hashtable]
+ # Resource tags.
+ ${Tag},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.CloudServiceUpgradeMode])]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.CloudServiceUpgradeMode]
+ # 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
**Auto**
**Manual**
**Simultaneous**
If not specified, the default value is Auto.
+ # If set to Manual, PUT UpdateDomain must be called to apply the update.
+ # If set to Auto, the update is automatically applied to each update domain in sequence.
+ ${UpgradeMode},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ CreateExpanded = 'Az.CloudService.private\New-AzCloudService_CreateExpanded';
+ }
+ if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudServiceDiagnosticsExtension.ps1 b/src/CloudService/exports/New-AzCloudServiceDiagnosticsExtension.ps1
new file mode 100644
index 000000000000..9636ceb3d17c
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudServiceDiagnosticsExtension.ps1
@@ -0,0 +1,135 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Diagnostics Extension
+.Description
+Create a in-memory object for Diagnostics Extension
+.Example
+PS C:\> $storageAccountKey = Get-AzStorageAccountKey -ResourceGroupName "ContosOrg" -Name "ContosSA"
+PS C:\> $configFile = ""
+PS C:\> $extension = New-AzCloudServiceDiagnosticsExtension -Name "WADExtension" -ResourceGroupName "ContosOrg" -CloudServiceName "ContosCS" -StorageAccountName "ContosSA" -StorageAccountKey $storageAccountKey[0].Value -DiagnosticsConfigurationPath $configFile -TypeHandlerVersion "1.5" -AutoUpgradeMinorVersion $true
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceExtensionObject
+#>
+function New-AzCloudServiceDiagnosticsExtension {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Position=1)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription.
+ ${Subscription},
+
+ [Parameter(Position=0, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name of Diagnostics Extension.
+ ${Name},
+
+ [Parameter(Position=2, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Resource Group name of Cloud Service.
+ ${ResourceGroupName},
+
+ [Parameter(Position=3, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name of Cloud Service.
+ ${CloudServiceName},
+
+ [Parameter(Position=4, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Specifies the configuration for Azure Diagnostics.
+ # You can download the schema by using the following command: (Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics').PublicConfigurationSchema | Out-File -Encoding utf8 -FilePath 'WadConfig.xsd'
+ ${DiagnosticsConfigurationPath},
+
+ [Parameter(Position=5, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name of the Storage Account.
+ ${StorageAccountName},
+
+ [Parameter(Position=6, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Storage Account Key.
+ ${StorageAccountKey},
+
+ [Parameter(Position=7)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Specifies the version of the extension.
+ ${TypeHandlerVersion},
+
+ [Parameter(Position=8)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String[]]
+ # Roles applied to.
+ ${RolesAppliedTo},
+
+ [Parameter(Position=9)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.Boolean]
+ # Auto upgrade minor version.
+ ${AutoUpgradeMinorVersion}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.CloudService.custom\New-AzCloudServiceDiagnosticsExtension';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Subscription')) {
+ $PSBoundParameters['Subscription'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudServiceExtensionObject.ps1 b/src/CloudService/exports/New-AzCloudServiceExtensionObject.ps1
new file mode 100644
index 000000000000..a5340ec3c892
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudServiceExtensionObject.ps1
@@ -0,0 +1,116 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Extension
+.Description
+Create a in-memory object for Extension
+.Example
+PS C:\> $extension = New-AzCloudServiceExtensionObject -Name "GenevaExtension" -Publisher "Microsoft.Azure.Geneva" -Type "GenevaMonitoringPaaS" -TypeHandlerVersion "2.14.0.2"
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceExtensionObject
+#>
+function New-AzCloudServiceExtensionObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.Boolean]
+ # Explicitly specify whether CRP can automatically upgrade typeHandlerVersion to higher minor versions when they become available.
+ ${AutoUpgradeMinorVersion},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name.
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Protected settings for the extension which are encrypted before sent to the VM.
+ ${ProtectedSetting},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Publisher.
+ ${Publisher},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String[]]
+ # RolesAppliedTo.
+ ${RolesAppliedTo},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Public settings for the extension.
+ ${Setting},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Type.
+ ${Type},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # TypeHandlerVersion.
+ ${TypeHandlerVersion}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.CloudService.custom\New-AzCloudServiceExtensionObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudServiceLoadBalancerConfigurationObject.ps1 b/src/CloudService/exports/New-AzCloudServiceLoadBalancerConfigurationObject.ps1
new file mode 100644
index 000000000000..515c1f3f3cf1
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudServiceLoadBalancerConfigurationObject.ps1
@@ -0,0 +1,93 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for LoadBalancerConfiguration
+.Description
+Create a in-memory object for LoadBalancerConfiguration
+.Example
+PS C:\> $publicIP = Get-AzPublicIpAddress -ResourceGroupName 'ContosoOrg' -Name 'ContosoPublicIP'
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIP.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerConfiguration
+.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.
+
+FRONTENDIPCONFIGURATION : FrontendIPConfiguration.
+ [Name ]:
+ [PrivateIPAddress ]: The private IP address referenced by the cloud service.
+ [PublicIPAddressId ]: Resource Id
+ [SubnetId ]: Resource Id
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceLoadBalancerConfigurationObject
+#>
+function New-AzCloudServiceLoadBalancerConfigurationObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerConfiguration])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ILoadBalancerFrontendIPConfiguration[]]
+ # FrontendIPConfiguration.
+ # To construct, see NOTES section for FRONTENDIPCONFIGURATION properties and create a hash table.
+ ${FrontendIPConfiguration},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name of LoadBalancerConfiguration.
+ ${Name}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.CloudService.custom\New-AzCloudServiceLoadBalancerConfigurationObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.ps1 b/src/CloudService/exports/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.ps1
new file mode 100644
index 000000000000..07aaa1a7e309
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject.ps1
@@ -0,0 +1,82 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for LoadBalancerFrontendIPConfiguration
+.Description
+Create a in-memory object for LoadBalancerFrontendIPConfiguration
+.Example
+PS C:\> $publicIP = Get-AzPublicIpAddress -ResourceGroupName 'ContosoOrg' -Name 'ContosoPublicIP'
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfiguration
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceLoadBalancerFrontendIPConfigurationObject
+#>
+function New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.LoadBalancerFrontendIPConfiguration])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name of FrontendIpConfigration.
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Resource Id.
+ ${PublicIPAddressId}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.CloudService.custom\New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudServiceRemoteDesktopExtensionObject.ps1 b/src/CloudService/exports/New-AzCloudServiceRemoteDesktopExtensionObject.ps1
new file mode 100644
index 000000000000..048ee49a5820
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudServiceRemoteDesktopExtensionObject.ps1
@@ -0,0 +1,106 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Remote Desktop Extension
+.Description
+Create a in-memory object for Remote Desktop Extension
+.Example
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $extension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceExtensionObject
+#>
+function New-AzCloudServiceRemoteDesktopExtensionObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.Extension])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter(Position=0, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name of Remote Desktop Extension.
+ ${Name},
+
+ [Parameter(Position=1, Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.Management.Automation.PSCredential]
+ # Credential for Remote Desktop Extension.
+ ${Credential},
+
+ [Parameter(Position=2)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.DateTime]
+ # Expiration for Remote Desktop Extension.
+ ${Expiration},
+
+ [Parameter(Position=3)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Remote Desktop Extension version.
+ ${TypeHandlerVersion},
+
+ [Parameter(Position=4)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String[]]
+ # Roles applied to.
+ ${RolesAppliedTo},
+
+ [Parameter(Position=5)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.Boolean]
+ # Auto upgrade minor version.
+ ${AutoUpgradeMinorVersion}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.CloudService.custom\New-AzCloudServiceRemoteDesktopExtensionObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudServiceRoleProfilePropertiesObject.ps1 b/src/CloudService/exports/New-AzCloudServiceRoleProfilePropertiesObject.ps1
new file mode 100644
index 000000000000..7d97e02cbc05
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudServiceRoleProfilePropertiesObject.ps1
@@ -0,0 +1,92 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for CloudServiceRoleProfileProperties
+.Description
+Create a in-memory object for CloudServiceRoleProfileProperties
+.Example
+$role = New-AzCloudServiceRoleProfilePropertiesObject -Name 'WebRole' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProfileProperties
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceRoleProfilePropertiesObject
+#>
+function New-AzCloudServiceRoleProfilePropertiesObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceRoleProfileProperties])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Name of role profile.
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.Int64]
+ # Specifies the number of role instances in the cloud service.
+ ${SkuCapacity},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # The sku name.
+ ${SkuName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # SkuTier.
+ ${SkuTier}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.CloudService.custom\New-AzCloudServiceRoleProfilePropertiesObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/New-AzCloudServiceVaultSecretGroupObject.ps1 b/src/CloudService/exports/New-AzCloudServiceVaultSecretGroupObject.ps1
new file mode 100644
index 000000000000..e51a37773a49
--- /dev/null
+++ b/src/CloudService/exports/New-AzCloudServiceVaultSecretGroupObject.ps1
@@ -0,0 +1,82 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create a in-memory object for Vault Secret Group
+.Description
+Create a in-memory object for Secret Group
+.Example
+$keyVault = Get-AzKeyVault -VaultName 'ContosoKeyVault'
+$certificate = Get-AzKeyVaultCertificate -VaultName 'ContosoKeyVault' -Name 'ContosoCert'
+$secretGroup = New-AzCloudServiceVaultSecretGroupObject -Id $keyVault.ResourceId -CertificateUrl $certificate.SecretId
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultSecretGroup
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.CloudService/new-AzCloudServiceVaultSecretGroupObject
+#>
+function New-AzCloudServiceVaultSecretGroupObject {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.CloudServiceVaultSecretGroup])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Key Vault Resource Id.
+ ${Id},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String[]]
+ # This is the URL of a certificate that has been uploaded to Key Vault as a secret.
+ ${CertificateUrl}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ __AllParameterSets = 'Az.CloudService.custom\New-AzCloudServiceVaultSecretGroupObject';
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/CloudService/exports/ProxyCmdletDefinitions.ps1 b/src/CloudService/exports/ProxyCmdletDefinitions.ps1
new file mode 100644
index 000000000000..6e5ea9cd6634
--- /dev/null
+++ b/src/CloudService/exports/ProxyCmdletDefinitions.ps1
@@ -0,0 +1,4731 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets the status of a cloud service.
+.Description
+Gets the status of a cloud service.
+.Example
+PS C:\>$cloudServiceInstanceView = Get-AzCloudServiceInstanceView -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+PS C:\>$cloudServiceInstanceView
+RoleInstanceStatusesSummary Statuses
+--------------------------- --------
+{{ProvisioningState/succeeded : 4}, {PowerState/started : 4}} {Provisioning succeeded, Started, Current Upgrade Domain of cloud service is -1., Max Upgrade Domain of cloud service is 1.}
+
+PS C:\>$cloudServiceInstanceView.ToJsonString()
+{
+ "roleInstance": {
+ "statusesSummary": [
+ {
+ "code": "ProvisioningState/succeeded",
+ "count": 4
+ },
+ {
+ "code": "PowerState/started",
+ "count": 4
+ }
+ ]
+ },
+ "statuses": [
+ {
+ "code": "ProvisioningState/succeeded",
+ "displayStatus": "Provisioning succeeded",
+ "level": "Info",
+ "time": "2020-10-28T13:26:48.8109686Z"
+ },
+ {
+ "code": "PowerState/started",
+ "displayStatus": "Started",
+ "level": "Info",
+ "time": "2020-10-28T13:26:48.8109686Z"
+ },
+ {
+ "code": "CurrentUpgradeDomain/-1",
+ "displayStatus": "Current Upgrade Domain of cloud service is -1.",
+ "level": "Info"
+ },
+ {
+ "code": "MaxUpgradeDomain/1",
+ "displayStatus": "Max Upgrade Domain of cloud service is 1.",
+ "level": "Info"
+ }
+ ]
+}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceInstanceView
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceinstanceview
+#>
+function Get-AzCloudServiceInstanceView {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudServiceInstanceView])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${CloudServiceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceInstanceView_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a remote desktop file for a role instance in a cloud service.
+.Description
+Gets a remote desktop file for a role instance in a cloud service.
+.Example
+PS C:\> Get-AzCloudServiceRoleInstanceRemoteDesktopFile -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0" -OutFile "C:\temp\ContosoFrontEnd_IN_0.rdp"
+
+.Outputs
+System.Boolean
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceroleinstanceremotedesktopfile
+#>
+function Get-AzCloudServiceRoleInstanceRemoteDesktopFile {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter()]
+ [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(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Body')]
+ [System.String]
+ # Path to write output file to
+ ${OutFile},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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]
+ # 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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceRoleInstanceRemoteDesktopFile_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Retrieves information about the run-time state of a role instance in a cloud service.
+.Description
+Retrieves information about the run-time state of a role instance in a cloud service.
+.Example
+PS C:\> Get-AzCloudServiceRoleInstanceView -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+Statuses PlatformFaultDomain PlatformUpdateDomain
+-------- ------------------- --------------------
+{RoleStateStarted} 0 0
+
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstanceView
+.Link
+https://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceroleinstanceview
+#>
+function Get-AzCloudServiceRoleInstanceView {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstanceView])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter()]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceRoleInstanceView_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets a role instance from a cloud service.
+.Description
+Gets a role instance from a cloud service.
+.Example
+PS C:\> Get-AzCloudServiceRoleInstance -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+Name Location SkuName SkuTier
+---- -------- ------- -------
+ContosoFrontEnd_IN_0 eastus2euap Standard_D1_v2 Standard
+ContosoFrontEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+ContosoBackEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+ContosoBackEnd_IN_1 eastus2euap Standard_D1_v2 Standard
+
+.Example
+PS C:\> Get-AzCloudServiceRoleInstance -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+Name Location SkuName SkuTier
+---- -------- ------- -------
+ContosoFrontEnd_IN_0 eastus2euap Standard_D1_v2 Standard
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstance
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudserviceroleinstance
+#>
+function Get-AzCloudServiceRoleInstance {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.IRoleInstance])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [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='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.InstanceViewTypes])]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Query')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Support.InstanceViewTypes]
+ # The expand expression to apply to the operation.
+ ${Expand},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudServiceRoleInstance_Get';
+ GetViaIdentity = 'Az.CloudService.private\Get-AzCloudServiceRoleInstance_GetViaIdentity';
+ List = 'Az.CloudService.private\Get-AzCloudServiceRoleInstance_List';
+ }
+ if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Display information about a cloud service.
+.Description
+Display information about a cloud service.
+.Example
+PS C:\> Get-AzCloudService -ResourceGroupName "ContosOrg"
+
+ResourceGroupName Name Location ProvisioningState
+----------------- ---- -------- -----------------
+ContosOrg ContosoCS eastus2euap Succeeded
+ContosOrg ContosoCSTest eastus2euap Failed
+.Example
+PS C:\> Get-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+
+ResourceGroupName Name Location ProvisioningState
+----------------- ---- -------- -----------------
+ContosOrg ContosoCS eastus2euap Succeeded
+
+PS C:\> $cloudService = Get-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS"
+PS C:\> $cloudService | Format-List
+ResourceGroupName : ContosOrg
+Configuration : xxxxxxxx
+ConfigurationUrl :
+ExtensionProfile : xxxxxxxx
+Id : xxxxxxxx
+Location : East US
+Name : ContosoCS
+NetworkProfile : xxxxxxxx
+OSProfile : xxxxxxxx
+PackageUrl : xxxxxxxx
+ProvisioningState : Succeeded
+RoleProfile : xxxxxxxx
+StartCloudService :
+Tag : {
+ "Owner": "Contos"
+ }
+Type : Microsoft.Compute/cloudServices
+UniqueId : xxxxxxxx
+UpgradeMode : Auto
+
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudService
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/get-azcloudservice
+#>
+function Get-AzCloudService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudService])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('CloudServiceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [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='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [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(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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.CloudService.private\Get-AzCloudService_Get';
+ GetViaIdentity = 'Az.CloudService.private\Get-AzCloudService_GetViaIdentity';
+ List = 'Az.CloudService.private\Get-AzCloudService_List';
+ List1 = 'Az.CloudService.private\Get-AzCloudService_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.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
+PS C:\> $roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
+PS C:\> Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
+.Example
+PS C:\> 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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/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)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='RebuildExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='RebuildExpanded')]
+ [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
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(Mandatory)]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ RebuildExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceRebuild_RebuildExpanded';
+ RebuildViaIdentityExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceRebuild_RebuildViaIdentityExpanded';
+ }
+ if (('RebuildExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Description
+Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Example
+PS C:\> $roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
+PS C:\> Invoke-AzCloudServiceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances
+.Example
+PS C:\> Invoke-AzCloudServiceReimage -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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/invoke-azcloudservicereimage
+#>
+function Invoke-AzCloudServiceReimage {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='ReimageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='ReimageExpanded', Mandatory)]
+ [Alias('CloudServiceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the cloud service.
+ ${Name},
+
+ [Parameter(ParameterSetName='ReimageExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the resource group.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='ReimageExpanded')]
+ [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='ReimageViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(Mandatory)]
+ [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()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ ReimageExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceReimage_ReimageExpanded';
+ ReimageViaIdentityExpanded = 'Az.CloudService.private\Invoke-AzCloudServiceReimage_ReimageViaIdentityExpanded';
+ }
+ if (('ReimageExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The Rebuild Role Instance asynchronous operation 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 Instance.
+.Description
+The Rebuild Role Instance asynchronous operation 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 Instance.
+.Example
+PS C:\> Invoke-AzCloudServiceRoleInstanceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/invoke-azcloudserviceroleinstancerebuild
+#>
+function Invoke-AzCloudServiceRoleInstanceRebuild {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Rebuild', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Rebuild', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='Rebuild', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Rebuild', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter(ParameterSetName='Rebuild')]
+ [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='RebuildViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Rebuild = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceRebuild_Rebuild';
+ RebuildViaIdentity = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceRebuild_RebuildViaIdentity';
+ }
+ if (('Rebuild') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Description
+The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+.Example
+PS C:\> Invoke-AzCloudServiceRoleInstanceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"
+
+.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 : Identity Parameter
+ [CloudServiceName ]:
+ [Id ]: Resource identity path
+ [ResourceGroupName ]:
+ [RoleInstanceName ]: Name of the role instance.
+ [RoleName ]: Name of the role.
+ [SubscriptionId ]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ [UpdateDomain ]: 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://docs.microsoft.com/en-us/powershell/module/az.cloudservice/invoke-azcloudserviceroleinstancereimage
+#>
+function Invoke-AzCloudServiceRoleInstanceReimage {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Reimage', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Reimage', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${CloudServiceName},
+
+ [Parameter(ParameterSetName='Reimage', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # .
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Reimage', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [System.String]
+ # Name of the role instance.
+ ${RoleInstanceName},
+
+ [Parameter(ParameterSetName='Reimage')]
+ [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='ReimageViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.ICloudServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${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}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Reimage = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceReimage_Reimage';
+ ReimageViaIdentity = 'Az.CloudService.private\Invoke-AzCloudServiceRoleInstanceReimage_ReimageViaIdentity';
+ }
+ if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create or update a cloud service.
+Please note some properties can be set only during cloud service creation.
+.Description
+Create or update a cloud service.
+Please note some properties can be set only during cloud service creation.
+.Example
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile
+.Example
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosoOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Create RDP extension object
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $extension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+PS C:\> $extensionProfile = @{extension = @($extension)}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -ExtensionProfile $extensionProfile
+.Example
+# Create role profile object
+PS C:\> $role = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role)}
+
+# Create OS profile object
+$keyVault = Get-AzKeyVault -ResourceGroupName ContosOrg -VaultName ContosKeyVault
+$certificate=Get-AzKeyVaultCertificate -VaultName ContosKeyVault -Name ContosCert
+$secretGroup = New-AzCloudServiceVaultSecretGroupObject -Id $keyVault.ResourceId -CertificateUrl $certificate.SecretId
+$osProfile = @{secret = @($secretGroup)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -OSProfile $osProfile
+.Example
+# Create role profile object
+PS C:\> $role1 = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoFrontend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $role2 = New-AzCloudServiceCloudServiceRoleProfilePropertiesObject -Name 'ContosoBackend' -SkuName 'Standard_D1_v2' -SkuTier 'Standard' -SkuCapacity 2
+PS C:\> $roleProfile = @{role = @($role1, $role2)}
+
+# Create network profile object
+PS C:\> $publicIp = Get-AzPublicIpAddress -ResourceGroupName ContosOrg -Name ContosIp
+PS C:\> $feIpConfig = New-AzCloudServiceLoadBalancerFrontendIPConfigurationObject -Name 'ContosoFe' -PublicIPAddressId $publicIp.Id
+PS C:\> $loadBalancerConfig = New-AzCloudServiceLoadBalancerConfigurationObject -Name 'ContosoLB' -FrontendIPConfiguration $feIpConfig
+PS C:\> $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig}
+
+# Create RDP extension object
+PS C:\> $credential = Get-Credential
+PS C:\> $expiration = (Get-Date).AddYears(1)
+PS C:\> $rdpExtension = New-AzCloudServiceRemoteDesktopExtensionObject -Name 'RDPExtension' -Credential $credential -Expiration $expiration -TypeHandlerVersion '1.2.1'
+
+# Create Geneva extension object
+PS C:\> $genevaExtension = New-AzCloudServiceExtensionObject -Name GenevaExtension -Publisher Microsoft.Azure.Geneva -Type GenevaMonitoringPaaS -TypeHandlerVersion "2.14.0.2"
+PS C:\> $extensionProfile = @{extension = @($rdpExtension, $genevaExtension)}
+
+# Add tags
+$tag=@{"Owner" = "Contoso"}
+
+# Read Configuration File
+$cscfgFile = ""
+$cscfgContent = Get-Content $cscfgFile | Out-String
+
+# Create cloud service
+$cloudService = New-AzCloudService `
+ -Name ContosoCS `
+ -ResourceGroupName ContosOrg `
+ -Location EastUS `
+ -PackageUrl "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
+ -Configuration $cscfgContent `
+ -UpgradeMode 'Auto' `
+ -RoleProfile $roleProfile `
+ -NetworkProfile $networkProfile `
+ -ExtensionProfile $extensionProfile `
+ -Tag $tag
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.CloudService.Models.Api20201001Preview.ICloudService
+.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.
+
+EXTENSIONPROFILE : Describes a cloud service extension profile.
+ [Extension ]: List of extensions for the cloud service.
+ [AutoUpgradeMinorVersion ]: Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available.
+ [ForceUpdateTag ]: Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension without changing any of the public or protected settings. If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not
+ [Name