The RunAsEmulator function mostly serves as a wrapper around adding the container image and port with a specific "emulator" name so it can be replaced by that call and whatever emulator is being used.
- Instead of
RunAsEmulator()
, instead specify the local client and add theConatinerImageAnnotation
(ref) - Update
Registry
,Image
, andTag
to the Emulator image you'd like to use - Ensure you've done a
docker pull
on that image - Allow dev-certs in dotnet with the command:
dotnet dev-certs https --trust
Here's our implementation for the
vnext-preview
tag that includesPROTOCOL = https
so the generated connection string remains correct and avoids SSL errors when clients try to use https/ssl on an http endpoint.See https://learn.microsoft.com/en-au/azure/cosmos-db/emulator-linux#docker-commands for details of the env vars you can set on the docker container for configuring the
vnext-preview
emulator's behaviour.