The country pays significant hosting fees to commercial rights holders Liberty Media but the fast city circuit is also a challenge for drivers and has a reputation for crashes and excitement since its debut in 2016.
Baku is hosting the first sprint race of the season this weekend.
To date, no driver has won more than once in Azerbaijan.
"The Baku City Circuit has become a hugely popular venue for Formula One," said F1 chief executive Stefano Domenicali in a statement.
"It is an incredible circuit which always delivers huge drama, and has played host to some of the most exciting races in recent memory. We are delighted to extend our relationship."