Polyacrylonitrile (PAN) and (CH3COO)2Zn were used as raw materials, and carbon nanofibers (CNFs) with high specific surface area were successfully prepared by an electrospinning method. A new method of electrochemiluminescence detection of azithromycin was established by modifying the glassy carbon electrode (GCE). Under the optimal conditions, the electrochemical behavior and electrochemiluminescence behavior of the Ru(bpy)32+-AZM system on the modified electrode were investigated. Owing to the large specific area, more active sites, and promotion of electron transfer, the sensor exhibits high electrocatalytic activity, high sensitivity, a good linear relationship ranging from
8.0
×
10
−
8
to
1.0
×
10
−
4
mol/L, and a low detection limit (
6.52
×
10
−
8
mol/L). In addition, the good recoveries indicate that the sensor was a promising device for the detection of azithromycin in real samples.