Skip to content

Commit 33ab849

Browse files
committed
Adding comments for Docker
1 parent fa35746 commit 33ab849

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

articles/cosmos-db/local-emulator.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -414,23 +414,7 @@ To open the Data Explorer, navigate to the following URL in your browser. The em
414414
415415
https://<emulator endpoint provided in response>/_explorer/index.html
416416
417-
If you have a .NET client application running on a Linux docker container and if you are running Azure Cosmos emulator on a host machine, in this case you can’t connect to the Azure Cosmos account from the emulator. Because the app is not running on the host machine, the certificate registered on the Linux container that matches the emulator’s endpoint cannot be added.
418-
419-
As a workaround, you can disable the server’s SSL certificate validation from your client application by passing a `HttpClientHandler` instance as shown in the following .Net code sample. This workaround is only applicable if you are using the `Microsoft.Azure.DocumentDB` Nuget package, it isn't supported with the `Microsoft.Azure.Cosmos` Nuget package:
420-
421-
```csharp
422-
var httpHandler = new HttpClientHandler()
423-
{
424-
ServerCertificateCustomValidationCallback = (req,cert,chain,errors) => true
425-
};
426-
427-
using (DocumentClient client = new DocumentClient(new Uri(strEndpoint), strKey, httpHandler))
428-
{
429-
RunDatabaseDemo(client).GetAwaiter().GetResult();
430-
}
431-
```
432-
433-
In addition to disabling the SSL certificate validation, it is important that you start the emulator with the `/allownetworkaccess` option and the emulator’s endpoint is accessible from the host IP address rather than `host.docker.internal` DNS.
417+
If you have a .NET client application running on a Linux docker container and if you are running Azure Cosmos emulator on a host machine, please follow the below section for Linux to import the certificate into the Linux docker container.
434418
435419
## Running on Mac or Linux<a id="mac"></a>
436420

0 commit comments

Comments
 (0)