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:

```yaml
install:
  - 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/0.1.0.149

  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.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:20 AM.

  5. Ilya Finkelshteyn re-opened this discussion on 26 Sep, 2018 01:32 AM

  6. 4 Posted by Zach on 26 Sep, 2018 01:41 AM

    Zach's Avatar

    AppVeyor images now have CosmosDb installed on them so you only need the bottom two lines of the code sample. The below code should work for ya.

    - 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
    
  7. 5 Posted by Mald on 28 Sep, 2018 02:45 PM

    Mald's Avatar

    Great that it's installed, but it's an older version of the emulator. Just a few days ago 2.0.0 version of the emulator was released. And now our build is failing, because the api doesn't match. Do you know when the emulator will be updated to 2.0.0?

  8. Support Staff 6 Posted by Ilya Finkelshte... on 28 Sep, 2018 06:04 PM

    Ilya Finkelshteyn's Avatar

    Please watch https://github.com/appveyor/ci/issues/2662

    For now workaround would be uninstall existing one before installing latest. e.g.

      - wmic product where name="Azure Cosmos DB Emulator" call uninstall  
      - 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
    
  9. Ilya Finkelshteyn closed this discussion on 09 Oct, 2018 06:59 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? 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