Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



[Azure/C#] Accessing Instance information from a website.


2 replies to this topic - - - - -

#1 Stephen

    Neowinian Senior

  • 3,052 posts
  • Joined: 17-July 05
  • Location: Manchester / Huddersfield, UK

Posted 04 March 2013 - 21:02

Hey!

I've been playing with websites in azure, and I want to get some information about the current site from azure, So I am trying to use the "RoleEnvironment" class from Microsoft.WindowsAzure.ServiceRuntime.dll to get the information.

However when I try RoleEnvironment.IsAvailable, I always get False, even though the website is running on azure? Am I missing something basic here?

Cheers!


#2 Kami-

    ♫ d(-_-)b ♫

  • 3,625 posts
  • Joined: 28-July 08
  • Location: SandBox

Posted 04 March 2013 - 21:42

http://msdn.microsof...nvironment.aspx
^ read this :)

#3 OP Stephen

    Neowinian Senior

  • 3,052 posts
  • Joined: 17-July 05
  • Location: Manchester / Huddersfield, UK

Posted 04 March 2013 - 21:48

I've read that, Can't see any where where i would have gone wrong.
The only part which sounds similar is

Quote

Windows Azure 1.3 and later reserves for its own use any environment variables that begin with the letters "RD", for example "RdRoleID". If your application creates environment variables that begin with "RD", in certain circumstances, the IsAvailable property will return false, and other methods and properties of theRoleEnvironment class will result in the error message "role discovery data is unavailable." To correct this, use environment variables that do not begin with the letters "RD".
but I havnt got any custom environment variables defined which could start with RD