Typically when building an Azure pipeline running a long-running task- say for example a UI automation task that calls BrowserStack to run, typically you would use multiple parallel jobs in a pipeline to call into BrowserStack, which ulimately ties up muliple agents in your pipeline agent pool. The problem is that those agents are tied up waiting around for BrowserStack to complete running its automation test.
If you want to prevent it from tying up your Azure DevOps pipeline, a potential solution to be investigated is that you can decouple the task by using Azure Queue Storage and an Azure Function.
- Pipeline Triggers UI Task:
The Azure DevOps pipeline adds a message to an Azure Queue, signaling the start of the UI automation task.