Skip to content

Commit 1b38251

Browse files
authored
Merge pull request #18609 from haraldfianbakken/release-local-disconnectednew
CLI doc improvement
2 parents 9e6c71f + af3a7b5 commit 1b38251

File tree

4 files changed

+43
-185
lines changed

4 files changed

+43
-185
lines changed

azure-local/manage/disconnected-operations-cli.md

Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ For disconnected operations:
109109
}
110110
111111
# Run the helper method in PowerShell:
112-
UpdatePythonCertStore -ApplianceRootCertPath D:\applianceIngressRoot.cer
112+
UpdatePythonCertStore -ApplianceRootCertPath C:\AzureLocalDisconnectedOperations\applianceRoot.cer
113113
```
114114
115115
## Set up Azure CLI for disconnected operations
@@ -123,56 +123,39 @@ To set up Azure CLI for disconnected operations on Azure Local, follow these ste
123123
```PowerShell
124124
function Get-ApplianceAzCliCloudConfig
125125
{
126-
[CmdletBinding()]
127-
[OutputType([String])]
128-
param (
129-
[Parameter(Position = 0, Mandatory = $true)]
130-
[string]
131-
$ArmEndpoint,
126+
[CmdletBinding()]
127+
[OutputType([String])]
128+
param (
129+
[Parameter(Position = 0, Mandatory = $true)]
130+
[string]
131+
$fqdn,
132+
[Parameter(Position = 1, Mandatory = $false)]
133+
[string]
134+
$exportToFile
135+
)
132136
133-
[Parameter(Position = 1, Mandatory = $false)]
134-
[string]
135-
$OutputFolder,
136-
137-
[Parameter(Position = 2, Mandatory = $false)]
138-
[string]
139-
$ApiVersion = "2022-09-01" )
140-
141-
$armMetadataUrl = "$($ArmEndpoint.TrimEnd('/'))/metadata/endpoints?api-version=${ApiVersion}"
142-
try
137+
$cloudConfig = @"
143138
{
144-
$response = Invoke-WebRequest $armMetadataUrl `
145-
-Method 'GET' `
146-
-ContentType "application/json" `
147-
-UseBasicParsing
148-
}
149-
catch
150-
{
151-
Write-Error "Failed to get ARM metadata endpoints at '$armMetadataUrl'."
152-
throw $_
153-
}
154-
155-
$cloudEndpoints = $response.Content | ConvertFrom-Json
156-
$cloudConfig = @{
157-
endpoints = @{
158-
activeDirectory = "$($cloudEndpoints.authentication.loginEndpoint.TrimEnd('/'))/adfs"
159-
activeDirectoryGraphResourceId = $cloudEndpoints.graph
160-
activeDirectoryResourceId = $cloudEndpoints.authentication.audiences[0]
161-
resourceManager = $cloudEndpoints.resourceManager
162-
microsoftGraphResourceId = $cloudEndpoints.graph
163-
}
164-
suffixes = @{
165-
storageEndpoint = $cloudEndpoints.suffixes.storage
166-
keyvaultDns = $cloudEndpoints.suffixes.keyvaultDns
167-
acrLoginServerEndpoint = $cloudEndpoints.suffixes.acrLoginServer
168-
}
139+
"suffixes": {
140+
"keyvaultDns": ".vault.autonomous.cloud.private",
141+
"storageEndpoint": "autonomous.cloud.private",
142+
"acrLoginServerEndpoint": ".edgeacr.autonomous.cloud.private"
143+
},
144+
"endpoints": {
145+
"activeDirectory": "https://login.autonomous.cloud.private/adfs",
146+
"activeDirectoryGraphResourceId": "https://graph.autonomous.cloud.private",
147+
"resourceManager": "https://armmanagement.autonomous.cloud.private",
148+
"microsoftGraphResourceId": "https://graph.autonomous.cloud.private",
149+
"activeDirectoryResourceId": "https://armmanagement.autonomous.cloud.private"
150+
}
169151
}
170-
$cloudConfigJson = $cloudConfig | ConvertTo-Json
171-
if ($OutputFolder)
152+
"@ -replace "autonomous.cloud.private", $fqdn
153+
154+
if ($exportToFile)
172155
{
173-
$cloudConfigJson | Set-Content -Path "$OutputFolder\cloudconfig.json"
156+
$cloudConfig | Set-Content -Path "$exportToFile"
174157
}
175-
return $cloudConfigJson
158+
return $cloudConfig
176159
}
177160
```
178161
@@ -182,7 +165,7 @@ To set up Azure CLI for disconnected operations on Azure Local, follow these ste
182165
az config set core.enable_broker_on_windows=false
183166
az config set core.instance_discovery=false
184167
$fqdn = "autonomous.cloud.private"
185-
$cloudConfigJson = Get-ApplianceAzCliCloudConfig -ArmEndpoint "https://armmanagement.$($fqdn)/"
168+
$cloudConfigJson = Get-ApplianceAzCliCloudConfig -fqdn $fqdn
186169
187170
# Write the content to a file cloudConfig.json
188171
$cloudConfigJson | Out-File -FilePath cloudConfig.json

azure-local/manage/disconnected-operations-deploy.md

Lines changed: 8 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ To prepare the first machine for the disconnected operations appliance, follow t
177177
Here's an example:
178178
179179
```powershell
180-
$applianceConfigBasePath = 'D:\AzureLocalDisconnectedOperations\'
180+
$applianceConfigBasePath = 'C:\AzureLocalDisconnectedOperations'
181181
```
182182
183183
1. Copy the disconnected operations installation files (appliance and manifest) to the first machine. Save these files into the base folder you created earlier.
@@ -222,11 +222,11 @@ To prepare the first machine for the disconnected operations appliance, follow t
222222
Copy-Item \\fileserver\share\azurelocalcerts $certspath -recurse
223223
```
224224
225-
1. Verify the certificates, public key, and management endpoint. You should have two folders: `ManagementEndpointCerts` and `IngressEndpointCerts` and at least 24 certificates.
225+
1. Verify the certificates, public key, and management endpoint. You should have two folders: `ManagementEndpointCerts` and `IngressEndpointsCerts` and at least 24 certificates.
226226
227227
```powershell
228228
Get-ChildItem $certsPath
229-
Get-Item $certsPath -recurse -filter *.cer
229+
Get-ChildItem $certsPath -recurse -filter *.cer
230230
```
231231
232232
1. Install the BitLocker feature including the management tool.
@@ -238,9 +238,9 @@ To prepare the first machine for the disconnected operations appliance, follow t
238238
1. Import the **Operations module**. Run the command as an administrator using PowerShell. Modify the path to match your folder structure.
239239
240240
```powershell
241-
Import-Module "$applianceConfigBasePath \OperationsModule\Azure.Local.DisconnectedOperations.psd1" -Force
241+
Import-Module "$applianceConfigBasePath\OperationsModule\Azure.Local.DisconnectedOperations.psd1" -Force
242242
$mgmntCertFolderPath = "$certspath\ManagementEndpointCerts"
243-
$ingressCertFolderPath = "$certspath\IngressEndpointCerts"
243+
$ingressCertFolderPath = "$certspath\IngressEndpointsCerts"
244244
```
245245
246246
## Initialize the parameters
@@ -323,138 +323,13 @@ Populate the required parameters based on your deployment planning. Modify the e
323323
324324
For more information, see [PKI for disconnected operations](disconnected-operations-pki.md).
325325
326-
1. Generate the appliance manifest file:
326+
1. Copy the appliance manifest file (Downloaded from Azure) to your configuration folder:
327327
328328
```powershell
329-
$stampId = (New-Guid).Guid
330-
$resourcename = "appliance1"
331-
$resourcegroupname= "rg"
332-
$subscriptionId= "subscriptionid"
333-
334-
$applianceManifest = @{
335-
resourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Edge/azurelocaldisconnected/$resourceName"
336-
resourceName = $resourceName
337-
stampId = $stampId
338-
location = "eastus"
339-
billingModel = "model"
340-
connectionIntent = "Disconnected"
341-
}
342-
$applianceManifestJsonPath = "$applianceConfigBasePath\AzureLocal.DisconnectedOperations.Appliance.manifest.json"
343-
$applianceManifest | ConvertTo-JSON | Out-File $ApplianceManifestJsonPath | Out-Null
329+
# Modify your source path accordingly
330+
copy-item AzureLocal.DisconnectedOperations.Manifest.json $applianceConfigBasePath\AzureLocal.DisconnectedOperations.Appliance.manifest.json
344331
```
345332
346-
## Validate the management endpoint certificates
347-
348-
Before you install the appliance, validate the management endpoint certificates. Ensure that the certificate has a validated certificate chain, isn't expired, has the correct subject, the appropriate enhanced key usage (EKUs), and the supported cryptography.
349-
350-
Run the following script:
351-
352-
```powershell
353-
function Test-SSLCertificateSAN {
354-
[CmdletBinding()]
355-
param(
356-
[Parameter(Mandatory = $true)]
357-
[string]$HostName,
358-
359-
[Parameter(Mandatory = $true)]
360-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
361-
)
362-
363-
$sanExtension = $SslCertificate.Extensions | Where-Object { $_.Oid.FriendlyName -ieq "Subject Alternative Name" }
364-
365-
if (-not $sanExtension) {
366-
throw "Subject Alternative Name is not specified in the certificate. Correct the certifcate and try again."
367-
}
368-
369-
$sanExtensionContent = $sanExtension.Format(0)
370-
$sanList = $sanExtensionContent.Split(",") | ForEach-Object { $_.Trim() }
371-
372-
if ($sanList -inotcontains "DNS Name=$HostName") {
373-
throw "Subject Alternative Name does not contain the hostname $HostName. It only has Subject Alternative Name: $sanExtensionContent. Correct the certificate and try again."
374-
}
375-
}
376-
377-
function Test-SSLCertificateChain {
378-
[CmdletBinding()]
379-
param(
380-
[Parameter(Mandatory = $true)]
381-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
382-
)
383-
384-
$chain = New-Object System.Security.Cryptography.X509Certificates.X509Chain
385-
$chain.ChainPolicy.RevocationMode = [System.Security.Cryptography.X509Certificates.X509RevocationMode]::NoCheck
386-
$chain.ChainPolicy.VerificationFlags = [System.Security.Cryptography.X509Certificates.X509VerificationFlags]::NoFlag
387-
388-
$chain.Build($SslCertificate) | Out-Null
389-
390-
if ($chain.ChainStatus.Count -ne 0) {
391-
throw "Certificate chain validation failed with error message: `r`n$(($chain.ChainStatus).StatusInformation -Join "`r`n"). Correct the certificate chain and try again."
392-
}
393-
}
394-
395-
function Test-SslCertificateEnhancedKeyUsage {
396-
[CmdletBinding()]
397-
param(
398-
[Parameter(Mandatory = $true)]
399-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
400-
)
401-
402-
$extensions = $SslCertificate.Extensions | Where-Object { $_ -is [System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension] }
403-
$serverAuthenticationValue = "1.3.6.1.5.5.7.3.1"
404-
$serverAuth = $extensions.EnhancedKeyUsages | Where-Object { $_.Value -ieq $serverAuthenticationValue }
405-
406-
if (-not $serverAuth) {
407-
throw "Certificate does not have Server Authentication Enhanced Key Usage. Correct the certificate and try again."
408-
}
409-
}
410-
411-
function Test-SslCertificateCrypto {
412-
[CmdletBinding()]
413-
param(
414-
[Parameter(Mandatory = $true)]
415-
[System.Security.Cryptography.X509Certificates.X509Certificate2]$SslCertificate
416-
)
417-
418-
if ($SslCertificate.PublicKey.Oid.FriendlyName -eq "RSA") {
419-
if ($SslCertificate.PublicKey.Key.KeySize -lt 2048) {
420-
throw "Weak RSA Key: Upgrade to at least 2048-bit"
421-
} else {
422-
Write-Verbose "RSA Key is secure ($($SslCertificate.PublicKey.Key.KeySize) bits)"
423-
}
424-
}
425-
426-
if ($SslCertificate.PublicKey.Oid.FriendlyName -match "ECDSA") {
427-
$validCurves = @("ECDSA_P256", "ECDSA_P384", "ECDSA_P521")
428-
if ($validCurves -contains $SslCertificate.PublicKey.Oid.FriendlyName) {
429-
Write-Verbose "ECDSA with $($SslCertificate.PublicKey.Oid.FriendlyName) curve is secure"
430-
} else {
431-
throw "Weak ECDSA Curve: Use P-256, P-384, or P-521"
432-
}
433-
}
434-
435-
if ($SslCertificate.SignatureAlgorithm.FriendlyName -match "sha1") {
436-
throw "Weak Signature Algorithm: Upgrade to SHA-256 or higher"
437-
}
438-
}
439-
440-
# Test SSL Certificate for Management cert
441-
$HostName = $ManagementNetworkConfiguration.ManagementIpAddress
442-
$SslCertificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new(`
443-
$ManagementNetworkConfiguration.TlsCertificatePath,
444-
$ManagementNetworkConfiguration.TlsCertificatePassword)
445-
446-
$currentDate = Get-Date
447-
if ($currentDate -lt $SslCertificate.NotBefore) {
448-
throw "Certificate is not yet valid (future start date). Correct the certificate and try again."
449-
} elseif ($currentDate -gt $SslCertificate.NotAfter) {
450-
throw "Certificate has expired. Correct the certificate and try again."
451-
}
452-
453-
Test-SSLCertificateSAN -HostName $HostName -SslCertificate $SslCertificate | Out-Null
454-
Test-SSLCertificateChain -SslCertificate $SslCertificate | Out-Null
455-
Test-SslCertificateEnhancedKeyUsage -SslCertificate $SslCertificate | Out-Null
456-
Test-SslCertificateCrypto -SslCertificate $SslCertificate | Out-Null
457-
```
458333
459334
## Install and configure the appliance
460335

azure-local/manage/disconnected-operations-pki.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ On the host machine or Active Directory virtual machine (VM), follow the steps i
8585
You need these certificates to deploy the disconnected operations appliance. You also need the public key for your local infrastructure to provide a secure trust chain.
8686

8787
> [!NOTE]
88-
> **IngressEndpointCerts** is the folder where you store all 24 certificate files. **IngressEndpointPassword** is a secure string with the certificate password.
88+
> **IngressEndpointsCerts** is the folder where you store all 24 certificate files. **IngressEndpointPassword** is a secure string with the certificate password.
8989
9090
1. Connect to the CA.
9191
1. Create a folder named **IngressEndpointsCerts**. Use this folder to store all certificates.
92-
1. Create the 24 certs in the table above and export them into the IngressEndpointCerts folder.
92+
1. Create the 24 certs in the table above and export them into the IngressEndpointsCerts folder.
9393

9494
Here's an example script you can modify and run. It creates ingress certificates and exports them to the configured folder by creating CSRs and issuing them to your CA.
9595

@@ -206,7 +206,7 @@ $AzLCerts = @(
206206
}
207207
```
208208

209-
- Copy the original certificates (24 .pfx files / *.pfx) obtained from your CA to the directory structure represented in IngressEndpointCerts.
209+
- Copy the original certificates (24 .pfx files / *.pfx) obtained from your CA to the directory structure represented in IngressEndpointsCerts.
210210

211211
### Management endpoint
212212

@@ -294,7 +294,7 @@ _continue_ = "DNS=$subject"
294294
You need the root certificate public key for deployment. The following example shows how to export your root certificate public key:
295295

296296
```azurecli
297-
certutil -ca.cert applianceRoot.cer
297+
certutil -ca.cert C:\AzureLocalDisconnectedOperations\applianceRoot.cer
298298
```
299299

300300
For more information, see [Active Directory Certificate Services](/troubleshoot/windows-server/certificates-and-public-key-infrastructure-pki/export-root-certification-authority-certificate).

azure-local/manage/disconnected-operations-security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ To back up Host Guardian Service certificates from your cluster, run these comma
9898
1. To export the Host Guardian Service certificates to a specific path, run `Export-ApplianceHGSCertificates`.
9999
100100
```powershell
101-
Export-ApplianceHGSCertificates -Path D:\AzureLocal\HGSBackup
101+
Export-ApplianceHGSCertificates -Path C:\AzureLocalDisconnectedOperations\HGSBackup
102102
```
103103
104104
## Configure syslog forwarding

0 commit comments

Comments
 (0)