@@ -123,56 +123,39 @@ To set up Azure CLI for disconnected operations on Azure Local, follow these ste
123
123
```PowerShell
124
124
function Get-ApplianceAzCliCloudConfig
125
125
{
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
+ )
132
136
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 = @"
143
138
{
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
+ }
169
151
}
170
- $cloudConfigJson = $cloudConfig | ConvertTo-Json
171
- if ($OutputFolder)
152
+ "@ -replace "autonomous.cloud.private", $fqdn
153
+
154
+ if ($exportToFile)
172
155
{
173
- $cloudConfigJson | Set-Content -Path "$OutputFolder\cloudconfig.json "
156
+ $cloudConfig | Set-Content -Path "$exportToFile "
174
157
}
175
- return $cloudConfigJson
158
+ return $cloudConfig
176
159
}
177
160
```
178
161
@@ -182,7 +165,7 @@ To set up Azure CLI for disconnected operations on Azure Local, follow these ste
182
165
az config set core.enable_broker_on_windows=false
183
166
az config set core.instance_discovery=false
184
167
$fqdn = "autonomous.cloud.private"
185
- $cloudConfigJson = Get-ApplianceAzCliCloudConfig -ArmEndpoint "https://armmanagement.$($ fqdn)/"
168
+ $cloudConfigJson = Get-ApplianceAzCliCloudConfig -fqdn $ fqdn
186
169
187
170
# Write the content to a file cloudConfig.json
188
171
$cloudConfigJson | Out-File -FilePath cloudConfig.json
0 commit comments