Adds a configuration for a Node.js worker role to the current Windows Azure service.
Add-AzureNodeWorkerRole [[-Name] <string>] [[-Instances] <Int32>]
Run Add-AzureNodeWorkerRole from a service directory to add the scaffolding for a Node.js worker role to the current Windows Azure hosted service.
In Windows Azure, worker roles are provided to support generalized development, and often are used to provide WebSocket or pure TCP for efficient bi-directional information exchange. A worker role can perform background processing for a web role. When your web role requires a background process that performs long running or intermittent tasks, you should use a worker role. For more information about using worker roles, see Overview of Creating a Hosted Service for Windows Azure.
Add-AzureNodeWorkerRole creates a subdirectory in the service directory, which has the worker role name and stores the configuration files for the role instances
(Position 1) Specifies a name for the worker role and determines the name of the worker role directory. If you do not specify a role name, the first worker role is named WorkerRole1, the second worker role is named WorkerRole2, and so forth.
(Position 2) Sets the number of worker role instances. By default, one role instance is configured. To apply the Windows Azure SLA to the service, set at least two role instances.
Example 1: Add the scaffolding for a new worker role with the default settings (Name = WorkerRole1, Instances = 1) to the MyService service:
PS C:\node\MyService> Add-AzureNodeWorkerRole Role has been created at C:\node\MyService\WorkerRole1. For easy access to Windows Azure Services from your application code, install Windows Azure client library for Node.js by running ‘npm install azure’.
Example 2: Add the scaffolding for a new worker role with the role name MyWorkerRole and two role instances to the current service:
PS C:\node\MyService> Add-AzureNodeWorkerRole MyWorkerRole -I 2