Jump to content



Photo

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

azure

  • Please log in to reply
2 replies to this topic

#1 vetStephen

Stephen

    Neowinian Senior

  • 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-

Kami-

    ♫ d(-_-)b ♫

  • Tech Issues Solved: 2
  • Joined: 28-July 08
  • Location: SandBox

Posted 04 March 2013 - 21:42

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

#3 OP vetStephen

Stephen

    Neowinian Senior

  • 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

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



Click here to login or here to register to remove this ad, it's free!