Kesha wept openly in court when a judge ruled she will NOT be let out of her Sony Music contract.
Kesha is accusing her longtime producer Dr. Luke of sexually, mentally, and physically abusing her during the years they cranked out hit music -- and as a result she wants out of her Sony deal.
She had sought an injunction allowing her to make an album outside of Sony, but the judge shot that down Friday morning ... saying she can work with a different producer under the Sony umbrella.
Kesha's attorneys say they're worried Sony will blackball her if she refuses to work with Luke, who was not in the courtroom.
There was no decision on the abuse claims ... that part of the litigation is ongoing.
Dr. Luke's attorney, Christine Lepera, released a statement to TMZ saying, "We are pleased with the Court's decision from the bench fully denying Ms. Sebert’s motion for a preliminary injunction. As the Court recognized, Ms. Sebert has always had the ability to proceed with her career if she so chooses."