Add "AzureManagementToolsSnapIn" Command Changed:
- Windows Azure PowerShell Cmdlets 1.0: PS C:\windows\system32>Add-PSSnapin AzureManagementToolsSnapIn
- Windows Azure PowerShell Cmdlets 2.0: PS C:\windows\system32>Add-PSSnapin WAPPSCmdlets
Create New Host Service
mytodo
New-Deployment
Approach1 ( package in local)
PS C:\windows\system32> New-Deployment -serviceName mytodo -subscriptionId xxxxxx-certificate (get-item cert:\CurrentUser\MY\xxxxxxx) -slot staging –package MyTodo.cspkg -configuration ServiceConfiguration.cscfg -label "v1.0" –storageServiceName xxxxxxx
Approach2 (package in blob)
PS C:\windows\system32> $package= 'http://xxxxxx.blob.core.windows.net/mydeployments/20111227_062844_MyTodo.cspkg'
PS C:\windows\system32> $config='C:\Users\xxxxxx\Documents\Labs\DeployingApplicationsinWindowsAzureVS2010\Source\Ex2-Dep
loyingWithPowerShell\begin\CS\MyTodo\bin\Release\app.publish\ServiceConfiguration.cscfg'
PS C:\windows\system32>New-Deployment -slot Production -package $package -configuration $config -label "v1.0" -serviceName myservice -SubscriptionId xxxxx -certificate (get-item cert:\CurrentUser\MY\xxxxxxx)
Upgrading a Deployment Using Windows PowerShell
Get-HostedService -serviceName testmytodo -subscriptionId xxxx-certificate (get-item cert:\CurrentUser\MY\xxxxxxx) | Get-Deployment Production | Set-Deployment -package MyTodo.cspkg -configuration ServiceConfiguration.cscfg -label "v2.1" –storageServiceName psdeployment
NOte:
If you were to run the command as described above, the operation runs asynchronously.To show the operation’s progress while the deployment is taking place, you can pipe the output
of the command into the Get-OperationStatus cmdlet and
specify the WaitToComplete parameter.
Add this cmdlet to the end of the command line entered previously making sure that you include the pipeline character ‘|’, as shown below.
Upgrading a Deployment Using Windows PowerShell 2
Get-HostedService testmytodo -subscriptionId xxx -certificate (get-item cert:\CurrentUser\MY\xxxxxxx) | Get-Deployment production | Set-Deployment -package MyTodo.cspkg -configuration ServiceConfiguration.cscfg -label "v2.2"
–storageServiceName xxxxxx| Get-OperationStatus -WaitToComplete