Skip to content

Commit b285a3a

Browse files
authored
Merge pull request #2410 from dkirby-ms/main
Update VI scenario with upstream changes to VI enabled by Arc extension deployment
2 parents 246fd48 + b135a4c commit b285a3a

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single_vi/artifacts/LogonScript.ps1

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Connect-AksEdgeArc -JsonConfigFilePath $tempDir\aksedge-config.json
136136
#####################################################################
137137
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
138138
helm repo update
139+
Start-Sleep -Seconds 5
139140
helm install ingress-nginx ingress-nginx/ingress-nginx
140141

141142
#####################################################################
@@ -149,19 +150,24 @@ Start-Sleep -Seconds 30
149150
### Video Indexer setup
150151
#####################################################################
151152
$viApiVersion="2023-06-02-preview"
152-
$extensionName="videoindexer"
153-
#$version="1.0.28-preview" # switch to blank
153+
$extensionName="video-indexer"
154+
$version="1.0.41" # switch to blank
154155
$namespace="video-indexer"
155156
$releaseTrain="release" # switch to release
156157
$storageClass="longhorn"
157158

158159
Write-Host "Create Cognitive Services on VI resource provider"
159160
$createResourceUri = "https://management.azure.com/subscriptions/${env:subscriptionId}/resourceGroups/${env:resourceGroup}/providers/Microsoft.VideoIndexer/accounts/${env:videoIndexerAccountName}/CreateExtensionDependencies?api-version=${viApiVersion}"
161+
160162
$result = $(az rest --method post --uri $createResourceUri) | ConvertFrom-Json
161163

162-
Write-Host "Retrieving Cognitive Service Credentials..."
164+
163165
$getSecretsUri="https://management.azure.com/subscriptions/${env:subscriptionId}/resourceGroups/${env:resourceGroup}/providers/Microsoft.VideoIndexer/accounts/${env:videoIndexerAccountName}/ListExtensionDependenciesData?api-version=$viApiVersion"
164-
$csResourcesData=$(az rest --method post --uri $getSecretsUri) | ConvertFrom-Json
166+
while ($null -eq $csResourcesData) {
167+
Write-Host "Retrieving Cognitive Service Credentials..."
168+
$csResourcesData=$(az rest --method post --uri $getSecretsUri) | ConvertFrom-Json
169+
Start-Sleep -Seconds 10
170+
}
165171
Write-Host
166172

167173
Write-Host "Getting VM public IP address..."
@@ -177,14 +183,16 @@ az k8s-extension create --name $extensionName `
177183
--cluster-name $clusterName `
178184
--resource-group $Env:resourceGroup `
179185
--cluster-type connectedClusters `
180-
--release-train $releaseTrain `
186+
--version $version `
181187
--auto-upgrade-minor-version false `
182188
--config-protected-settings "speech.endpointUri=$($csResourcesData.speechCognitiveServicesEndpoint)" `
183189
--config-protected-settings "speech.secret=$($csResourcesData.speechCognitiveServicesPrimaryKey)" `
184190
--config-protected-settings "translate.endpointUri=$($csResourcesData.translatorCognitiveServicesEndpoint)" `
185191
--config-protected-settings "translate.secret=$($csResourcesData.translatorCognitiveServicesPrimaryKey)" `
186-
--config "videoIndexer.accountId=${Env:videoIndexerAccountId}" `
192+
--config-protected-settings "ocr.endpointUri=$($csResourcesData.ocrCognitiveServicesEndpoint)" `
193+
--config-protected-settings "ocr.secret=$($csResourcesData.ocrCognitiveServicesPrimaryKey)" `
187194
--config "frontend.endpointUri=https://$ipAddress" `
195+
--config "videoIndexer.accountId=${Env:videoIndexerAccountId}" `
188196
--config "storage.storageClass=$storageClass" `
189197
--config "storage.accessMode=ReadWriteMany"
190198

@@ -195,7 +203,7 @@ New-NetFirewallRule -DisplayName "Allow Inbound Port 443" -Direction Inbound -Lo
195203

196204
Write-Host "Adding port forward for VI frontend..."
197205
Start-Sleep -Seconds 20
198-
$ing = kubectl get ing videoindexer-vi-arc -n $namespace -o json | ConvertFrom-Json
206+
$ing = kubectl get ing video-indexer-vi-arc -n $namespace -o json | ConvertFrom-Json
199207
$ingIp = $ing.status.loadBalancer.ingress.ip
200208
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress=$ingIp connectport=80
201209
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=443 connectaddress=$ingIp connectport=443

azure_jumpstart_hcibox/artifacts/PowerShell/Bootstrap.ps1

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,17 @@ Register-ScheduledTask -TaskName "HCIBoxLogonScript" -Trigger $Trigger -User $ad
149149
# Disable Edge 'First Run' Setup
150150
Write-Host "Configuring Microsoft Edge."
151151
$edgePolicyRegistryPath = 'HKLM:SOFTWARE\Policies\Microsoft\Edge'
152-
$desktopSettingsRegistryPath = 'HKCU:SOFTWARE\Microsoft\Windows\Shell\Bags\1\Desktop'
153152
$firstRunRegistryName = 'HideFirstRunExperience'
154153
$firstRunRegistryValue = '0x00000001'
155154
$savePasswordRegistryName = 'PasswordManagerEnabled'
156155
$savePasswordRegistryValue = '0x00000000'
157-
$autoArrangeRegistryName = 'FFlags'
158-
$autoArrangeRegistryValue = '1075839525'
159156

160157
if (-NOT (Test-Path -Path $edgePolicyRegistryPath)) {
161158
New-Item -Path $edgePolicyRegistryPath -Force | Out-Null
162159
}
163160

164161
New-ItemProperty -Path $edgePolicyRegistryPath -Name $firstRunRegistryName -Value $firstRunRegistryValue -PropertyType DWORD -Force
165162
New-ItemProperty -Path $edgePolicyRegistryPath -Name $savePasswordRegistryName -Value $savePasswordRegistryValue -PropertyType DWORD -Force
166-
Set-ItemProperty -Path $desktopSettingsRegistryPath -Name $autoArrangeRegistryName -Value $autoArrangeRegistryValue -Force
167163

168164
# Change RDP Port
169165
Write-Host "Updating RDP Port - RDP port number from configuration is $rdpPort"
@@ -207,5 +203,5 @@ Install-WindowsFeature -Name Hyper-V -IncludeAllSubFeature -IncludeManagementToo
207203
# Clean up Bootstrap.log
208204
Write-Header "Clean up Bootstrap.log."
209205
Stop-Transcript
210-
$logSuppress = Get-Content $($HCIBoxConfig.Paths.LogsDir)\Bootstrap.log | Where-Object { $_ -notmatch "Host Application: powershell.exe" }
211-
$logSuppress | Set-Content $($HCIBoxConfig.Paths.LogsDir)\Bootstrap.log -Force
206+
$logSuppress = Get-Content "$($HCIBoxConfig.Paths.LogsDir)\Bootstrap.log" | Where-Object { $_ -notmatch "Host Application: powershell.exe" }
207+
$logSuppress | Set-Content "$($HCIBoxConfig.Paths.LogsDir)\Bootstrap.log" -Force

azure_jumpstart_hcibox/artifacts/PowerShell/New-HCIBoxCluster.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ function Set-HCIDeployPrereqs {
14821482
Get-NetAdapter StorageA | Disable-NetAdapter -Confirm:$false | Out-Null
14831483
Get-NetAdapter StorageB | Disable-NetAdapter -Confirm:$false | Out-Null
14841484

1485-
#Invoke the registration script. For this preview release, only eastus region is supported.
1485+
#Invoke the registration script. For this release, only eastus region is supported.
14861486
Invoke-AzStackHciArcInitialization -SubscriptionID $subId -ResourceGroup $resourceGroup -TenantID $tenantId -Region eastus -Cloud "AzureCloud" -ArmAccessToken $armtoken.Token -AccountID $clientId
14871487

14881488
Get-NetAdapter StorageA | Enable-NetAdapter -Confirm:$false | Out-Null

0 commit comments

Comments
 (0)