5 out of 9 rated this helpful - Rate this topic

Windows Azure PowerShell for Node.js Cmdlet Reference

Windows Azure PowerShell for Node.js provides a command-line environment for developing and deploying Node applications for Windows Azure by using a few Windows PowerShell cmdlets. The Windows Azure PowerShell for Node.js Cmdlet Reference explains how to use the Node.js cmdlets.

For requirements and installation instructions for Windows Azure PowerShell for Node.js, see the Node.js Web Application tutorial.

To open Windows Azure PowerShell for Node.js

  • On the Start menu, click All Programs, click Windows Azure SDK for Node.js, and then click Windows PowerShell for Node.js. Opening your Windows PowerShell environment this way ensures that all of the Node command-line tools are available.

You can use Windows PowerShell cmdlets for Node.js to perform the following tasks:

Task PowerShell Cmdlets

Enable use of your Windows Azure subscription for hosted service deployments

Get-AzurePublishSettings

Opens a web page for downloading a publishing profile for your Windows Azure account.

Import-AzurePublishSettings [-Path] <string>

Imports the publishing settings for use during service deployments.

Get information about available storage accounts for a subscription

Get-AzureStorageAccounts [[-Subscription] <string>]

Create the scaffolding for a hosted service for your Node application

New-AzureService [-Name] <string>

Add a web role to a hosted service

Add-AzureNodeWebRole [[-Name] <string>] [[-Instances] <Int32>]

Add a worker role to a hosted service

Add-AzureNodeWorkerRole [[-Name] <string>] [[-Instances] <Int32>]

Run a service locally in the Windows Azure compute emulator, optionally opening the web role in a browser

Start-AzureEmulator [-Launch]

Stop the Windows Azure compute emulator

Stop-AzureEmulator

Set deployment options for a hosted service

Hh689725.note(en-us,Azure.100).gifNote
The deployment options take effect the next time you use Publish-AzureService to deploy the service in Windows Azure or to update an existing cloud deployment. They can be overridden for a deployment by using parameters for Publish-AzureService.

Set-AzureDeploymentLocation [-Location] <location>

Sets the default geographic region for service deployments.

Set-AzureDeploymentSlot [-Slot]<slot>

Sets the default Windows Azure deployment environment to Staging or Production.

Set-AzureDeploymentSubscription [-Subscription] <string>

Sets the Windows Azure subscription to use in service deployments.

Set-AzureDeploymentStorage [-AccountName] <string>

Sets the storage account to use for service deployments.

Deploy a new hosted service to Windows Azure, or publish updates to a deployed service

Publish-AzureService [-Subscription <string>] [-Name <string>] [-StorageAccountName <string>] [-Location <location>] [-Slot <slot>] [-Launch]

Scale a hosted service by adding or removing role instances

Set-AzureInstances [-RoleName] <string> [-Instances] <Int32>

Stop and start a hosted service

Stop-AzureService [-Slot <slot>] [-Subscription <string>]

Start-AzureService

Enable and disable remote access to service role instances

Enable-AzureRemoteDesktop -Username <string>

Disable-AzureRemoteDesktop

Remove a hosted service

Remove-AzureService [-Subscription <string>]

The Node.js cmdlets have the following special requirements:

  • To deploy your Node.js applications in Windows Azure, you must have a Windows Azure subscription. Before you can set perform cloud service deployments using the Node.js cmdlets, you must download your subscription information (by using Get-AzurePublishSettings) and then import those settings (by using Import-AzurePublishSettings).

  • You must run cmdlets that act on a hosted service from within the service directory.

    When you create a new hosted service, a service directory is created in the current directory, and the focus of the Windows PowerShell command prompt moves to the service directory. From the service directory, you can add web roles and worker roles to the service. All other cmdlets for the service can be run from any child directory of the service directory.

  • After you create and configure a new hosted service, or after you run any cmdlet that updates the configuration of a deployed service, you must run the Publish-AzureService cmdlet to publish the updates to the cloud service deployment. For example, after you run Set-AzureInstances to add additional web role instance to a service configuration, run Publish-AzureService to scale out a hosted service.

    If you are running the deployment locally in the Windows Azure compute emulator, you must run Start-AzureEmulator again after you update the service definition file (.csdef) or the service configuration file (.cscfg). However, the compute emulator renders updates to the server.js and web.config files instantly.

  • Although Windows Azure PowerShell cmdlets and parameters are not case-sensitive, the following values that are entered for Node.js cmdlets are case-sensitive: service names, subscription names, storage account names, and deployment locations.

Hh689725.note(en-us,Azure.100).gifNote
For basic instructions on using Windows PowerShell, see Using Windows PowerShell in the Windows PowerShell Getting Started Guide. While you are working in Windows PowerShell, your best source of help is the Get-Help cmdlet; for information about using the Get-Help cmdlet, enter Get-Help Get-Help.

For an introduction to using the Node.js cmdlets, see How to Use Windows Azure PowerShell for Node.js.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.