Skip to content

Latest commit

 

History

History
76 lines (45 loc) · 2.84 KB

onboard_server_win.md

File metadata and controls

76 lines (45 loc) · 2.84 KB

Onboard an existing Windows server with Azure Arc

The following README will guide you on how to connect an Windows machine to Azure Arc using a simple PowerShell script.

Prerequisites

  • Install or update Azure CLI. Azure CLI should be running version 2.7 or later. Use az --version to check your current installed version.

  • Create Azure Service Principal (SP)

    To connect a server to Azure Arc, an Azure Service Principal assigned with the "Azure Connected Machine Onboarding" role is required. To create it, login to your Azure account run the below command (this can also be done in Azure Cloud Shell).

    az login
    az ad sp create-for-rbac -n "<Unique SP Name>" --role "Azure Connected Machine Onboarding"

    For example:

    az ad sp create-for-rbac -n "http://AzureArcServers" --role "Azure Connected Machine Onboarding"

    Output should look like this:

    {
    "appId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "displayName": "AzureArcServers",
    "name": "http://AzureArcServers",
    "password": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "tenant": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
    

    Note: It is optional but highly recommended to scope the SP to a specific Azure subscription and Resource Group

  • Azure Arc enabled servers is leveraging the Microsoft.HybridCompute resource provider (RP). Using the bellow command, register the RP.

    az provider register --namespace 'Microsoft.HybridCompute'
  • Create a new Azure Resource Group where you want your machine(s) to show up.

  • Download the az_connect_win PowerShell script.

  • Change the environment variables according to your environment and copy the script to the designated machine.

Deployment

On the designated machine, Open PowerShell ISE as Administrator and run the script. Note the script is using $env:ProgramFiles as the agent installation path so make sure you are not using PowerShell ISE (x86).

Upon completion, you will have your Windows server, connected as a new Azure Arc resource inside your resource group.

Delete the deployment

The most straightforward way is to delete the server via the Azure Portal, just select server and delete it.

If you want to nuke the entire environment, just delete the Azure resource group.