#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 :)
Citation
For attribution, please cite this work as
Maneu (2019, December 9). maneu.net: #Tip Use local Azure Storage emulator in Remote Containers. Retrieved from https://www.maneu.net/dev/use-local-storage-emulator-remote-container/
@misc{ use-local-storage-emulator-remote-container,
author = {Maneu, Christopher},
title = { #Tip Use local Azure Storage emulator in Remote Containers },
url = { https://www.maneu.net/dev/use-local-storage-emulator-remote-container/ },
year = { 2019 }
}