SOLVED
Home

Running server-less in azure?

%3CLINGO-SUB%20id%3D%22lingo-sub-975179%22%20slang%3D%22en-US%22%3ERunning%20server-less%20in%20azure%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-975179%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20i%20have%20developed%20a%20continuous%20running%20script%2Fapp%20that%20integrates%20two%20systems%2C%20pulling%20data%20out%20of%20one%20and%20posting%20into%20another.%26nbsp%3B%20It%20is%20currently%20written%20in%20PowerShell%2C%20it%20has%20no%20UI%2C%20it%20just%20needs%20to%20run%20continuously%20and%20restart%20if%20it%20stops.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20now%20want%20to%20move%20it%20off%20my%20localhost%20and%20host%20it%20in%20Azure%20somewhere.%26nbsp%3B%20I%20am%20looking%20for%20a%20server-less%20type%20hosting%20environment%2C%20and%20asking%20here%20for%20advice.%26nbsp%3B%20I%20understand%20this%20could%20be%20an%20Azure%20Function%2C%20it%20could%20be%20Azure%20Automation%2C%20Containers%2C%26nbsp%3B%20it%20could%20possible%20even%20be%20an%20Azure%20Logic%20App%2C%20i'm%20just%20unsure%20what%20is%20the%20best%20approach.%26nbsp%3B%20I%20am%20also%20happy%20to%20port%20the%20code%20to%20a%20ore%20suitable%20language%20like%20nodejs%20if%20need%20be.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-975179%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-976522%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20server-less%20in%20azure%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-976522%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4821%22%20target%3D%22_blank%22%3E%40Andrew%20Huddleston%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EAs%20it%20is%20written%20in%20powershell%2C%20I%20would%20first%20take%20a%20look%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Ffunctions-reference-powershell%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPowershell%20Azure%20Functions%3C%2FA%3E.%20The%20first%20step%20is%20get%20your%20head%20around%20structure%20and%20gain%20some%20familiarity%20with%20the%20platform%20so%20I%20suggest%20running%20through%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Ffunctions-create-first-function-powershell%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECreate%20your%20first%20PowerShell%3C%2FA%3E%20before%20diving%20in%20with%20yours.%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20my%20opinion%2C%20continuous%20is%20not%20necessarily%20a%20good%20fit%20for%20functions%20though%20as%20I%20find%20they%20work%20best%20with%20a%20trigger%20of%20some%20sort%20(even%20a%20timer).%20In%20other%20words%2C%20get%20triggered%2C%20do%20some%20work%20and%20then%20complete.%20So%20maybe%20a%20rethink%20of%20your%20integration%20pattern%20might%20be%20a%20good%20idea.%20Continuous%20implies%20it%20has%20a%20constant%20steady%20stream%20of%20work%20which%20sounds%20like%20it%20might%20fit%20better%20with%20Data%20Factory.%3C%2FP%3E%3CP%3EThe%20good%20news%20is%20you%20have%20something%20working%20now%20so%20you%20can%20use%20it%20while%20developing%20a%20cloud-based%20solution.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-976530%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20server-less%20in%20azure%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-976530%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F141713%22%20target%3D%22_blank%22%3E%40Jeffrey%20Chilberto%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20this%20reply%2C%20this%20is%20very%20helpful.%26nbsp%3B%20A%20little%20more%20context%20around%20the%20app%2C%20is%20that%20it%20is%20used%20to%20stream%20authentication%20logs%20from%20our%20IDP%20into%20Elasticsearch%20(equivalent%20of%20streaming%20the%20Azure%20Signin%20Logs%20from%20the%20Azure%20APIs%20to%20Elasticsearch).%26nbsp%3B%20Each%20page%20of%20data%20it%20collects%2C%20has%20a%20%22next%20url%22%20link%2C%20to%20retrieve%20the%20next%20page%20of%20results.%26nbsp%3B%20Because%20i%20am%20not%20using%20specific%20dates%2C%20any%20simply%20following%20the%20next%20url%2C%20the%20next%20url%20will%20ALWAYS%20exist%20and%20is%20infinite.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20could%20technically%20modify%20the%20script%20to%20pull%20a%20page%20of%20results%20and%20store%20the%20next%20url%20and%20stop.%26nbsp%3B%20Then%20have%20a%20schedule%20trigger%20of%20%22every%20minute%22%20to%20pull%20the%20next%20stream%20of%20results%20starting%20from%20the%20%22nexturl%22.%26nbsp%3B%20This%20way%20it%20would%20act%20more%20like%20a%20start%2Fstop%20on%20a%20recurring%20trigger.%26nbsp%3B%20This%20might%20fit%20into%20the%20Azure%20Functions%20framework%20better.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20see%20any%20issue%20with%20that%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-976593%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20server-less%20in%20azure%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-976593%22%20slang%3D%22en-US%22%3E%3CP%3EInteresting%20scenario%2C%20thanks%20for%20sharing%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4821%22%20target%3D%22_blank%22%3E%40Andrew%20Huddleston%3C%2FA%3E.%20Does%20your%20IDP%20ever%20run%20out%20of%20information%3F%20As%20in%20does%20the%20return%20url%20ever%20return%20an%20empty%20result%3F%20Is%20there%20a%20concern%20that%20if%20you%20change%20to%20every%20minute%2C%20more%20than%20one%20function%20could%20post%20the%20same%20information%20to%20the%20elasticsearch%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDepending%20on%20where%20you%20see%20this%20solution%20going%2C%20you%20might%20want%20to%20look%20at%20pushing%20this%20information%20into%20the%20Event%20Hub.%20Take%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-in%2Fsolutions%2Farchitecture%2Ftelemetry-analytics%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%3C%2FA%3E%20as%20a%20basis.%20Your%20situation%20is%20simpler%20now%20but%20the%20nice%20thing%20is%20once%20you%20are%20in%20the%20cloud%20you%20have%20more%20flexibility%20as%20to%20how%20to%20handle%20the%20information.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20suggestion%20though%20is%20to%20start%20with%20what%20you%20have%20and%20see%20if%20you%20can%20get%20it%20to%20run%20in%20Azure%20Functions.%20You%20will%20need%20something%20to%20start%20your%20function%3A%20http%20call%2C%20file%20drop%20or%20timer%20for%20example.%20Then%20once%20it%20is%20running%20you%20could%20try%20to%20just%20run%20continuously.%20My%20concern%20is%20after%20an%20unpredictable%20amount%20of%20time%20the%20function%20will%20stop%20without%20a%20clear%20reason%20why%20so%20you%20will%20need%20some%20mechanism%20to%20start%20it%20again.%20That%20is%20why%20I%20like%20the%20timer%20idea.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20an%20interesting%20one%20though%2C%20and%20I%20for%20one%20would%20appreciate%20if%20you%20did%20a%20post%20on%20how%20you%20solve%20this.%20Cheers%20-%20Jeff%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-976600%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20server-less%20in%20azure%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-976600%22%20slang%3D%22en-US%22%3ESometimes%20the%20IDP%20does%20run%20out%20of%20information%2C%20in%20which%20case%2C%20it%20simply%20returns%200%20results%20and%20the%20next%20url%20doesn't%20change%2C%20so%20it%20simply%20makes%20the%20same%20request%20in%20the%20next%20iteration%20and%20will%20do%20over%20and%20over%20again%20until%20there%20is%20new%20data%20and%20a%20new%20next%20url.%20The%20org%20has%20enough%20activity%20and%20users%2C%20that%20i%20have%20only%20seen%20this%20happen%20occasionally.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20all%20your%20help.%3C%2FLINGO-BODY%3E
Frequent Contributor

Hello, i have developed a continuous running script/app that integrates two systems, pulling data out of one and posting into another.  It is currently written in PowerShell, it has no UI, it just needs to run continuously and restart if it stops.

 

I now want to move it off my localhost and host it in Azure somewhere.  I am looking for a server-less type hosting environment, and asking here for advice.  I understand this could be an Azure Function, it could be Azure Automation, Containers,  it could possible even be an Azure Logic App, i'm just unsure what is the best approach.  I am also happy to port the code to a ore suitable language like nodejs if need be.

4 Replies

Hello @Andrew Huddleston,

As it is written in powershell, I would first take a look at Powershell Azure Functions. The first step is get your head around structure and gain some familiarity with the platform so I suggest running through Create your first PowerShell before diving in with yours. 

In my opinion, continuous is not necessarily a good fit for functions though as I find they work best with a trigger of some sort (even a timer). In other words, get triggered, do some work and then complete. So maybe a rethink of your integration pattern might be a good idea. Continuous implies it has a constant steady stream of work which sounds like it might fit better with Data Factory.

The good news is you have something working now so you can use it while developing a cloud-based solution.

Hello @Jeffrey Chilberto 

 

Thank you for this reply, this is very helpful.  A little more context around the app, is that it is used to stream authentication logs from our IDP into Elasticsearch (equivalent of streaming the Azure Signin Logs from the Azure APIs to Elasticsearch).  Each page of data it collects, has a "next url" link, to retrieve the next page of results.  Because i am not using specific dates, any simply following the next url, the next url will ALWAYS exist and is infinite.

 

I could technically modify the script to pull a page of results and store the next url and stop.  Then have a schedule trigger of "every minute" to pull the next stream of results starting from the "nexturl".  This way it would act more like a start/stop on a recurring trigger.  This might fit into the Azure Functions framework better.

 

Do you see any issue with that?

Solution

Interesting scenario, thanks for sharing @Andrew Huddleston. Does your IDP ever run out of information? As in does the return url ever return an empty result? Is there a concern that if you change to every minute, more than one function could post the same information to the elasticsearch? 

 

Depending on where you see this solution going, you might want to look at pushing this information into the Event Hub. Take this as a basis. Your situation is simpler now but the nice thing is once you are in the cloud you have more flexibility as to how to handle the information. 

 

My suggestion though is to start with what you have and see if you can get it to run in Azure Functions. You will need something to start your function: http call, file drop or timer for example. Then once it is running you could try to just run continuously. My concern is after an unpredictable amount of time the function will stop without a clear reason why so you will need some mechanism to start it again. That is why I like the timer idea.

 

This is an interesting one though, and I for one would appreciate if you did a post on how you solve this. Cheers - Jeff

 

 

Sometimes the IDP does run out of information, in which case, it simply returns 0 results and the next url doesn't change, so it simply makes the same request in the next iteration and will do over and over again until there is new data and a new next url. The org has enough activity and users, that i have only seen this happen occasionally.

Thanks for all your help.
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies