The code referenced her is not executed any more because WEBSITE_HOSTNAME is configured on linux dedicated. We should consider removing this code. https://github.com/Azure/azure-functions-host/blob/6c23426d7de334e628212eba095002f7d8a78ffe/src/WebJobs.Script/HostNameProvider.cs#L45