Skip to content

Commit 22b2c52

Browse files
dineshreddy007digot007isra-fel
authored
Az.StackHCI Cmdlet registration changes for GA (#13454)
* 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 <[email protected]> Co-authored-by: Yeming Liu <[email protected]>
1 parent 68cdc03 commit 22b2c52

File tree

7 files changed

+1196
-240
lines changed

7 files changed

+1196
-240
lines changed

src/StackHCI/Az.StackHCI.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.1.2'; })
6969
# NestedModules = @()
7070

7171
# 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.
72-
FunctionsToExport = 'Register-AzStackHCI', 'Unregister-AzStackHCI'
72+
FunctionsToExport = 'Register-AzStackHCI', 'Unregister-AzStackHCI', 'Test-AzStackHCIConnection'
7373

7474
# 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.
7575
CmdletsToExport = @()

src/StackHCI/Az.StackHCI.psm1

Lines changed: 886 additions & 131 deletions
Large diffs are not rendered by default.

src/StackHCI/ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Made changes to registration script to register the GA version of On-Premises Azure Stack HCI with Azure.
22+
- Supports registering with user provided certificate thumbprint.
23+
- Supports On-Premises Azure Stack HCI OS changes to use independent certificate on cluster nodes.
24+
- Cleans up resource group during unregistration.
25+
- Improves registration output and logging.
26+
* [Breaking Change] Breaks the public preview registration of On-Premises Azure Stack HCI with Azure.
27+
- To register public preview On-Premises Azure Stack HCi with Azure, use 0.3.1 version of Az.StackHCI.
2128

2229
## Version 0.3.1
2330
* Fixed an issue that may block Stack HCI registration.

src/StackHCI/help/Az.StackHCI.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Microsoft Azure PowerShell: StackHCI cmdlets
1414
### [Register-AzStackHCI](Register-AzStackHCI.md)
1515
Register-AzStackHCI creates a Microsoft.AzureStackHCI cloud resource representing the on-premise cluster and registers the on-premise cluster with Azure.
1616

17+
### [Test-AzStackHCIConnection](Test-AzStackHCIConnection.md)
18+
Test-AzStackHCIConnection verifies connectivity from on-premises clustered nodes to the Azure services required by Azure Stack HCI.
19+
1720
### [Unregister-AzStackHCI](Unregister-AzStackHCI.md)
1821
Unregister-AzStackHCI deletes the Microsoft.AzureStackHCI cloud resource representing the on-premise cluster and unregisters the on-premise cluster with Azure.
22+
The registered information available on the cluster is used to unregister the cluster if no parameters are passed.
1923

src/StackHCI/help/Register-AzStackHCI.md

Lines changed: 100 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Register-AzStackHCI creates a Microsoft.AzureStackHCI cloud resource representin
1616
Register-AzStackHCI [-SubscriptionId] <String> [[-Region] <String>] [[-ResourceName] <String>]
1717
[[-TenantId] <String>] [[-ResourceGroupName] <String>] [[-ArmAccessToken] <String>]
1818
[[-GraphAccessToken] <String>] [[-AccountId] <String>] [[-EnvironmentName] <String>]
19-
[[-ComputerName] <String>] [[-Credential] <PSCredential>] [<CommonParameters>]
19+
[[-ComputerName] <String>] [[-CertificateThumbprint] <String>] [-RepairRegistration]
20+
[-UseDeviceAuthentication] [[-Credential] <PSCredential>] [<CommonParameters>]
2021
```
2122

2223
## DESCRIPTION
@@ -70,97 +71,97 @@ PortalAADAppPermissionsURL: https://portal.azure.com/#blade/Microsoft_AAD_Regist
7071

7172
## PARAMETERS
7273

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

7778
```yaml
78-
Type: String
79+
Type: System.String
7980
Parameter Sets: (All)
8081
Aliases:
8182

82-
Required: True
83-
Position: 1
83+
Required: False
84+
Position: 8
8485
Default value: None
8586
Accept pipeline input: False
8687
Accept wildcard characters: False
8788
```
8889
89-
### -Region
90-
Specifies the Region to create the resource.
91-
Default is EastUS.
90+
### -ArmAccessToken
91+
Specifies the ARM access token.
92+
Specifying this along with GraphAccessToken and AccountId will avoid Azure interactive logon.
9293
9394
```yaml
94-
Type: String
95+
Type: System.String
9596
Parameter Sets: (All)
9697
Aliases:
9798

9899
Required: False
99-
Position: 2
100+
Position: 6
100101
Default value: None
101102
Accept pipeline input: False
102103
Accept wildcard characters: False
103104
```
104105
105-
### -ResourceName
106-
Specifies the resource name of the resource created in Azure.
107-
If not specified, on-premise cluster name is used.
106+
### -CertificateThumbprint
107+
Specifies the thumbprint of the certificate available on all the nodes. User is responsible for managing the certificate.
108108
109109
```yaml
110-
Type: String
110+
Type: System.String
111111
Parameter Sets: (All)
112112
Aliases:
113113

114114
Required: False
115-
Position: 3
115+
Position: 11
116116
Default value: None
117117
Accept pipeline input: False
118118
Accept wildcard characters: False
119119
```
120120
121-
### -TenantId
122-
Specifies the Azure TenantId.
121+
### -ComputerName
122+
Specifies the cluster name or one of the cluster node in on-premise cluster that is being registered to Azure.
123123
124124
```yaml
125-
Type: String
125+
Type: System.String
126126
Parameter Sets: (All)
127127
Aliases:
128128

129129
Required: False
130-
Position: 4
130+
Position: 10
131131
Default value: None
132132
Accept pipeline input: False
133133
Accept wildcard characters: False
134134
```
135135
136-
### -ResourceGroupName
137-
Specifies the Azure Resource Group name.
138-
If not specified \<LocalClusterName\>-rg will be used as resource group name.
136+
### -Credential
137+
Specifies the credential for the ComputerName.
138+
Default is the current user executing the Cmdlet.
139139
140140
```yaml
141-
Type: String
141+
Type: System.Management.Automation.PSCredential
142142
Parameter Sets: (All)
143143
Aliases:
144144

145145
Required: False
146-
Position: 5
146+
Position: 12
147147
Default value: None
148148
Accept pipeline input: False
149149
Accept wildcard characters: False
150150
```
151151
152-
### -ArmAccessToken
153-
Specifies the ARM access token.
154-
Specifying this along with GraphAccessToken and AccountId will avoid Azure interactive logon.
152+
### -EnvironmentName
153+
Specifies the Azure Environment.
154+
Default is AzureCloud.
155+
Valid values are AzureCloud, AzureChinaCloud, AzureUSGovernment, AzureGermanCloud, AzurePPE
155156
156157
```yaml
157-
Type: String
158+
Type: System.String
158159
Parameter Sets: (All)
159160
Aliases:
160161

161162
Required: False
162-
Position: 6
163-
Default value: None
163+
Position: 9
164+
Default value: $AzureCloud
164165
Accept pipeline input: False
165166
Accept wildcard characters: False
166167
```
@@ -170,7 +171,7 @@ Specifies the Graph access token.
170171
Specifying this along with ArmAccessToken and AccountId will avoid Azure interactive logon.
171172
172173
```yaml
173-
Type: String
174+
Type: System.String
174175
Parameter Sets: (All)
175176
Aliases:
176177

@@ -181,70 +182,115 @@ Accept pipeline input: False
181182
Accept wildcard characters: False
182183
```
183184
184-
### -AccountId
185-
Specifies the ARM access token.
186-
Specifying this along with ArmAccessToken and GraphAccessToken will avoid Azure interactive logon.
185+
### -Region
186+
Specifies the Region to create the resource.
187+
Default is EastUS.
187188
188189
```yaml
189-
Type: String
190+
Type: System.String
190191
Parameter Sets: (All)
191192
Aliases:
192193

193194
Required: False
194-
Position: 8
195+
Position: 2
195196
Default value: None
196197
Accept pipeline input: False
197198
Accept wildcard characters: False
198199
```
199200
200-
### -EnvironmentName
201-
Specifies the Azure Environment.
202-
Default is AzureCloud.
203-
Valid values are AzureCloud, AzureChinaCloud, AzureUSGovernment, AzureGermanCloud, AzurePPE
201+
### -RepairRegistration
202+
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.
204203
205204
```yaml
206-
Type: String
205+
Type: System.Management.Automation.SwitchParameter
207206
Parameter Sets: (All)
208207
Aliases:
209208

210209
Required: False
211-
Position: 9
212-
Default value: $AzureCloud
210+
Position: Named
211+
Default value: False
213212
Accept pipeline input: False
214213
Accept wildcard characters: False
215214
```
216215
217-
### -ComputerName
218-
Specifies the cluster name or one of the cluster node in on-premise cluster that is being registered to Azure.
216+
### -ResourceGroupName
217+
Specifies the Azure Resource Group name.
218+
If not specified \<LocalClusterName\>-rg will be used as resource group name.
219219
220220
```yaml
221-
Type: String
221+
Type: System.String
222222
Parameter Sets: (All)
223223
Aliases:
224224

225225
Required: False
226-
Position: 10
226+
Position: 5
227227
Default value: None
228228
Accept pipeline input: False
229229
Accept wildcard characters: False
230230
```
231231
232-
### -Credential
233-
Specifies the credential for the ComputerName.
234-
Default is the current user executing the Cmdlet.
232+
### -ResourceName
233+
Specifies the resource name of the resource created in Azure.
234+
If not specified, on-premise cluster name is used.
235235
236236
```yaml
237-
Type: PSCredential
237+
Type: System.String
238238
Parameter Sets: (All)
239239
Aliases:
240240

241241
Required: False
242-
Position: 11
242+
Position: 3
243243
Default value: None
244244
Accept pipeline input: False
245245
Accept wildcard characters: False
246246
```
247247
248+
### -SubscriptionId
249+
Specifies the Azure Subscription to create the resource.
250+
This is the only Mandatory parameter.
251+
252+
```yaml
253+
Type: System.String
254+
Parameter Sets: (All)
255+
Aliases:
256+
257+
Required: True
258+
Position: 1
259+
Default value: None
260+
Accept pipeline input: False
261+
Accept wildcard characters: False
262+
```
263+
264+
### -TenantId
265+
Specifies the Azure TenantId.
266+
267+
```yaml
268+
Type: System.String
269+
Parameter Sets: (All)
270+
Aliases:
271+
272+
Required: False
273+
Position: 4
274+
Default value: None
275+
Accept pipeline input: False
276+
Accept wildcard characters: False
277+
```
278+
279+
### -UseDeviceAuthentication
280+
Use device code authentication instead of an interactive browser prompt.
281+
282+
```yaml
283+
Type: System.Management.Automation.SwitchParameter
284+
Parameter Sets: (All)
285+
Aliases:
286+
287+
Required: False
288+
Position: Named
289+
Default value: False
290+
Accept pipeline input: False
291+
Accept wildcard characters: False
292+
```
293+
248294
### CommonParameters
249295
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).
250296

0 commit comments

Comments
 (0)