It's easy enough to learn how to impersonate Microsoft (or Amazon or American Express, etc.) on the internet. There is nothing that Microsoft or anyone else can do to prevent this. It's no different in real life.
That's why all of us have to have our b#llsh$t detectors on 'high' - on the internet as in real life - as you have successfully done.
Most of these kinds of email are stopped by spam filters, but some manage to get through anyway. It's a big cat and mouse game.
A search of the internet, or a question to your favorite AI, will show you how to detect these dangerous messages and how to handle them safely. Tread carefully: The professionals who create some of these messages are getting better at fooling people. (And they are professional, don't underestimate them.)