Hello! My name is Ben a fellow member here in the community, not a Microsoft employee. Hope you are doing well!
If you can still sign in to your account or the Outlook.com website, can you try accessing your recovery information to confirm it is still up to date?
You can check it here:
https://account.live.com/proofs/manage/additional
You can only make changes to your account if you can verify it so it is important to keep your recovery information up to date. Best practice is to put at least 2 or 3 recovery information there such as email, or phone number.
Once you made sure it is updated, try to access the apps you are accessing again and you should be able to receive the code this time.
I hope the information helps and feel free to post back in the community if you have other questions.