I had to do this too a bit ago. I typed this up after I succeeded in
getting it to work:
https://sites.uw.edu/bxf4/2022/09/01/getting-uw-outlook-365-oauth2-to-work-with-emacs-mu4e-mbsync-and-msmtp/
It turns out I did not need to change msmtp because my employer had an
old smtp server I could still use, but I assume the logic would be
similar.
The other gotcha I've since encountered is that the security key or
password one creates on the MS Azure web app expires after a year. (That
might be customizable.) One day mbsync just stops working. I don't
remember exactly how I updated/refreshed the password, but it wasn't too
painful. I've done it twice now, but never at a time when I took the
time to jot down notes to remember how to do it.
The DAV solution might be much nicer though. I'm unfamiliar with it, but
the above took me hours to figure out the first time I did it.
Take care,
Brian