Islets transplantation is a promising method to treat type 1 diabetes. Unfortunately, current islet encapsulation and transplantation strategies are difficult to simultaneously achieve the minimally invasive transplantation, rapid mass transportation, accurate positioning, long-term stability and easy retrieval. Herein, we present a novel strategy for islet encapsulation and transplantation that integrates the advantages of microencapsulation and macroencapsulation. Specifically, islets are first encapsulated in methacrylated carboxymethyl chitosan (CMCSMA) microgels by droplet microfluidic technology, and then oxidized sodium alginate-succinimide ester (OSA-NHS) as the assembling agent is added to time-sequentially assemble the islets-laden microgels. The as-formed microgel assembly (MA-CHO/NHS), or namely bioartificial pancreas, is injectable before transplantation due to the quick formation of dynamic Schiff base bonds, and becomes quite stable after transplantation with the slow formation of stable amide bonds. In addition, the interconnected micropores inside the microgel assembly is beneficial for mass transportation, and the abundant aldehyde and succinimide ester groups on assembling agent ensures good tissue adhesion. This injectable, tissue-adhesive, microporous, positionable and retrievable bioartificial pancreas can reverse the blood glucose levels of diabetic mice from hyperglycemia to normoglycemia for at least 90 days, and thus shows a broad application prospect in the field of diabetes treatment.