Skip to content

Azure Deploy Cloud Service Task

Mike Mooney edited this page Mar 27, 2015 · 6 revisions

Azure - Deploy Cloud Service Task

Description

The Deploy Cloud Service Task allows you to deploy, and create if necessary, an Azure Cloud Service. In order to run this task, you will need an Azure account (example here), a Cloud Service project (example here), and a management certificate for that account (example here, under Authentication)

Syntax

sriracha.run.exe --taskBinary=Sriracha.DeployTask.Azure.dll --taskName=DeployCloudServiceTask --configFile=.\MyDeployCloudService.json 

You can pull the deployment runner and task assembly into our solution with this NuGet package: http://www.nuget.org/packages/Sriracha.DeployTask.Azure/

Configuration File Format

Field Name Parent Description
AzureSubscriptionIdentifier Root [Required] Identifies Azure Subscription. See here for how to get this value
AzureManagementCertificate Root [Required] Management Certificate to allow publishing to Azure subscription. See here for how to get this value
Service Name Root [Required] Name of your service in Azure. If this service does not yet exist, it will be created. When we’re done, the cloud service will have the url http://[servicename].cloudapp.net/. Note: as you would guess with the URL, this service name must be unique, not just within your account, but also throughout all of Azure cloud services, so be creative.
StorageAccountName Root [Required] An Azure storage account that is needed to to hold the Azure package binary during the deployment. If this account doesn’t exist, it will be created. Note: the storage account name must be between 3 and 24 characters, and can only contain lower case letters and numbers.
AzurePackagePath Root [Required] The location of your Azure Cloud Service package (*.cspkg). This can be created by right-clicking your Cloud Service in Visual Studio and selecting Publish
AzureConfigPath Root [Required] The location of the Azure configuration file (*.cscfg) to deploy with your project, also created when you package your Azure Cloud Service. By default it will use the values from this file, but those values can be overridden during deployment using the parameters below
DeploymentSlot Root [Optional] The Azure deployment slot to deploy the package too. Common values are "production" and "staging", default is "production"
AzureTimeoutMinutes Root [Optional] The number of minutes to wait for each step of the deployment process to complete before timing out. Default is 30 minutes.
InstanceCount CloudServiceRole [Optional] The number of instances to initialize. This value will be written into the Azure package configuration file (*.cscfg) during the deployment. If not provided, the existing value from the Azure package configuration file will be used.
ConfigurationSettingValues CloudServiceRoles [Optional] Hash object defining values to be overridden in the Azure package configuration file (*.cscfg). If no Setting element exists for a given name, it will be created.
CertificateThumbprints CloudServiceRoles [Optional] Hash object defining thumbprint values to be overridden in the Azure package configuration file (*.cscfg). If no Certificate element exists for a given name, it will be created.

Example:

{
	"AzureSubscriptionIdentifier":"REPLACE_ME",
	"AzureManagementCertificate" : "REPLACE_ME",
	"ServiceName" : "REPLACE_ME",
	"StorageAccountName" : "REPLACE_ME",
	"AzurePackagePath": "REPLACE_ME",
	"AzureConfigPath": "REPLACE_ME",
	"RoleList": {
		"MyRoleName": {
			"InstanceCount": 1,
			"ConfigurationSettingValues": {
				"ConnectionString": "Data Source=MY_SERVER;Initial Catalog=MY_DATABASE;User ID=MY_USER; Password=MY_PASSWORD;",
				"AzureStorageConnectionString": "DefaultEndpointsProtocol=https;AccountName=REPLACE_ME;AccountKey=REPLACE_ME"
			},
			"CertificateThumbprints": {
				"MyCertificate": "REPLACE_ME"
			}			
		}
	}
}