I'm sorry about the issue. That is certainly a scam. They pretend to be from a legitimate company, such as Yahoo, Microsoft, Google, etc. You should always ignore any popup message, or email message, or phone call that you do not know or that you are not expecting. Microsoft has written an article about this kind of scams at the website below:
How did you get that number? Was there any issue with your computer that you needed to call that number?
Is there still any issue with your computer?
When you are available, please reply at the box below to continue troubleshooting. Thank you.