A kind of environmental friendly anodizing routine for AZ91D magnesium alloy,based on an alkaline borate-potassium acid phthalate(KAP) electrolyte,was studied.The effect of KAP on the properties of the anodized film was investigated by scanning electron microscopy(SEM),X-ray diffraction(XRD),energy dispersive spectrometry(EDS),potentiodynamic polarization and electrochemical impedance spectroscopy(EIS),respectively.The results showed that the anodizing process,surface morphology,thickness,phase structure and corrosion resistance of the anodized film were strongly dependent on the concentration of KAP.In the presence of adequate KAP,a compact and smooth anodized film with excellent corrosion resistance was obtained.