title: Can I use an Azure Function to run unit/integration tests? How?
body: <h1>Background</h1>
  <p><em>Disambiguation</em>: Here I am NOT trying to <em>test</em> my Azure Function. Rather, I am investigating the possiblity of using an Azure Function to test <em>my other code</em>.</p>
  <p>I am developing an Azure web application in C#. I want to have really good coverage of unit and integration tests (aka end-to-end-tests). We use Jenkins as our main continuous integration tool. We have a suite of tests that runs on each Jenkins push. We have the following conflict of interests:</p>
  <ul>
  <li>We want our mandatory Jenkins test suite to be reasonably fast (a few minutes).</li>
  <li>We want to have automated tests of a number of complex scenarios that can be quite long-running (potentially many minutes).</li>
  </ul>
  <p>So I am investigating how to auto-run our long-running tests somewhere <em>other</em> than our regular Jenkins pipeline.</p>
  <p>Since we need Azure anyway, I have looked into having an Azure Function run some of our tests. It would run every evening and would need to get the newest code (either take it from GitHub, or our regular Jenkins job could put the code as an artifact somewhere else where the test runner can get it) and run the tests.</p>
  <h1>Actual question</h1>
  <p>Can I get any standard test runner (e.g. <code>dotnet test</code>) to run from an Azure Function? Is that reasonably practical? If so, how can I do it?</p>
  <p>It is possible that this is a bad idea. I am a novice to Azure Functions, so I don't know how difficult this would be.</p>
  <p>Alternatives might be:</p>
  <ul>
  <li>A separate Jenkins pipeline.</li>
  <li>GitHub Actions.</li>
  <li>Azure DevOps.</li>
  <li>Azure container apps (which I have not looked into at all).</li>
  </ul>
  <p>We are using C#, .NET 5.0+ and ASP.Net Core. Our tests currently use xUnit, but that part is negotiable.</p>
  <p>Again, my core question is: Is it possible - and reasonably convenient - to get an Azure Function to run a suite of tests? Or should I bark up a completely different tree?</p>
  <p>Thanks a lot in advance!</p>