Map from Google - Azerbaijan

In Azerbaijan, the climate is slightly continental, with relatively cold winters and hot summers; it's also arid in most of the low-lying areas, while it becomes colder and generally rainier in the mountains. The coastline on the Caspian Sea is semi-arid in the northern part, and arid in the centre (see Baku), while it becomes rainy in the southernmost stretch, which is therefore an exception to the rule that the plains of Azerbaijan are arid.
Winter in Azerbaijan is cold but not freezing, at least in the plains. The Caucasus Mountain Range partially protects inland areas from outbreaks of cold air from Russia, so that the north wind descending from the mountains is warm and dry, similar to Foehn or Chinook, while along the coast the cold wind blows intensely but it's tempered by the Caspian Sea. Anyway, in winter there may be some light snowfalls and frosts on the coast, but especially in inland areas, where cold air stagnates with more ease, after the wind has ceased.
Summer in Azerbaijan is hot and sunny, with some afternoon thunderstorms in inland areas.
The mountainous areas are usually green and full of forests and streams; the highest peak is Bazardüzü, 4,466 metres (14,652 feet) high, located in the northern Caucasus Range, on the border with the Russian Republic of Dagestan. Some natural parks are also located in the plains and along the coast, to protect the species of birds that come to nest in these area, or marine animals such as seals.
The capital Baku lies on the coast, 28 metres (92 feet) below sea level (the Caspian Sea is in fact a large lake located in a depression). Here, the average temperature of February is 4 °C (39.5 °F), while that of July is 26.5 °C (79.5 °F). The rains are scarce, at a semi-desert level, amounting to just 210 millimetres (8.5 inches) per year, with a maximum between autumn and winter, when they are light but relatively frequent, and a minimum in summer.
Here is the average precipitation.
Average precipitation - Baku
BakuJanFebMarAprMayJunJulAugSepOctNovDecYear
BakuJFMAMJJASONDY
Prec. (mm)202020181882615253025210
Prec.(in)0.80.80.80.70.70.30.10.20.611.218.3
Days66543212266649

Summer is indeed hot and sunny, with highs around 30 °C (86 °F). In the cold months, polar air masses can bring strong winds; Baku is actually a windy city: the Khazri (cold north wind), alternates with the Gilavar (warm wind from the south), in addition to the summer breeze. Here are the average temperatures of Baku.
Average temperatures - Baku
BakuJanFebMarAprMayJunJulAugSepOctNovDec
BakuJFMAMJJASOND
Min (°C)224915202223191495
Max (°C)7610162227313026201410
Min (°F)363639485968727366574841
Max (°F)454350617281888679685750

For swimming and sunbathing, the sea temperature is warm enough, exceeding 23 °C (73 °F), from July to September, while it's still cool in June.
Sea temperature - Baku
BakuJanFebMarAprMayJunJulAugSepOctNovDec
BakuJFMAMJJASOND
Sea (°C)988111520242523201612
Sea (°F)484646525968757773686154

Baku

In the southern part of the coast, Lenkoran (or Lankaran) has more or less the same temperature as Baku, but it's much more rainy, because it's located at the foothills of the Talysh Range, which forces air masses to rise and condense in clouds. In fact here 1,150 mm (45 in) of rain fall in a year, with a maximum between September and November. The rains are still quite abundant until March, and at times in winter even snowfalls can be heavy. Here is the average precipitation.
Average precipitation - Lenkoran
LenkoranJanFebMarAprMayJunJulAugSepOctNovDecYear
LenkoranJFMAMJJASONDY
Prec. (mm)90115905055201550145260170901145
Prec.(in)3.54.53.522.20.80.625.710.26.73.545.1
Days1010118832471312997

In the interior of the country we find Ganja, which is located at 400 metres (1,300 feet) above sea level, and whose climate is a bit more continental, so that the average temperature goes from 2 °C (35 °F) in January, to 26 °C (79 °F) in July. In summer the temperature can reach 40 °C (104 °F), while in winter it can drop to -15 °C (5 °F).
Average temperatures - Ganja
GanjaJanFebMarAprMayJunJulAugSepOctNovDec
GanjaJFMAMJJASOND
Min (°C)-2-1281216201815950
Max (°C)771219232832302619138
Min (°F)283036465461686459484132
Max (°F)454554667382908679665546

The rains are not abundant, amounting to 300 millimetres (12 inches) per year, but they are slightly more abundant than in Baku. Here is the average precipitation.
Average precipitation - Ganja
GanjaJanFebMarAprMayJunJulAugSepOctNovDecYear
GanjaJFMAMJJASONDY
Prec. (mm)101530304045252015301520300
Prec.(in)0.40.61.21.21.61.810.80.61.20.60.811.8
Days45569734363459

Outside the borders of the country, between Armenia and Iran, there is a small exclave of Azerbaijan: the Nakhchivan Autonomous Republic. Even here the climate is arid, but it becomes definitely continental, because of the distance from the sea. Hence, in the capital Nakhchivan, 900 metres (2,950 feet) above sea level, the average temperature goes from -3 °C (26.5 °F) in January to 27 °C (80.5 °F) in July. In winter the temperature drops easily to -20 °C (-4 °F), while in summer it easily reaches 40 °C (104 °F).
Average temperatures - Nakhchivan
NakhchivanJanFebMarAprMayJunJulAugSepOctNovDec
NakhchivanJFMAMJJASOND
Min (°C)-7-517111520181482-3
Max (°C)141220242934332921125
Min (°F)192334455259686457463627
Max (°F)343954687584939184705441

The precipitation amount is low, around 265 mm (10.5 in) per year, with a maximum in spring and a minimum in summer. In winter, a snow layer, though usually not thick, often lies on the ground. Here is the average precipitation.
Average precipitation - Nakhchivan
NakhchivanJanFebMarAprMayJunJulAugSepOctNovDecYear
NakhchivanJFMAMJJASONDY
Prec. (mm)202030403530151010252015265
Prec.(in)0.80.81.21.61.41.20.60.40.410.80.610.4
Days54679522254455

When to go

The best times to travel to Azerbaijan are spring and autumn, and in particular the months of May and October, although in October it rains a lot in the southern city of Lenkoran. Even September is usually a good month in Baku and the main territory, while the exclave of Nakhchivan in this month can still be hot.

What to pack

In winter: in Baku, the plains and the coast, warm clothes, sweater, jacket, hat, raincoat or umbrella. In high mountains, mountain clothes, hiking shoes. In Nakhchivan, very warm clothes, fleece, down jacket, gloves, hat.
In summer: in Baku, the plains and the coast, light clothes for the day, sun hat, a light sweatshirt for the evening, a scarf for the breeze. In the mountains, spring/autumn clothes, sun hat, sweater and jacket, hiking shoes, possibly a raincoat or umbrella; mountain outfit for the highest peaks.
For the Nakhchivan: in the capital and the valley, lightweight clothes for the day, light sweatshirt for the evening; at higher altitudes, jacket and sweater for the evening.