Azure-docs: CosmosDB Emulator Documentation re: certificates

Created on 20 Dec 2018  Â·  6Comments  Â·  Source: MicrosoftDocs/azure-docs

Running this does not work, neither in Powershell nor in CMD. I'm running on:

  • windows 10 v1809
  • Docker Desktop Version 2.0.0.0-win81 (29211) - Build: 4271b9e

    • Using Windows containers

Following the steps here
https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator#running-on-docker
CMD:

  1. Ran md %LOCALAPPDATA%\CosmosDBEmulatorCert 2>null

    • No troubles

  2. Ran docker run -v %LOCALAPPDATA%\CosmosDBEmulatorCert:C:\CosmosDB.Emulator\CosmosDBEmulatorCert -P -t -i -m 2GB microsoft/azure-cosmosdb-emulator

    • Received this back:

      ```

      Transcript started, output file is C:CosmosDB.Emulator\bind-mount\Diagnostics\Transcript.log

      Directory: C:CosmosDB.Emulator\bind-mount

Mode LastWriteTime Length Name ---- ------------- ------ ----
-a---- 12/19/2018 11:20 AM 511 CosmosDbEmulatorCert.cer

Key : Emulator
Value : CosmosDB.Emulator
Name : Emulator

Key : Version
Value : 2.1.3.0

Key : Key
Value : C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
Name : Key

Key : IPAddress
Value : 172.20.90.75
Name : IPAddress

Key : MongoDBEndpoint
Value : {mongodb://12fcc13458d8:10255/, mongodb://172.20.90.75:10255/}
Name : MongoDBEndpoint

Key : Endpoint
Value : {https://12fcc13458d8:8081/, https://172.20.90.75:8081/}
Name : Endpoint

Key : CassandraEndpoint
Value : {tcp://12fcc13458d8:10350/, tcp://172.20.90.75:10350/}
Name : CassandraEndpoint

  - This only sort of resembles the documentation... which isn't ideal.
3. This is where things start not working; I run `PS C:\> cd %LOCALAPPDATA%\CosmosDBEmulatorCert`
  - Received:  

cd : Cannot find path 'C:\%LOCALAPPDATA%CosmosDBEmulatorCert' because it does not exist.
At line:1 char:1

  • cd %LOCALAPPDATA%CosmosDBEmulatorCert
  • ~~~~~~~~~~

    • CategoryInfo : ObjectNotFound: (C:\%LOCALAPPDATA%CosmosDBEmulatorCert:String) [Set-Location], ItemNotFoundException

    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

      ```

I ran into near identical problems when trying this in powershell as well. If this is just due to a mismatch in the documentation somewhere, then this should be fixed.

Is the certificate is made/downloaded not then getting loaded/referenced in the docker run command?

Document Details

âš  Do not edit this section. It is required for docs.microsoft.com âžź GitHub issue linking.

cosmos-dsvc cxp product-issue triaged

Most helpful comment

@mindlessroman @oleh-zheleznyak @damienestewart apologies for the delay in getting back on this thread, you your are correct, the commands are wrong.

@oleh-zheleznyak submitted a doc fix, which we will merge and I had a chat with our product team regarding the Git issue. I updated the commands to be more specific with other options. I will go through some review process. Also made a complete doc refresh so there are bunch of other updates. Content repo is going through a migration process so there is a content freeze until Monday. You can see the changes live on Monday.

cmd:

md %LOCALAPPDATA%CosmosDBEmulatorbind-mount

docker run --name azure-cosmosdb-emulator --memory 2GB --mount "type=bind,source=%LOCALAPPDATA%CosmosDBEmulatorbind-mount,destination=C:CosmosDB.Emulatorbind-mount" --interactive --tty -p 8081:8081 -p 8900:8900 -p 8901:8901 -p 8902:8902 -p 10250:10250 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 -p 10255:10255 -p 10256:10256 -p 10350:10350 microsoft/azure-cosmosdb-emulator

powershell:

md $env:LOCALAPPDATACosmosDBEmulatorbind-mount 2>null

docker run --name azure-cosmosdb-emulator --memory 2GB --mount "type=bind,source=$env:LOCALAPPDATACosmosDBEmulatorbind-mount,destination=C:CosmosDB.Emulatorbind-mount" --interactive --tty -p 8081:8081 -p 8900:8900 -p 8901:8901 -p 8902:8902 -p 10250:10250 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 -p 10255:10255 -p 10256:10256 -p 10350:10350 microsoft/azure-cosmosdb-emulator

We will close this issue of there aren't any further questions.

please-close

All 6 comments

@mindlessroman Thank you for the detailed feedback.
From my repro: I have observed that Azure CosmosDB Emulator certificates are located in this directory: “C:CosmosDB.Emulator\bind-mount”

image

This is being assigned to the content author to evaluate and update as appropriate.

@David-Noble-at-work “cd %LOCALAPPDATA%CosmosDBEmulatorCert” doesn’t contains certificate. Could you please evaluate and update as appropriate.

Until this doc gets updated, and for people running into this issue, the command you'll have to run is:
docker run -v %LOCALAPPDATA%\CosmosDBEmulatorCert:C:\CosmosDB.Emulator\bind-mount -P -t -i -m 2GB microsoft/azure-cosmosdb-emulator. There isn't actually a "CosmosDBEmulatorCert" folder in CosmosDB.Emulator so the posted instructions won't work.

The issue with the docs is exactly as @damienestewart explained - the wrong folder is mounted, i.e. bind-mount should be used instead of CosmosDBEmulatorCert
The script from @damienestewart fixes that issue. The powershell equivalent is
docker run -v $env:LOCALAPPDATA\CosmosDBEmulatorCert:C:\CosmosDB.Emulator\bind-mount -P -t -i -m 2GB microsoft/azure-cosmosdb-emulator
This page on dockerHub has appropriate instructions https://hub.docker.com/r/microsoft/azure-cosmosdb-emulator/

@oleh-zheleznyak Thanks, the instructions on https://hub.docker.com/r/microsoft/azure-cosmosdb-emulator/ work for me.

Will the documentation on https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator#running-on-docker be updated? Could one link to the other or vice-versa?

@tjrobinson , I'm happy it helped.

I have raised a pull request to to update the docs:
https://github.com/MicrosoftDocs/azure-docs/pull/26489

When it's going to be merged, or even if it will be merged at all is up to maintainers of the repo.

@David-Noble-at-work , would you be so kind to review the aforementioned PR?

Thanks for your time!

@mindlessroman @oleh-zheleznyak @damienestewart apologies for the delay in getting back on this thread, you your are correct, the commands are wrong.

@oleh-zheleznyak submitted a doc fix, which we will merge and I had a chat with our product team regarding the Git issue. I updated the commands to be more specific with other options. I will go through some review process. Also made a complete doc refresh so there are bunch of other updates. Content repo is going through a migration process so there is a content freeze until Monday. You can see the changes live on Monday.

cmd:

md %LOCALAPPDATA%CosmosDBEmulatorbind-mount

docker run --name azure-cosmosdb-emulator --memory 2GB --mount "type=bind,source=%LOCALAPPDATA%CosmosDBEmulatorbind-mount,destination=C:CosmosDB.Emulatorbind-mount" --interactive --tty -p 8081:8081 -p 8900:8900 -p 8901:8901 -p 8902:8902 -p 10250:10250 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 -p 10255:10255 -p 10256:10256 -p 10350:10350 microsoft/azure-cosmosdb-emulator

powershell:

md $env:LOCALAPPDATACosmosDBEmulatorbind-mount 2>null

docker run --name azure-cosmosdb-emulator --memory 2GB --mount "type=bind,source=$env:LOCALAPPDATACosmosDBEmulatorbind-mount,destination=C:CosmosDB.Emulatorbind-mount" --interactive --tty -p 8081:8081 -p 8900:8900 -p 8901:8901 -p 8902:8902 -p 10250:10250 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 -p 10255:10255 -p 10256:10256 -p 10350:10350 microsoft/azure-cosmosdb-emulator

We will close this issue of there aren't any further questions.

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monteledwards picture monteledwards  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments

bityob picture bityob  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments