https://prefect.io logo
Title
d

Daniel Lomartra

06/01/2022, 12:53 AM
Hello. I am trying to set up prefect server on an Azure Ubuntu VM. How do I register flows from my local machine?
k

Kevin Kho

06/01/2022, 1:37 AM
In your config.toml on local, point to the VM
[server]
endpoint = "YOUR_MACHINES_PUBLIC_IP:4200/graphql"
or set an env var
PREFECT__SERVER__ENDPOINT
d

Daniel Lomartra

06/01/2022, 2:35 AM
I tried setting the environment variable in both my python venv and host machine. The prefect register cli command completes successfully but no flow shows up in the UI (I assume this is registering it locally?).
k

Kevin Kho

06/01/2022, 2:38 AM
I think your UI is not configured. You need this before you spin server up in the config.toml
[server]
  [server.ui]
    apollo_url = "<http://YOUR_MACHINES_PUBLIC_IP:4200/graphql>"
as seen here. So that the UI knows what URL to hit.
d

Daniel Lomartra

06/01/2022, 2:27 PM
Thanks for the help, Kevin. I did set up the config.toml before spinning up the server and the UI seems to confirm that its able to see the endpoint (see below screenshot). I also tried opening up IP restrictions on 4200 incase that was causing an issue but with no luck.
I think I figured out what's wrong. As mentioned before my flows are being successfully registered, just not appearing in the server UI. Before spinning up this server, I did some testing in prefect cloud. It seems like my flows are still being registered with the cloud instance even though I am running the registration from inside a separate virtual environment. Is there a way for me to unauthenticate with the cloud UI?
k

Kevin Kho

06/01/2022, 2:35 PM
Ah server has no authentication, only cloud does for you, you should do:
prefect backend server
to change backend
d

Daniel Lomartra

06/01/2022, 2:39 PM
Nice! That did the trick. Thanks again, Kevin. For future reference, the environment variable does need to include the
http://
or else requests module throws an error.
k

Kevin Kho

06/01/2022, 2:41 PM
ah ok. thanks for mentioning!
d

Daniel Lomartra

06/01/2022, 3:00 PM
As a follow up question: I am using docker agent with git storage (azure repos). Where is the preferred place to set the git url environment variable? I tried putting it in the config.toml but flows don't seem to see it.
k

Kevin Kho

06/01/2022, 3:00 PM
If you are on server, you have to use Local Secrets for that so either environment variable or config.toml