DEV Community

Cover image for #Tip Use local Azure Storage emulator in Remote Containers
Christopher Maneu
Christopher Maneu

Posted on • Originally published at maneu.net

2

#Tip Use local Azure Storage emulator in Remote Containers

I LOVE Remote Development Extensions for Visual Studio Code. It allows me to simply pack all my technical stack in one docker container, while getting me everything I need to run and debug things.

Everything, this includes localhost, right?

Ehmm.. that depends! This morning, I was doing different things with Azure Functions SDK for 25 days of serverless, and for that I needed to access the local Azure Storage Emulator, the one on my local machine - not within a Docker container.

How can I possibly access local resources - who are neither on Internet or within another container - from a container?

3 magic words

host.docker.internal. That's all you need within your container to access your "real" localhost, and everything hosted on it. Like my Azure Storage Emulator :). With that bit of magic, I was able to replace the usuel local connection string UseDevelopmentStorage=true; by the following :

UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal

Et voilà! I'm now able to use the benefits of Remote Containers development while using all my local hosted tools, including the Azure Storage Emulator :)

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay