RobVious
RobVious

Reputation: 12925

Azure Worker Role can't resolve its own DNS?

I have an issue where locally, I can access xyz.com and a.xyz.com, endpoints for a multi-tenant app hosted as an Azure Web Role in a Cloud Service.

From within that role, a request is sent to a.xyz.com (subdomain) - this is capturing a cookie for forms auth when a user performs some action and automatically gets redirected/authenticated from xyz > a.xyz.

I can hit both endpoints locally just fine, and running the application locally works as expected. So DNS seems to be working fine from my client machine.

When hosted in the service, I can hit both endpoints independently and all is fine, but when the service makes a call for a.xyz, the resolution fails. All I see is the following:

{"ClassName":"System.Net.WebException","Message":"The remote name could not be resolved: 'a.xyz.com'"}

From the following call:

 using (var client = new HttpClient(new HttpClientHandler() { CookieContainer = container })) {
      client.PostAsync(extension, content).Wait(); // here
}

It seems like the internal DNS cache for the Azure Cloud Services Traffic Manager is holding some bogus information... but that's just a theory. How can I go about either manually resetting that cache, or troubleshooting? I've enabled Diagnostics in my web role but haven't been able to find anything revealing - this is my first Azure project though so I could be overlooking something. Any help would be awesome.

Update:

I can't seem to ping the hostname or VIP either locally or from within the worker role (RDP). I just get timeouts. I can navigate to xyz.com from within the WR but a.xyz.com is not resolving. I'm at a loss...

Upvotes: 0

Views: 239

Answers (1)

RobVious
RobVious

Reputation: 12925

If anyone else runs into this - it was just a timing issue. It took ~24 hours for the DNS to propagate all the way up to the internals of Azure. I'm not sure how exactly the caching / propagation works, but the fact remains - time fixed it.

Upvotes: 1

Related Questions