This paper deals with the optimal operation of microgrids in presence of uncertainties. Loads and distributed energy resources such as renewable-based generation units and electrical energy storage systems are supposed to be clustered and managed by a microgrid operator. The proposed approach allows the operator to optimally schedule the microgrid's control variables by properly managing the uncertainties affecting the input parameters. Different forecasting methods are adopted within an optimal day ahead scheduling procedure which is devoted to the total cost minimization while preserving a secure operation of the network. The proposed approach accounts for uncertainties affecting the active power of loads and renewable generators, the reactive power of loads, and the electricity prices. Comparison of different forecasting methods allows evidencing the impact of uncertainties on the operation of the microgrid.