Skip to content

Commit 3b14dfa

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pgnanashekar/neon-code-removal
# Conflicts: # src/index.json # src/managednetworkfabric/HISTORY.rst # src/managednetworkfabric/setup.py
2 parents b9ba5f5 + 7d2e30e commit 3b14dfa

118 files changed

Lines changed: 50379 additions & 19 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/acrcssc/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.0.0b7
7+
++++++++
8+
* Unpin cssc image version so that the latest cached image in task infra can be automatically picked for workflow runs. This allows us to push patch updates to cssc image without needing to update the task definition and release a new version of the extension.
9+
610
1.0.0b6
711
++++++++
812
* Fix issue with DNL registry names when scheduling tasks

src/acrcssc/azext_acrcssc/templates/task/cssc_patch_image.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: v1.1.0
22
alias:
33
values:
44
ScanReport : os-vulnerability-report_trivy_{{ regexReplaceAll "[^a-zA-Z0-9]" .Values.SOURCE_REPOSITORY "-" }}_{{.Values.SOURCE_IMAGE_TAG}}_$(date "+%Y-%m-%d").json
5-
cssc : mcr.microsoft.com/acr/cssc:1fb6e2a
65
steps:
76
- id: print-inputs
87
cmd: |

src/acrcssc/azext_acrcssc/templates/task/cssc_scan_image.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ alias:
33
values:
44
patchimagetask: cssc-patch-image
55
DATE: $(date "+%Y-%m-%d")
6-
cssc : mcr.microsoft.com/acr/cssc:1fb6e2a
76
steps:
87
- id: print-inputs
98
cmd: |

src/acrcssc/azext_acrcssc/templates/task/cssc_trigger_workflow.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: v1.1.0
22
alias:
33
values:
44
ScanImageAndSchedulePatchTask: cssc-scan-image
5-
cssc : mcr.microsoft.com/acr/cssc:1fb6e2a
65
maxLimit: 100
76
steps:
87
- cmd: bash -c 'echo "Inside cssc-trigger-workflow task, getting list of images to be patched based on --filter-policy for Registry {{.Run.Registry}}."'

src/acrcssc/azext_acrcssc/templates/tmp_dry_run_template.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: v1.1.0
22
alias:
33
values:
4-
cssc : mcr.microsoft.com/acr/cssc:1fb6e2a
54
maxLimit: 100
65
steps:
76
- id: acr-cli-filter

src/acrcssc/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from distutils import log as logger
1414
logger.warn("Wheel is not available, disabling bdist_wheel hook")
1515

16-
VERSION = '1.0.0b6'
16+
VERSION = '1.0.0b7'
1717

1818
# The full list of classifiers is available at
1919
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

src/dataprotection/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
33
Release History
44
===============
5+
1.9.0
6+
+++++
7+
* `az dataprotection enable-backup trigger`: New command to enable backup for AKS clusters with a single command. Supports preset backup strategies (Week, Month, DisasterRecovery) and Custom strategy with user-provided configuration.
8+
* Added vendored SDKs: `azure-mgmt-containerservice` (40.2.0), `azure-mgmt-kubernetesconfiguration` (3.1.0), `azure-mgmt-resourcegraph` (8.0.0).
9+
510
1.8.1
611
+++++
712
* Documentation update for `initialize-backupconfig` and `initialize-restoreconfig` commands to clarify that the generated JSON is meant for use with other CLI commands, and may not work as an input for non-CLI scenarios without modification.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
6+
# AKS Backup Strategy Constants
7+
CONST_BACKUP_STRATEGY_WEEK = "Week"
8+
CONST_BACKUP_STRATEGY_MONTH = "Month"
9+
CONST_BACKUP_STRATEGY_DISASTER_RECOVERY = "DisasterRecovery"
10+
CONST_BACKUP_STRATEGY_CUSTOM = "Custom"
11+
12+
# List of all backup strategies for AKS
13+
CONST_AKS_BACKUP_STRATEGIES = [
14+
CONST_BACKUP_STRATEGY_WEEK,
15+
CONST_BACKUP_STRATEGY_MONTH,
16+
CONST_BACKUP_STRATEGY_DISASTER_RECOVERY,
17+
CONST_BACKUP_STRATEGY_CUSTOM,
18+
]

src/dataprotection/azext_dataprotection/manual/_help.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,67 @@
291291
- name: List of Recovery Points in a Vault
292292
text: az dataprotection recovery-point list --backup-instance-name "sample_biname-00000000-0000-0000-0000-000000000000" --resource-group "sample_rg" --vault-name "sample_vault"
293293
"""
294+
295+
helps['dataprotection enable-backup'] = """
296+
type: group
297+
short-summary: Enable backup for Azure resources.
298+
"""
299+
300+
helps['dataprotection enable-backup trigger'] = """
301+
type: command
302+
short-summary: Enable backup for an AKS cluster by setting up all required resources including backup vault, policy, storage account, extension, and trusted access.
303+
long-summary: |
304+
This command orchestrates all the steps required to enable backup for an AKS cluster:
305+
1. Creates or reuses a backup resource group, storage account, and blob container
306+
2. Installs the backup extension on the cluster (or reuses an existing one)
307+
3. Creates or reuses a backup vault and backup policy
308+
4. Configures trusted access and role assignments
309+
5. Creates a backup instance
310+
311+
The --backup-configuration-file parameter accepts a JSON file (@file.json) or inline JSON string with the following optional settings:
312+
- storageAccountResourceId: ARM ID of an existing storage account to use
313+
- blobContainerName: Name of an existing blob container (used with storageAccountResourceId)
314+
- backupResourceGroupId: ARM ID of an existing resource group for backup resources
315+
- backupVaultId: ARM ID of an existing backup vault (required for Custom strategy)
316+
- backupPolicyId: ARM ID of an existing backup policy (required for Custom strategy)
317+
- tags: Dictionary of tags to apply to created resources (e.g., {"Owner": "team", "Env": "prod"})
318+
319+
Backup strategy presets (--backup-strategy):
320+
- Week (default): Daily incremental backups with 7-day retention in Operational Store.
321+
- Month: Daily incremental backups with 30-day retention in Operational Store.
322+
- DisasterRecovery: Daily incremental backups with 7-day Operational Store + 90-day Vault Store retention. FirstOfDay backups are copied to Vault Store for cross-region restore.
323+
- Custom: Bring your own vault and policy. Requires backupVaultId and backupPolicyId in --backup-configuration-file.
324+
examples:
325+
- name: Enable backup for an AKS cluster with default Week strategy
326+
text: az dataprotection enable-backup trigger --datasource-type AzureKubernetesService --datasource-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ContainerService/managedClusters/{cluster}
327+
- name: Enable backup with Month strategy
328+
text: az dataprotection enable-backup trigger --datasource-type AzureKubernetesService --datasource-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ContainerService/managedClusters/{cluster} --backup-strategy Month
329+
- name: Enable backup with Custom strategy using existing vault and policy
330+
text: |
331+
az dataprotection enable-backup trigger --datasource-type AzureKubernetesService \\
332+
--datasource-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ContainerService/managedClusters/{cluster} \\
333+
--backup-strategy Custom \\
334+
--backup-configuration-file @config.json
335+
336+
Where config.json contains:
337+
{
338+
"backupVaultId": "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.DataProtection/backupVaults/{vault}",
339+
"backupPolicyId": "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.DataProtection/backupVaults/{vault}/backupPolicies/{policy}"
340+
}
341+
- name: Enable backup with resource tags for policy compliance
342+
text: |
343+
az dataprotection enable-backup trigger --datasource-type AzureKubernetesService \\
344+
--datasource-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ContainerService/managedClusters/{cluster} \\
345+
--backup-configuration-file '{"tags": {"Owner": "team", "Environment": "prod", "DeleteBy": "2026-12"}}'
346+
- name: Enable backup using an existing storage account
347+
text: |
348+
az dataprotection enable-backup trigger --datasource-type AzureKubernetesService \\
349+
--datasource-id /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ContainerService/managedClusters/{cluster} \\
350+
--backup-configuration-file @config.json
351+
352+
Where config.json contains:
353+
{
354+
"storageAccountResourceId": "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}",
355+
"blobContainerName": "my-backup-container"
356+
}
357+
"""

src/dataprotection/azext_dataprotection/manual/_params.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
get_permission_scope_values,
4343
get_resource_type_values,
4444
get_persistent_volume_restore_mode_values,
45-
get_conflict_policy_values
45+
get_conflict_policy_values,
46+
get_all_backup_strategies,
4647
)
4748

4849
vault_name_type = CLIArgumentType(help='Name of the backup vault.', options_list=['--vault-name', '-v'], type=str)
@@ -182,6 +183,27 @@ def load_arguments(self, _):
182183
c.argument('restore_request_object', type=validate_file_or_dict, help='Request body for operation "Restore" Expected value: '
183184
'json-string/@json-file. Required when --operation is Restore')
184185

186+
# Enable Backup command
187+
with self.argument_context('dataprotection enable-backup trigger') as c:
188+
c.argument('datasource_type', type=str, help="The type of datasource to be backed up. Supported values: AzureKubernetesService.")
189+
c.argument('datasource_id', type=str, help="The full ARM resource ID of the datasource to be backed up.")
190+
c.argument('backup_strategy', arg_type=get_enum_type(get_all_backup_strategies()),
191+
help="Backup strategy preset (daily incremental backups). "
192+
"For AzureKubernetesService: "
193+
"Week (7-day operational store retention), "
194+
"Month (30-day operational store retention), "
195+
"DisasterRecovery (7-day operational + 90-day vault store retention), "
196+
"Custom (bring your own vault/policy). Default: Week.")
197+
c.argument('backup_configuration_file', type=validate_file_or_dict,
198+
options_list=['--backup-configuration-file', '-f'],
199+
help="Path to a JSON backup configuration file. "
200+
"Supports backupVaultId and backupPolicyId "
201+
"(required for Custom strategy). "
202+
"For workload-specific settings, "
203+
"refer to the documentation.")
204+
c.argument('yes', options_list=['--yes', '-y'], action='store_true',
205+
help='Do not prompt for confirmation.')
206+
185207
with self.argument_context('dataprotection job show') as c:
186208
c.argument('resource_group_name', resource_group_name_type)
187209
c.argument('vault_name', vault_name_type, id_part='name')

0 commit comments

Comments
 (0)