In your build file what agent pool are you using? If you're using windows-latest
, which is recommended, then it already has WixToolset and SDK 10.1. You shouldn't need to install anything else. You can see the full list of available agent pools and what software they have installed here.
If you need to install third-party software that isn't on an image then you have to do so using an installer task or script. For a popular toolset look for an Azure DevOps task in the marketplace that provides the necessary installer task that you can use in your build. If there isn't one then you have to write a script (probably Powershell) to do it instead. Unfortunately how hard that is depends on the installer you're trying to run. Note that installing software can eat up build times so ideally install only the minimal toolset you might need.