Closed MatheusXavier closed 2 years ago
@MatheusXavier We do not specifically support this scenario. For local testing and development while using Visual Studio and Cosmos DB we strongly recommend to our users to rely on the MSI installation of the Azure Cosmos DB emulator in order to get the best performance while using the emulator.
In your testing you should be able to configure the Cosmos DB endpoint to the emulator's endpoint (started from the MSI installation), just like you might configure your test/application to target an Azure Cosmos DB account hosted in the Azure cloud.
This is my current local development scenario:
I'm using this Docker image for Cosmos Db Emulator on Linux
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
, this is my issue: If I don't set the environment variableAZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE
then it's possible to access the cosmos db from the application, but it's not possible to access from my Integration Tests, otherwise if I set the variableAZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE
with the value127.0.0.1
then it's possible to access from my integration tests but it is NOT possible to access from my application, this is the docker-compose.yml file:And here it's my docker-compose.override.yml file:
And here it's a sample of a dumb test that works only whe set the variable
AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE
:Any sugetions on how can I manage this situation? I also tried to Cosmos Db emulator installed on my local machine, but I had the same problem, the integration tests can access but the application can not.