PowerAppAdvisorClient 1.0.0
dotnet add package PowerAppAdvisorClient --version 1.0.0
NuGet\Install-Package PowerAppAdvisorClient -Version 1.0.0
<PackageReference Include="PowerAppAdvisorClient" Version="1.0.0" />
paket add PowerAppAdvisorClient --version 1.0.0
#r "nuget: PowerAppAdvisorClient, 1.0.0"
// Install PowerAppAdvisorClient as a Cake Addin #addin nuget:?package=PowerAppAdvisorClient&version=1.0.0 // Install PowerAppAdvisorClient as a Cake Tool #tool nuget:?package=PowerAppAdvisorClient&version=1.0.0
Motivation
In the moment of implementing existing Powershell module Microsoft.PowerApps.Checker.PowerShell does not implement client credential flow. This library implements client credential flow. It calls powerapps checker web api - https://docs.microsoft.com/en-us/power-platform/alm/checker-api/overview
For teams who are in need of automation CI/CD pipeline introducing static analysis of powerapp / dynamics 365 solution is great benefit. It quickly identifies problematic patterns and prevent introducing to solution legacy patterns or deprecated API etc.
What it does
Library allows to call PowerApps Checker Web Api and make static analysis of power app solution including Dynamics 365 solution. Implements OAuth client credential flow. It is possible to use client secret or client certificate.
What is needed
- Registered app in portal azure
- App should have assigned either
- Dynamics CRM /user_impersonation and assigned system administrator role in environment
- or PowerApps-Adivsor/Analysis.All
Example usage
string tenantId = "123456b6-1234-1234-1234-123456789abc"; // tenant id
string clientId = "12345678-1234-5678-1234-123456789abc"; // application id for registered app in portal azure
string redrictUri = "http://localhost" // registered redirect uri for app in portal azure
//using secret
var client = DefaultClientFactory.Instance.Create(
new ClientSettings()
{
TenantId = tenantId,
ClientId = clientId,
Scopes = new [] { "https://api.advisor.powerapps.com//.default" },
RedirectUri = redrictUri,
Secret = "somesecret",
});
//using certificate
X509Certificate2 certificate = ... // load certificate from store or file
client = DefaultClientFactory.Instance.Create(
new ClientSettings()
{
TenantId = tenantId,
ClientId = clientId,
Scopes = new [] { "https://api.advisor.powerapps.com//.default" },
RedirectUri = redrictUri,
Certificate = certificate,
});
//load zipped managed solution
string fullPathToManagedSolution = "C:\\directory\solution_managed.zip";
byte[] managedSolution = null;
using(var fs = File.Open(fullPathToManagedSolution,FileMode.Open)){
using(var ms = new MemoryStream()){
fs.CopyTo(ms);
ms.Position=0L;
managedSolution = ms.ToArray();
}
}
//calling powerapps checker web api
//initialize correlationId
Guid correlationID = Guid.NewGuid();
var uploadReqResponse = await client.UploadSolution(managedSolution,"<solutionName>",tenantId, correlationId);
var analysisInvokationResult = await client.InvokeAnalysis(uploadReqResponse,tenantId,correlationId);
//in the loop
var analysisStatus = await client.CheckAnalysis(tenantId,correlationId);
do
{
analysisStatus = await client.CheckAnalysis(tenantId, correlationId, default);
} while ( analysisStatus.Progress!=100 );
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.6 is compatible. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 1.6
- Common (>= 1.0.0)
- Microsoft.Identity.Client (>= 4.17.1)
- NETStandard.Library (>= 1.6.1)
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 493 | 9/1/2020 |
In the moment of implementing existing Powershell module Microsoft.PowerApps.Checker.PowerShell does not implement confidential client flow. This library implements confidential client flow. It calls powerapps checker web api - https://docs.microsoft.com/en-us/power-platform/alm/checker-api/overview
For teams who are in need of automation CI/CD pipeline introducing static analysis of powerapp / dynamics 365 solution is great benefit. It quickly identifies problematic patterns and prevent introducing to solution legacy patterns or deprecated API etc.