Connecting to photon cloud if self hosted photon server fails

Options
Hi! I am just starting out with Photon, but the game(unity) I am tasked to work on is currently connecting to photon cloud. We would like to try out hosting our own instance of Photon Server, would it be possible to try to connect to our own server first and connect to photon cloud if it fails? From what I understood in the documentation, I have to use "ConnectUsingSettings" and "ConnectToMaster" if using photon server. But I am not sure how to move forward. Hope to hear from you all soon, TIA.