Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

MattSN
Mega Sage

The new Docker recipe makes building out a MID Server, something you can create in under a minute! This is great for working with PDI's.

Official Build Process
Containerized MID Server | ServiceNow Docs

You will need a Linux distro with docker installed. Windows users may like Virtual Box or WSL

  1. To get the latest link from your instance. Navigate to MID Server --> Downloads and get the link from the copy link button under Linux Docker Recipe.
    find_real_file.png
  2. Create a new user in the sys_user table and grant it the role "mid_server"
  3. Use this Linux shell script to create the mid server. Just update the variables
    #Set mid server variables
    export instance='https://<instancename>.service-now.com'
    export midservername='my-docker-midserver'
    export miduser='miduser'
    export midpassword='change_me'
    export dockerImage='servicenow_midserver'
    
    #download the build files
    mkdir snbuild && cd "$_"
    #you can get the latest link from your instance
    wget https://install.service-now.com/glide/distribution/builds/package/app-signed/mid-linux-container-recipe/2022/01/04/mid-linux-container-recipe.rome-06-23-2021__patch5-12-15-2021_01-04-2022_2221.linux.x86-64.zip
    zipFile=`find -name mid*.zip`
    unzip $zipFile
    
    #create the docker image
    sudo docker build . --build-arg MID_SIGNATURE_VERIFICATION=false --tag $dockerImage
    
    #creat the docker container
    sudo docker run -d \
    --name $midservername \
    --env MID_INSTANCE_URL=$instance \
    --env MID_SERVER_NAME=$midservername \
    --env MID_INSTANCE_USERNAME=$miduser \
    --env MID_INSTANCE_PASSWORD=$midpassword \
    $dockerImage:latest
    
    #to tail the mid server logs
    sudo docker logs $midservername --follow
    
    
    #if you need to to tear it down
    #sudo docker rm $midservername -f​

     

  4. Confirm the midserver shows up in the Mid Server --> Servers section of ServiceNow
  5. Now validate it from the related links

That's it! Instant mid server!

Version history
Last update:
‎02-15-2022 02:07 PM
Updated by: