tech-debt-analytics

Quickstart guide to running this project

0. Fork the repository

This solution is made available under the MIT license. You can fork the repository to your own GitHub account and use it as you see fit.

1. Deploy resources to Azure via CI/CD

To ensure the repository can securely deploy resources to Azure, do the following:

- name: Azure login
    uses: azure/login@v2
    with:
    client-id: $
    tenant-id: $
    subscription-id: $

2. Add modernisation assessment pipelines to your repos

For each repository that you want to analyse, you will need to add the secrets for authenticating and a pipeline/action yaml file that will run the assessment and send it to the shipper API.

To support authentication by the pipeline, you need to get the app registration’s client ID plus the tent ID and add them as secrets in the repository.

Then, within the pipeline you will need to login to Entra as the pipeline. The --allow-no-subscriptions flag is used to allow the pipeline to login even if though it won’t be connected to any subscriptions.

- name: Azure login
    uses: azure/login@v2
    with:
    # This is an app registration client ID associated with the shipper function.
    client-id: $ 
    tenant-id: $
    allow-no-subscriptions: true

As the Function will need a Bearer token to authenticate, you will need to get a token from Entra that you can then pass as a header of the request. You can use the Azure CLI to get an access token.

- name: Set environment variables
    run: |
    echo "ACCESS_TOKEN=$(az account get-access-token --query accessToken --resource  $ -o tsv)" >> $GITHUB_ENV

You will need your modernisation assessment process to run. It is recommended to work on this within a GitHub Codespace as a close replica of the environment that the pipeline will run in.

- name: Install appcat
    run: dotnet tool install -g dotnet-appcat
- name: Run appcat JSON
    # This creates the payload for the datalake to give overall visibility of the modernisation effort
    run: appcat analyze $ --source folder --report $ --serializer json --non-interactive --code --binaries --target $

You can then use the token in the Authorization header of the request.

- name: Send report
    run: |
    response=$(curl -X $ -v \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $" \
    --data @$ \
    "$")

Optionally, you can also add analysis outputs as Github Actions Artifacts to the pipeline to allow immediate viewing of outputs by developers and other people who have an interest and access to the Actions.

    - name: Upload results
      uses: actions/upload-artifact@v4
      with:
        path: $

You can see a working end-to-end example of this in the appcat-demos.yml file.

3. Deploy the Power BI report

Work in progress