Azure website remote debugging with git not working

I tested the new "Remote Debugging" feature for Azure websites, but I think I ran into a problem: I can get it working fine if I use Web Publish. If I bred a site with a local git deployment, the debugger joins but the debugging symbols do not load (breakpoints show a warning).

I tried setting up the Release configuration to include PDB files (since Azure git deployment uses the Release configuration by default) and using a special deployment script generated by the azure site deploymentscript command detailed here and setting the build command to use the Debug configuration. In both cases, I still get the same problem that characters are not loading.

I feel the problem is probably one of the following:

  • Azure launches some kind of custom action after publishing on the Internet, which must be launched in order to enable remote debugging
  • There is no flag in the build options used by git deployment scripts, because of which PDB output will not be present for the web application (I don't think this is possible)
  • Azure does not perform the settings that I use in deploying the script when the site is actually running and compiled on demand

Ultimately, I hope to write some automatic deployment scripts, and I would rather use git deployment than web publishing to accomplish this. What really puzzles me is that it fails even when setting up Release to include PDB files. It really makes me think that there must be something else on Azure for publishing on the Internet that was not done to deploy git. Does anyone have any ideas on what could be causing this difference?

Custom git Deployment Script

I enable a custom deployment script generated with azure site deploymentscript for reference and to display the build flags used. The relevant parts are located after the :: Deployment section.

 @if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off :: ---------------------- :: KUDU Deployment Script :: Version: 0.1.5 :: ---------------------- :: Prerequisites :: ------------- :: Verify node.js installed where node 2>nul >nul IF %ERRORLEVEL% NEQ 0 ( echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment. goto error ) :: Setup :: ----- setlocal enabledelayedexpansion SET ARTIFACTS=%~dp0%..\artifacts IF NOT DEFINED DEPLOYMENT_SOURCE ( SET DEPLOYMENT_SOURCE=%~dp0%. ) IF NOT DEFINED DEPLOYMENT_TARGET ( SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot ) IF NOT DEFINED NEXT_MANIFEST_PATH ( SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest IF NOT DEFINED PREVIOUS_MANIFEST_PATH ( SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest ) ) IF NOT DEFINED KUDU_SYNC_CMD ( :: Install kudu sync echo Installing Kudu Sync call npm install kudusync -g --silent IF !ERRORLEVEL! NEQ 0 goto error :: Locally just running "kuduSync" would also work SET KUDU_SYNC_CMD=node "%appdata%\npm\node_modules\kuduSync\bin\kuduSync" ) IF NOT DEFINED DEPLOYMENT_TEMP ( SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random% SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true ) IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP ( IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%" mkdir "%DEPLOYMENT_TEMP%" ) IF NOT DEFINED MSBUILD_PATH ( SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Deployment :: ---------- echo Handling .NET Web Application deployment. :: 1. Restore NuGet packages IF /I "azure-test.sln" NEQ "" ( call "%NUGET_EXE%" restore "%DEPLOYMENT_SOURCE%\azure-test.sln" IF !ERRORLEVEL! NEQ 0 goto error ) :: 2. Build to the temporary path IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" ( %MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\azure-test\azure-test.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Debug /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS% ) ELSE ( %MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\azure-test\azure-test.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Debug /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS% ) IF !ERRORLEVEL! NEQ 0 goto error :: 3. KuduSync IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" ( call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd" IF !ERRORLEVEL! NEQ 0 goto error ) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Post deployment stub call %POST_DEPLOYMENT_ACTION% IF !ERRORLEVEL! NEQ 0 goto error goto end :error echo An error has occurred during web site deployment. call :exitSetErrorLevel call :exitFromFunction 2>nul :exitSetErrorLevel exit /b 1 :exitFromFunction () :end echo Finished successfully. 
+6
source share
2 answers

Update 2/8/2014

Some fixes were fixed in WAWS, and now you can debug when using git by loading VS correctly on the server PDBs. For it to work, you need to do one of two things (i.e. you do not need to do both). It can work both in VS 2012 and in 2013.

  • Disable debugging Just My Code: Just turn off this setting in the VS debugger settings and try to debug your Azure website.
  • Create in debug mode . To do this on the server assembly, you can go to the Azure Portal and add ApSetting called SCM_BUILD_ARGS with the value -p:Configuration=Debug (more details here ). Then go to the Deployment page and click the Redeploy button (for the current deployment). Then join VS, and everything should work!

Original answer

Indeed, today this does not work, and we are trying to understand how we can make it work. The root of the problem is that the Visual Studio debugger expects to find the PDB on the client, and in the case of git, they exist only on the server.

This article discusses changes in how the debugger works since 2010 and later, and this probably affects things.

More research is required, but now it is a state of things.

+27
source

I had this problem with a .Net Core Azure Function project using the Cloud Explorer functionality to right click. The following github problem says this, but the solution did not solve my problem:

https://github.com/Azure/Azure-Functions/issues/872

I finally stumbled upon the answer here:

http://dontcodetired.com/blog/post/Remote-Debugging-Azure-Functions-V2-The-breakpoint-will-not-currently-be-hit-No-symbols-have-been-loaded-for-this- document

It comes down to manually connecting to a process in Azure, rather than using the right-click function in Cloud Explorer.

0
source

Source: https://habr.com/ru/post/957709/


All Articles