I'm not the Azure expert, only using MS for Office365. And did not see anyone using Azure REST on the forums yet...
I know AWS pretty well, so thought cert approach work. But with Azure, they do want use OAuth2 – and
don't seem to support X509 certs. And, now it make sense why Mikrotik does NOT have an HTTP example for Azure, but does have an HTTP example for AWS: OAuth2 using /tool/fetch be pretty complex.
But it really comes down to how MS is using OAuth2 that matters. In theory you can use your PC to do the OAuth to generate the needed token. But the issue is OAuth2 tokens typically expire, sometime hours, generally days/months. Similar why using Let's Encrypt was difficult to use on a Mikrotik before V7 added direct support for it.
I couldn't find out when the Azure's OAuth tokens expire... But there docs on how generate one with curl, should be pretty close with fetch, so you could try:
https://docs.microsoft.com/en-us/rest/a ... -with-curl
You have to pay attention that the content is JSON, but the
headers follow the HTTP form with
colons.
With this posting having more details:
https://mauridb.medium.com/calling-azur ... eb10a06127
Sure you have reasons for using Azure, but I'll offer with AWS Route53, the approach with X509 client certs on V7 to call AWS APIs is pretty straightforward. Basically you follow Mikrotik's IoT instruction. It doesn't matter if you use MQTT, it the IoT Core certificate issue by AWS to the Mikrotik that's what critical. So it's just attaching the right ACL in AWS IAM to IoT certificate issue to the Mikrotik that allow calling the AWS Route53 DNS REST API. The the /tool/fetch on the Mikrotik is pretty simple, just use "certificate=" in /tool/fetch. While certs expired, in AWS you control how long you want the IoT one to be valid for.
Basically getting X509 cert isn't always easy. But
using them is pretty easy. It just wasn't possible to use X509 client cert auth on Mikrotik before V7.1.
But yeah the AWS approach will not work for Azure it seems. Google Cloud seems to have same issue but no solution either:
viewtopic.php?p=897133&hilit=azure#p897133