Power systems have been undergoing significant restructuring as a result of increasing independently operated local resources. Consequently, new entities, i.e. microgrids (MGs), are developed, which facilitate the integration of local resources, specifically renewable energy sources (RESs), into the operation of power systems. Despite many benefits, the integration of RESs could cause severe rampings in the net-load, which would challenge the reliable operation of the system. Therefore, it seems essential that flexible local resources in an MG should be employed to provide flexibility services to the main grid, thus ensuring that ramping in the MG's net-load would meet the ramping capability in the upper-level system. Accordingly, this study aims to develop an energy management framework to schedule local resources in an MG considering system's ramping limits. In this regard, the interaction between electricity and gas grid as a potential future flexible resource for energy systems is considered in the developed scheme. Moreover, the chance-constrained methodology is employed to address the uncertainty associated with the operational management of RESs. Finally, the proposed energy management model is analysed from different perspectives to show the importance of the contribution of flexible local resources to the efficient improvement of the power system flexibility.