The Windows Azure activities enable interaction with Windows Azure Compute and Storage services from within a TFS build workflow. The activities expose the capabilities of the Windows Azure Service Management API, for managing deployment, configuration and the operational status of services, roles and instances.

Before you can make use of any of the TFS 2010 community build activities you have to make sure they are available for the build system and on your development PC. Instructions for this process can be found in the ALM Rangers build guide or in the StyleCop page of this wiki. This page assumes the Windows Azure activities are available in the developers build process workflow toolbox.

Common Configuration

All of the activities require two common arguments for interacting with Windows Azure.

  • SubscriptionId - the string identifier of the subscription which you would like to manage.
  • CertificateThumbprintId - all operations against the Azure API are authenticated using a certificate which has been uploaded to the Azure Management Portal.  This parameter identifies the thumbprint of the certificate which is located in the Personal store of the TFS build user.

It is advisable to include these settings as arguments to the workflow to allow for reuse against different subscriptions.

Asynchronous Operations

Many activities initiate the execution of an asynchronous operation within the Windows Azure infrastructure.  Each of these activities will return an OperationId as the result of the activity.  This identifier is a string returned by Windows Azure to be used to query for the status of the specific operation.  Using this identifier, the GetOperationStatus activity can be used to poll periodically for the completion or termination of the originating operation.  Because this is a common pattern, you will find the need to make a composite or other block similar to that shown below for handling asynchronous operations.

Asynchrnous Operation pattern

This workflow excerpt calls the SetDeploymentStatus activity to suspend the running instance in the staging slot of a service.  It then polls every 30 seconds to find the status of the suspend operation.  If the operation was not successful, it throws an exception to be handled elsewhere in the workflow.

Included Activities

Hosted Services

Name

Description

GetHostedService

Gets the service context for the specified hosted service.

GetHostedServiceProperties

Lists all hosted services in the specified subscription.

GetHostedServices

Sets the label and description of the specified hosted service.

Deployments

Name

Description

GetDeployment

Get the deployment context for a currently running service.

SwapDeployment

Swaps the deployments in the Production and Staging slots.

NewDeployment

Creates a new deployment (using an already uploaded package).

RemoveDeployment

Deletes a pre-existing deployment.

UpgradeDeployment

Initiates an in-place upgrade of the specified deployment.

ChangeDeploymentConfiguration

Updates the configuration of a running instance.

SetDeploymentStatus

Set a deployment to the running or suspended state.  

UploadPackageToBlobStorage

Upload a packaged service to blob storage as a precursor to deployment. 

Role Instances

Name

Description

RebootRoleInstance

Reboots the specified role instance.

ReimageRoleInstance

Re-images the specified role instance.

Affinity Groups

Name

Description

GetAffinityGroup

Lists the properties for the specified affinity group.

GetAffinityGroups

Lists all affinity groups in the subscription.

Service Certificates

Name

Description

GetCertificates

Lists the certificates for the specified hosted service.

GetCertificate

Retrieves a specified service certificate.

AddCertificate

Uploads a service certificate.

RemoveCertificate

Deletes the specified service certificate.

Storage Services

Name

Description

GetStorageKeys

Displays the primary and secondary keys for the storage account.

GetStorageProperties

Lists the properties of the specified storage account.

NewStorageKey

Regenerates the primary or secondary storage key for the specified storage account.

GetStorageAccount

Lists all storage services in the specified subscription.

Operating Systems

Name

Description

GetOSVersions

Get a list of the versions of the guest operating system families that are currently available in Windows Azure.

GetOSVersions

Get a list of the versions of the guest operating system that are currently available in Windows Azure.

Locations

Name

Description

GetLocations

Get a list all of the data center locations that are valid for a subscription.

Last edited Dec 23, 2011 at 3:04 PM by shschaefer, version 5

Comments

bjnix04 Apr 23, 2012 at 6:40 PM 
The arguments and their suggested values should be documented...I can barely make heads or tails of things as they stand now.