Thanks for posting your question in the Microsoft Q&A forum.
Azure does not currently have a built-in service or feature to capture and export DNS query logs from individual virtual machines.
To capture DNS query logs from a virtual machine in Azure, you would likely need to set up a custom logging solution on the virtual machine itself, such as configuring the DNS server software (Bind, Windows DNS Server) to log DNS queries or using a third-party DNS logging tool.
Alternatively, you could explore using a network traffic capture solution like Azure Network Watcher or a third-party network monitoring tool to capture and analyze DNS traffic at the network level, but this would not provide the same level of detail as logs from the DNS server itself.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful