Skip to content

Latest commit

 

History

History
78 lines (46 loc) · 2.97 KB

onboard_server_linux.md

File metadata and controls

78 lines (46 loc) · 2.97 KB

Onboard an existing Linux server with Azure Arc

The following README will guide you on how to connect an Linux server to Azure Arc using a simple shell 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 server(s) to show up.

  • Download the az_connect_linux shell script.

  • Change the environment variables according to your environment.

  • Copy the script to the designated server using your preferred tool of choice (or copy/paste the script to a new file inside the server). Below example shows copy the script from macOS to the server using SCP.

Deployment

Run the script using the . ./az_connect_linux.sh command.

Note: The extra dot is due to the script has an export function and needs to have the vars exported in the same shell session as the rest of the commands.

Upon completion, you will have your Linux 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.