-
Notifications
You must be signed in to change notification settings - Fork 4
Incorporate Dash Deployment into ALM
DASH is often required to support a separate, non-trivial cloud-based application with its own mechanisms for build, test and deployment. In these cases, it is sometimes appropriate to incorporate DASH into this Application Lifecycle Management (ALM) processes.
The following prerequisites are required in order to successfully build and deploy DASH (generally on a dedicated build server):
- Visual Studio 2013 (Update 5 or greater) - http://www.microsoft.com/en-us/download/details.aspx?id=48129
- Azure SDK 2.4 (cannot be greater as 2.5 introduces a breaking change) - http://www.microsoft.com/en-us/download/details.aspx?id=43709
- Typescript 1.7 or greater - http://www.microsoft.com/en-us/download/details.aspx?id=48739
- Git Client (any version) - http://www.git-scm.com/downloads
DASH is maintained in a public GitHub repository. The clone URI for this repository is:
https://github.com/MicrosoftDX/Dash.git
The source code for DASH can be cloned either one-time and preserved in the build location or (preferably) cloned each time the application is built (Git allows cloning to a specific commit or tag).
DASH is an Azure Cloud Service. The Azure SDK provides tools to build the required artifacts (.cspkg & .cscfg) to deploy the cloud service. These build tools integrate with the msbuild
tool.
DASH is available in 2 flavors, manifest via distinct cloud service projects:
- HTTP endpoint only -
/DashServer.Azure/DashServer.Azure.ccproj
- HTTP and HTTPS endpoints -
/DashServer.Azure.Https/DashServer.Azure.Https.ccproj
When building DASH the project associated with the desired configuration must be specified as the project to msbuild. The usage to build DASH is as follows:
msbuild {project} /t:Publish /p:Configuration=Release;PublishDir={outpath} [/p:TargetProfile={configuration}] [/p:SourceServiceConfiguration={config_file_name}]
where:
project: the relative or fully-qualified file name of the desired project to build (DashServer.Azure.ccproj or DashServer.Azure.Https.ccproj)
outpath: the directory name (including trailing backslash) where the output artifacts should be written to
configuration: the name of the built-in configuration to be used as the cloud service configuration file (.cscfg). The built-in configuration files are; ServiceConfiguration.Cloud.cscfg or ServiceConfiguration.Publish.cscfg. The value to specify is 'Cloud' or 'Publish' respectively
config_file_name: the relative or fully-qualified file name of the .cscfg file to be used as the cloud service configuration file. Note that the filename is relative to the .ccproj project file.
If repeatedly building and deploying DASH, it will be common to want to use the same configuration. The configuration can be maintained and specified in 3 different ways:
- Maintain the configuration in one of the .cscfg files included in the DASH source repository and specify using the
TargetProfile
property. While this approach is relatively straight forward, you will need to manage resolving any future conflicts when changes occur to these files in the DASH codebase. Additionally, this approach is not applicable if making a fresh clone of the DASH repository each time you build. - Maintain a separate .cscfg file outside of the DASH directory structure and specify using the
SourceServiceConfiguration
property. Using this approach allows you to maintain the .cscfg file independently of the DASH codebase and you may be able to check-in the file to the application's own repository. Note that since this file will contain the account keys (the secrets) for the DASH account, it may not be a great idea to store this in a source control repository. Instead, consider a 'lock box' style design where only a trusted principal (ie. the build server) may retrieve the file. - Download the existing .cscfg file from the already deployed DASH service and specify this temporary file using the
SourceServiceConfiguration
property.
There are numerous approaches to deploying Azure Cloud Services from build environments, including Powershell and msbuild tasks. A key point to decide is whether or not you want to deploy directly to the 'Production' slot or the 'Staging' slot and VIP-swapping. Both approaches ensure that the DASH service is updated without any disruption to the service. Deploying directly to 'Production' requires less billable resources and is less complex, however there is no way to verify the operation of the newly-deployed service or roll-back if a fault is detected. Deploying to the 'Staging' slot enables the deployment logic to perform 'smoke' tests without disrupting the production service. Additionally, if a fault is detected in the new deployment (either during smoke testing or even after swapping to production) the prior version may be 'rolled-back' without interruption. This approach does require additional short-term billable resources (staging VMs) and the logic to manage multiple slots is more complex.