A monitoring agent can be installed through powershell. But DCR is required after that How can we deploy DCR through DevOps?
Data collection rules currently support the following input sources:
Azure virtual machine with the Azure Monitor agent.
There are currently two available methods to create a DCR:
Use the Azure portal to create a data collection rule and have it associated with one or more virtual machines.
Directly edit the data collection rule in JSON and submit using the REST API.
Azure DevOps Service side do not provide any build-in solution or extension/task to handle this. You may have to use JSON and REST API as mentioned above.