Access local data from Azure Virtual Machine

%3CLINGO-SUB%20id%3D%22lingo-sub-1493728%22%20slang%3D%22en-US%22%3EAccess%20local%20data%20from%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1493728%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EMy%20first%20time%20here%20so%20be%20nice%20%3B%20)%3C%2FP%3E%3CP%3EWhen%20i%20deploy%20WebApps%20i%20use%20a%20Hybrid%20Connection%20to%20access%20onprem%20databases.%3C%2FP%3E%3CP%3EBut%20now%20i%20need%20to%20install%20a%20Windows%20Service%20on%20a%20virtual%20machine%2C%20and%20still%20want%20to%20connect%20to%20my%20local%20databas%20server.%20Having%20trouble%20figuring%20out%20the%20best%20way%2C%20i%20would%20prefere%20not%20to%20setup%20a%20private%20VPN%20between%20Azure%20and%20my%20local%20network%20(Going%20to%20deploy%20a%20couples%20of%20customers).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-%20Hybrid%20Connection%2C%20not%20working%20only%20for%20WebApp%3F%3C%2FP%3E%3CP%3E-%20On-premises%20data%20gateway%2C%20not%20for%20Virtual%20machines%3F%3C%2FP%3E%3CP%3E-%20VPN%20(Feels%20like%20overkill)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20do%20you%20recommend%3F%26nbsp%3B%3CBR%20%2F%3EOr%20can%20i%20run%20a%20Windows%20service%20as%20App%20for%20something%20in%20Azure%3F%20Please%20point%20my%20in%20the%20right%20direction%20%3B)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1493728%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApp%20Services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDevOps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENetworking%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVirtual%20Network%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494241%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20local%20data%20from%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494241%22%20slang%3D%22en-US%22%3EHello%2C%3CBR%20%2F%3ECould%20please%20clarify%20the%20following.%3CBR%20%2F%3EWhere%20you%20are%20planning%20to%20host%20the%20windows%20service%20-%20Azure%20VM%20or%20onprem%20VM%3F%3CBR%20%2F%3EWhat%20the%20service%20will%20do%3F%3CBR%20%2F%3EWith%20whom%20the%20service%20will%20interact%20-%20you%20app%20or%20dB%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494244%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20local%20data%20from%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494244%22%20slang%3D%22en-US%22%3EThe%20service%20get%20into%20the%20VM%20on%20Azure%2C%20and%20fetch%20data%20from%20my%20local%20database.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494261%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20local%20data%20from%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494261%22%20slang%3D%22en-US%22%3EIf%20you%20want%20to%20securely%20access%20your%20onprem%20database%20from%20a%20service%20running%20on%20Azure%20VM%20directly%2C%20the%20best%20option%20is%20to%20setup%20a%20private%20connectivity%20between%20your%20Azure%20vnet%20and%20onprem%20network.%20You%20can%20achieve%20this%20via%20s2s%20vpn%20or%20Express%20Route.%3CBR%20%2F%3ENow%2C%20if%20you%20don't%20want%20to%20setup%20vpn%2FExpress%20Route%2C%20I%20see%20the%20following%20two%20options%3A%3CBR%20%2F%3EYou%20have%20to%20see%20if%20the%20function%20of%20your%20Windows%20service%20can%20be%20replaced%20by%20a%20suitable%20PaaS%20services%20to%20use%20a%20onprem%20data%20gateway%20to%20securely%20access%20the%20onprem%20data%20over%20the%20internet.%3CBR%20%2F%3EOr%2C%3CBR%20%2F%3EYou%20can%20use%20Azure%20Data%20Factory%20Integration%20Runtime%20to%20securely%20move%20your%20onprem%20data%20to%20a%20blob%20storage%20or%20Azure%20SQL%20dB%20then%20setup%20your%20Windows%20service%20to%20access%20the%20data%20from%20there.%3CBR%20%2F%3EHope%20this%20helps.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%2C%3CBR%20%2F%3ERohan%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494313%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20local%20data%20from%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494313%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EShould%20be%20nice%20if%20everything%20can%20be%20done%20from%20the%20OnPrem%20server%20(dont%20want%20to%20involve%20opening%20port%20eg%20in%20the%20firewall).%20Are%20there%20any%20reason%20that%20Hybrid%20Connection%20can't%20be%20used%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENever%20tried%20a%20Express%20Route%20have%20to%20google%20VPN%20vs%20Express%20Route.%26nbsp%3B%3C%2FP%3E%3CP%3ECan't%20move%20the%20data%20because%20of%20local%20country%20laws%20(It's%20fine%20to%20view%20but%20not%20store%20in%20my%20case).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20service%20are%20used%20to%20fetch%20data%20from%20some%20third%20part%20API%2C%20not%20sure%20if%20you%20can%20do%20that%20with%20some%20%22s%3CSPAN%3Euitable%20PaaS%20services%3C%2FSPAN%3E%22.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494621%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20local%20data%20from%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494621%22%20slang%3D%22en-US%22%3E%3CP%3EPreviously%20you%20said%20your%20service%20fetch%20data%20from%20the%20local%20database%20and%20now%20you%20are%20saying%20the%20service%20is%20used%20to%20fetch%20data%20from%20some%20third%20part%20API.%20%3B)%3C%2Fimg%3E%3CBR%20%2F%3EIf%20the%20first%20one%20is%20true%2C%20you%20can%20simply%20try%20using%20Azure%20%22Function%20App%22%20to%20connect%20to%20your%20local%20sql%20db%20via%20hybrid%20connection.%3CBR%20%2F%3EIf%20the%20latter%20is%20true%2C%20you%20can%20try%20using%20%22Logic%20App%22%2C%20you%20should%20be%20able%20to%20connect%20to%20any%20API%20by%20configuring%20a%20custom%20connector.%20You%20can%20also%20connect%20logic%20app%20to%20your%20local%20sql%20server%20via%20an%20onprem%20data%20gateway%20as%20well.%3CBR%20%2F%3ESo%2C%20I%20would%20explore%20Function%20App%20and%20Logic%20App%20and%20see%20which%20one%20suits%20the%20best%20to%20meet%20the%20requirement.%3CBR%20%2F%3EHope%20this%20helps%2C%20please%20let%20me%20know%20if%20you%20have%20any%20further%20query.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%2C%3CBR%20%2F%3ERohan%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494653%22%20slang%3D%22en-US%22%3ERe%3A%20Access%20local%20data%20from%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494653%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%2C%20i%20did%20not%20provid%20you%20with%20all%20information%20the%20flow%20is%20the%20following%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Fetch%20data%20from%20external%20API.%3C%2FP%3E%3CP%3E2.%20Import%20it%20into%20the%20local%20database%20(and%20process%20it)%3C%2FP%3E%3CP%3E3.%20Then%20display%20the%20processed%20data%20on%20the%20web%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGoing%20to%20look%20into%20%3CSPAN%3EFunction%20App%2C%20and%26nbsp%3BLogic%26nbsp%3BApp%20%3B)%3C%2Fimg%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello, 

My first time here so be nice ; )

When i deploy WebApps i use a Hybrid Connection to access onprem databases.

But now i need to install a Windows Service on a virtual machine, and still want to connect to my local databas server. Having trouble figuring out the best way, i would prefere not to setup a private VPN between Azure and my local network (Going to deploy a couples of customers).

 

- Hybrid Connection, not working only for WebApp?

- On-premises data gateway, not for Virtual machines?

- VPN (Feels like overkill)

 

What do you recommend? 
Or can i run a Windows service as App for something in Azure? Please point my in the right direction ;)

6 Replies
Highlighted
Hello,
Could please clarify the following.
Where you are planning to host the windows service - Azure VM or onprem VM?
What the service will do?
With whom the service will interact - you app or dB?

Highlighted
The service get into the VM on Azure, and fetch data from my local database.
Highlighted
If you want to securely access your onprem database from a service running on Azure VM directly, the best option is to setup a private connectivity between your Azure vnet and onprem network. You can achieve this via s2s vpn or Express Route.
Now, if you don't want to setup vpn/Express Route, I see the following two options:
You have to see if the function of your Windows service can be replaced by a suitable PaaS services to use a onprem data gateway to securely access the onprem data over the internet.
Or,
You can use Azure Data Factory Integration Runtime to securely move your onprem data to a blob storage or Azure SQL dB then setup your Windows service to access the data from there.
Hope this helps.

Thanks,
Rohan
Highlighted

Thank you,

 

Should be nice if everything can be done from the OnPrem server (dont want to involve opening port eg in the firewall). Are there any reason that Hybrid Connection can't be used?

 

Never tried a Express Route have to google VPN vs Express Route. 

Can't move the data because of local country laws (It's fine to view but not store in my case).

 

My service are used to fetch data from some third part API, not sure if you can do that with some "suitable PaaS services". 

Highlighted

Previously you said your service fetch data from the local database and now you are saying the service is used to fetch data from some third part API. ;)
If the first one is true, you can simply try using Azure "Function App" to connect to your local sql db via hybrid connection.
If the latter is true, you can try using "Logic App", you should be able to connect to any API by configuring a custom connector. You can also connect logic app to your local sql server via an onprem data gateway as well.
So, I would explore Function App and Logic App and see which one suits the best to meet the requirement.
Hope this helps, please let me know if you have any further query.

Thanks,
Rohan



Highlighted

Thank you, i did not provid you with all information the flow is the following:

 

1. Fetch data from external API.

2. Import it into the local database (and process it)

3. Then display the processed data on the web again.

 

Going to look into Function App, and Logic App ;)