Skip to content

Webhook: Capture event messages from the MyCloudIT portal for external services & custom integrations

How to add use the MCIT webhook feature

Overview

The MCIT webhook feature is a web-based method for receiving event notifications. When that event occurs, the MCIT system makes a HTTP request to the URL configured for the webhook. You can configure them to cause MCIT events to invoke behaviour on your own website, application or other tool. Often technicians call this an API, and while similar the definition is not the same.

An example event notification is when a session host VM (AVD or RDS) is deallocated due to MCIT auto scale determining the capacity is not required. Note that, in the future we will be adding more notifications to the feature.

This feature and article is considered advanced and generally some development experience is required to implement safely and effectively.

Example use cases are:

  • You have a RMM (remote monitoring & management) tool and need to have autoscale alerts come into it so you can take action. You may need to disable an outage alert for a session host that is deallocated and turn monitoring back on when it is powered on.
  • You manage a large number of deployments and want to implement your own autoscale monitoring dashboard for all deployments.
  • You need to configure custom alerts for auto scale events or for compliance reporting. You may need a summary email of session hosts running at the start of the business day.
  • You want to trigger specific scripts or actions on auto scale events such as when a session host is deallocated change the disk performance level or perform other maintenance.
  • Integration with other third party platforms. 

Configure the setting in the MCIT portal

  1. Log in to the portal
  2. Click on your "account name" (profile) in the top right of the screen
  3. Click on Account
  4. Click Monitoring
  5. Click EDIT
  6. Add your URL that can accept accept the push notifications
    1. Example is: https://mycompany.com/uniqueid-75d7f7ba-0000-0000-845c-9f27cd5f9505
    2. Warning: Upon creating or editing this URL it may take up to 30 minutes for the change to take effect.   
  7. Click Save

That is is you are done!

Documentation of Notifications

All notification requests have the following JSON structure:

{

    "Id": "0000bbbb-bbbb-0000-0000-bbbb0000bbbb",

    "UserId": "0000aaaa-aaaa-0000-0000-0000aaaa0000",

  "CustomerId": "0000cccc-cccc-0000-0000-0000cccc0000",

  "Type": "Conexlink.CloudManager.Data.Context.Models.TYPE",

    "ResourceId": "/subscriptions/1111aaaa-0000-aaaa-0000-0000aaaa0000/resourceGroups/office-avd/providers/Microsoft.Compute/virtualMachines/office-VDSH-1",

    "Timestamp": "2022-01-01T22:00:00.2111000Z",

    "ActionData": {

    }    

}
The TYPE will be replaced with the type of message. Current possible types are:
  • Power state of a VM changed (manual or autoscale initiated)
    •  Conexlink.CloudManager.Data.Context.Models.VmPowerStateAuditData 
  • Auto Scale disabled or enabled for a collection or hostpool by an Administrator
    • Conexlink.CloudManager.Data.Context.Models.DisableAutoScaleAuditData
Example for an autoscale scale-out (power on) event for the VM office-VDSH-1:
{

    "Id": "0000bbbb-bbbb-0000-0000-bbbb0000bbbb",

    "UserId": "0000aaaa-aaaa-0000-0000-0000aaaa0000",

    "CustomerId": "0000cccc-cccc-0000-0000-0000cccc0000",

    "Type": "Conexlink.CloudManager.Data.Context.Models.VmPowerStateAuditData",

    "ResourceId": "/subscriptions/1111aaaa-0000-aaaa-0000-0000aaaa0000/resourceGroups/office-avd/providers/Microsoft.Compute/virtualMachines/office-VDSH-1",

    "Timestamp": "2022-01-01T22:00:00.2111000Z",

    "ActionData": {

        "powerState": "Start",

        "reason": "AutoScale",

        "response": {

          "result": null,

          "isSuccess": true,

          "code": "AZR-S-018",

          "message": "VM Start action sent successfully",

          "exceptionMessage": null,

          "exceptionsList": null

 
--- REDACTED ---

 

Example for an autoscale scale-in (deallocate) event for the VM office-VDSH-8:

{
"Id": "0000bbbb-bbbb-0000-0000-bbbb0000bbbb",

    "UserId": "0000aaaa-aaaa-0000-0000-0000aaaa0000",

    "CustomerId": "0000cccc-cccc-0000-0000-0000cccc0000",

    "Type": "Conexlink.CloudManager.Data.Context.Models.VmPowerStateAuditData",

    "ResourceId": "/subscriptions/1111aaaa-0000-aaaa-0000-0000aaaa0000/resourceGroups/office-avd/providers/Microsoft.Compute/virtualMachines/office-VDSH-8",

    "Timestamp": "2022-01-01T22:00:00.2111000Z",

    "ActionData": {

  "ActionData": {

    "powerState": "Deallocate",

    "reason": "AutoScale",

    "response": {

      "result": null,

      "isSuccess": true,

      "code": "AZR-S-021",

      "message": "VM Deallocate action sent successfully",

      "exceptionMessage": null,

      "exceptionsList": null,

      "headers": null,

      "executionTime": null


--- REDACTED ---

 

Example for administrator initiated manual VM start:

{

    "Id": "0000bbbb-bbbb-0000-0000-bbbb0000bbbb",

    "UserId": "0000aaaa-aaaa-0000-0000-0000aaaa0000",

    "CustomerId": "0000cccc-cccc-0000-0000-0000cccc0000",

    "Type": "Conexlink.CloudManager.Data.Context.Models.VmPowerStateAuditData",

  "ResourceId": "/subscriptions/1111aaaa-0000-aaaa-0000-0000aaaa0000/resourceGroups/office-avd/providers/Microsoft.Compute/virtualMachines/office-VDSH-3",

    "Timestamp": "2022-01-01T22:00:00.2111000Z",

    "ActionData": {

  "ActionData": {

    "powerState": "Start",

    "reason": "UserInitiated",

    "response": {

      "result": null,

      "isSuccess": true,

      "code": "AZR-S-018",

      "message": "VM Start action sent successfully",

      "exceptionMessage": null,

      "exceptionsList": null


--- REDACTED ---

 

Example of autoscale manually enabled for a collection or hostpool by an Administrator:

{

    "Id": "0000bbbb-bbbb-0000-0000-bbbb0000bbbb",

    "UserId": "0000aaaa-aaaa-0000-0000-0000aaaa0000",

    "CustomerId": "0000cccc-cccc-0000-0000-0000cccc0000",

  "Type": "Conexlink.CloudManager.Data.Context.Models.DisableAutoScaleAuditData",

  "ResourceId": "collection/dddd0000-0000-0000-dddd-dddd0000dddd",

    "Timestamp": "2022-01-01T22:00:00.2111000Z",

    "ActionData": {

  "ActionData": {

    "request": {

        "disable": false,

        "disablePermanently": null,

        "disableUntil": null,

        "reason": null

      },

      "response": {

        "result": "RDS Collection policy enabled sucessfully",

        "isSuccess": true,

        "code": "RDS-S-031",

        "message": "RDS Collection policy enabled sucessfully",

        "exceptionMessage": null,

        "exceptionsList": null,

        "headers": null,

        "executionTime": null


--- REDACTED ---