This project is read-only.

Converting raw Node.js worker role to NTVS project

Sep 12, 2014 at 10:16 AM
Edited Sep 12, 2014 at 10:17 AM
Since something is messed up on my workstation preventing me from using the Azure Powershell cmdlets properly, I am trying to see if NTVS can save the day by upgrading the Node.js app folder into a first-class citizen Node.js project in Visual Studio 2013.

I tried to redefine a new cloud service project to target the converted Node.js project, but it does not appear to realize the existing Node.js project is an Azure worker role, forcing me to create a new C# worker role. I deleted that and see the "Worker Role Project in solution" option is disabled so I still cannot relate the cloud service to the Node.js project.

If I create a Blank Microsoft Azure Node.js Worker Role project, that gets added into the cloud service project. I cannot see any different between the dummy Node.js project and my own. And then on disassociating that dummy project away from the cloud service project, I see that it also cannot include back the dummy project as a worker role target.

Am I missing something to get this wired up properly in Visual Studio?
Sep 12, 2014 at 11:01 AM
I notice the Node.js project had the option to convert into Microsoft Azure cloud service app, of which it created its own separate cloud service deployment project. So I removed my own cloud service project and renamed the new one according to my convention. Had to totally rewrite the csdef cscfg files as it seems to assume a web role when mine's a worker role.

After ensuring the configuration's matching the previous raw files I had to Powershell publishing, I tried a Publish via the cloud service project, but it ended up with

Error 18 web.config not found in project, to create a project to deploy to Microsoft Azure you must create a Microsoft Azure Node.js project. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Node.js Tools\Microsoft.NodejsTools.targets 200 5 <cloud project>

But this is a worker role and there is no web.config to speak of. Is NTVS only targeted towards web role publishing?

I also noticed VS 2013 scaling 1-2GB memory use during build.
Sep 12, 2014 at 11:49 AM
Edited Sep 12, 2014 at 11:49 AM
Ok so I inspected the .ccproj file and found
<ProjectReference Include="..\SocketWorker\SocketWorker.njsproj">
  <Name>SocketWorker</Name>
  <Project>{cdb85034-fd37-44bb-bae5-6b88050d2d82}</Project>
  <Private>True</Private>
  <RoleType>Web</RoleType>
  <RoleName>SocketWorker</RoleName>
  <UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish>
</ProjectReference>
Changed the role type to Worker and does not check for web.config now.

However met a further blocking check

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools\2.4\Microsoft.WindowsAzure.targets(2880,5): warning : CloudServices67 : The entrypoint for role SocketWorker is already defined in the service definition file. Ignoring entrypoint Microsoft.NodejsTools.WebRole.dll.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools\2.4\Microsoft.WindowsAzure.targets(2880,5): warning : CloudServices67 : The entrypoint for role SocketWorker is already defined in the service definition file. Ignoring entrypoint Microsoft.NodejsTools.WebRole.dll.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools\2.4\Microsoft.WindowsAzure.targets(2880,5): error : CloudServices35 : An SSL certificate was not specified for the https input endpoint 'HttpsIn' of role SocketWorker.
Done building project "cloudservice.ccproj" -- FAILED.

I have a HTTPS endpoint defined which uses a self-bundled SSL cert in a config folder; on startup, the app code loads that SSL cert. This works fine with our current worker role implementation; how can this check be bypassed?