How to specify build configuration when using local git to publish to Azure

Viewed 79

I would like to use local git to publish a project to Azure.

I need to specify the *.csproj (there are multiple projects in my solution) and build configuration (debug/release/etc.).

I only see how to specify the project here.

How can I also specify the build configuration?

1 Answers

You can use the parameter SCM_BUILD_ARGS. Here is the documentation.

e.g. via a .deployment file:

[config]
SCM_BUILD_ARGS=-p:configuration=myconfig
PROJECT=WebApi.csproj

Which will result in a build log like this:

remote:   Copying file from "C:\home\site\repository\obj\myconfig\net5.0\PubTmp\Out\WebAPI.dll" to "C:\local\Temp\8d93f0d60e8e884\WebAPI.dll".
remote:   Copying file from "C:\home\site\repository\obj\myconfig\net5.0\PubTmp\Out\WebAPI.exe" to "C:\local\Temp\8d93f0d60e8e884\WebAPI.exe".
remote:   Copying file from "C:\home\site\repository\obj\myconfig\net5.0\PubTmp\Out\WebAPI.pdb" to "C:\local\Temp\8d93f0d60e8e884\WebAPI.pdb".
remote:   Copying file from "C:\home\site\repository\obj\myconfig\net5.0\PubTmp\Out\WebAPI.runtimeconfig.json" to "C:\local\Temp\8d93f0d60e8e884\WebAPI.runtimeconfig.json".
Related