Hello. I am trying to set up prefect server on an ...
# prefect-community
d
Hello. I am trying to set up prefect server on an Azure Ubuntu VM. How do I register flows from my local machine?
k
In your config.toml on local, point to the VM
Copy code
[server]
endpoint = "YOUR_MACHINES_PUBLIC_IP:4200/graphql"
or set an env var
Copy code
PREFECT__SERVER__ENDPOINT
d
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
I think your UI is not configured. You need this before you spin server up in the config.toml
Copy code
[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
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
Ah server has no authentication, only cloud does for you, you should do:
Copy code
prefect backend server
to change backend
d
Nice! That did the trick. Thanks again, Kevin. For future reference, the environment variable does need to include the
Copy code
http://
or else requests module throws an error.
k
ah ok. thanks for mentioning!
d
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
If you are on server, you have to use Local Secrets for that so either environment variable or config.toml