In case you are setting up automated build, for a Local VM by default this will force to setup build for a branch named as Main. Does not matter if you are not doing development on Main branch or might be the case you never used Main branch since Day 1. But automation scripts will forcefully route the process to Main branch.

That means, under such situation Main branch is empty and has nothing to build (if you never used Main Branch).

If so is the case, you can do a small trick before you setup Automatic Builds. Take the script named as BuildEnvironmentReadiness.ps1 which is located on C:\DynamicsSDK (Drive can be different). Modify this script to change the following Line of Code

//next is exiting line of code

[string]$Branch = "Main"

//next is modified Line Of Code  

[string]$Branch = "NameOfYourBranch"

The good new is that; this has been kept as parameter by Microsoft in PowerShell Script, which means without modification of Line of code, you can also try by passing name of Branch as – Branch

This should fix the issue of automatic build by routing it to branch of your choice.