Given the complexities of reservoir exploration and development, it is vital to understand the geomechanical properties of the reservoir and well in the drilling operation. In constructing a mechanical model of the earth, a combination of environmental geomechanical parameters, as well as the magnitude and direction of stresses, is used. In this study, stress analysis and its effect on azimuth well in deviated drilling in an oil field located in southwestern Iran are investigated. Necessary geomechanical parameters are estimated using density and slowness logs of sonic waves (shear and compression). The Mohr–Coulomb failure criterion is followed to determine a safe mud weight window. A mechanical model of the earth is designed using laboratory data and well logging, and it is validated by the results obtained from laboratory rock mechanics using the calibrated core samples. The results show that drilling in the azimuth at about 135° with an angle of about 15° is the most stable path for the well in the carbonate reservoir formation in the studied oil field.