This paper investigates the impact of investment budget, solar system efficiency, and project area limitation on the capacity planning, and daily operation of a microgrid (MG), which consists of photovoltaic (PV) and Energy storage systems (ESS). A general grid-connected hospital located in NJ is considered as an illustrative case study. Access to reliable, affordable and sustainable energy is essential for the critical and high electricity demand facilities such as hospitals. This study shows that the capacity planning of ESS depends on the PV system capacity and the facility electricity demand profile. Moreover, we show that, the PV system capacity has to be derived according to the investment budget, solar system efficiency and, project area constraints. Utilizing the on-site power generation from the installed MG, results in the lower energy cost of the facility. In this paper, we show that by installing the optimal size of the PV system coupled with ESS the annual energy cost of the hospital could be reduced by 30%. This amount of cost reduction justifies the high up-front cost of the MG project where the pay-back-period is between 4 to 4.5 years.