She did not outlive her husband, Emperor Joseph II, or her mother-in-law, Empress Maria Theresia. Maria Theresia forced the marriage of Joseph and her because Joseph had not produced an heir through marriage to his first wife, Isabella of Parma. Joseph was unable to get over Isabella so, even though she loved Joseph, Maria Josepha and he had almost no relationship. She died in 1767, largely rejected by Joseph who did not consummate the marriage and refused to attend her funeral. She died of smallpox, infecting Maria Theresia, who recovered, Maria Theresia's daughter, also named Maria Josepha who died, and Maria Theresia's daughter Maria Elisabeth who recovered but was permanently disfigured.