Skip to content

Instantly share code, notes, and snippets.

@SyntaxC4
Created March 21, 2012 19:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SyntaxC4/2151597 to your computer and use it in GitHub Desktop.
Save SyntaxC4/2151597 to your computer and use it in GitHub Desktop.
Determining if you're running on Storage Emulator or Windows Azure Storage Account
public ActionResult Index()
{
const string welcomeNote = "Welcome to ASP.NET MVC {0}!";
var account = CloudStorageAccount.Parse(
RoleEnvironment.
GetConfigurationSettingValue("DataConnectionString"));
ViewBag.Message = (account.BlobEndpoint.IsLoopback) ?
string.Format(welcomeNote, " on Local") :
string.Format(welcomeNote, " in the Cloud";
return View();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment