https://prefect.io logo
Title
r

rafaqat ali

02/26/2021, 3:39 PM
Hi, I have deployed my backend server on a different location. How can I register a flow using the url for that server? i need to flow.register('project name', 'in remote server)
n

nicholas

02/26/2021, 3:40 PM
HI @rafaqat ali - you can change the default endpoint for flow registration using this:
[server]
endpoint = "YOUR_MACHINES_PUBLIC_IP:4200/graphql"
r

rafaqat ali

02/26/2021, 3:42 PM
Where I have to change this? I'm using django project and in that project, i'm registering my flow.
while my server is running on a remote machine like http://ip:port/graphql
n

nicholas

02/26/2021, 3:44 PM
You'll need to change that on your local machine or wherever you're registering flows
In
~/.prefect/config.toml
r

rafaqat ali

02/26/2021, 3:45 PM
What if, I deploy this code on azure app service? then where I'll change this variable?
I'm new to this tech that's why don't have much idea about it
I have find the way: We can set global end point like below
os.environ["PREFECT__CLOUD__API"]="server url"
n

nicholas

02/26/2021, 4:18 PM
@rafaqat ali - the only places you need to set that variable are the machine from which you're registering your flows (where you're calling
flow.register
) and where you start your agent 🙂