You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-arc/servers/onboard-service-principal.md
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,41 +53,28 @@ The Azure Arc service in the Azure portal provides a streamlined way to create a
53
53
54
54
You can use [Azure PowerShell](/powershell/azure/install-az-ps) to create a service principal with the [New-AzADServicePrincipal](/powershell/module/Az.Resources/New-AzADServicePrincipal) cmdlet.
55
55
56
-
1.Run the following command. You must store the output of the [`New-AzADServicePrincipal`](/powershell/module/az.resources/new-azadserviceprincipal) cmdlet in a variable, or you will not be able to retrieve the password needed in a later step.
57
-
56
+
1.Check the context of your Azure PowerShell session to ensure you're working in the correct subscription. Use [Set-AzContext](/powershell/module/az.accounts/set-azcontext) if you need to change the subscription.
2. To retrieve the password stored in the `$sp` variable, run the following command:
74
-
61
+
62
+
1. Run the following command to create a service principal and assign it the Azure Connected Machine Onboarding role for the selected subscription. After the service principal is created, it will print the application ID and secret. The secret is valid for 1 year, after which you'll need to generate a new secret and update any scripts with the new secret.
3. In the output, find the values for the fields **password** and **ApplicationId**. You'll need these values later, so save them in a secure place. If you forget or lose your service principal password, you can reset it using the [`New-AzADSpCredential`](/powershell/module/az.resources/new-azadspcredential) cmdlet.
81
-
82
-
The values from the following properties are used with parameters passed to the `azcmagent`:
83
-
84
-
- The value from the **ApplicationId** property is used for the `--service-principal-id` parameter value
85
-
- The value from the **password** property is used for the `--service-principal-secret` parameter used to connect the agent.
86
-
87
-
> [!TIP]
88
-
> Make sure to use the service principal **ApplicationId** property, not the **Id** property.
89
-
90
-
4. Assign the **Azure Connected Machine Onboarding** role to the service principal for the designated resource group or subscription. This role contains only the permissions required to onboard a machine. Note that your account must be a member of the **Owner** or **User Access Administrator** role for the subscription to which the service principal will have access. For information on how to add role assignments, see [Assign Azure roles using the Azure portal](../../role-based-access-control/role-assignments-portal.md) or [Assign Azure roles using Azure CLI](../../role-based-access-control/role-assignments-cli.md).
74
+
The values from the following properties are used with parameters passed to the `azcmagent`:
75
+
76
+
- The value from the **AppId** property is used for the `--service-principal-id` parameter value
77
+
- The value from the **Secret** property is used for the `--service-principal-secret` parameter used to connect the agent.
91
78
92
79
## Generate the installation script from the Azure portal
93
80
@@ -144,8 +131,21 @@ After you install the agent and configure it to connect to Azure Arc-enabled ser
144
131
145
132

146
133
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
147
144
## Next steps
148
145
149
146
- Review the [Planning and deployment guide](plan-at-scale-deployment.md) to plan for deploying Azure Arc-enabled servers at any scale and implement centralized management and monitoring.
150
147
- Learn how to [troubleshoot agent connection issues](troubleshoot-agent-onboard.md).
151
148
- Learn how to manage your machines using [Azure Policy](../../governance/policy/overview.md) for such things as VM [guest configuration](../../governance/machine-configuration/overview.md), verifying that machines are reporting to the expected Log Analytics workspace, monitoring with [VM insights](../../azure-monitor/vm/vminsights-enable-policy.md), and more.
0 commit comments