Microsoft beat Wall Street's targets for its fiscal second quarter thanks to its booming artificial intelligence business.