Skip to content

Commit 37f3b51

Browse files
authored
Merge pull request #235212 from rpsqrd/azcmagent-cli-docs
azcmagent CLI docs
2 parents bd01e8c + 0aa26a4 commit 37f3b51

13 files changed

+750
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: azcmagent check CLI reference
3+
description: Syntax for the azcmagent check command line tool
4+
ms.topic: reference
5+
ms.date: 04/20/2023
6+
---
7+
8+
# azcmagent check
9+
10+
Run a series of network connectivity checks to see if the agent can successfully communicate with required network endpoints. The command outputs a table showing connectivity test results for each required endpoint, including whether the agent used a private endpoint and/or proxy server.
11+
12+
## Usage
13+
14+
```
15+
azcmagent check [flags]
16+
```
17+
18+
## Examples
19+
20+
Check connectivity with the agent's currently configured cloud and region.
21+
22+
```
23+
azcmagent check
24+
```
25+
26+
Check connectivity with the East US region using public endpoints.
27+
28+
```
29+
azcmagent check --location "eastus"
30+
```
31+
32+
Check connectivity with the Central India region using private endpoints.
33+
34+
```
35+
azcmagent check --location "centralindia" --enable-pls-check
36+
```
37+
38+
## Flags
39+
40+
`--cloud`
41+
42+
Specifies the Azure cloud instance. Must be used with the `--location` flag. If the machine is already connected to Azure Arc, the default value is the cloud to which the agent is already connected. Otherwise, the default value is "AzureCloud".
43+
44+
Supported values:
45+
46+
* AzureCloud (public regions)
47+
* AzureUSGovernment (Azure US Government regions)
48+
* AzureChinaCloud (Azure China regions)
49+
50+
`-l`, `--location`
51+
52+
The Azure region to check connectivity with. If the machine is already connected to Azure Arc, the current region is selected as the default.
53+
54+
Sample value: westeurope
55+
56+
`-p`, `--enable-pls-check`
57+
58+
Checks if supported Azure Arc endpoints resolve to private IP addresses. This flag should be used when you intend to connect the server to Azure using an Azure Arc private link scope.
59+
60+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
title: azcmagent config CLI reference
3+
description: Syntax for the azcmagent config command line tool
4+
ms.topic: reference
5+
ms.date: 04/20/2023
6+
---
7+
8+
# azcmagent config
9+
10+
Configure settings for the Azure connected machine agent. Configurations are stored locally and are unique to each machine. Available configuration properties vary by agent version. Use [azcmagent config info](#azcmagent-config-info) to see all available configuration properties and supported values for the currently installed agent.
11+
12+
## Commands
13+
14+
| Command | Purpose |
15+
| ------- | ------- |
16+
| [azcmagent config clear](#azcmagent-config-clear) | Clear a configuration property's value |
17+
| [azcmagent config get](#azcmagent-config-get) | Gets a configuration property's value |
18+
| [azcmagent config info](#azcmagent-config-info) | Describes all available configuration properties and supported values |
19+
| [azcmagent config list](#azcmagent-config-list) | Lists all configuration properties and values |
20+
| [azcmagent config set](#azcmagent-config-set) | Set a value for a configuration property |
21+
22+
## azcmagent config clear
23+
24+
Clear a configuration property's value and reset it to its default state.
25+
26+
### Usage
27+
28+
```
29+
azcmagent config clear [property] [flags]
30+
```
31+
32+
### Examples
33+
34+
Clear the proxy server URL property.
35+
36+
```
37+
azcmagent config clear proxy.url
38+
```
39+
40+
### Flags
41+
42+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
43+
44+
## azcmagent config get
45+
46+
Get a configuration property's value.
47+
48+
### Usage
49+
50+
```
51+
azcmagent config get [property] [flags]
52+
```
53+
54+
### Examples
55+
56+
Get the agent mode.
57+
58+
```
59+
azcmagent config get config.mode
60+
```
61+
62+
### Flags
63+
64+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
65+
66+
## azcmagent config info
67+
68+
Describes available configuration properties and supported values. When run without specifying a specific property, the command describes all available properties their supported values.
69+
70+
### Usage
71+
72+
```
73+
azcmagent config info [property] [flags]
74+
```
75+
76+
### Examples
77+
78+
Describe all available configuration properties and supported values.
79+
80+
```
81+
azcmagent config info
82+
```
83+
84+
Learn more about the extensions allowlist property and its supported values.
85+
86+
```
87+
azcmagent config info extensions.allowlist
88+
```
89+
90+
### Flags
91+
92+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
93+
94+
## azcmagent config list
95+
96+
Lists all configuration properties and their current values
97+
98+
### Usage
99+
100+
```
101+
azcmagent config list [flags]
102+
```
103+
104+
### Examples
105+
106+
List the current agent configuration.
107+
108+
```
109+
azcmagent config list
110+
```
111+
112+
### Flags
113+
114+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
115+
116+
## azcmagent config set
117+
118+
Set a value for a configuration property.
119+
120+
### Usage
121+
122+
```
123+
azcmagent config set [property] [value] [flags]
124+
```
125+
126+
### Examples
127+
128+
Configure the agent to use a proxy server.
129+
130+
```
131+
azcmagent config set proxy.url "http://proxy.contoso.corp:8080"
132+
```
133+
134+
Append an extension to the extension allowlist.
135+
136+
```
137+
azcmagent config set extensions.allowlist "Microsoft.Azure.Monitor/AzureMonitorWindowsAgent" --add
138+
```
139+
140+
### Flags
141+
142+
`-a`, `--add`
143+
144+
Append the value to the list of existing values. If not specified, the default behavior is to replace the list of existing values. This flag is only supported for configuration properties that support more than one value. Can't be used with the `--remove` flag.
145+
146+
`-r`, `--remove`
147+
148+
Remove the specified value from the list, retaining all other values. If not specified, the default behavior is to replace the list of existing values. This flag is only supported for configuration properties that support more than one value. Can't be used in conjunction with the `--add` flag.
149+
150+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
title: azcmagent connect CLI reference
3+
description: Syntax for the azcmagent connect command line tool
4+
ms.topic: reference
5+
ms.date: 04/20/2023
6+
---
7+
8+
# azcmagent connect
9+
10+
Connects the server to Azure Arc by creating a metadata representation of the server in Azure and associating the Azure connected machine agent with it. The command requires information about the tenant, subscription, and resource group where you want to represent the server in Azure and valid credentials with permissions to create Azure Arc-enabled server resources in that location.
11+
12+
## Usage
13+
14+
```
15+
azcmagent connect [authentication] --subscription-id [subscription] --resource-group [resourcegroup] --location [region] [flags]
16+
```
17+
18+
## Examples
19+
20+
Connect a server using the default login method (interactive browser or device code).
21+
22+
```
23+
azcmagent connect --subscription "Production" --resource-group "HybridServers" --location "eastus"
24+
```
25+
26+
Connect a server using a service principal.
27+
28+
```
29+
azcmagent connect --subscription "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" --resource-group "HybridServers" --location "australiaeast" --service-principal-id "ID" --service-principal-secret "SECRET" --tenant-id "TENANT"
30+
```
31+
32+
Connect a server using a private endpoint and device code login method.
33+
34+
```
35+
azcmagent connect --subscription "Production" --resource-group "HybridServers" --location "koreacentral" --use-device-code --private-link-scope "/subscriptions/.../Microsoft.HybridCompute/privateLinkScopes/ScopeName"
36+
```
37+
38+
## Authentication options
39+
40+
There are 4 ways to provide authentication credentials to the Azure connected machine agent. Choose one authentication option and replace the `[authentication]` section in the usage syntax with the recommended flags.
41+
42+
### Interactive browser login (Windows-only)
43+
44+
This option is the default on Windows operating systems with a desktop experience. It login page opens in your default web browser. This option may be required if your organization has configured conditional access policies that require you to log in from trusted machines.
45+
46+
No flag is required to use the interactive browser login.
47+
48+
### Device code login
49+
50+
This option generates a code that you can use to log in on a web browser on another device. This is the default option on Windows Server core editions and all Linux distributions. When you execute the connect command, you have 5 minutes to open the specified login URL on an internet-connected device and complete the login flow.
51+
52+
To authenticate with a device code, use the `--use-device-code` flag. If the account you're logging in with and the subscription where you're registering the server aren't in the same tenant, you must also provide the tenant ID for the subscription with `--tenant-id [tenant]`.
53+
54+
### Service principal
55+
56+
Service principals allow you to authenticate non-interactively and are often used for at-scale deployments where the same script is run across multiple servers. It's recommended that you provide service principal information via a configuration file (see `--config`) to avoid exposing the secret in any console logs. The service principal should also be dedicated for Arc onboarding and have as few permissions as possible, to limit the impact of a stolen credential.
57+
58+
To authenticate with a service principal, provide the service principal's application ID, secret, and tenant ID: `--service-principal-id [appid] --service-principal-secret [secret] --tenant-id [tenantid]`
59+
60+
### Access token
61+
62+
Access tokens can also be used for non-interactive authentication, but are short-lived and typically used by automation solutions onboarding several servers over a short period of time. You can get an access token with [Get-AzAccessToken](/powershell/module/az.accounts/get-azaccesstoken) or any other Azure Active Directory client.
63+
64+
To authenticate with an access token, use the `--access-token [token]` flag. If the account you're logging in with and the subscription where you're registering the server aren't in the same tenant, you must also provide the tenant ID for the subscription with `--tenant-id [tenant]`.
65+
66+
## Flags
67+
68+
`--access-token`
69+
70+
Specifies the Azure Active Directory access token used to create the Azure Arc-enabled server resource in Azure. For more information, see [authentication options](#authentication-options).
71+
72+
`--automanage-profile`
73+
74+
Resource ID of an Azure Automanage best practices profile that will be applied to the server once it's connected to Azure.
75+
76+
Sample value: /providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction
77+
78+
`--cloud`
79+
80+
Specifies the Azure cloud instance. Must be used with the `--location` flag. If the machine is already connected to Azure Arc, the default value is the cloud to which the agent is already connected. Otherwise, the default value is "AzureCloud".
81+
82+
Supported values:
83+
84+
* AzureCloud (public regions)
85+
* AzureUSGovernment (Azure US Government regions)
86+
* AzureChinaCloud (Azure China regions)
87+
88+
`--correlation-id`
89+
90+
Identifies the mechanism being used to connect the server to Azure Arc. For example, scripts generated in the Azure portal include a GUID that helps Microsoft track usage of that experience. This flag is optional and only used for telemetry purposes to improve your experience.
91+
92+
`--ignore-network-check`
93+
94+
Instructs the agent to continue onboarding even if the network check for required endpoints fails. You should only use this option if you're sure that the network check results are incorrect. In most cases, a failed network check indicates that the Arc agent won't function correctly on the server.
95+
96+
`-l`, `--location`
97+
98+
The Azure region to check connectivity with. If the machine is already connected to Azure Arc, the current region is selected as the default.
99+
100+
Sample value: westeurope
101+
102+
`--private-link-scope`
103+
104+
Specifies the resource ID of the Azure Arc private link scope to associate with the server. This flag is required if you're using private endpoints to connect the server to Azure.
105+
106+
`-g`, `--resource-group`
107+
108+
Name of the Azure resource group where you want to create the Azure Arc-enabled server resource.
109+
110+
Sample value: HybridServers
111+
112+
`-n`, `--resource-name`
113+
114+
Name for the Azure Arc-enabled server resource. By default, the resource name is:
115+
116+
* The AWS instance ID, if the server is on AWS
117+
* The hostname for all other machines
118+
119+
You can override the default name with a name of your own choosing to avoid naming conflicts. Once chosen, the name of the Azure resource can't be changed without disconnecting and re-connecting the agent.
120+
121+
If you want to force AWS servers to use the hostname instead of the instance ID, pass in `$(hostname)` to have the shell evaluate the current hostname and pass that in as the new resource name.
122+
123+
Sample value: FileServer01
124+
125+
`-i`, `--service-principal-id`
126+
127+
Specifies the application ID of the service principal used to create the Azure Arc-enabled server resource in Azure. Must be used with the `--service-principal-secret` and `--tenant-id` flags. For more information, see [authentication options](#authentication-options).
128+
129+
`-p`, `--service-principal-secret`
130+
131+
Specifies the service principal secret. Must be used with the `--service-principal-id` and `--tenant-id` flags. To avoid exposing the secret in console logs, it's recommended to pass in the service principal secret in a configuration file. For more information, see [authentication options](#authentication-options).
132+
133+
`-s`, `--subscription-id`
134+
135+
The subscription name or ID where you want to create the Azure Arc-enabled server resource.
136+
137+
Sample values: Production, aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
138+
139+
`--tags`
140+
141+
Comma-delimited list of tags to apply to the Azure Arc-enabled server resource. Each tag should be specified in the format: TagName=TagValue. If the tag name or value contains a space, use single quotes around the name or value.
142+
143+
Sample value: Datacenter=NY3,Application=SharePoint,Owner='Shared Infrastructure Services'
144+
145+
`-t`, `--tenant-id`
146+
147+
The tenant ID for the subscription where you want to create the Azure Arc-enabled server resource. This flag is required when authenticating with a service principal. For all other authentication methods, the home tenant of the account used to authenticate with Azure is used for the resource as well. If the tenants for the account and subscription are different (guest accounts, Lighthouse), you must specify the tenant ID to clarify the tenant where the subscription is located.
148+
149+
`--use-device-code`
150+
151+
Generate an Azure Active Directory device login code that can be entered in a web browser on another computer to authenticate the agent with Azure. For more information, see [authentication options](#authentication-options).
152+
153+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]

0 commit comments

Comments
 (0)