Skip to content

Commit e2aa8e1

Browse files
authored
Merge pull request #278318 from johnmarco/jm-arc-gateway2-NEW
New Arc Gateway article
2 parents 22d906d + ed5a9f9 commit e2aa8e1

File tree

3 files changed

+301
-0
lines changed

3 files changed

+301
-0
lines changed
Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
---
2+
title: How to simplify network configuration requirements through Azure Arc gateway (Limited preview)
3+
description: Learn how to simplify network configuration requirements through Azure Arc gateway (Limited preview).
4+
ms.date: 06/26/2024
5+
ms.topic: how-to
6+
---
7+
8+
# Simplify network configuration requirements through Azure Arc gateway (Limited preview)
9+
10+
> [!NOTE]
11+
> **This is a Limited Public Preview, so customer subscriptions must be allowed by Microsoft to use the feature. To participate, complete the [Azure Arc gateway Limited Public Preview Sign-up form](https://forms.office.com/r/bfTkU2i0Qw).**
12+
>
13+
14+
If you use enterprise firewalls or proxies to manage outbound traffic, the Azure Arc gateway lets you onboard infrastructure to Azure Arc using only seven (7) endpoints. With Azure Arc gateway, you can:
15+
16+
- Connect to Azure Arc by opening public network access to only seven Fully Qualified Domains (FQDNs).
17+
- View and audit all traffic an Azure Connected Machine agent sends to Azure via the Arc gateway.
18+
19+
This article explains how to set up and use an Arc gateway Resource.
20+
21+
> [!IMPORTANT]
22+
> The Arc gateway feature for [Azure Arc-enabled servers](overview.md) is currently in Limited preview in all regions where Azure Arc-enabled servers is present. See the Supplemental Terms of Use for Microsoft Azure Limited previews for legal terms that apply to Azure features that are in beta, limited preview, or otherwise not yet released into general availability.
23+
>
24+
25+
## Supported scenarios
26+
27+
Azure Arc gateway supports the following scenarios:
28+
29+
- Azure Monitor (Azure Monitor Agent + Dependency Agent) <sup>1</sup>
30+
- Microsoft Defender for Cloud <sup>2</sup>
31+
- Windows Admin Center
32+
- SSH
33+
- Microsoft Sentinel
34+
- Azure Update Management
35+
- Azure Extension for SQL Server
36+
37+
<sup>1</sup> Traffic to Log Analytics workspaces isn't covered by Arc gateway, so the FQDNs for your Log Analytics workspaces must still be allowed in your firewalls or enterprise proxies.
38+
39+
<sup>2</sup> To send Microsoft Defender traffic via Arc gateway, you must configure the extension’s proxy settings.
40+
41+
## How it works
42+
43+
Azure Arc gateway consists of two main components:
44+
45+
**The Arc gateway resource:** An Azure resource that serves as a common front-end for Azure traffic. This gateway resource is served on a specific domain. Once the Arc gateway resource is created, the domain is returned to you in the success response.
46+
47+
**The Arc Proxy:** A new component added to Arc agentry. This component runs as a service called "Azure Arc Proxy" and acts as a forward proxy used by the Azure Arc agents and extensions. No configuration is required on your part for the gateway router. This router is part of Arc core agentry and runs within the context of an Arc-enabled resource.
48+
49+
When the gateway is in place, traffic flows via the following hops: **Arc agentry → Arc Proxy → Enterprise proxy → Arc gateway → Target service**
50+
51+
:::image type="content" source="media/arc-gateway/arc-gateway-overview.png" alt-text="Diagram showing the route of traffic flow for Azure Arc gateway.":::
52+
53+
## Restrictions and limitations
54+
55+
The Arc gateway object has limits you should consider when planning your setup. These limitations apply only to the Limited public preview. These limitations might not apply when the Arc gateway feature is generally available.
56+
57+
- TLS Terminating Proxies aren't supported.
58+
- ExpressRoute/Site-to-Site VPN used with the Arc gateway (Limited preview) isn't supported.
59+
- The Arc gateway (Limited preview) is only supported for Azure Arc-enabled servers.
60+
- There's a limit of five Arc gateway (Limited preview) resources per Azure subscription.
61+
62+
## How to use the Arc gateway (Limited preview)
63+
64+
After completing the [Azure Arc gateway Limited Public Preview Sign-up form](https://forms.office.com/r/bfTkU2i0Qw), your subscription will be allowed to use the feature within 1 business day. You'll receive an email when the Arc gateway (Limited preview) feature has been allowed on the subscription you submitted.
65+
66+
There are six main steps to use the feature:
67+
68+
1. Download the az connected.whl file and use it to install the az connectedmachine extension.
69+
1. Create an Arc gateway resource.
70+
1. Ensure the required URLs are allowed in your environment.
71+
1. Associate new or existing Azure Arc resources with your Arc gateway resource.
72+
1. Verify that the setup succeeded.
73+
1. Ensure other scenarios use the Arc gateway (Linux only).
74+
75+
### Step 1: Download the az connectedmachine.whl file
76+
77+
1. Select the link to [download the az connectedmachine.whl file](https://aka.ms/ArcGatewayWhl).
78+
79+
This file contains the az connected machine commands required to create and manage your gateway Resource.
80+
81+
1. Install the [Azure CLI](/cli/azure/install-azure-cli) (if you haven't already).
82+
83+
1. Execute the following command to add the connectedmachine extension:
84+
85+
`az extension add --allow-limited preview true --yes --source [whl file path]`
86+
87+
### Step 2: Create an Arc gateway resource
88+
89+
On a machine with access to Azure, run the following commands to create your Arc gateway resource:
90+
91+
```azurecli
92+
az login --use-device-code
93+
az account set --subscription [subscription name or id]
94+
az connectedmachine gateway create --name [Your gateway’s Name] --resource-group [Your Resource Group] --location [Location] --gateway-type public --allowed-features * --subscription [subscription name or id]
95+
```
96+
The gateway creation process takes 9-10 minutes to complete.
97+
98+
### Step 3: Ensure the required URLs are allowed in your environment
99+
100+
When the resource is created, the success response includes the Arc gateway URL. Ensure your Arc gateway URL and all URLs in the following table are allowed in the environment where your Arc resources live:
101+
102+
|URL |Purpose |
103+
|---------|---------|
104+
|[Your URL Prefix].gw.arc.azure.com |Your gateway URL (This URL can be obtained by running `az connectedmachine gateway list` after you create your gateway Resource) |
105+
|management.azure.com |Azure Resource Manager Endpoint, required for Azure Resource Manager control channel |
106+
|login.microsoftonline.com |Microsoft Entra ID’s endpoint, for acquiring Identity access tokens |
107+
|gbl.his.arc.azure.com |The cloud service endpoint for communicating with Azure Arc agents |
108+
|\<region\>.his.arc.azure.com |Used for Arc’s core control channel |
109+
|packages.microsoft.com |Required to acquire Linux based Arc agentry payload, only needed to connect Linux servers to Arc |
110+
|download.microsoft.com |Used to download the Windows installation package |
111+
112+
### Step 4: Associate new or existing Azure Arc resources with your gateway resource
113+
114+
**To onboard a new server with Arc gateway**, generate an installation script, then edit the script to specify your gateway resource:
115+
116+
1. Generate the installation script.
117+
Follow the instructions at [Quickstart: Connect hybrid machines with Azure Arc-enabled servers](learn/quick-enable-hybrid-vm.md) to create a script that automates the downloading and installation of the Azure Connected Machine agent and establishes the connection with Azure Arc.
118+
119+
1. Edit the installation script.
120+
Your gateway Resource must be specific in the installation script. To accomplish this, a new parameter called `--gateway-id` is added to the connect command.
121+
122+
**For Linux servers:**
123+
124+
1. Obtain your gateway's Resource ID by running the `az connectedmachine gateway list` command. Note the "id" parameter in the output (that is, the full ARM resource ID).
125+
1. In the installation script, add the "id" found in the previous step as the following parameter: `--gateway-id "[Your-gateway’s-Resource-ID]"`
126+
127+
Linux server onboarding script example:
128+
129+
This script template includes parameters for you to specify your enterprise proxy server.
130+
131+
```
132+
export subscriptionId="SubscriptionId";
133+
export resourceGroup="ResourceGroup";
134+
export tenantId="TenantID";
135+
export location="Region";
136+
export authType="AuthType";
137+
export cloud="AzureCloud";
138+
export gatewayID="gatewayResourceID";
139+
140+
# Download the installation package
141+
output=$(wget https://aka.ms/azcmagent -e use_proxy=yes -e https_proxy="[Your Proxy URL]" -O /tmp/install_linux_azcmagent.sh 2>&1);
142+
if [ $? != 0 ]; then wget -qO- -e use_proxy=yes -e https_proxy="[Your Proxy URL]" --method=PUT --body-data="{\"subscriptionId\":\"$subscriptionId\",\"resourceGroup\":\"$resourceGroup\",\"tenantId\":\"$tenantId\",\"location\":\"$location\",\"correlationId\":\"$correlationId\",\"authType\":\"$authType\",\"operation\":\"onboarding\",\"messageType\":\"DownloadScriptFailed\",\"message\":\"$output\"}" "https://gbl.his.arc.azure.com/log" &> /dev/null || true; fi;
143+
echo "$output";
144+
145+
# Install the hybrid agent
146+
bash /tmp/install_linux_azcmagent.sh --proxy "[Your Proxy URL]";
147+
148+
# Run connect command
149+
sudo azcmagent connect --resource-group "$resourceGroup" --tenant-id "$tenantId" --location "$location" --subscription-id "$subscriptionId" --cloud "$cloud" --correlation-id "$correlationId" --gateway-id "$gatewayID";
150+
```
151+
152+
**For Windows servers:**
153+
154+
1. Obtain your gateway's Resource ID by running the `az connectedmachine gateway list` command. This command outputs information about all the gateway resources in your subscription. Note the ID parameter in the output (that is, the full ARM resource ID).
155+
1. In the **try section** of the installation script, add the ID found in the previous step as the following parameter: `--gateway-id "[Your-gateway’s-Resource-ID]"`
156+
1. In the **catch section** of the installation script, add the ID found in the previous step as the following parameter: `gateway-id="[Your-gateway’s-Resource-ID]"`
157+
158+
Windows server onboarding script example:
159+
160+
This script template includes parameters for you to specify your enterprise proxy server.
161+
162+
```
163+
$global:scriptPath = $myinvocation.mycommand.definition
164+
165+
function Restart-AsAdmin {
166+
    $pwshCommand = "powershell"
167+
    if ($PSVersionTable.PSVersion.Major -ge 6) {
168+
        $pwshCommand = "pwsh"
169+
    }
170+
171+
    try {
172+
        Write-Host "This script requires administrator permissions to install the Azure Connected Machine Agent. Attempting to restart script with elevated permissions..."
173+
        $arguments = "-NoExit -Command `"& '$scriptPath'`""
174+
        Start-Process $pwshCommand -Verb runAs -ArgumentList $arguments
175+
        exit 0
176+
    } catch {
177+
        throw "Failed to elevate permissions. Please run this script as Administrator."
178+
    }
179+
}
180+
181+
try {
182+
    if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
183+
        if ([System.Environment]::UserInteractive) {
184+
            Restart-AsAdmin
185+
        } else {
186+
            throw "This script requires administrator permissions to install the Azure Connected Machine Agent. Please run this script as Administrator."
187+
        }
188+
    }
189+
190+
    $env:SUBSCRIPTION_ID = "SubscriptionId";
191+
    $env:RESOURCE_GROUP = "ResourceGroup";
192+
    $env:TENANT_ID = "TenantID";
193+
    $env:LOCATION = "Region";
194+
    $env:AUTH_TYPE = "AuthType";
195+
    $env:CLOUD = "AzureCloud";
196+
$env:GATEWAY_ID = "gatewayResourceID";
197+
198+
    [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072;
199+
200+
    # Download the installation package
201+
    Invoke-WebRequest -UseBasicParsing -Uri "https://aka.ms/azcmagent-windows" -TimeoutSec 30 -OutFile "$env:TEMP\install_windows_azcmagent.ps1" -proxy "[Your Proxy URL]";
202+
203+
    # Install the hybrid agent
204+
    & "$env:TEMP\install_windows_azcmagent.ps1" -proxy "[Your Proxy URL]";
205+
    if ($LASTEXITCODE -ne 0) { exit 1; }
206+
207+
    # Run connect command
208+
    & "$env:ProgramW6432\AzureConnectedMachineAgent\azcmagent.exe" connect --resource-group "$env:RESOURCE_GROUP" --tenant-id "$env:TENANT_ID" --location "$env:LOCATION" --subscription-id "$env:SUBSCRIPTION_ID" --cloud "$env:CLOUD" --gateway-id "$env:GATEWAY_ID";
209+
}
210+
catch {
211+
    $logBody = @{subscriptionId="$env:SUBSCRIPTION_ID";resourceGroup="$env:RESOURCE_GROUP";tenantId="$env:TENANT_ID";location="$env:LOCATION";authType="$env:AUTH_TYPE";gatewayId="$env:GATEWAY_ID";operation="onboarding";messageType=$_.FullyQualifiedErrorId;message="$_";};
212+
    Invoke-WebRequest -UseBasicParsing -Uri "https://gbl.his.arc.azure.com/log" -Method "PUT" -Body ($logBody | ConvertTo-Json) -proxy "[Your Proxy URL]" | out-null;
213+
    Write-Host  -ForegroundColor red $_.Exception;
214+
}
215+
```
216+
217+
218+
1. Run the installation script to onboard your servers to Azure Arc.
219+
220+
To configure an existing machine to use Arc gateway, follow these steps:
221+
222+
> [!NOTE]
223+
> The existing machine must be using the Arc-enabled servers connected machine agent version 1.43 or higher to use the Arc gateway Limited Public preview.
224+
225+
1. Associate your existing machine with your Arc gateway resource:
226+
227+
```azurecli
228+
az connectedmachine setting update --resource-group [res-group] --subscription [subscription name] --base-provider Microsoft.HyrbridCompute --base-resource-type machines --base-resource-name [Arc-server's resource name] --settings-resource-name default --gateway-resource-id [Full Arm resourceid]
229+
```
230+
231+
1. Update the machine to use the Arc gateway resource.
232+
Run the following command on the Arc-enabled server to set it to use Arc gateway:
233+
234+
```azurecli
235+
azcmagent config set connection.type gateway
236+
```
237+
1. Await reconciliation.
238+
239+
Once your machines have been updated to use the Arc gateway, some Azure Arc endpoints that were previously allowed in your enterprise proxy or firewalls won't be needed. However, there's a transition period, so allow **1 hour** before removing unneeded endpoints from your firewall/enterprise proxy.
240+
241+
### Step 5: Verify that the setup succeeded
242+
On the onboarded server, run the following command: `azcmagent show`
243+
The result should indicate the following values:
244+
245+
- **Agent Status** should show as **Connected**.
246+
- **Using HTTPS Proxy** should show as **http://localhost:40343**
247+
- **Upstream Proxy** should show as your enterprise proxy (if you set one)
248+
249+
Additionally, to verify successful set-up, you can run the following command: `azcmagent check`
250+
The result should indicate that the `connection.type` is set to gateway, and the **Reachable** column should indicate **true** for all URLs.
251+
252+
### Step 6: Ensure additional scenarios use the Arc gateway (Linux only)
253+
254+
On Linux, to use Azure Monitor or Microsoft Defender for Endpoint, additional commands need to be executed to work with the Azure Arc gateway (Limited preview).
255+
256+
For **Azure Monitor**, explicit proxy settings should be provided when deploying Azure Monitor Agent. From Azure Cloud Shell, execute the following commands:
257+
258+
```
259+
$settings = @{"proxy" = @{mode = "application"; address = "http://127.0.0.1:40343"; auth = false}}
260+
261+
New-AzConnectedMachineExtension -Name AzureMonitorLinuxAgent -ExtensionType AzureMonitorLinuxAgent -Publisher Microsoft.Azure.Monitor -ResourceGroupName <resource-group-name> -MachineName <arc-server-name> -Location <arc-server-location> -Setting $settings
262+
```
263+
264+
If you’re deploying Azure Monitor through the Azure portal, be sure to select the **Use Proxy** setting and set the **Proxy Address** to `http://127.0.0.1:40343`.
265+
266+
For **Microsoft Defender for Endpoint**, run the following command:
267+
268+
`mdatp config proxy set --value http://127.0.0.1:40343`
269+
270+
## Cleanup instructions
271+
272+
To clean up your gateway, detach the gateway resource from the applicable server(s); the resource can then be deleted safely:
273+
274+
1. Set the connection type of the Azure Arc-enabled server to "direct" instead of "gateway":
275+
276+
`azcmagent config set connection.type direct`
277+
278+
1. Run the following command to delete the resource:
279+
280+
`az connectedmachine gateway delete --resource group [resource group name] --gateway-name [gateway resource name]`
281+
282+
This operation can take couple of minutes.
283+
284+
## Troubleshooting
285+
286+
You can audit your Arc gateway’s traffic by viewing the gateway Router’s logs.
287+
288+
To view gateway Router logs on **Windows**:
289+
1. Run `azcmagent logs` in PowerShell.
290+
1. In the resulting .zip file, the logs are located in the `C:\ProgramData\Microsoft\ArcGatewayRouter` folder.
291+
292+
To view gateway Router logs on **Linux**:
293+
1. Run `sudo azcmagent logs`.
294+
1. In the resulting log file, the logs are located in the `/usr/local/arcrtr/logs/` folder.
295+
296+
## Known issues
297+
298+
It's not yet possible to use the Azure CLI to disassociate a gateway Resource from an Arc-enabled server. To make an Arc-enabled server stop using an Arc gateway, use the `azcmagent config set connection.type direct` command. This command configures the Arc-enabled resource to use the direct route instead of the Arc gateway.
299+
61.1 KB
Loading

articles/azure-arc/servers/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
href: prerequisites.md
4141
- name: Network requirements
4242
href: network-requirements.md
43+
- name: Simplify network configuration requirements
44+
href: arc-gateway.md
4345
- name: Private Link networking
4446
href: private-link-security.md
4547
- name: Deployment options

0 commit comments

Comments
 (0)