# Load-balancer enabled Litium Cloud Azure DevOps Release Pipeline

**URL:** <https://forum.litium.com/t/load-balancer-enabled-litium-cloud-azure-devops-release-pipeline/2404>\
**Category:** Questions\
**Tags:** accelerator, litium-7\
**Created:** [January 27, 2022, 9:55am UTC](https://forum.litium.com/t/load-balancer-enabled-litium-cloud-azure-devops-release-pipeline/2404 "2022-01-27T09:55:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdxperbol](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/kdxperbol/32/513_2.png) [@kdxperbol](https://forum.litium.com/u/kdxperbol)\
**Post date:** [January 27, 2022, 9:55am UTC](https://forum.litium.com/t/load-balancer-enabled-litium-cloud-azure-devops-release-pipeline/2404/1 "2022-01-27T09:55:46Z")

</div>

We have setup a load-balancer enabled Azure DevOps Release Pipeline for Litium Cloud for Litium 7. I thought I’d share it here to see if others are doing it the same way, or if any improvements can be made.

The pipeline follows the deployment guidelines given to us by Litium Cloud Operations, and seems to work fine.

Some things to note:

- The “delay/wait” task we had to get from Azure DevOps Marketplace.
- `-UseBasicParsing` was necessary because PowerShell 1.0 uses Internet Explorer under the hood. We also had to add the wake-up URL to “Trusted Sites” in the Internet Explorer settings.
- The wake-up URL is the external URL, and has been `hosts`d to 127.0.0.1. We couldn’t get it to work any other way, probably because of Internet Explorer or the low PowerShell version?
- Manually stopping the Application Pool is necessary because `libsass` (IIRC) holds some files hostage otherwise.

All defaults removed, for brevity.

```auto
{
 "environments": [
  {
   "name": "Litium production deployment",
   "deployPhases": [
    {
     "deploymentInput": {
      "deploymentHealthOption": "OneTargetAtATime"
     },
     "name": "Deploy to all deployment targets in \"Litium Production\" deployment group, one target at a time",
     "workflowTasks": [
      {
       "name": "Remove deployment target from load balancer (by stopping the LoadBalancer IIS Website)",
       "timeoutInMinutes": 1,
       "retryCountOnTaskFailure": 5,
       "inputs": {
        "IISDeploymentType": "IISWebsite",
        "ActionIISWebsite": "StopWebsite",
        "StartStopWebsiteName": "LoadBalancer"
       }
      },
      {
       "name": "Wait for existing connections to finish",
       "inputs": {
        "seconds": "10"
       }
      },
      {
       "name": "Stop application pool (since libsass is always \"file in use\" otherwise)",
       "timeoutInMinutes": 1,
       "retryCountOnTaskFailure": 5,
       "inputs": {
        "IISDeploymentType": "IISApplicationPool",
        "ActionIISApplicationPool": "StopAppPool",
        "StartStopRecycleAppPoolName": "Litium-Production"
       }
      },
      {
       "name": "Deploy Litium",
       "timeoutInMinutes": 1,
       "retryCountOnTaskFailure": 5,
       "inputs": {
        "WebSiteName": "Litium-Production",
        "Package": "$(System.DefaultWorkingDirectory)\\**\\*.zip"
       }
      },
      {
       "name": "Start application pool",
       "inputs": {
        "IISDeploymentType": "IISApplicationPool",
        "ActionIISApplicationPool": "StartAppPool",
        "StartStopRecycleAppPoolName": "Litium-Production"
       }
      },
      {
       "name": "Wake up deployment target (by invoking https://www.litium.se)",
       "inputs": {
        "script": "Invoke-WebRequest -UseBasicParsing -Uri https://www.litium.se",
        "errorActionPreference": "stop"
       }
      },
      {
       "name": "Add target to load balancer",
       "inputs": {
        "IISDeploymentType": "IISWebsite",
        "ActionIISWebsite": "StartWebsite",
        "StartStopWebsiteName": "LoadBalancer"
       }
      }
     ]
    }
   ],
   "executionPolicy": {
    "concurrencyCount": 1
   }
  }
 ],
 "artifacts": [
  {
   "type": "Build",
   "alias": "_Litium Production",
   "definitionReference": {
    "definition": {
     "id": "182",
     "name": "Litium Production"
    }
   }
  }
 ],
 "name": "Litium Production (Load Balancer-enabled)"
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [February 24, 2022, 9:56am UTC](https://forum.litium.com/t/load-balancer-enabled-litium-cloud-azure-devops-release-pipeline/2404/2 "2022-02-24T09:56:09Z")

</div>

Closed on February 24, 2022, 9:56am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
