My local (windows) azure function works fine when I start azurite in windows and use UseDevelopmentStorage=true
. I can connect to the port with telnet localhost 10000
and telnet 127.0.0.1 10000
.
However, when I stop azurite on windows and run it in WSL via docker the function cannot connect.
Azure.Core: No connection could be made because the target machine actively refused it. (127.0.0.1:10000). System.Net.Http: No connection could be made because the target machine actively refused it. (127.0.0.1:10000). System.Net.Sockets: No connection could be made because the target machine actively refused it.
The port is definitely open but telnet on 127.0.0.1
confirms that that binding is missing:
telnet localhost 10000
✅telnet 127.0.0.1 10000
❌
What most be changed in docker(-compose) so that binding to 127.0.0.1
works?
OR
How can I tell my azure function to connect to localhost
or 0.0.0.0
instead of 127.0.0.1
?
docker describe azurite
"Ports": {
"10000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "10000"
},
{
"HostIp": "::",
"HostPort": "10000"
}
],
docker compose
name: microsoft-azure-eventhubs
services:
azurite:
container_name: "azurite"
image: "mcr.microsoft/azure-storage/azurite:latest"
ports:
- "10000:10000"
- "10001:10001"
- "10002:10002"
restart: unless-stopped
networks:
eh-emulator:
aliases:
- "azurite"