Skip to content

Commit f93b297

Browse files
committed
customer controlled maintenance
1 parent 7c0702a commit f93b297

File tree

7 files changed

+358
-2
lines changed

7 files changed

+358
-2
lines changed
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
---
2+
title: Configure customer-controlled maintenance for Azure Firewall
3+
description: Learn how to configure customer-controlled maintenance for your Azure Firewall using the Azure portal, or PowerShell.
4+
services: firewall
5+
author: varunkalyana
6+
ms.service: azure-firewall
7+
ms.topic: concept-article
8+
ms.date: 07/01/2025
9+
ms.author: varunkalyana
10+
---
11+
12+
# Configure customer-controlled maintenance for Azure Firewall
13+
14+
This article explains how to configure customer-controlled maintenance windows for Azure Firewall. It provides step-by-step guidance for scheduling maintenance using the Azure portal or PowerShell.
15+
16+
Azure Firewall is a managed, cloud-based network security service designed to protect Azure Virtual Network and Azure Virtual WAN resources. Regular upgrades are essential to ensure the service remains effective against emerging cyber threats, complies with regulatory requirements, and incorporates the latest features, security enhancements, and performance improvements.
17+
18+
Upgrades are typically scheduled during off-business hours to minimize disruptions to critical business operations and reduce application downtime. While many modern applications can handle transient network interruptions through autoreconnections, legacy applications such as SAP and Azure Virtual Desktop (AVD) might require persistent connections. These applications are more sensitive to connection drops, which can lead to disruptions during upgrade processes and affect business continuity. To address this, Azure Firewall now supports configurable daily maintenance windows, allowing you to align upgrade schedules with your operational needs.
19+
20+
For more information on limitations and frequently asked questions about customer-controlled maintenance, see the [Azure Firewall FAQ](firewall-faq.yml#customer-controlled-maintenance).
21+
22+
## Maintenance configuration
23+
24+
#### [Azure portal](#tab/portal)
25+
26+
You can configure customer-controlled maintenance in the Azure portal using two methods:
27+
28+
- [**From the Azure Firewall resource**](#configure-maintenance-from-the-azure-firewall-resource): This method allows you to configure maintenance directly for a specific Azure Firewall.
29+
- [**From the maintenance configurations page**](#set-up-in-maintenance-configurations): This method enables you to create a maintenance configuration that can be applied to multiple Azure Firewalls, offering greater flexibility and efficiency.
30+
31+
## Configure maintenance from the Azure Firewall resource
32+
33+
Follow these steps to create a maintenance configuration directly from the Azure Firewall resource:
34+
35+
1. In the Azure portal, navigate to the **Firewall** resource for which you want to create a maintenance configuration.
36+
1. On the **Azure Firewall** page, navigate to **Settings** and select **Maintenance**.
37+
1. Select **+ Add a configuration** to open the **Configure maintenance control** page.
38+
39+
:::image type="content" source="media/customer-controlled-maintenance/maintenance-overview.png" alt-text="Screenshot showing the Maintenance configuration option in an Azure Firewall resource.":::
40+
41+
1. In the configuration panel, choose an existing configuration from the drop-down menu or create a new configuration.
42+
1. Enter a descriptive name for the maintenance configuration and select **Edit schedule**. Define a maintenance schedule of atleast 5 hours recurring daily and select **Save**.
43+
44+
:::image type="content" source="media/customer-controlled-maintenance/maintenance-schedule-on-firewall.png" alt-text="Screenshot showing the Maintenance configuration scheduling in an Azure Firewall resource.":::
45+
46+
1. Select **Enable** to apply the maintenance configuration on the Azure Firewall resource.
47+
48+
Complete the configuration as required to align with your operational needs.
49+
50+
## Set up in Maintenance Configurations
51+
52+
Follow these steps to create a maintenance configuration in the Azure portal using the *Maintenance Configurations*
53+
page:
54+
55+
1. In the Azure portal, search for **Maintenance Configurations**.
56+
1. On the **Maintenance Configurations** page, select **+ Create** to open the **Create a maintenance configuration** page.
57+
58+
:::image type="content" source="media/customer-controlled-maintenance/maintenance-configuration-overview.png" alt-text="Screenshot showing the creation of maintenance configuration.":::
59+
60+
1. On the **Basics** tab, provide the following details:
61+
62+
- **Subscription**: Select your subscription.
63+
- **Resource Group**: Choose the resource group where your resources are located.
64+
- **Configuration name**: Enter a descriptive name for the maintenance configuration.
65+
- **Region**: Select the same region as your firewall resources.
66+
- **Maintenance scope**: Choose **Resource** from the dropdown.
67+
- **Maintenance subscope**: Select **Network Security** from the dropdown.
68+
69+
1. Select **Add a schedule** to define the maintenance schedule.
70+
71+
> [!NOTE]
72+
> The maintenance window must be at least 5 hours in duration.
73+
74+
1. After specifying the schedule, select **Save**.
75+
1. Proceed to the **Resources** tab. Select **+ Add resources** to associate resources with the maintenance configuration. You can add resources during the creation process or later. For this example, you're adding resources during the configuration creation.
76+
1. On the **Select resources** page, verify that your resources are listed. If not, ensure the correct region and maintenance scope are selected. Choose the resources to include in the maintenance configuration, then select **Save**.
77+
78+
:::image type="content" source="media/customer-controlled-maintenance/maintenance-resource-association.png" alt-text="Screenshot showing the association of resources to the maintenance configuration.":::
79+
80+
1. Select **Review + Create** to validate the configuration. Once validation is successful, select **Create** to finalize the setup.
81+
82+
### View associated resources
83+
84+
Follow these steps to view the resources linked to a maintenance configuration:
85+
86+
1. Navigate to the **Maintenance Configurations** page in the Azure portal.
87+
1. Select the maintenance configuration you want to inspect.
88+
1. In the left-hand menu, navigate to **Settings** and select **Resources**. This opens the **Resources** page, where you can see all resources associated with the selected maintenance configuration.
89+
90+
### Add resources
91+
92+
To add resources to an existing maintenance configuration, follow these steps:
93+
94+
1. Navigate to the **Maintenance Configurations** page in the Azure portal.
95+
1. Select the maintenance configuration you want to modify.
96+
1. In the left-hand menu, go to **Settings** and select **Resources**. This opens the **Resources** page, where you can view all resources associated with the selected maintenance configuration.
97+
1. On the **Resources** page, select **+ Add** to include a new resource in the maintenance configuration.
98+
99+
### Remove resources
100+
101+
To remove resources associated with a maintenance configuration, follow these steps:
102+
103+
1. Navigate to the **Maintenance Configurations** page in the Azure portal.
104+
1. Select the maintenance configuration from which you want to remove resources.
105+
1. In the left-hand menu, navigate to **Settings** and select **Resources** to open the **Resources** page and view the associated resources.
106+
1. On the **Resources** page, select the resource you want to remove, then select **Remove**.
107+
1. In the confirmation dialog, select **Yes** to finalize the removal.
108+
109+
#### [PowerShell](#tab/powershell)
110+
111+
Use the following steps to assign policy to the resources. If you're new to Azure PowerShell, see [Get started with Azure PowerShell](/powershell/azure/get-started-azureps).
112+
113+
1. Set the Subscription context.
114+
115+
```powershell-interactive
116+
set-AzContext -Subscription 'Subscription ID’
117+
```
118+
119+
1. Register the Azure Resource Provider.
120+
121+
```powershell-interactive
122+
Register-AzResourceProvider -ProviderNamespace Microsoft.Maintenance
123+
```
124+
125+
1. Create a maintenance configuration using the `New-AzMaintenanceConfiguration` cmdlet.
126+
127+
- The `-Duration` must be a minimum of a five hour window.
128+
- The `-RecurEvery` is per day.
129+
- For TimeZone options, see [Time Zones](/dotnet/api/system.timezoneinfo).
130+
131+
```powershell-interactive
132+
New-AzMaintenanceConfiguration -ResourceGroupName <rgName> -Name <configurationName> -Location <arm location of resource> -MaintenanceScope Resource -ExtensionProperty @{"maintenanceSubScope"="NetworkSecurity"} -StartDateTime "<date in YYYY-MM-DD HH:mm format>" -TimeZone "<Selected Time Zone>" -Duration "<Duration in HH:mm format>" -Visibility "Custom" -RecurEvery Day
133+
```
134+
135+
1. Save the maintenance configuration as a variable named `$config`.
136+
137+
```powershell-interactive
138+
$config = Get-AzMaintenanceConfiguration -ResourceGroupName <rgName> -Name <configurationName>
139+
```
140+
141+
1. Save the service resource as a variable named `$serviceResource`.
142+
143+
1. Create the maintenance configuration assignment using the `New-AzConfigurationAssignment` cmdlet. The maintenance policy is applied to the resource within 24 hours.
144+
145+
```powershell-interactive
146+
New-AzConfigurationAssignment -ResourceGroupName <rgName> -ProviderName "Microsoft.Network" -ResourceType "<your resource's resource type per ARM. For example, azureFirewalls>" -ResourceName "<your resource's name>" -ConfigurationAssignmentName "<assignment name>" -ResourceId $serviceResource.Id -MaintenanceConfigurationId $config.Id -Location "<arm location of resource>"
147+
```
148+
149+
1. To remove a configuration assignment:
150+
151+
- A configuration assignment is removed automatically if the configuration or the resource is deleted.
152+
- If you want to manually remove a configuration assignment from the maintenance configuration to a resource, use the `Remove-AzConfigurationAssignment` cmdlet.
153+
154+
```powershell-interactive
155+
Remove-AzConfigurationAssignment -ResourceGroupName <rgName> -ProviderName "Microsoft.Network" -ResourceType "<your resource's resource type per ARM. For example, azureFirewalls>" -ResourceName "<your resource's name>" -ConfigurationAssignmentName "<assignment name>"
156+
```
157+
158+
#### [CLI](#tab/cli)
159+
160+
Use the following steps to assign policy to the resources. If you're new to Azure CLI, see [Get started with Azure CLI](/cli/azure/get-started-with-azure-cli).
161+
162+
1. Set the Subscription context.
163+
164+
```azurecli-interactive
165+
az account set --subscription "<subscription id>"
166+
```
167+
168+
1. Register the Azure Resource Provider.
169+
170+
```azurecli-interactive
171+
az provider register --namespace Microsoft.Maintenance
172+
```
173+
174+
1. Create a maintenance configuration using the `az maintenance configuration create` command.
175+
176+
- Sets the `--location` to specify the Azure region for the maintenance configuration.
177+
- Sets the `--maintenance-scope` to `Resource`.
178+
- Sets the extension property to `maintenanceSubScope=NetworkSecurity` using `--extension-properties`.
179+
- Sets the `--maintenance-window-duration` to specify the maintenance window length (must be at least five hours, format: HH:mm).
180+
- Sets the `--maintenance-window-start-date-time` to specify when the maintenance window begins (format: YYYY-MM-DD HH:MM).
181+
- Sets the `--maintenance-window-expiration-date-time` to specify when the maintenance window expires (format: YYYY-MM-DD HH:MM).
182+
- Sets the `--maintenance-window-recur-every` to `Day` for daily recurrence.
183+
- Sets the `--maintenance-window-time-zone` to specify the time zone for the schedule. For available time zones, see [Time Zones](/dotnet/api/system.timezoneinfo).
184+
- Sets the `--namespace` to `Microsoft.Maintenance`.
185+
- Sets the `--visibility` to `Custom`.
186+
- Sets the `--resource-group` to specify the resource group.
187+
- Sets the `--resource-name` to specify the name of the maintenance configuration.
188+
189+
```azurecli-interactive
190+
az maintenance configuration create \
191+
--location "centraluseuap" \
192+
--maintenance-scope "Resource" \
193+
--maintenance-window-duration "HH:mm" \
194+
--maintenance-window-start-date-time "YYYY-MM-DD HH:MM" \
195+
--maintenance-window-expiration-date-time "YYYY-MM-DD HH:MM" \
196+
--maintenance-window-recur-every "Day" \
197+
--maintenance-window-time-zone "Pacific Standard Time" \
198+
--namespace "Microsoft.Maintenance" \
199+
--visibility "Custom" \
200+
--resource-group "<rg name>" \
201+
--resource-name "<config name>" \
202+
--extension-properties maintenanceSubScope=NetworkSecurity
203+
```
204+
205+
> [!NOTE]
206+
> The resource ID for the maintenance configuration is displayed in the output of the above command. Use this value for `--maintenance-configuration-id` in the next step.
207+
208+
1. Create the maintenance configuration assignment using the `az maintenance assignment create` command. The maintenance policy is applied to the resource within 24 hours.
209+
210+
```azurecli-interactive
211+
az maintenance assignment create \
212+
--maintenance-configuration-id "<config resource id>" \
213+
--name "<assignment name>" \
214+
--provider-name "Microsoft.Network" \
215+
--resource-group "<firewall rg name>" \
216+
--resource-name "<firewall name>" \
217+
--resource-type "azureFirewalls"
218+
```
219+
220+
### Remove a configuration assignment
221+
222+
To manually remove a configuration assignment from a resource, use the `az maintenance assignment delete` command.
223+
224+
```azurecli-interactive
225+
az maintenance assignment delete \
226+
--resource-group "<firewall rg name>" \
227+
--resource-name "<firewall name>" \
228+
--resource-type "azureFirewalls" \
229+
--provider-name "Microsoft.Network" \
230+
--name "<assignment name>"
231+
```
232+
233+
### View a configuration assignment
234+
235+
To view a maintenance configuration assignment using Azure CLI, use the following command:
236+
237+
```azurecli-interactive
238+
az maintenance configuration show \
239+
--resource-group "<resource-group-name>" \
240+
--resource-name "<configuration-name>"
241+
```
242+
243+
Replace `<resource-group-name>` with your resource group and `<configuration-name>` with your maintenance configuration name.
244+
245+
---
246+
247+
## Next steps
248+
249+
To explore the latest capabilities in Azure Firewall, see [Azure Firewall preview features](firewall-preview.md).
250+
251+
252+
253+
254+
255+
256+
257+
258+
259+
260+

0 commit comments

Comments
 (0)