Whenever you access, change personal information, or add new contact information to your Microsoft account, a security code is generated and sent to either an email address or mobile phone number in your account security information. You're then prompted to enter that code to confirm the change.