In this study, corrosion resistance was developed to ensure that AZ91 Mg alloy remains stable in the body for longer periods. For this purpose, tantalum oxide and tantalum oxide with diethanolamine coatings were made by sol-gel method on AZ91 magnesium alloy surfaces. The structural analyses of tantalum oxide and tantalum oxide with diethanolamine obtained by sol-gel method were carried out. By using the dip coating method, coatings with different concentrations of solutions and different dipping numbers were applied on AZ91 Mg alloy surfaces. Thus, the effects of dipping numbers and chemical content of the solution on the coating thicknesses, surface roughnesses, morphologies and corrosion resistances of coating layers were examined. As a result, it was determined that the coating thicknesses increased with the dipping number. The low number of dipping could not provide sufficient protective layer formation on the surface. Better results were obtained in samples with a high dipping numbers. It was observed that needle-like structures were formed in the solution using diethanolamine. As the amount of diethanolamine increased, a more homogeneous and dense coating layer was observed. Accordingly, an increase in corrosion resistance has been observed. It was determined that the corrosion rate of AZ91 Mg alloy has decreased by 86% with increasing dipping number and diethanolamine amount.