Malaker.PowerAppsTools.PowerAppAdvisorClient 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Malaker.PowerAppsTools.PowerAppAdvisorClient --version 1.0.0
NuGet\Install-Package Malaker.PowerAppsTools.PowerAppAdvisorClient -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Malaker.PowerAppsTools.PowerAppAdvisorClient" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Malaker.PowerAppsTools.PowerAppAdvisorClient --version 1.0.0
#r "nuget: Malaker.PowerAppsTools.PowerAppAdvisorClient, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Malaker.PowerAppsTools.PowerAppAdvisorClient as a Cake Addin
#addin nuget:?package=Malaker.PowerAppsTools.PowerAppAdvisorClient&version=1.0.0

// Install Malaker.PowerAppsTools.PowerAppAdvisorClient as a Cake Tool
#tool nuget:?package=Malaker.PowerAppsTools.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

  1. Registered app in portal azure
  2. 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 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. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Malaker.PowerAppsTools.PowerAppAdvisorClient:

Package Downloads
Malaker.PowerAppsTools.Powershell.Cmdlets

Powershell Cmdlets that makes easier to call Powerapp Advisor Checker API and xrm online management API

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.8 741 9/12/2020
1.0.0.7 793 9/11/2020
1.0.0.6 423 9/10/2020
1.0.0.5 447 9/9/2020
1.0.0.4 452 9/9/2020
1.0.0.3 465 9/2/2020
1.0.0.2 438 9/2/2020
1.0.0.1 477 9/2/2020
1.0.0 481 9/1/2020

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.