I would like to be able of adding a tiny REST endpoint to an Azure Worker Role, just dumping some non critical monitoring meta-data. I can think of many complicated ways of doing that, but I feel there are simpler solutions. What would be your code snippet to tackle this?
views:
79answers:
1
+2
A:
I suspect you want the HttpListener class: http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx. I've never used it, but it looks fairly trivial.
Watch out in Windows Azure for HTTP vs. TCP input endpoints (not sure which to choose here... depends on whether HttpListener uses http.sys) and making sure you bind to the exact IP address and port the fabric tells you to.
smarx
2010-06-04 12:03:23
HttpListener does use HTTP.sys.
Darrel Miller
2010-06-04 13:28:25
Okay, then HTTP is the kind of endpoint to use. But definitely be sure to bind to the specific address/port the fabric gives you... if you try to bind to "any", you'll get a permission error.
smarx
2010-06-04 21:40:48