Cosmos DB database accounts: 'locations' parameter not necessarily required.
Hi,
upon Cosmos DB database account creation, it is not necessary to enable geo replication. In this case, it is also not necessary to mark the 'locations' parameter as required - as there is no need for additional replication targets then.
Imho, 'required' could be set to False here: azure-sdk-for-python/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'locations': {'required': True},
'database_account_offer_type': {'required': True, 'constant': True},
}
best regards Holger
Thank you @holgerjay for the report! Let's bring a CosmosDB expert: @dmakwana could I get your input on this one? Thanks!
Hi @holgerjay thank you for raising this question. Our API, which the python SDK uses, requires the "locations" property when creating an account. The "location" property is supplied to ARM and does not necessarily represent the location of the account. The "locations" property is a list of regions you want your account to have. If you do not want geo-replication, then only provide one location in the list.