Skip to content

Commit 2b2a2e2

Browse files
Merge pull request #250298 from SnehaSudhirG/05Sep-DynamicscopeUpdate
Added info on creating dynamic scope using CLI and PowerShell
2 parents 509e948 + e8193b7 commit 2b2a2e2

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

articles/update-center/includes/dynamic-scope-prerequisites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Ensure to register the preview feature in your Azure subscription by following t
1717
1. Search for **Dynamic scoping**.
1818
1. Select **Register** and then select **OK** to get started with Dynamic scope (preview).
1919

20-
### [PowerShell](#tab/ps)
20+
#### [PowerShell](#tab/ps)
2121
To register the preview feature, use the [Get-AzProviderFeature](/powershell/module/az.resources/get-azproviderfeature) cmdlet
2222

2323
```powershell-interactive

articles/update-center/tutorial-dynamic-grouping-for-scheduled-patching.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
2828

2929
## Create a Dynamic scope
3030

31-
To create a dynamic scope, follow the steps:
31+
To create a dynamic scope, follow these steps:
32+
33+
#### [Azure portal](#tab/az-portal)
3234

3335
1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to Update Manager (preview).
3436
1. Select **Overview** > **Schedule updates** > **Create a maintenance configuration**.
@@ -39,9 +41,23 @@ To create a dynamic scope, follow the steps:
3941
1. Provide the tags in **Tags** tab.
4042
1. Select **Review** and then **Review + Create**.
4143

42-
>[!NOTE]
44+
> [!NOTE]
4345
> A dynamic scope exists within the context of a schedule only. You can use one schedule to link to a machine, dynamic scope, or both. One dynamic scope cannot have more than one schedule.
4446
47+
48+
#### [Azure CLI](#tab/az-cli)
49+
50+
```azurecli
51+
52+
az maintenance assignment create-or-update-subscription --maintenance-configuration-id "/subscriptions/{subscription_id}/resourcegroups/{rg}/providers/Microsoft.Maintenance/maintenanceConfigurations/clitestmrpconfinguestadvanced" --name cli_dynamicscope_recording01 --filter-locations eastus2euap centraluseuap --filter-os-types windows linux --filter-tags {{tagKey1:[tagKey1Val1,tagKey1Val2],tagKey2:[tagKey2Val1,tagKey2Val2]}} --filter-resource-group rg1, rg2 --filter-tags-operator All -l global
53+
```
54+
#### [PowerShell](#tab/az-ps)
55+
56+
```powershell
57+
New-AzConfigurationAssignment -ConfigurationAssignmentName $maintenanceConfigurationName -MaintenanceConfigurationId $maintenanceConfigurationInGuestPatchCreated.Id -FilterLocation eastus2euap,centraluseuap -FilterOsType Windows,Linux -FilterTag '{"tagKey1" : ["tagKey1Value1", "tagKey1Value2"], "tagKey2" : ["tagKey2Value1", "tagKey2Value2", "tagKey2Value3"] }' -FilterOperator "Any"
58+
```
59+
---
60+
4561
## Provide the consent
4662
Obtaining consent to apply updates is an important step in the workflow of scheduled patching and follow the steps on various ways to [provide the consent](manage-dynamic-scoping.md#provide-consent-to-apply-updates).
4763

0 commit comments

Comments
 (0)