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, andTagto the Emulator image you'd like to use - Ensure you've done a
docker pullon that image - Allow dev-certs in dotnet with the command:
dotnet dev-certs https --trust
Here's our implementation for the
vnext-previewtag that includesPROTOCOL = httpsso 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-previewemulator's behaviour.