Search code examples
azurevisual-studio-codevisual-studio-2017iis-expressazure-cloud-services

How to run/debug Azure Cloud Service locally on Visual Studio Code?


I have an Azure Cloud Service solution in Visual Studio 2017 which I debug with Emulator Express.

I'd like "migrate" from Visual Studio to Visual Studio Code. I mean that I'd like to be able to run/debug my cloud service(web role project) in VSCode without the use of Visual Studio at all.

My solution has two project:

  1. Service project - contains .csdef, .ccproj and multiple .cscfg.
  2. Role project - contains the .csproj file and the rest of the sample web role project.

I've tried:

I'm building both of the projects with msbuild, the same way it's been built in visual studio. The problem is running the site locally.

  1. Run a local site with IIS Express VSCode extension and configure the web role project root as site root. It didn't work, I tried to browse the site but I got a notification that the folder of the site can't be viewed as a directory. When I think of it this option is missing all the configuration that is defined in the Service project so how is it suppose to work? Does IIS Express can run an Azure cloud service app locally? Maybe I configure a wrong path?
  2. I've tried running csrun.exe command multiple times with different arguments. Something like this:
"C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe" 
/run:./csx/Debug/roles/WebRoleProject/approot;./ServiceConfiguration.myconfig.cscfg /launchBrowser
/launchDebugger:%systemroot%/System32/vsjitdebugger.exe

It gave me the following error:

The compute emulator had a error: Can't locate service descriptions..

I also saw here that compute emulator(csrun.exe) needs visual studio opened as administrator, so maybe it's not possible to run it without it..


Solution

  • I’ve verified this question with the Azure Cloud Compute team and this is not supported in VSCode, they only built an extension for Visual Studio.