Search code examples
neo4jneo4jclient

AzureWorkerHost get the uri after startup for Neo4jClient


I am trying to create a ASP.Net with neo4jclient project to be hosted on the Azure and am kind of unable to grasp how to do the following:

  1. get hold of an neo4j rest endpoint address once the worker role has started. I think I am seeing a different address each time the emulator spins up a instance of worker role. I believe that i'll need this to create an client somewhat like this

neo4jClient = new GraphClient(new Uri("http ://localhost:7474/db/data"));

so any thoughts on how to get hold of the uri after the neo4j is deployed by AzureWorkerHost.

  1. Also how is the graph database persisted on the blob store, in the example its always deploying a new instance of pristine db in the zip and updating, which is probably not correct. I am unable to understand where to configure this.

BTW I am using the Neo4j 2.0 M06 and when it runs in emulator, I get an endpoint somewhat like this http://127.255.0.1:20000 in the emulator log but i am unable to access it from my base machine.

any clue what might be going on here?

Thanks,
Kiran


Solution

  • AzureWorkerHost was a proof of concept that hasn't been touched in a year.

    The GitHub readme says:

    Just past alpha. Some known deficiencies still. Not quite beta.

    You likely don't want to use it.

    The preferred way of hosting on Azure these days seems to be IaaS approach inside a VM. (There's a preconfigured one in VM Depot, but that's a little old now too.)

    Or, you could use a hosted endpoint from somebody like GrapheneDB.

    To answer you question generally though, Azure manages all the endpoints. The worker roles says "hey, I need an endpoint to bind to!" and Azure works that out for it.

    Then, you query this from the Web role by interrogating Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.Roles.