Skip to content

Commit 5e181c1

Browse files
authored
Install Azure CLI as part of the jump box
1 parent a089c63 commit 5e181c1

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Follow these instructions to deploy this example to your Azure subscription, try
6060

6161
- An [Azure subscription](https://azure.microsoft.com/free/)
6262

63-
- The subscription must have the following resource providers [registered](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-providers-and-types#register-resource-provider).
63+
- The subscription must have all of the resource providers used in this deployment [registered](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-providers-and-types#register-resource-provider).
6464

6565
- `Microsoft.AlertsManagement`
6666
- `Microsoft.Bing`
@@ -197,9 +197,7 @@ The AI agent definition would likely be deployed from your application's pipelin
197197
| :computer: | Unless otherwise noted, the following steps are performed from the jump box or from your VPN-connected workstation. The instructions are written as if you are using the provided Windows jump box.|
198198
| :--------: | :------------------------- |
199199

200-
1. [Install the Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli-windows) in your jump box.
201-
202-
1. Open a new PowerShell terminal. Log in and select your target subscription.
200+
1. Open a PowerShell terminal. Log in and select your target subscription.
203201

204202
```powershell
205203
az login

infra-as-code/bicep/jump-box.bicep

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,22 @@ resource jumpBoxVirtualMachine 'Microsoft.Compute/virtualMachines@2024-11-01' =
332332
}
333333
}
334334

335+
@description('Install Azure CLI on the jump box.')
336+
resource azureCliExtension 'extensions' = {
337+
name: 'installAzureCLI'
338+
location: location
339+
properties: {
340+
autoUpgradeMinorVersion: true
341+
enableAutomaticUpgrade: false
342+
publisher: 'Microsoft.Compute'
343+
type: 'CustomScriptExtension'
344+
typeHandlerVersion: '1.10'
345+
settings: {
346+
commandToExecute: 'powershell -ExecutionPolicy Unrestricted -Command "Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList \'/I AzureCLI.msi /quiet\'"'
347+
}
348+
}
349+
}
350+
335351
@description('Enable Azure Monitor Agent for observability though VM Insights.')
336352
resource amaExtension 'extensions' = {
337353
name: 'AzureMonitorWindowsAgent'

0 commit comments

Comments
 (0)