Microsoft has had a tough year on the stock market, with its cloud business being a blessing and a curse.