forked from microsoft/azure_arc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaz_connect_win.ps1
24 lines (20 loc) · 998 Bytes
/
az_connect_win.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# <--- Change the following environment variables according to your Azure Service Principal name --->
$env:subscriptionId='<Your Azure Subscription ID>'
$env:appId='<Your Azure Service Principal name>'
$env:password='<Your Azure Service Principal password>'
$env:tenantId='<Your Azure tenant ID>'
$env:resourceGroup='<Azure Resource Group Name>'
$env:location='<Azure Region>'
# Download the package
function download() {$ProgressPreference="SilentlyContinue"; Invoke-WebRequest -Uri https://aka.ms/AzureConnectedMachineAgent -OutFile AzureConnectedMachineAgent.msi}
download
# Install the package
msiexec /i AzureConnectedMachineAgent.msi /l*v installationlog.txt /qn | Out-String
# Run connect command
& "$env:ProgramFiles\AzureConnectedMachineAgent\azcmagent.exe" connect `
--service-principal-id $env:appId `
--service-principal-secret $env:password `
--resource-group $env:resourceGroup `
--tenant-id $env:tenantId `
--location $env:location `
--subscription-id $env:subscriptionId