Skip to content

Commit

Permalink
Az.StackHCI Cmdlet registration changes for GA (Azure#13454)
Browse files Browse the repository at this point in the history
* Registration changes to support GA On-Premises Stack HCI

Made changes to registration script to register the GA version of On-Premises Azure Stack HCI with Azure.
- Supports registering with user provided certificate thumbprint.
- Supports On-Premises Azure Stack HCI OS changes to use independent certificate on cluster nodes.
- Cleans up resource group during unregistration.
- Improves registration output and logging.
Breaks the public preview registration of On-Premises Azure Stack HCI with Azure.
- To register public preview On-Premises Azure Stack HCi with Azure, use 0.3.1 version of Az.StackHCI.

* Added Test-AzStackHCIConnection Cmdlet

Added Test-AzStackHCIConnection Cmdlet and generated help files

* Using UseDeviceAuthentication param name

Using UseDeviceAuthentication as paramater name instead of UseDeviceLogin.
Checking existing resource location against given location.

* Added synopsis and corrected changelog

Added synopsis and corrected changelog as per review suggestion

* try to fix static analysis issue

Co-authored-by: Dinesh Reddy Gottam <digot@microsoft.com>
Co-authored-by: Yeming Liu <Yeming.Liu@microsoft.com>
  • Loading branch information
3 people authored and greenms committed Nov 13, 2020
1 parent 18ae234 commit 1dc33c6
Show file tree
Hide file tree
Showing 7 changed files with 1,196 additions and 240 deletions.
2 changes: 1 addition & 1 deletion src/StackHCI/Az.StackHCI.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.1.2'; })
# 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 = 'Register-AzStackHCI', 'Unregister-AzStackHCI'
FunctionsToExport = 'Register-AzStackHCI', 'Unregister-AzStackHCI', 'Test-AzStackHCIConnection'

# 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 = @()
Expand Down
1,017 changes: 886 additions & 131 deletions src/StackHCI/Az.StackHCI.psm1

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/StackHCI/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
- Additional information about change #1
-->
## Upcoming Release
* Made changes to registration script to register the GA version of On-Premises Azure Stack HCI with Azure.
- Supports registering with user provided certificate thumbprint.
- Supports On-Premises Azure Stack HCI OS changes to use independent certificate on cluster nodes.
- Cleans up resource group during unregistration.
- Improves registration output and logging.
* [Breaking Change] Breaks the public preview registration of On-Premises Azure Stack HCI with Azure.
- To register public preview On-Premises Azure Stack HCi with Azure, use 0.3.1 version of Az.StackHCI.

## Version 0.3.1
* Fixed an issue that may block Stack HCI registration.
Expand Down
4 changes: 4 additions & 0 deletions src/StackHCI/help/Az.StackHCI.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Microsoft Azure PowerShell: StackHCI cmdlets
### [Register-AzStackHCI](Register-AzStackHCI.md)
Register-AzStackHCI creates a Microsoft.AzureStackHCI cloud resource representing the on-premise cluster and registers the on-premise cluster with Azure.

### [Test-AzStackHCIConnection](Test-AzStackHCIConnection.md)
Test-AzStackHCIConnection verifies connectivity from on-premises clustered nodes to the Azure services required by Azure Stack HCI.

### [Unregister-AzStackHCI](Unregister-AzStackHCI.md)
Unregister-AzStackHCI deletes the Microsoft.AzureStackHCI cloud resource representing the on-premise cluster and unregisters the on-premise cluster with Azure.
The registered information available on the cluster is used to unregister the cluster if no parameters are passed.

154 changes: 100 additions & 54 deletions src/StackHCI/help/Register-AzStackHCI.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Register-AzStackHCI creates a Microsoft.AzureStackHCI cloud resource representin
Register-AzStackHCI [-SubscriptionId] <String> [[-Region] <String>] [[-ResourceName] <String>]
[[-TenantId] <String>] [[-ResourceGroupName] <String>] [[-ArmAccessToken] <String>]
[[-GraphAccessToken] <String>] [[-AccountId] <String>] [[-EnvironmentName] <String>]
[[-ComputerName] <String>] [[-Credential] <PSCredential>] [<CommonParameters>]
[[-ComputerName] <String>] [[-CertificateThumbprint] <String>] [-RepairRegistration]
[-UseDeviceAuthentication] [[-Credential] <PSCredential>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -70,97 +71,97 @@ PortalAADAppPermissionsURL: https://portal.azure.com/#blade/Microsoft_AAD_Regist

## PARAMETERS

### -SubscriptionId
Specifies the Azure Subscription to create the resource.
This is the only Mandatory parameter.
### -AccountId
Specifies the ARM access token.
Specifying this along with ArmAccessToken and GraphAccessToken will avoid Azure interactive logon.

```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Region
Specifies the Region to create the resource.
Default is EastUS.
### -ArmAccessToken
Specifies the ARM access token.
Specifying this along with GraphAccessToken and AccountId will avoid Azure interactive logon.
```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ResourceName
Specifies the resource name of the resource created in Azure.
If not specified, on-premise cluster name is used.
### -CertificateThumbprint
Specifies the thumbprint of the certificate available on all the nodes. User is responsible for managing the certificate.
```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -TenantId
Specifies the Azure TenantId.
### -ComputerName
Specifies the cluster name or one of the cluster node in on-premise cluster that is being registered to Azure.
```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ResourceGroupName
Specifies the Azure Resource Group name.
If not specified \<LocalClusterName\>-rg will be used as resource group name.
### -Credential
Specifies the credential for the ComputerName.
Default is the current user executing the Cmdlet.
```yaml
Type: String
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ArmAccessToken
Specifies the ARM access token.
Specifying this along with GraphAccessToken and AccountId will avoid Azure interactive logon.
### -EnvironmentName
Specifies the Azure Environment.
Default is AzureCloud.
Valid values are AzureCloud, AzureChinaCloud, AzureUSGovernment, AzureGermanCloud, AzurePPE
```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Position: 9
Default value: $AzureCloud
Accept pipeline input: False
Accept wildcard characters: False
```
Expand All @@ -170,7 +171,7 @@ Specifies the Graph access token.
Specifying this along with ArmAccessToken and AccountId will avoid Azure interactive logon.
```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Expand All @@ -181,70 +182,115 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -AccountId
Specifies the ARM access token.
Specifying this along with ArmAccessToken and GraphAccessToken will avoid Azure interactive logon.
### -Region
Specifies the Region to create the resource.
Default is EastUS.
```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -EnvironmentName
Specifies the Azure Environment.
Default is AzureCloud.
Valid values are AzureCloud, AzureChinaCloud, AzureUSGovernment, AzureGermanCloud, AzurePPE
### -RepairRegistration
Repair the current Azure Stack HCI registration with the cloud. This cmdlet deletes the local certificates on the clustered nodes and the remote certificates in the Azure AD application in the cloud and generates new replacement certificates for both. The resource group, resource name, and other registration choices are preserved.
```yaml
Type: String
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: $AzureCloud
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -ComputerName
Specifies the cluster name or one of the cluster node in on-premise cluster that is being registered to Azure.
### -ResourceGroupName
Specifies the Azure Resource Group name.
If not specified \<LocalClusterName\>-rg will be used as resource group name.
```yaml
Type: String
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Credential
Specifies the credential for the ComputerName.
Default is the current user executing the Cmdlet.
### -ResourceName
Specifies the resource name of the resource created in Azure.
If not specified, on-premise cluster name is used.
```yaml
Type: PSCredential
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SubscriptionId
Specifies the Azure Subscription to create the resource.
This is the only Mandatory parameter.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -TenantId
Specifies the Azure TenantId.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -UseDeviceAuthentication
Use device code authentication instead of an interactive browser prompt.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Expand Down
Loading

0 comments on commit 1dc33c6

Please sign in to comment.