Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

manifest = '''
{
"isProxyResource": false,
"enableDataSourceSetInfo": false,
"resourceType": "Microsoft.DocumentDB/databaseAccounts",
"parentResourceType": "Microsoft.DocumentDB/databaseAccounts",
"datasourceType": "Microsoft.DocumentDB/databaseAccounts",
"allowedRestoreModes": [ "RecoveryPointBased" ],
"allowedRestoreTargetTypes": [ "AlternateLocation" ],
"itemLevelRecoveryEnabled": false,
"addBackupDatasourceParametersList": false,
"backupConfigurationRequired": false,
"addDataStoreParametersList": false,
"friendlyNameRequired": false,
"supportSecretStoreAuthentication": false,
"backupVaultPermissions": [
{
"roleDefinitionName": "Reader",
"type": "DataSourceRG"
},
{
"roleDefinitionName": "Cosmos DB Operator",
"type": "DataSource"
}
],
"backupVaultRestorePermissions": [
{
"roleDefinitionName": "Cosmos DB Operator",
"type": "DataSource"
}
],
"policySettings": {
"supportedRetentionTags": [ "Weekly", "Monthly", "Yearly" ],
"supportedDatastoreTypes": [ "VaultStore" ],
"disableAddRetentionRule": false,
"disableCustomRetentionTag": false,
"backupScheduleSupported": true,
"supportedBackupFrequency": [ "Weekly" ],
"defaultPolicy": {
"policyRules": [
{
"name": "BackupWeekly",
"objectType": "AzureBackupRule",
"backupParameters": {
"backupType": "full",
"objectType": "AzureBackupParams"
},
"dataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"trigger": {
"schedule": {
"timeZone": "UTC",
"repeatingTimeIntervals": [ "R/2026-02-08T10:00:00+00:00/P1W" ]
},
"taggingCriteria": [
{
"isDefault": true,
"taggingPriority": 99,
"tagInfo": {
"id": "Default_",
"tagName": "Default"
}
}
],
"objectType": "ScheduleBasedTriggerContext"
}
},
{
"name": "Default",
"objectType": "AzureRetentionRule",
"isDefault": true,
"lifecycles": [
{
"deleteAfter": {
"duration": "P10Y",
"objectType": "AbsoluteDeleteOption"
},
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"targetDataStoreCopySettings": []
}
]
}
],
"datasourceTypes": [ "Microsoft.DocumentDB/databaseAccounts" ],
"objectType": "BackupPolicy",
"name": "CosmosDBPolicy1"
}
}
}'''
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

supported_datasource_types = ["AzureDisk", "AzureBlob", "AzureDataLakeStorage",
"AzureDatabaseForPostgreSQL", "AzureKubernetesService",
"AzureDatabaseForPostgreSQLFlexibleServer", "AzureDatabaseForMySQL"]
"AzureDatabaseForPostgreSQLFlexibleServer", "AzureDatabaseForMySQL",
"AzureCosmosDB"]
10 changes: 9 additions & 1 deletion src/dataprotection/azext_dataprotection/manual/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"AzureDatabaseForPostgreSQL": "Microsoft.DBforPostgreSQL/servers/databases",
"AzureKubernetesService": "Microsoft.ContainerService/managedClusters",
"AzureDatabaseForPostgreSQLFlexibleServer": "Microsoft.DBforPostgreSQL/flexibleServers",
"AzureDatabaseForMySQL": "Microsoft.DBforMySQL/flexibleServers"
"AzureDatabaseForMySQL": "Microsoft.DBforMySQL/flexibleServers",
"AzureCosmosDB": "Microsoft.DocumentDB/databaseAccounts"
}

# This is ideally temporary, as Backup Vault contains secondary region information. But in some cases
Expand Down Expand Up @@ -1028,7 +1029,14 @@ def convert_dict_keys_snake_to_camel(dictionary):
return new_dictionary


_SNAKE_TO_CAMEL_OVERRIDES = {
"resource_id": "resourceID",
}


def convert_string_snake_to_camel(string):
if string in _SNAKE_TO_CAMEL_OVERRIDES:
return _SNAKE_TO_CAMEL_OVERRIDES[string]
new_string = re.sub(r'_([a-z])', lambda m: m.group(1).upper(), string)
return new_string

Expand Down
Loading
Loading