@@ -245,18 +245,24 @@ The Docker container variant of the emulator doesn't support the API for Table.
245
245
| ** ` AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE` * (Optional)*** | * Enable data persistence between emulator runs.* |
246
246
| ** ` AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE` * (Optional)*** | * Override the emulator' s default IP address.* |
247
247
248
+ For Linux systems, use:
249
+
248
250
```bash
249
251
docker run \
250
252
--publish 8081:8081 \
251
253
--publish 10250-10255:10250-10255 \
254
+ --name linux-emulator \
252
255
--detach \
253
256
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
254
257
```
255
258
259
+ For Windows systems, use:
260
+
256
261
```powershell
257
262
$parameters = @(
258
263
"--publish", "8081:8081"
259
264
"--publish", "10250-10255:10250-10255"
265
+ "--name", "windows-emulator"
260
266
"--detach"
261
267
)
262
268
docker run @parameters mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
@@ -274,6 +280,7 @@ The Docker container variant of the emulator doesn't support the API for Table.
274
280
$parameters = @(
275
281
"--publish", "8081:8081"
276
282
"--publish", "10250-10255:10250-10255"
283
+ "--name", "windows-emulator"
277
284
"--detach"
278
285
)
279
286
docker run @parameters mcr.microsoft.com/cosmosdb/windows/azure-cosmos-emulator
@@ -319,20 +326,26 @@ The Docker container variant of the emulator doesn't support the API for Table.
319
326
| ** ` AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE` * (Optional)*** | * Enable data persistence between emulator runs.* |
320
327
| ** ` AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE` * (Optional)*** | * Override the emulator' s default IP address.* |
321
328
329
+ For Linux systems, use:
330
+
322
331
```bash
323
332
docker run \
324
333
--publish 8081:8081 \
325
334
--publish 10250:10250 \
326
335
--env AZURE_COSMOS_EMULATOR_ENABLE_MONGODB_ENDPOINT=4.0 \
336
+ --name linux-emulator \
327
337
--detach \
328
338
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:mongodb
329
339
```
330
340
341
+ For Windows systems, use:
342
+
331
343
```powershell
332
344
$parameters = @(
333
345
"--publish", "8081:8081"
334
346
"--publish", "10250:10250"
335
347
"--env", "AZURE_COSMOS_EMULATOR_ENABLE_MONGODB_ENDPOINT=4.0"
348
+ "--name", "windows-emulator"
336
349
"--detach"
337
350
)
338
351
docker run @parameters mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:mongodb
@@ -388,8 +401,20 @@ The Windows local installation of the emulator automatically imports the TLS/SSL
388
401
389
402
The certificate for the emulator is available at the path ` _explorer/emulator.pem` on the running container. Use ` curl` to download the certificate from the running container to your local machine.
390
403
404
+ For Linux systems, use:
405
+
391
406
` ` ` bash
392
- curl -k https://localhost:8081/_explorer/emulator.pem > ~ /emulatorcert.crt
407
+ curl --insecure https://localhost:8081/_explorer/emulator.pem > ~ /emulatorcert.crt
408
+ ` ` `
409
+
410
+ ` ` ` powershell
411
+ $parameters = @{
412
+ Uri = ' https://localhost:8081/_explorer/emulator.pem'
413
+ Method = ' GET'
414
+ OutFile = ' emulatorcert.crt'
415
+ SkipCertificateCheck = $True
416
+ }
417
+ Invoke-WebRequest @parameters
393
418
` ` `
394
419
395
420
# ## [Docker (Windows container)](#tab/docker-windows)
@@ -404,40 +429,82 @@ The Windows local installation of the emulator automatically imports the TLS/SSL
404
429
405
430
::: zone pivot="api-nosql"
406
431
407
- ### [Docker (Linux container) / Docker (Windows container)](#tab/docker-linux+docker-windows)
432
+ ### [Docker (Linux container)](#tab/docker-linux)
433
+
434
+ The certificate for the emulator is available at the path `/_explorer/emulator.pem` on the running container.
408
435
409
- The certificate for the emulator is available at the path `_explorer/emulator.pem` on the running container .
436
+ 1. Download the certificate from the running container to your local machine .
410
437
411
- 1. Use `curl` to download the certificate from the running container to your local machine.
438
+ For Linux systems, use:
412
439
413
440
```bash
414
- curl -k https://localhost:8081/_explorer/emulator.pem > ~/emulatorcert.crt
441
+ curl --insecure https://localhost:8081/_explorer/emulator.pem > ~/emulatorcert.crt
442
+ ```
443
+
444
+ For Windows systems, use:
445
+
446
+ ```powershell
447
+ $parameters = @{
448
+ Uri = ' https://localhost:8081/_explorer/emulator.pem'
449
+ Method = ' GET'
450
+ OutFile = ' emulatorcert.crt'
451
+ SkipCertificateCheck = $True
452
+ }
453
+ Invoke-WebRequest @parameters
415
454
```
416
455
417
456
> [!NOTE]
418
457
> You may need to change the host (or IP address) and port number if you have previously modified those values.
419
458
420
459
1. Install the certificate according to the process typically used for your operating system. For example, in Linux you would copy the certificate to the `/usr/local/share/ca-certificates/` path.
421
460
461
+ For Linux systems, use:
462
+
422
463
```bash
423
464
cp ~/emulatorcert.crt /usr/local/share/ca-certificates/
424
465
```
425
466
426
- 1. Regenerate the certificate bundle by using the appropriate command for your Linux distribution.
467
+ For Windows systems, use:
427
468
428
- For **Debian-based** systems (for example, Ubuntu), use:
469
+ ```powershell
470
+ $parameters = @{
471
+ FilePath = ' emulatorcert.crt'
472
+ CertStoreLocation = ' Cert:\C urrentUser\R oot'
473
+ }
474
+ Import-Certificate @parameters
475
+ ```
476
+
477
+ 1. For linux systems, regenerate the certificate bundle by using the appropriate command for your Linux distribution.
478
+
479
+ For **Debian-based** Linux systems (for example, Ubuntu), use:
429
480
430
481
```bash
431
482
sudo update-ca-certificates
432
483
```
433
484
434
- For **Red Hat-based** systems (for example, CentOS, Fedora), use:
485
+ For **Red Hat-based** Linux systems (for example, CentOS, Fedora), use:
435
486
436
487
```bash
437
488
sudo update-ca-trust
438
489
```
439
490
440
- For more detailed instructions, consult the documentation specific to your Linux distribution.
491
+ For more detailed instructions, consult the documentation specific to your operating system.
492
+
493
+ ### [Docker (Windows container)](#tab/docker-windows)
494
+
495
+ The certificate for the emulator is available at the folder `C:\CosmosDB.Emulator\bind-mount` on the running container. The folder also contains a script to automatically install the certificate.
496
+
497
+ 1. Use `docker cp` to copy the entire folder to your local machine.
498
+
499
+ ```powershell
500
+ docker cp windows-emulator:C:\CosmosDB.Emulator\bind-mount .
501
+ ```
502
+
503
+ 1. Run the *importcert.ps1* script in the folder.
504
+
505
+ ```powershell
506
+ .\bind-mount\importcert.ps1
507
+ ```
441
508
442
509
### [Windows (local)](#tab/windows)
443
510
0 commit comments