Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Azure Function Hell

Azure Function Hell

Scheduled Pinned Locked Moved The Lounge
csharpclouddata-structurestoolsquestion
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #1

    So we've built a system that uses Azure, it's a function that validates a payload and pushes it onto a queue, and then another function pulls it off to process it. It's integration, keeping two systems in sync Worked fine until the client decided to push in 2000 records at once. We find that HTTP functions blow up if they get too many calls. At one point they were sending 20, waiting 30 seconds, sending more and that still blew up. We've been chasing this for over a month. There's Azure doco on this being limiting code that you can turn off. You cannot. The doco is all over the place. We found it doesn't happen to C# script BUT C# script won't work with queues with sessions. Today we get one of my co workers to code review it all. He says it all looks good then, off the cuff, says, why does your DI code use injecttransient. Because we're injecting a few lightweight classes and I didn't trust the idea of a singleton across Azure servers being better. So I make them all singletons, and now the code works. No documentation anywhere that I can find on why that would be.

    G Kornfeld Eliyahu PeterK S R 4 Replies Last reply
    0
    • C Christian Graus

      So we've built a system that uses Azure, it's a function that validates a payload and pushes it onto a queue, and then another function pulls it off to process it. It's integration, keeping two systems in sync Worked fine until the client decided to push in 2000 records at once. We find that HTTP functions blow up if they get too many calls. At one point they were sending 20, waiting 30 seconds, sending more and that still blew up. We've been chasing this for over a month. There's Azure doco on this being limiting code that you can turn off. You cannot. The doco is all over the place. We found it doesn't happen to C# script BUT C# script won't work with queues with sessions. Today we get one of my co workers to code review it all. He says it all looks good then, off the cuff, says, why does your DI code use injecttransient. Because we're injecting a few lightweight classes and I didn't trust the idea of a singleton across Azure servers being better. So I make them all singletons, and now the code works. No documentation anywhere that I can find on why that would be.

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      yikes - that's a nasty trap - kudos to co-worker btw for asking the question

      C 1 Reply Last reply
      0
      • C Christian Graus

        So we've built a system that uses Azure, it's a function that validates a payload and pushes it onto a queue, and then another function pulls it off to process it. It's integration, keeping two systems in sync Worked fine until the client decided to push in 2000 records at once. We find that HTTP functions blow up if they get too many calls. At one point they were sending 20, waiting 30 seconds, sending more and that still blew up. We've been chasing this for over a month. There's Azure doco on this being limiting code that you can turn off. You cannot. The doco is all over the place. We found it doesn't happen to C# script BUT C# script won't work with queues with sessions. Today we get one of my co workers to code review it all. He says it all looks good then, off the cuff, says, why does your DI code use injecttransient. Because we're injecting a few lightweight classes and I didn't trust the idea of a singleton across Azure servers being better. So I make them all singletons, and now the code works. No documentation anywhere that I can find on why that would be.

        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu PeterK Offline
        Kornfeld Eliyahu Peter
        wrote on last edited by
        #3

        There are tons of undocumented behaviors in Azure - it is an environment developed in production... For instance (from my personal experience) a Linux based app service is actually sits behind an IIS wrapper, where that wrapper always 'talks' to the Linux instance in HTTP, which actually makes it unusable for like 90% of the scenarios in today world, where HTTPS is a minimum requirement and checked by most...

        "The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012

        "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

        C 1 Reply Last reply
        0
        • G Garth J Lancaster

          yikes - that's a nasty trap - kudos to co-worker btw for asking the question

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Yeah, I found no doco so his suggestion was awesome. I did find other limits that I could turn off, so I assume all of those changes also worked in their own way

          1 Reply Last reply
          0
          • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

            There are tons of undocumented behaviors in Azure - it is an environment developed in production... For instance (from my personal experience) a Linux based app service is actually sits behind an IIS wrapper, where that wrapper always 'talks' to the Linux instance in HTTP, which actually makes it unusable for like 90% of the scenarios in today world, where HTTPS is a minimum requirement and checked by most...

            "The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            *sigh* there's a lot of defunct doco still live as well. The source of truth is what your function does in real life

            1 Reply Last reply
            0
            • C Christian Graus

              So we've built a system that uses Azure, it's a function that validates a payload and pushes it onto a queue, and then another function pulls it off to process it. It's integration, keeping two systems in sync Worked fine until the client decided to push in 2000 records at once. We find that HTTP functions blow up if they get too many calls. At one point they were sending 20, waiting 30 seconds, sending more and that still blew up. We've been chasing this for over a month. There's Azure doco on this being limiting code that you can turn off. You cannot. The doco is all over the place. We found it doesn't happen to C# script BUT C# script won't work with queues with sessions. Today we get one of my co workers to code review it all. He says it all looks good then, off the cuff, says, why does your DI code use injecttransient. Because we're injecting a few lightweight classes and I didn't trust the idea of a singleton across Azure servers being better. So I make them all singletons, and now the code works. No documentation anywhere that I can find on why that would be.

              S Offline
              S Offline
              steve at p2cl
              wrote on last edited by
              #6

              Feel free to ignore this because it's just a wild stab in the dark (and it's obvious once one knows), but are you somehow injecting an HttpClient using transient ?... because HttpClient is (as I know due to (cough) experience) "once per app" and exhibits interesting behaviour if it's continually 'new'd ... see first comment line in the c# example (link below) and text in the in the Remarks section... HttpClient Class (System.Net.Http) | Microsoft Docs[^] HTH

              C 1 Reply Last reply
              0
              • C Christian Graus

                So we've built a system that uses Azure, it's a function that validates a payload and pushes it onto a queue, and then another function pulls it off to process it. It's integration, keeping two systems in sync Worked fine until the client decided to push in 2000 records at once. We find that HTTP functions blow up if they get too many calls. At one point they were sending 20, waiting 30 seconds, sending more and that still blew up. We've been chasing this for over a month. There's Azure doco on this being limiting code that you can turn off. You cannot. The doco is all over the place. We found it doesn't happen to C# script BUT C# script won't work with queues with sessions. Today we get one of my co workers to code review it all. He says it all looks good then, off the cuff, says, why does your DI code use injecttransient. Because we're injecting a few lightweight classes and I didn't trust the idea of a singleton across Azure servers being better. So I make them all singletons, and now the code works. No documentation anywhere that I can find on why that would be.

                R Offline
                R Offline
                RedDk
                wrote on last edited by
                #7

                Christian Graus wrote:

                No documentation anywhere that I can find

                ... because people who live in glass houses don't throw stones. Really? Honestly there's gotta be sample/example use somewhere. If there's no sample there's no way anyone's gonna use it. Anyone who is anybody. Now, as for Bob ...

                C 1 Reply Last reply
                0
                • S steve at p2cl

                  Feel free to ignore this because it's just a wild stab in the dark (and it's obvious once one knows), but are you somehow injecting an HttpClient using transient ?... because HttpClient is (as I know due to (cough) experience) "once per app" and exhibits interesting behaviour if it's continually 'new'd ... see first comment line in the c# example (link below) and text in the in the Remarks section... HttpClient Class (System.Net.Http) | Microsoft Docs[^] HTH

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  No, in .NET Core there's a HTTP Context factory. I inject that to get a HttpClient

                  1 Reply Last reply
                  0
                  • R RedDk

                    Christian Graus wrote:

                    No documentation anywhere that I can find

                    ... because people who live in glass houses don't throw stones. Really? Honestly there's gotta be sample/example use somewhere. If there's no sample there's no way anyone's gonna use it. Anyone who is anybody. Now, as for Bob ...

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #9

                    There's tons of .NET Core and Azure functions samples. Nothing on the issue I had that I found while searching

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups