Skip to content

Instantly share code, notes, and snippets.

@domgreen
Created April 16, 2011 15:53
Show Gist options
  • Save domgreen/923220 to your computer and use it in GitHub Desktop.
Save domgreen/923220 to your computer and use it in GitHub Desktop.
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.CloudService.WorkerRole.dll
/out:CloudService.cspkg
</PackageCommand>
<DeployToBlobStorageCommand>
C:\PackageToBlobStorage\PackageToBlobStorage.exe
</DeployToBlobStorageCommand>
<SuspendCommand>
csmanage /update-deployment /hosted-service:domgreen /slot:production
/status:suspended
</SuspendCommand>
<DeleteCommand>
csmanage /delete-deployment /hosted-service:domgreen /slot:production
</DeleteCommand>
<CreateCommand>
csmanage /create-deployment /hosted-service:domgreen /slot:production
/name:domgreen /label:domgreenLabel
/package:$(BlobStorageEndpoint)packages/CloudService.cspkg
/config:$(SolutionDir)\CloudService\ServiceConfiguration.cscfg
</CreateCommand>
<RunCommand>
csmanage /update-deployment /hosted-service:domgreen /slot:production
/status:running
</RunCommand>
...
</PropertyGroup>
<Target Name="BeforeDropBuild" Condition=" '$(IsDesktopBuild)'!='true' ">
...
<Message Text="use cspack create a package for deployment"/>
<Exec Command="$(PackageCommand)" WorkingDirectory="$(SolutionDir)" />
<Message Text="run program to place package in blob storage"/>
<Exec Command="$(DeployToBlobStorageCommand) $(SolutionDir)\AirWatch.cspkg"/>
<Message Text="suspend the current running cloud application"/>
<Exec Command="$(SuspendCommand)" ContinueOnError="true"/>
<Message Text="delete the currently deployed cloud application"/>
<Exec Command="$(DeleteCommand)" ContinueOnError="true"/>
<Message Text="create a azure service using the package placed in blob storage"/>
<Exec Command="$(CreateCommand)" WorkingDirectory="$(SolutionRoot)"/>
<Message Text="run the created application"/>
<Exec Command="$(RunCommand)" />
...
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment