I used this link as a guide to install the tools required for deploying EventStore to Azure.
A description of the tools needed are as follows:
- Kubectl: Kubernetes command-line tool
- Helm: Kubernetes package manager
- Azure CLI: Azure command-line tool
EventStore Deployed on Azure
I observed the following resources created in Azure after executing the commands listed from the link:
Connecting to the EventStore hosted on Azure
I wrote the following test to establish a connection to the EventStore running in Azure:
[Test] let ``Azure: Establish connection to event store``() = // Setup let credentials = UserCredentials("admin", "changeit"); let port = 1113 let clusterAddress = "188.8.131.52" // // Test use connection= EventStore.remoteConnection clusterAddress port credentials // Verify Assert.NotNull connection
Retrieving the IP Address
I extracted the IP address by navigating to the root resource and then selecting the Kubernetes service:
From the Kubernetes service, I referenced the API server address:
I then mapped the API server address to its corresponding IP address as depicted in the test code.
Here’s the implementation details for establishing the remote endpoint connection:
let remoteConnection (ipAddress:string) (port:int) (credentials:UserCredentials) = let connectionSettings = ConnectionSettings.Create() .SetDefaultUserCredentials(credentials) .Build() let connection = EventStoreConnection.Create(connectionSettings, new IPEndPoint(IPAddress.Parse(ipAddress), port)) connection.ConnectAsync().Wait() connection
In conclusion, I documented the tools as well as the code required to deploy an event-store to Azure. I also documented how to retrieve the API server address that’s required, before mapping it to an IP address. Lastly, I showed the implementation details on how to pass-in user credentials and the IP address to establish a connection.