As the self-accepted answer is outdated and there's a follow-up question, I'm posting a new answer.
You can find all the visa information by visiting the website of the Ministry of Foreign Affairs of Azerbaijan and going through the "CONSULAR SERVICE AND VISA" - "Visa" tabs.
Here you will find the link to List of states whose citizens can be issued visas at international airports of the Republic of Azerbaijan. Here you will see that China is among the countries whose citizens can be issued visas upon arrival:
The list from that link:
Name of the country Validity period of issued visa
1 Qatar 30 days
2 Oman 30 days
3 Saudi Arabia 30 days
4 Bahrain 30 days
5 Kuwait 30 days
6 Japan 30 days
7 Indonesia 30 days
8 People`s Republic of China 30 days
9 South Korea 30 days
10 Malaysia 30 days
11 Singapore 30 days
12 Republic of Turkey 60 days
13 Israel 30 days
14 United Arab Emirates 30 days
Note: Only citizens of USA traveling with New York – Baku flight can
be issued 30 days visa at Heydar Aliyev International
Airport.
Regarding your follow-up question:
My friend who was on the Tbilisi-Baku train was not permitted by the Georgian customs and immigration people to leave at this border
crossing. Why?
Again, in the link provided above, there's another link to Documents required for visa issuance. In the bottom of the page there's the following section:
Following documents shall be submitted for visa issuance at a visa
section of the Consular Department of the Ministry of Foreign Affairs
of the Republic of Azerbaijan at the International Airport named after
Haydar Aliyev; visa sections of the Ministry of Foreign Affairs of
the Republic of Azerbaijan at the International Airport in Nakhchivan
Autonomous Republic, at Ganja International Airport; at Lankaran
International Airport; at Gabala International Airport; at Zagatala
International Airport of the Republic of Azerbaijan:
- 1 application form (sample is attached - download link);
- A passport of a foreigner and an identity card of a stateless person;
- A receipt about payment of state duty for visa issuance.
I can't tell exactly why Georgian customs didn't permit your friend to enter Azerbaijan, but if your friend didn't have any legal problems with leaving Georgia and the immigration people stated explicitly, that your friend needs a visa to Azerbaijan, then from the link I've referenced above, it might be that your friend needed the aforementioned application form (Application form to obtain a visa in the territory of the Republic of Azerbaijan) or this application form is issued and accepted only at the international airports of Azerbaijan.
Long story short, I can only assure you, that 2 of my Chinese friends visited Baku and both got the visa upon arrival. The catch is that they came directly to Baku by plane, as expected from most of the Chinese tourists visiting Azerbaijan.