How to go serverless with long running functions

Welcome Forums General PowerShell Q&A How to go serverless with long running functions

This topic contains 4 replies, has 2 voices, and was last updated by

 
Participant
4 days, 6 hours ago.

  • Author
    Posts
  • #178584

    Participant
    Topics: 9
    Replies: 21
    Points: 125
    Rank: Participant

    Hi all,

    I am looking at getting some PowerShell scripts that run on on-prem servers into Azure as serverless scripts.

    Some of them are pretty lengthy, and would run for much longer than the 5 minute limit that Azure Functions have (AFAIK)...

    While I could potentially split the scripts into smaller chunks, they will mostly, I suspect, go over 5 minutes.

    They largely collect data from our environment, Storage & VMWare stuff, and then write it to Azure Tables and CSVs.

     

    My questions essentially are:

    1. where are there any good resources for taking long running on-prem scripts and going serverless? Most Azure Function articles I can find are more about alerting you to stuff, or posting to twitter (Brandon Olin's article on that is probably the best I've read)
    2. Would Azure Automation be a better choice than Azure Functions.

    Google has only led me to articles about smaller scripts/tasks...

     

    Thanks in advance...

  • #180414

    Participant
    Topics: 1
    Replies: 96
    Points: 514
    Helping Hand
    Rank: Major Contributor

    If I understand correctly, you are working on an inventory job where it pulls the data from various environments across your organisation. If so I would suggest going with the push method instead of the pull method.

    Not sure how you are connecting your cloud environment either by express route or site to site VPN, it is ideally a good approach to collect the stats within the localhost and then push them to any central repository on cloud or on-prem instead of running a single job hours together.

  • #183042

    Participant
    Topics: 9
    Replies: 21
    Points: 125
    Rank: Participant

    Thanks for your response.

    What you're describing is what we are currently doing, but we were hoping to run it in Azure, with a view to getting rid of the script servers.

     

    • #183171

      Participant
      Topics: 1
      Replies: 96
      Points: 514
      Helping Hand
      Rank: Major Contributor

      Then you can spin up a PowerShell Container Instance (ACI) in Azure and run it on on-demand.

      Thank you.

  • #183384

    Participant
    Topics: 9
    Replies: 21
    Points: 125
    Rank: Participant

    That is actually a pretty good idea. I hadn't thought about that as an option. I will definitely try looking into that.

You must be logged in to reply to this topic.