This project contains custom availability tests for Dataverse (Power Platform) components. The tests are implemented as a C# Console Application that uses the Microsoft.PowerPlatform.Dataverse.Client NuGet package to connect to Dataverse and check the availability of various components. The application is designed to be run as a GitHub Action on a schedule, and it tracks the availability of the components in Azure Application Insights.
The project cotnains the following components and can be executed locally or on GitHub as an Action. The console application "TrackAvailabilty" performs the tests and records the results to Application Insights.
- Console App
- GitHub Actions 2.1 Build Publish Run Track Availablity (BuildPublishRunTrackAvailablity.yml) 2.2 Track Dataverse Availabilty (trackavailablity.yml)
- BuildPublishRunTrackAvailablity.yml
- This GitHub Action builds the C# Console Application and publishes it to a GitHub Release. The action is triggered on a push to the main branch. The action uses the
dotnetCLI to build and publish the application. The action also creates a GitHub Release and uploads the published application to the release.
- This GitHub Action builds the C# Console Application and publishes it to a GitHub Release. The action is triggered on a push to the main branch. The action uses the
- TrackAvailability.yml
-
- This GitHub Action runs the C# Console Application and tracks the availability of the Power Platform components. The action is triggered on a schedule (every 5 minutes). The action uses the
dotnetCLI to run the application. The action also sends the availability data to Application Insights using theApplicationInsightsNuGet package. The action uses theAZURE_APPLICATION_INSIGHTS_INSTRUMENTATION_KEYsecret to authenticate with Application Insights. The action also uses theAZURE_SUBSCRIPTION_ID,AZURE_TENANT_ID, andAZURE_CLIENT_IDsecrets to authenticate with Azure. The action uses theAZURE_CLIENT_SECRETsecret to authenticate with Azure. The action uses theAZURE_RESOURCE_GROUP_NAMEsecret to specify the resource group name for Application Insights.
- This GitHub Action runs the C# Console Application and tracks the availability of the Power Platform components. The action is triggered on a schedule (every 5 minutes). The action uses the
To add tests to the console application, follow these steps:
- Open the
Program.csfile in the console application. - Add a new method for the test you want to implement. The method must return a
AvailabilityTelemetrywith the following information:- Name: The name of the test.
- Success: A boolean indicating whether the test was successful or not.
- Message: A message describing the result of the test.
- Duration: The duration of the test in milliseconds.
- Timestamp: The timestamp of the test result.
- Call the method in the
Mainmethod of the console application. - Execute 'TrackCustomAvailability' after the test routine is called.
- Build and test from local to verify the custom availablity is logging
- Commit and push the changes to the GitHub repository.
NOTE: The following secrets are required to be in place on GitHub.
- AICONNECTIONSTRING: Contains the connection string to the Application Insights resource.
- DVCONNECTIONSTRING: Contains the connection string to the Dataverse environment.
