Azure

Azure Diagnostics: Backup Local Storage to Blob

published on
Windows Azure Diagnostics gives you the ability to watch directories on your cloud services and copy the files within to a blob container automatically. This is great for archiving things like IIS logs. IIS logs are a special case that you can turn on with a switch, but if you have some other custom logs that you would like to persist to blob storage, it’s fairly easy to do this. Read More...

WCF Azure Table Transport on Nuget

published on
The WCF Azure table transport is a fun adaptation of the original example by Dr. Nick, which used files as a transport layer. I thought I would take it a step further and turn it into a Nuget package. To set up a server, you would add the following to your config: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 <system. Read More...

Azure Queue Message Workflow Activity

published on
A WF4 activity to queue a message in an Azure Queue. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 public sealed class QueueMessageActivity : AsyncCodeActivity {[RequiredArgument] public InArgument<string> StorageConnectionString { get; set; }[RequiredArgument] public InArgument<string> QueueName { get; set; }[RequiredArgument] public InArgument<string> Message { get; set; } protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { CloudStorageAccount storageAccount = CloudStorageAccount. Read More...

Azure table storage WCF transport channel

published on
Communicating with an Azure role through table storage is a common practice. When you setup a worker role, you typically have it watching a queue looking for new messages to signal work. You essentially have something that works like a server and is acting on requests. It fits with a WCF model so I decided to create a WCF transport channel that uses Azure table storage. Instead of creating your own loop and putting in logic for handling concurrent messages, faults, etc. Read More...

Editing Azure Cloud Service csdef Files with NuGet

published on
If you want to edit a csdef file in a cloud project from your NuGet package, this can be done using the install.ps1 PowerShell script in the tools directory. Note that you cannot add NuGet packages directly to a cloud project. Most likely the user will be adding your package to a web or worker role. The install script will then have to search the solution for csdef files. You will also want to put in a uninstall script to remove the changes your NuGet package made. Read More...

Reboot Azure Role Instance Workflow Activity

published on
A WF4 activity to reboot a role instance in an Azure cloud service deployment. Note that this method uses the Azure REST API and requires a management certificate to be installed on the machine executing the workflow in the local machine store. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 public class RebootAzureRoleInstanceActivity : AsyncCodeActivity {[RequiredArgument] public InArgument<string> SubscriptionId { get; set; }[RequiredArgument] public InArgument<string> HostedServiceName { get; set; }[RequiredArgument] public InArgument<string> DeploymentSlot { get; set; }[RequiredArgument] public InArgument<string> CertThumbprint { get; set; }[RequiredArgument] public InArgument<string> RoleInstanceName { get; set; } protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { // X. Read More...