An azo (N═N) based covalent organic framework (COF-TpAzo) has been synthesized via a Schiff base condensation reaction. The Braunauer–Emmett–Teller (BET) specific surface area up to 1552 m2·g–1 was obtained for the framework with a pore volume of 0.97 cm3·g–1. The COF-TpAzo exhibits a high selectivity in CO2/N2 (127/145 at 273/298 K, respectively, Henry method) due to the N2-phobic and CO2-philic feature of COF-TpAzo. Furthermore, hydrogen and methane storage capacities of the nitrogen-rich COF-TpAzo have been investigated. The COF-TpAzo shows high H2 and CH4 storage capacity at 1 bar (10.6 mg·g–1 at 77 K for H2, 11.2 mg·g–1 at 273 K for CH4, and 5.5 mg·g–1 at 298 K for CH4).