azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Cosmos DB database accounts: 'locations' parameter not necessarily required.

Open ghost opened this issue 8 years ago • 2 comments

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

ghost avatar Apr 26 '18 06:04 ghost

Thank you @holgerjay for the report! Let's bring a CosmosDB expert: @dmakwana could I get your input on this one? Thanks!

lmazuel avatar Apr 26 '18 23:04 lmazuel

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.

shurd avatar Jun 06 '19 19:06 shurd