Created
February 8, 2011 19:44
-
-
Save vquaiato/817052 to your computer and use it in GitHub Desktop.
"Push" deploy on Windows Azure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param($S,$I,$Cert,$L,$P,$Cfg) | |
$start = Get-Date | |
$service_name = $S | |
$subscription_id = $I | |
$certificate = $Cert | |
$label = $L | |
$package = $P | |
$config_file = $Cfg | |
if(-not(Get-PSSnapin AzureManagementToolsSnapIn)) | |
{ | |
Add-PSSnapin AzureManagementToolsSnapIn | |
} | |
New-Deployment -ServiceName $service_name -SubscriptionId $subscription_id -Certificate $certificate -Slot staging -Package $package -Configuration $config_file -Label $label | | |
Get-OperationStatus -WaitToComplete | |
Get-HostedService -ServiceName $service_name -SubscriptionId $subscription_id -Certificate $certificate | | |
Get-Deployment -Slot staging | | |
Set-DeploymentStatus running | | |
Get-OperationStatus -WaitToComplete | |
Get-HostedService -ServiceName $service_name -SubscriptionId $subscription_id -Certificate $certificate | | |
Get-Deployment -Slot staging | | |
Move-Deployment | | |
Get-OperationStatus -WaitToComplete | |
Get-HostedService -ServiceName $service_name -SubscriptionId $subscription_id -Certificate $certificate | | |
Get-Deployment -Slot staging | | |
Set-DeploymentStatus suspended | | |
Get-OperationStatus -WaitToComplete | |
Get-HostedService -ServiceName $service_name -SubscriptionId $subscription_id -Certificate $certificate | | |
Get-Deployment -Slot staging | | |
Remove-Deployment | | |
Get-OperationStatus -WaitToComplete | |
$end = Get-Date | |
"Deploy finished in " + ($end-$start).TotalSeconds + " secs." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
.'.\push.ps1' -S "service_name" -I "your_subscription_id" -Cert (Get-Item cert:\CurrentUser\My<thumb_print>) -L "label_name" -P ".cspkg local" -Cfg ".cscfg local"