How to build windows image on azure dev ops hosted agent
EDIT
Microsoft added a new hosted agent: Hosted Windows 2019 with VS 2019.
So you should use this image to build for windows-1809 or windows-2019
Source : https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&amp;tabs=yaml#use-a-microsoft-hosted-agent

Old answer:
FWIW, I ended up creating a windows server 2019 vm on azure to act as a build agent.
Could not manage to build 2019 image in any of the hosted agent pools.