Many Enterprise customers have a workflow approval process already in place with tools like ServiceNow.  Today, I wanted to show you how you can quickly take advantage of your existing ITSM tooling, and business processes - while enabling self-service infrastructure provisioning with env0. 

Pre-Requisites

  1. ServiceNow - Outbound Rest Integration
  2. env0 Organization
  3. env0 API Key

Overview

The purpose of this guide is to show the possibilities of integrating ServiceNow with env0 to create an env0 Environment through the ServiceNow Catalog. 

Outbound Rest Integration

First, we are going to create a new REST Message Record.

We are going to take advantage of ServiceNow’s outbound REST integration and env0’s API.

In ServiceNow, search for “REST Message” and create a “New” record.

Name: env0

Endpoint: https://api.env0.com

Authentication type: “Basic” 

and add a new Basic auth profile.  You can retrieve the API key from env0 (https://app.env0.com/organizations/ under the “API KEYS” tab)

Hit “submit”

Next, we are going to create a new HTTP Method to create the desired environment.

Click on the “env0” Rest Message you just created and Create a “New” HTTP Methods

Name: Create Environment

HTTP method: POST

Endoint: https://api.env0.com/environments

Authentication: Inherit from parent

HTTP Request:

((log_record.log_record -> ‘attributes’::text) @> ‘{  "name": "${name}",  "projectId": "${ENV0_PROJECT_ID}",  "requiresApproval": true,  "ttl": {    "type": "INFINITE",    "value": "string"  },  "configurationChanges": [{    "name": "refresh_date",    "value": "${refresh_date}",    "scope": "DEPLOYMENT",    "type": 1,    "description": "refresh date is used to reset the random var",    "isSensitive": false  },{    "name": "storage_size",    "value": "${storage_size}",    "scope": "ENVIRONMENT",    "type": 1,    "description": "adding additional variable through payload",    "isSensitive": false  }],  "deployRequest": {    "blueprintId": "${ENV0_TEMPLATE_ID}",     "ttl": {      "type": "INFINITE"    },    "userRequiresApproval": true  }}
  • callout: You will need to modify the “configurationChanges” based on your env0 environment variables required.
  • callout: I’m using several variables that will get replaced during the execution of the script.

Lastly, we are going to copy the Preview Script Usage.

Click on the Preview Script Usage, and make a copy of the script, we will use it later.

  • Note: if you want to test the API key you can create another HTTP Method that queries the organization: https://docs.env0.com/reference/organization-find-organization-by-id

Create a Business Rule.

I’m going to assume you know how to create a ServiceNow catalog item, and that you’ve created a catalog item for the env0 environment you want to create.
So the most important step is to trigger the env0 deployment when a new catalog item is being requested.

For that we will use ServiceNow Business Rule to detect when a catalog item has been Requested. 

Advanced:

We will paste in the script we copied from above.


Voila!

Now request a new S3 Bucket from the Service Catalog, and watch the deployment trigger in env0. 

Next Steps:

  1. Send Plan details back to ServiceNow for review
  2. Request Approval Process in ServiceNow
  3. Send Approval to env0 to deploy
  4. Update ServiceNow Request with Status provisioned

Many Enterprise customers have a workflow approval process already in place with tools like ServiceNow.  Today, I wanted to show you how you can quickly take advantage of your existing ITSM tooling, and business processes - while enabling self-service infrastructure provisioning with env0. 

Pre-Requisites

  1. ServiceNow - Outbound Rest Integration
  2. env0 Organization
  3. env0 API Key

Overview

The purpose of this guide is to show the possibilities of integrating ServiceNow with env0 to create an env0 Environment through the ServiceNow Catalog. 

Outbound Rest Integration

First, we are going to create a new REST Message Record.

We are going to take advantage of ServiceNow’s outbound REST integration and env0’s API.

In ServiceNow, search for “REST Message” and create a “New” record.

Name: env0

Endpoint: https://api.env0.com

Authentication type: “Basic” 

and add a new Basic auth profile.  You can retrieve the API key from env0 (https://app.env0.com/organizations/ under the “API KEYS” tab)

Hit “submit”

Next, we are going to create a new HTTP Method to create the desired environment.

Click on the “env0” Rest Message you just created and Create a “New” HTTP Methods

Name: Create Environment

HTTP method: POST

Endoint: https://api.env0.com/environments

Authentication: Inherit from parent

HTTP Request:

((log_record.log_record -> ‘attributes’::text) @> ‘{  "name": "${name}",  "projectId": "${ENV0_PROJECT_ID}",  "requiresApproval": true,  "ttl": {    "type": "INFINITE",    "value": "string"  },  "configurationChanges": [{    "name": "refresh_date",    "value": "${refresh_date}",    "scope": "DEPLOYMENT",    "type": 1,    "description": "refresh date is used to reset the random var",    "isSensitive": false  },{    "name": "storage_size",    "value": "${storage_size}",    "scope": "ENVIRONMENT",    "type": 1,    "description": "adding additional variable through payload",    "isSensitive": false  }],  "deployRequest": {    "blueprintId": "${ENV0_TEMPLATE_ID}",     "ttl": {      "type": "INFINITE"    },    "userRequiresApproval": true  }}
  • callout: You will need to modify the “configurationChanges” based on your env0 environment variables required.
  • callout: I’m using several variables that will get replaced during the execution of the script.

Lastly, we are going to copy the Preview Script Usage.

Click on the Preview Script Usage, and make a copy of the script, we will use it later.

  • Note: if you want to test the API key you can create another HTTP Method that queries the organization: https://docs.env0.com/reference/organization-find-organization-by-id

Create a Business Rule.

I’m going to assume you know how to create a ServiceNow catalog item, and that you’ve created a catalog item for the env0 environment you want to create.
So the most important step is to trigger the env0 deployment when a new catalog item is being requested.

For that we will use ServiceNow Business Rule to detect when a catalog item has been Requested. 

Advanced:

We will paste in the script we copied from above.


Voila!

Now request a new S3 Bucket from the Service Catalog, and watch the deployment trigger in env0. 

Next Steps:

  1. Send Plan details back to ServiceNow for review
  2. Request Approval Process in ServiceNow
  3. Send Approval to env0 to deploy
  4. Update ServiceNow Request with Status provisioned
Logo Podcast
With special guest
Andrew Brown

Schedule a technical demo. See env0 in action.

CTA Illustration