diff --git a/src/azure-cli/azure/cli/command_modules/batchai/custom.py b/src/azure-cli/azure/cli/command_modules/batchai/custom.py index b200318ea3a..db27349c02a 100644 --- a/src/azure-cli/azure/cli/command_modules/batchai/custom.py +++ b/src/azure-cli/azure/cli/command_modules/batchai/custom.py @@ -1024,7 +1024,7 @@ def _get_available_local_port(): Gets a random, available local port """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # pylint: disable=no-member - s.bind(('', 0)) + s.bind(('127.0.0.1', 0)) s.listen(1) port = s.getsockname()[1] s.close()