The conversion of glucose to glycogen, which is stimulated by insulin from the pancreas. Glycogenesis occurs in skeletal muscles and to a lesser extent in the liver. Glucose that is taken up by cells is phosphorylated to glucose 6-phosphate; this is converted successively to glucose 1-phosphate, uridine diphosphate glucose, and finally to glycogen. Compare glycogenolysis.