Search code examples
mongodbazureazure-cosmosdbhangfire

Hangfire with Azure Cosmos DB


I am trying to connect hangfire with Azure Cosmos DB, but I am getting exception MongoDB.Driver.MongoCommandException: 'Command renameCollection failed: Command is not supported.' in GlobalConfiguration.Configuration.UseMongoStorage.

When I am trying to connect with Azure VM hosted MongoDB, it is working fine.


Solution

  • Im contributing to the Hangfire.Mongo lib you are using. We have changed the migrations to support CosmosDB. So the issue you are experiencing should be solved in the latest release.

    We currently do not actively test against CosmosDB as we target MongoDB. But please submit issues you find with CosmosDB to https://github.com/sergeyzwezdin/Hangfire.Mongo I would be happy to accept PR's fixing CosmosDB related issues, or provide the patch myself if time permits.