Open the assistant and ask it to spin up a lakehouse notebook and it should drop in the code you can run right away to connect and explore. If you're thinking to download the notebook, make you download it in pdf format and rename it after download ...
Easiest way is to log each loop’s status with `dbutils.jobs.taskValues.set` then just grab those in the next task and only work with the ones that passed.