After my team decided to incorporate Azure Pipelines on existing projects, one of the most difficult parts of the task for me was to look for the right pipeline task that would compile the setup project (vdproj) present in my solution using a pipeline.
After a lot of research and hours of testing, I found a way to achieve it.
Just use a command line task and use a script in the format shown below to compile the solution
"<full path to devenv.exe" "<full path to solution file (.sln)>" /Rebuild "<configuration>|<platform>"
Executing this task would compile all the projects present in the solution file, including setup projects. The outcome of setup projects like EXE and MSI files could be found in the configured the output path
If you have a requirement of compiling the solution as an administrator, then that's easy too. Just create a shortcut of devenv.exe as an admin in any desired location, and use that path in the command line given above.
Let me know if it helped you!