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.
To ensure the repository can securely deploy resources to Azure, do the following:
AZURE_CLIENT_ID
: The client ID of the User Managed Identity.AZURE_TENANT_ID
: The tenant ID that the User Managed Identity exists in.AZURE_SUBSCRIPTION_ID
: The subscription ID where the resources are to be deployed.- name: Azure login
uses: azure/login@v2
with:
client-id: $
tenant-id: $
subscription-id: $
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.
Work in progress