Skip to content

Instantly share code, notes, and snippets.

View domgreen's full-sized avatar
👻
Boo!

Dominic Green domgreen

👻
Boo!
View GitHub Profile
@domgreen
domgreen / simplePack.cmd
Created April 16, 2011 15:39
Simple cspack command for cloud automation
cspack \ServiceDefinition.csdef
/role:WebRole1;\CloudService.WebRole
/role:WorkerRole1;\CloudService.WorkerRole\bin\Release;
domgreen.CloudService.WorkerRole.dll
/out:CloudService.cspkg
@domgreen
domgreen / simpleManage.cmd
Created April 16, 2011 15:43
Simple use of csmanage for
csmanage /update-deployment /hosted-service:domgreen
/slot:production /status:suspended
csmanage /delete-deployment /hosted-service:domgreen
/slot:production
@domgreen
domgreen / csmanagePackage.cmd
Created April 16, 2011 15:45
CSManage Command to deploy an uploaded package
csmanage /create-deployment /hosted-service:domgreen
/slot:production /name:domgreen
/label:domgreenLabel
/package:$(BlobStorageEndpoint)packages/CloudService.cspkg
/config:$(SolutionDir)\CloudService\ServiceConfiguration.cscfg
@domgreen
domgreen / csmanageRunDeployment.cmd
Created April 16, 2011 15:47
CSManage simple call to update the deployment to a running state
csmanage /update-deployment /hosted-service:domgreen
/slot:production /status:running
@domgreen
domgreen / gist:923220
Created April 16, 2011 15:53
Sample Build target for Azure Automated Deployment
<PropertyGroup>
...
<BlobStorageEndpoint>
http://domgreen.blob.core.windows.net/
</BlobStorageEndpoint>
<PackageCommand>
cspack \ServiceDefinition.csdef
/role:WebRole1;\CloudService.WebRole
/role:WorkerRole1;
\CloudService.WorkerRole\bin\Release;
@domgreen
domgreen / gist:923232
Created April 16, 2011 16:12
sample program to call out to the Azure ServiceManagementAPI from C#
namespace serviceManagementConsoleApplication
{
class Program
{
private const string subscriberID = "...";
static void Main(string[] args)
{
var serviceManagment = ServiceManagementHelper.CreateServiceManagementChannel("WindowsAzureEndPoint", new X509Certificate2("insertcert"));
@domgreen
domgreen / gist:923235
Created April 16, 2011 16:15
Configuration file for utilizing the ServiceManagementAPI on Azure
<configuration>
<system .servicemodel="">
<bindings>
<webhttpbinding>
<binding name="WindowsAzureServiceManagement_WebHttpBinding" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00">
<readerquotas maxstringcontentlength="1048576" maxbytesperread="131072">
<security mode="Transport">
<transport clientcredentialtype="Certificate">
</transport>
</security>
@domgreen
domgreen / gist:923240
Created April 16, 2011 16:21
regex to check the naming of Azure Queues
bool match = false;
var exp = new Regex(@"^[0-9a-z]+-*[0-9a-z]+$");
if (exp.IsMatch(input))
{
if (input.Length >= 3 && input.Length <= 63)
{
match = true;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("VALID Queue Name: {0}", input);
}
@domgreen
domgreen / gist:923242
Created April 16, 2011 16:25
calling REST from REST
using(new OperationContextScope((IContextChannel)WebRole.serviceManagement))
{
var hostedServices = WebRole.serviceManagement.ListHostedServices(subscriberID);
foreach (HostedService service in hostedServices)
{
Trace.TraceInformation("Hosted Service: {0}", service.ServiceName);
}
}
@domgreen
domgreen / gist:923250
Created April 16, 2011 16:31
running memcached from Azure
string arguments = "-m " + cacheSize +
" -l " + endpoint.Address +
" -p " + endpoint.Port;
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = "memcached.exe";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = arguments;