Steroid diabetes
Steroid diabetes is a medical term referring to prolonged hyperglycemia due to glucocorticoid therapy for another medical condition.  It is usually, but not always, a transient condition.

Cause
The most common glucocorticoids which cause steroid diabetes are prednisolone and dexamethasone given systemically in "pharmacologic doses" for days or weeks.  Typical medical conditions in which steroid diabetes arises during high-dose glucocorticoid treatment include severe asthma, organ transplantation, cystic fibrosis, inflammatory bowel disease, and induction chemotherapy for leukemia or other cancers.

Mechanism
Glucocorticoids oppose insulin action and stimulate gluconeogenesis, especially in the liver, resulting in a net increase in hepatic glucose output.  Most people can produce enough extra insulin to compensate for this effect and maintain normal glucose levels, but those who cannot develop steroid diabetes.

Diagnosis
Steroid diabetes must be distinguished from stress hyperglycemia, hyperglycemia due to excessive intravenous glucose, or new-onset diabetes of another type.  Because it is not unusual for steroid treatment to precipitate type 1 or type 2 diabetes in a person who is already in the process of developing it, it is not always possible to determine whether apparent steroid diabetes will be permanent or will go away when the steroids are finished. More commonly undiagnosed cases of type 2 diabetes are brought to clinical attention with corticosteroid treatment because subclinical hyperglycemia worsens and becomes symptomatic.  Generally, steroid diabetes without preexisting type 2 diabetes will resolve upon termination of corticosteroid administration.   
Steroid diabetes does not occur with other steroid hormones, such as anabolic steroids or sex steroids because these other categories of steroids have actually shown to have positive effects on glucose metabolism.

Criteria
The diagnostic criteria for steroid diabetes are those of diabetes (fasting glucoses persistently above 125 mg/dl (7 mM) or random levels above 200 mg/dl (11 mM)) occurring in the context of high-dose glucocorticoid therapy. Insulin levels are usually detectable, and sometimes elevated, but inadequate to control the glucose.  In extreme cases the hyperglycemia may be severe enough to cause nonketotic hyperosmolar coma.

Treatment
Treatment depends on the severity of the hyperglycemia and the estimated duration of the steroid treatment.  Mild hyperglycemia in an immunocompetent patient may not require treatment if the steroids will be discontinued in a week or two. Moderate hyperglycemia carries an increased risk of infection, especially fungal, and especially in people with other risk factors such as immunocompromise or central intravenous lines. Insulin is the most common treatment.

Further reading
Fresh insights into glucocorticoid-induced diabetes mellitus and new therapeutic directions, Nature Reviews Endocrinology  volume 18, pages540–557 (2022)Steroid-Induced Diabetes Mellitus and Related Risk Factors in Patients With Neurologic Disease - MedScape