Unable to laucnh CosmosDB Emulator

Launching CosmosDB Emulator from within AppVeyor's Avatar

Launching CosmosDB Emulator from within AppVeyor

17 Sep, 2017 03:57 PM

I'm trying to run a local CosmosDB Emulator to run integration tests against, but I'm having issues launching it. Locally it can be launched from the command line, but I'm unable to figure out if this is a workable issue with AppVeyor or an issue with CosmosDB Emulator itself. Here's my appveyor file:

  - ps: Invoke-WebRequest -Uri 'https://aka.ms/cosmosdb-emulator' -OutFile 'cosmos-db.msi'
  - start /wait msiexec /i cosmos-db.msi /qn /quiet /norestart /log install.log
  - "\"C:\\Program Files\\Azure Cosmos DB Emulator\\CosmosDB.Emulator.exe\" /NoUI /NoExplorer /NoFirewall"

When it runs, it simply hangs.

Here's an example of a build: https://ci.appveyor.com/project/kensykora/musicbot-backend/build/

  1. 1 Posted by Launching Cosmo... on 17 Sep, 2017 04:04 PM

    Launching CosmosDB Emulator from within AppVeyor's Avatar

    Also, it's worth noting that when I run this command locally, it prompts for UAC, but as I've read on these forums, this is disabled on the build servers.

    Also, I'm using the Visual Studio 2017 Preview image.

  2. Support Staff 2 Posted by Ilya Finkelshte... on 18 Sep, 2017 06:45 PM

    Ilya Finkelshteyn's Avatar

    It starts OK, but it blocks next steps, as it runs interactively in in build execution context. To avoid this you have to run it in separate process with Start-Process command, like this:

      - ps: Invoke-WebRequest -Uri 'https://aka.ms/cosmosdb-emulator' -OutFile 'cosmos-db.msi'
      - start /wait msiexec /i cosmos-db.msi /qn /quiet /norestart /log install.log  
      - ps: Set-Content -Value '"C:\Program Files\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" /NoUI /NoExplorer /NoFirewall' -Path .\startCosmosDb.cmd
      - ps: Start-Process -FilePath .\startCosmosDb.cmd

    Also I would recommend to ensure that it is started with pinging it's default port. Please look at this sample.

  3. 3 Posted by Ken Sykora on 23 Sep, 2017 03:24 PM

    Ken Sykora's Avatar

    Awesome, thank you so much for your help. That worked wonderfully.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac