|
| 1 | +--- |
| 2 | +title: Azure Connected Machine Agent CLI interface |
| 3 | +description: Reference documentation for the Azure Connected Machine agent CLI |
| 4 | +author: bobbytreed |
| 5 | +manager: carmonm |
| 6 | +services: azure-arc |
| 7 | +ms.service: azure-arc |
| 8 | +ms.subservice: azure-arc-servers |
| 9 | +ms.topic: reference |
| 10 | +ms.date: 11/04/2019 |
| 11 | +ms.author: robreed |
| 12 | +--- |
| 13 | +# Azure Connected Machine Agent CLI interface |
| 14 | + |
| 15 | +The `Azcmagent` (Azure Connected Machine Agent) tool is used to configure and troubleshoot a non-azure machines connection to Azure. |
| 16 | + |
| 17 | +The agent itself is a daemon process called `himdsd` on Linux, and a Windows Service called `himds` on Windows. |
| 18 | + |
| 19 | +In normal usage, `azcmagent connect` is used to establish a connection between this machine and Azure, and |
| 20 | +`azcmagent disconnect` if you decide you no longer want that connection. The other commands are for troubleshooting |
| 21 | +or other special cases. |
| 22 | + |
| 23 | +## Options |
| 24 | + |
| 25 | +```none |
| 26 | + -h, --help help for azcmagent |
| 27 | + -v, --verbose Increase logging verbosity to show all logs |
| 28 | +``` |
| 29 | + |
| 30 | +## SEE ALSO |
| 31 | + |
| 32 | +* [azcmagent connect](#azcmagent-connect) - Connects this machine to Azure |
| 33 | +* [azcmagent disconnect](#azcmagent-disconnect) - Disconnects this machine from Azure |
| 34 | +* [azcmagent reconnect](#azcmagent-reconnect) - Reconnects this machine to Azure |
| 35 | +* [azcmagent show](#azcmagent-show) - Gets machine metadata and Agent status. This is primarily useful for troubleshooting. |
| 36 | +* [azcmagent version](#azcmagent-version) - Display the Hybrid Management Agent version |
| 37 | + |
| 38 | +## azcmagent connect |
| 39 | + |
| 40 | +Connects this machine to Azure |
| 41 | + |
| 42 | +### Synopsis |
| 43 | + |
| 44 | +Creates a resource in Azure representing this machine. |
| 45 | + |
| 46 | +This uses the authentication options provided to create a resource in Azure Resource Manager |
| 47 | +representing this machine. The resource is in the subscription and resource group requested, |
| 48 | +and data about the machine is stored in the Azure region specified by the location parameter. |
| 49 | +The default resource name is the hostname of this machine if not overridden. |
| 50 | + |
| 51 | +A certificate corresponding to the System-Assigned Identity of this machine is then downloaded |
| 52 | +and stored locally. Once this step completes the **Azure Connected Machine Metadata** Service and Guest |
| 53 | +Configuration Agent begin synchronizing with Azure cloud. |
| 54 | + |
| 55 | +Authentication options: |
| 56 | + |
| 57 | +* Access Token |
| 58 | + `azcmagent connect --access-token <> --subscription-id <> --resource-group <> --location <>` |
| 59 | +* Service Principal ID and secret |
| 60 | + `azcmagent connect --service-principal-id <> --service-principal-secret <> --tenant-id <tenantid> --subscription-id <> --resource-group <> --location <>` |
| 61 | +* Device sign in (Interactive) |
| 62 | + `azcmagent connect --tenant-id <> --subscription-id <> --resource-group <> --location <>` |
| 63 | + |
| 64 | +### Syntax |
| 65 | + |
| 66 | +```none |
| 67 | +azcmagent connect [flags] |
| 68 | +``` |
| 69 | + |
| 70 | +### Options |
| 71 | + |
| 72 | +```none |
| 73 | + --access-token string Access token |
| 74 | + -h, --help help for connect |
| 75 | + -l, --location string Location of the resource [Required] |
| 76 | + --physical-location string Physical location of the resource |
| 77 | + -g, --resource-group string Name of the resource group. [Required] |
| 78 | + -n, --resource-name string Name of the resource. Defaults to Host Name |
| 79 | + -i, --service-principal-id string Service Principal Id |
| 80 | + -p, --service-principal-secret string Service Principal Secret |
| 81 | + -s, --subscription-id string Subscription Id [Required] |
| 82 | + -t, --tags string Tags for resource |
| 83 | + --tenant-id string Tenant Id |
| 84 | +``` |
| 85 | + |
| 86 | +## azcmagent disconnect |
| 87 | + |
| 88 | +Disconnects this machine from Azure |
| 89 | + |
| 90 | +### Synopsis |
| 91 | + |
| 92 | +Deletes the resource in Azure that represents this server. |
| 93 | + |
| 94 | +This command uses the authentication options provided to remove the Azure Resource Manager |
| 95 | +resource representing this machine. After this point the **Azure Connected Machine Metadata Service** |
| 96 | +and Guest Configuration Agent will be disconnected. This command does not stop or remove |
| 97 | +the services: remove the package in order to do that. |
| 98 | + |
| 99 | +This command requires higher privileges than the "Azure Connected Machine Onboarding" role. |
| 100 | + |
| 101 | +Once a machine is disconnected, use `azcmagent connect`, not `azcmagent reconnect` if you want to create |
| 102 | +a new resource for it in Azure. |
| 103 | + |
| 104 | +Authentication Options: |
| 105 | + |
| 106 | +* Access Token |
| 107 | + `azcmagent disconnect --access-token <>` |
| 108 | +* Service Principal ID and secret |
| 109 | + `azcmagent disconnect --service-principal-id <> --service-principal-secret <> --tenant-id <tenantid>` |
| 110 | +* Interactive Device sign in |
| 111 | + `azcmagent disconnect --tenant-id <>` |
| 112 | + |
| 113 | +### Syntax |
| 114 | + |
| 115 | +```none |
| 116 | +azcmagent disconnect [flags] |
| 117 | +``` |
| 118 | + |
| 119 | +### Options |
| 120 | + |
| 121 | +```none |
| 122 | + --access-token string Access token |
| 123 | + -h, --help help for disconnect |
| 124 | + -r, --resource-group string Name of the resource group |
| 125 | + -n, --resource-name string Name of the resource |
| 126 | + -i, --service-principal-id string Service Principal Id |
| 127 | + -p, --service-principal-secret string Service Principal Secret |
| 128 | + -s, --subscription-id string Subscription Id |
| 129 | + -t, --tenant-id string Tenant Id |
| 130 | +``` |
| 131 | + |
| 132 | +## azcmagent reconnect |
| 133 | + |
| 134 | +Reconnects this machine to Azure |
| 135 | + |
| 136 | +### Synopsis |
| 137 | + |
| 138 | +Reconnect machine with invalid credentials to Azure. |
| 139 | + |
| 140 | +If a machine already has a resource in Azure but is not able to authenticate to it, it can |
| 141 | +be reconnected using this command. This is possible if a machine was turned off long enough |
| 142 | +for its certificate to expire (at least 45 days). |
| 143 | + |
| 144 | +If a machine was disconnected with `azcmagent disconnect`, use `azcmagent connect` instead. |
| 145 | + |
| 146 | +This command uses the authentication options provided to retrieve new credentials corresponding |
| 147 | +to the Azure Resource Manager resource representing this machine. |
| 148 | + |
| 149 | +This command requires higher privileges than the **Azure Connected Machine Onboarding** role. |
| 150 | + |
| 151 | +Authentication Options |
| 152 | + |
| 153 | +* Access Token |
| 154 | + `azcmagent reconnect --access-token <>` |
| 155 | +* Service Principal ID and secret |
| 156 | + `azcmagent reconnect --service-principal-id <> --service-principal-secret <> --tenant-id <tenantid>` |
| 157 | +* Interactive Device sign in |
| 158 | + `azcmagent reconnect --tenant-id <>` |
| 159 | + |
| 160 | +### Syntax |
| 161 | + |
| 162 | +```none |
| 163 | +azcmagent reconnect [flags] |
| 164 | +``` |
| 165 | + |
| 166 | +### Options |
| 167 | + |
| 168 | +```none |
| 169 | + --access-token string Access token |
| 170 | + -h, --help help for reconnect |
| 171 | + -l, --location string Location of the resource |
| 172 | + -g, --resource-group string Name of the resource group. |
| 173 | + -n, --resource-name string Name of the resource. Defaults to Host Name |
| 174 | + -i, --service-principal-id string Service Principal Id |
| 175 | + -p, --service-principal-secret string Service Principal Secret |
| 176 | + -s, --subscription-id string Subscription Id |
| 177 | + --tenant-id string tenant id |
| 178 | +``` |
| 179 | + |
| 180 | +## azcmagent show |
| 181 | + |
| 182 | +Gets machine metadata and Agent status. This is primarily useful for troubleshooting. |
| 183 | + |
| 184 | +### Synopsis |
| 185 | + |
| 186 | +Gets machine metadata and Agent status. This is primarily useful for troubleshooting. |
| 187 | + |
| 188 | + |
| 189 | +### Syntax |
| 190 | + |
| 191 | +``` |
| 192 | +azcmagent show [flags] |
| 193 | +``` |
| 194 | + |
| 195 | +### Options |
| 196 | + |
| 197 | +``` |
| 198 | + -h, --help help for show |
| 199 | +``` |
| 200 | + |
| 201 | +## azcmagent version |
| 202 | + |
| 203 | +Display the Hybrid Management Agent version |
| 204 | + |
| 205 | +### Synopsis |
| 206 | + |
| 207 | +Display the Hybrid Management Agent version |
| 208 | + |
| 209 | +### Syntax |
| 210 | + |
| 211 | +```none |
| 212 | +azcmagent version [flags] |
| 213 | +``` |
| 214 | + |
| 215 | +### Options |
| 216 | + |
| 217 | +```none |
| 218 | + -h, --help help for version |
| 219 | +``` |
0 commit comments