Skip to content

Commit ba72f2f

Browse files
author
Ryan Willis
committed
first draft of cli docs
1 parent ccf9e40 commit ba72f2f

File tree

9 files changed

+606
-0
lines changed

9 files changed

+606
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: azcmagent check CLI reference
3+
description: Syntax for the azcmagent check command line tool
4+
author: rpsqrd
5+
ms.author: ryanpu
6+
ms.date: 04/20/2023
7+
---
8+
9+
# azcmagent check
10+
11+
Run a series of network connectivity checks to see if the agent can successfully communicate with required network endpoints. The command will output a table showing connectivity test results for each required endpoint, including whether the agent used a private endpoint and/or proxy server.
12+
13+
## Usage
14+
15+
```
16+
azcmagent check [flags]
17+
```
18+
19+
## Examples
20+
21+
Check connectivity with the agent's currently configured cloud and region.
22+
23+
```
24+
azcmagent check
25+
```
26+
27+
Check connectivity with the East US region using public endpoints.
28+
29+
```
30+
azcmagent check --location "eastus"
31+
```
32+
33+
Check connectivity with the Central India region using private endpoints.
34+
35+
```
36+
azcmagent check --location "centralindia" --enable-pls-check
37+
```
38+
39+
## Flags
40+
41+
`--cloud`
42+
43+
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".
44+
45+
Supported values:
46+
47+
* AzureCloud (public regions)
48+
* AzureUSGovernment (Azure US Government regions)
49+
* AzureChinaCloud (Azure China regions)
50+
51+
`-l`, `--location`
52+
53+
The Azure region to check connectivity with. If the machine is already connected to Azure Arc, the current region is selected as the default.
54+
55+
Sample value: westeurope
56+
57+
`-p`, `--enable-pls-check`
58+
59+
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.
60+
61+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
---
2+
title: azcmagent config CLI reference
3+
description: Syntax for the azcmagent config command line tool
4+
author: rpsqrd
5+
ms.author: ryanpu
6+
ms.date: 04/20/2023
7+
---
8+
9+
# azcmagent config
10+
11+
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.
12+
13+
## Commands
14+
15+
| Command | Purpose |
16+
| ------- | ------- |
17+
| [azcmagent config clear](#azcmagent-config-clear) | Clear a configuration property's value |
18+
| [azcmagent config get](#azcmagent-config-get) | Gets a configuration property's value |
19+
| [azcmagent config info](#azcmagent-config-info) | Describes all available configuration properties and supported values |
20+
| [azcmagent config list](#azcmagent-config-list) | Lists all configuration properties and values |
21+
| [azcmagent config set](#azcmagent-config-set) | Set a value for a configuration property |
22+
23+
## azcmagent config clear
24+
25+
Clear a configuration property's value and reset it to its default state.
26+
27+
### Usage
28+
29+
```
30+
azcmagent config clear [property] [flags]
31+
```
32+
33+
### Examples
34+
35+
Clear the proxy server URL property
36+
37+
```
38+
azcmagent config clear proxy.url
39+
```
40+
41+
### Flags
42+
43+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
44+
45+
## azcmagent config get
46+
47+
Get a configuration property's value.
48+
49+
### Usage
50+
51+
```
52+
azcmagent config get [property] [flags]
53+
```
54+
55+
### Examples
56+
57+
Get the agent mode
58+
59+
```
60+
azcmagent config get config.mode
61+
```
62+
63+
### Flags
64+
65+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
66+
67+
## azcmagent config info
68+
69+
Describes available configuration properties and supported values. When run without specifying a specific property, the command will describe all available properties their supported values.
70+
71+
### Usage
72+
73+
```
74+
azcmagent config info [property] [flags]
75+
```
76+
77+
### Examples
78+
79+
Describe all available configuration properties and supported values
80+
81+
```
82+
azcmagent config info
83+
```
84+
85+
Learn more about the extensions allowlist property and its supported values
86+
87+
```
88+
azcmagent config info extensions.allowlist
89+
```
90+
91+
### Flags
92+
93+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
94+
95+
## azcmagent config list
96+
97+
Lists all configuration properties and their current values
98+
99+
### Usage
100+
101+
```
102+
azcmagent config list [flags]
103+
```
104+
105+
### Examples
106+
107+
List the current agent configuration.
108+
109+
```
110+
azcmagent config list
111+
```
112+
113+
### Flags
114+
115+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
116+
117+
## azcmagent config set
118+
119+
Set a value for a configuration property.
120+
121+
### Usage
122+
123+
```
124+
azcmagent config set [property] [value] [flags]
125+
```
126+
127+
### Examples
128+
129+
Configure the agent to use a proxy server
130+
131+
```
132+
azcmagent config set proxy.url "http://proxy.contoso.corp:8080"
133+
```
134+
135+
Append an extension to the extension allowlist.
136+
137+
```
138+
azcmagent config set extensions.allowlist "Microsoft.Azure.Monitor/AzureMonitorWindowsAgent" --add
139+
```
140+
141+
### Flags
142+
143+
`-a`, `--add`
144+
145+
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. Cannot be used with the `--remove` flag.
146+
147+
`-r`, `--remove`
148+
149+
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. Cannot be used in conjunction with the `--add` flag.
150+
151+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
title: azcmagent connect CLI reference
3+
description: Syntax for the azcmagent connect command line tool
4+
author: rpsqrd
5+
ms.author: ryanpu
6+
ms.date: 04/20/2023
7+
---
8+
9+
# azcmagent connect
10+
11+
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 servers (Microsoft.HybridCompute/machines) resources in that location.
12+
13+
## Usage
14+
15+
```
16+
azcmagent connect [authentication] --subscription-id [subscription] --resource-group [resourcegroup] --location [region] [flags]
17+
```
18+
19+
## Examples
20+
21+
Connect a server using the default login method (interactive browser or device code)
22+
23+
```
24+
azcmagent connect --subscription "Production" --resource-group "HybridServers" --location "eastus"
25+
```
26+
27+
Connect a server using a service principal
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 will open the login page 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 will 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 are not 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 are not 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. See [authentication options](#authentication-options) for more information.
71+
72+
`--cloud`
73+
74+
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".
75+
76+
Supported values:
77+
78+
* AzureCloud (public regions)
79+
* AzureUSGovernment (Azure US Government regions)
80+
* AzureChinaCloud (Azure China regions)
81+
82+
`--correlation-id`
83+
84+
Identifies the mechanism being used to connect the server to Azure Arc. For example, the GUID may indicate the agent was installed by a script generated in the Azure Portal or executed as part of an Azure Arc Jumpstart scenario. This flag is optional and only used for telemetry purposes.
85+
86+
`--ignore-network-check`
87+
88+
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 will not function correctly on the server.
89+
90+
`-l`, `--location`
91+
92+
The Azure region to check connectivity with. If the machine is already connected to Azure Arc, the current region is selected as the default.
93+
94+
Sample value: westeurope
95+
96+
`--private-link-scope`
97+
98+
Specifies the resource ID of the Azure Arc private link scope to associate with the server. This flag is required if you are using private endpoints to connect the server to Azure.
99+
100+
`-g`, `--resource-group`
101+
102+
Name of the Azure resource group where you want to create the Azure Arc-enabled server resource.
103+
104+
Sample value: HybridServers
105+
106+
`-n`, `--resource-name`
107+
108+
Name for the Azure Arc-enabled server resource. By default, the resource name is:
109+
110+
* The AWS instance ID, if the server is on AWS
111+
* The hostname for all other machines
112+
113+
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 cannot be changed without disconnecting and re-connecting the agent.
114+
115+
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.
116+
117+
Sample value: FileServer01
118+
119+
`-i`, `--service-principal-id`
120+
121+
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. See [authentication options](#authentication-options) for more information.
122+
123+
`-p`, `--service-principal-secret`
124+
125+
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. See [authentication options](#authentication-options) for more information.
126+
127+
`-s`, `--subscription-id`
128+
129+
The subscription name or ID where you want to create the Azure Arc-enabled server resource.
130+
131+
Sample values: Production, aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
132+
133+
`--tags`
134+
135+
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.
136+
137+
Sample value: Datacenter=NY3,Application=SharePoint,Owner='Shared Infrastructure Services'
138+
139+
`-t`, `--tenant-id`
140+
141+
The tenant ID for the subscription where you want to create the Azure Arc-enabled server resource. This 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 tenant 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.
142+
143+
`--use-device-code`
144+
145+
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. See [authentication options](#authentication-options) for more information.
146+
147+
[!INCLUDE [common-flags](includes/azcmagent-common-flags.md)]

0 commit comments

Comments
 (0)