In the version Az.CosmosDB 1.10.0 or above the Restore-AzCosmosDBAccount does not allow restore from deleted CosmosDB Accounts (except the oldest one). There is a warning "No database accounts found with matching account name cosmos-aa-bb-cc that was alive at given utc-timestamp". In version 1.9.0 it works with no issue. In both cases Get-AzCosmosDBRestorableDatabaseAccount displays the current and also all the deleted CosmosDB Accounts. It has been tested with multiple CosmosDB Accounts.
Id : /subscriptions/xx/providers/Microsoft.DocumentDB/locations/centralus/restorableDatabaseAccounts/xx
DatabaseAccountInstanceId : xxx
Location : Central US
DatabaseAccountName : cosmos-aa-bb-cc
CreationTime : 5/14/2024 8:20:15 AM
DeletionTime : 5/15/2024 4:24:02 PM
OldestRestorableTime : 4/15/2024 5:10:32 PM
ApiType : Sql
RestorableLocations : {Central US}
Starting restore process for cosmos-aa-gl-bb...
Initiating restore operation for CosmosDB Account 'cosmos-aa-bb-cc'...
WARNING: No database accounts found with matching account name cosmos-aa-bb-cc that was alive at given utc-timestamp 5/15/2024 12:40:34 PM in location Central US
WARNING: No database accounts found with matching account name cosmos-aa-bb-cc that was alive at given utc-timestamp 5/15/2024 12:40:34 PM in location Central US
Restoration failed
Description
In the version Az.CosmosDB 1.10.0 or above the Restore-AzCosmosDBAccount does not allow restore from deleted CosmosDB Accounts (except the oldest one). There is a warning "No database accounts found with matching account name cosmos-aa-bb-cc that was alive at given utc-timestamp". In version 1.9.0 it works with no issue. In both cases Get-AzCosmosDBRestorableDatabaseAccount displays the current and also all the deleted CosmosDB Accounts. It has been tested with multiple CosmosDB Accounts.
Issue script & Debug output
Environment data
Module versions
Error output