Skip to content

Instantly share code, notes, and snippets.

View SyntaxC4's full-sized avatar
🏠
Working from home

Cory Fowler SyntaxC4

🏠
Working from home
View GitHub Profile
@SyntaxC4
SyntaxC4 / index.php
Created July 26, 2012 07:42
Accessing Portal Set App Settings from PHP and Node.js
<html>
<head><title>Accessing App Settings from PHP</title></head>
<body>
<h1>Hello from <?php echo getenv("CloudProvider"); ?></h1>
<ul>
<li><label>Service Bus Namespace:</label> <?php echo getenv("ServiceBusConnectionString"); ?></li>
<li><label>Storage Connection String:</label> <?php echo getenv("StorageConnectionString"); ?>
</ul>
@SyntaxC4
SyntaxC4 / .user.ini
Last active October 12, 2020 14:52
Web.config Starter for PHP on Windows Azure Web Sites
upload_max_filesize = 12M
log_errors=1
// Developer: Cory Fowler
//
namespace Net.SyntaxC4.Helpers
{
using System.Configuration;
using Microsoft.WindowsAzure.ServiceRuntime;
/// <summary>
/// Provides a way of Providing Context between Cloud and On-Premise Deployment of an Application.
@SyntaxC4
SyntaxC4 / DeterminingStorageLocation
Created March 21, 2012 19:18
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") :