Try using "partner connect" API by databricks. They have manual connect and automatic connect options for this. databricks have individual partner connect api for each third application. Check if M365 supports this type of integration with databricks.