Azure Function: TIME Model

In this example we will show, how you can re-use the Azure Function we have created related to TIME Model to measure and map the business value of applications.

Overview

TIME represents a 2x2 quadrant and is an acronym for Tolerate, Invest, Migrate, Eliminate.
You can use the setup provided and add your own logic on top in order to implement the specific case where a Tag on FactSheet will be updated according to "Functional Fit" and "Technical Fit".

For more information on the TIME Model please see the User documentation.

Setup

Cloning LeanIX Public Scripts

Create an Azure Function App

There are two options here to create an azure function app on your Azure Environment :-

Deploy project to your environment

func azure functionapp publish timeModelSync

Copy the Invoke URL that is posted in your console after the successful deployment.

Create a Tag Group : "Time Model"

  • Add the specific tags to the Tag group : invest, eliminate, tolerate and migrate.

Setup a Webhook Subscription

Use the link if you want to know how to create a Webhook.

  • Create a webhook subscription for the events: "FACT_SHEET_CREATED" and "FACT_SHEET_UPDATED"
  • Set type to "PUSH"
  • Paste the invoke url of your Azure function into the target url field.
  • Grab the callback function from callback.js and paste it to the callback field.
  • Select "Ignore Errors".
  • Save.
Webhook SubscriptionWebhook Subscription

Webhook Subscription

Set Azure Environment Variables

  • Create an environment variable in your Azure portal called "HOST " and set it to your host (e.g. app.leanix.net)
  • Paste the following JSON into an environment variable called "TAG_MAPPING" with the correct ids for your workspace.
{
    "tolerate": "<tag id>",
    "invest": "<tag id>",
    "migrate": "<tag id>",
    "eliminate": "<tag id>"
}

🚧

Recommendation

To save your API token for a live environment LeanIX advises you to use the Microsoft KeyVault. Create a link to the Key Vault from an environment variable called: "DEMO_TOKEN"

Now you are ready to use the Azure Functions and run some tests by changing values of "Functional Fit" and "Technical Fit", see the impact on the Tag : "Time Model"