Windows Azure Service Management CmdLets

Windows Azure Service Management CmdLets を使って、AzureへのDeploy、Start、SuspendStop、Removeするスクリプトを作成する際に参考にしたところ。

Windows Azure Service Management CmdLets

設定

$label=''

$cert = Get-Item cert:\CurrentUser\Root\<証明書を設定する>
$servicename = '<サービス名>'
$sub = "<サブスクリプションID>"
$storagename = '<ストレージ名>'
$package = ""
$config = ""

Add-PSSnapin AzureManagementToolsSnapIn

パッケージのDeploy

New-Deployment -serviceName $servicename -storageserviceName $storagename -subscriptionId $sub -certificate $cert -slot 'Staging' -package $package -configuration $config -label $label |
Get-OperationStatus -WaitToComplete

ステータスをRUNにする

Get-HostedService $servicename -Certificate $cert -SubscriptionId $sub |
Get-Deployment -Slot 'Staging' |
Set-DeploymentStatus 'Running' |
Get-OperationStatus -WaitToComplete

ステータスをSUSPENDSTOPにする

Get-HostedService $servicename -Certificate $cert -SubscriptionId $sub |
Get-Deployment -Slot 'Staging' |
Set-DeploymentStatus 'Suspended' |
Get-OperationStatus -WaitToComplete

パッケージのRemove *1

Get-HostedService $servicename -Certificate $cert -SubscriptionId $sub |
Get-Deployment -Slot 'Staging' |
Remove-Deployment |
Get-OperationStatus -WaitToComplete

Windows Azureアプリケーション開発入門 (MSDNプログラミングシリーズ)

Windows Azureアプリケーション開発入門 (MSDNプログラミングシリーズ)


Microsoftのクラウドコンピューティング Windows Azure入門

Microsoftのクラウドコンピューティング Windows Azure入門

Windows Power Shellの各種情報へのポインタ

Windows PowerShell でのスクリプティング (本家)

Windows PowerShell でのスクリプティング
スクリプト センター

Windows PowerShell は新しいコマンド ライン シェルであり、システム管理に役立つように設計されたスクリプト言語です。

Windows PowerShellコマンド&スクリプティング入門 (@IT)

Windows PowerShellコマンド&スクリプティング入門

*1:開発時はRemoveし忘れて課金が嵩まない様にShutdown Scriptに設定しておくといいかも。