The would flow to Russia via a 200-kilometer pipeline running along the Caspian coast from the Azeri capital Baku to the Russian town of Novo-Filya, Gazprom said.
Gazprom buys gas from Central Asia and resells it to other countries, such as Russia's neighbor Ukraine.
Under the memorandum signed between Gazprom and Azerbaijan's state energy company Socar, the two countries may also swap natural gas, Gazprom said without elaborating.
Last week, Russia signed an agreement with Iran, allowing Gazprom to deliver gas to northern Iran in return for facilitating the delivery of Iranian gas from the south of the country to Persian Gulf countries.
Under that deal, Gazprom may swap gas from Azerbaijan via a pipeline running to Iran, a Gazprom official said then.