Using SARIF Viewer to read the static analysis results generated by Microsoft.PowerApps.Checker.PowerShell module

In the last post, we saw how we can use the Microsoft.PowerApps.Checker.PowerShell module to analyze the Solution (Unmanaged and Managed – Online or On-Premise) outside the PowerApps Maker Portal.

https://nishantrana.me/2019/07/12/using-the-powerapps-checker-powershell-module-to-validate-the-solution/

The reports generated by the tool are in SARIF format i.e. Static Analysis Results Interchange Format (JSON based) standard for the output format of the static analysis tool. This format originated at Microsoft.

To view the result, we can use the below tools

For Visual Studio :

After installing the extension, navigate to Tools à Import Static Analysis Log files for Error List à Import SARIF file and select the result file generated.

It will list down the details in the Error List Window as shown below.

For Visual Studio Code :

For Visual Studio Code, after installing the SARIF Viewer, simply open the file

Below is how the result is displayed in the UI inside Visual studio code.

Hope it helps..

Advertisements

Using the PowerApps checker PowerShell Module to validate the solution

Using PowerApps Checker PowerShell Module we can perform the solution check functionality from outside the PowerApps Maker Portal. This can be useful for automated build and release pipelines. Apart from that some of the notable capabilities of the module include

  • Support for both managed and unmanaged solution.
  • Support for On-Premise.
  • Support for more than one solution at a time.

To get started à

Open the PowerShell (as administrator) and install the module

  • install-module Microsoft.PowerApps.Checker.Powershell

Next, we need to register an Azure Active Directory application in a tenant with PowerApps or Dynamics 365 licensing, even if it is on-premise environment (solution) against which we want to run it.

  • Login to Azure Portal

https://portal.azure.com

  • Click on New registration to register a new application

  • Provide the below details

Redirect URI

  • Type: Public client (mobile & desktop)
  • Redirect URI: urn:ietf:wg:oauth:2.0:oob

Copy the values of Application id and Directory (tenant) Id which we will use later and click on View API Permission to give the required permission to the app.

Click on Add a permission (we’d see Sign and read user profile added by default)

API level permissions to the PowerApps-Advisor first party Microsoft AAD application

  • Application permissions to Analysis.All

Permissions à

PowerApps solution checker uses Solution checker rule set. Here we are getting all the rulesets available passing our tenant’s id.

  • $rulesets = Get-PowerAppsCheckerRulesets -TenantId ‘290055c6-7eb1-4ec4-93e6-81f053d13f76’

We wil be using Solution Checker rule set here.

  • $rulesetToUse = $rulesets | where Name -EQ ‘Solution Checker’

Now let us run it against the Solution Zip file as shown below

  • $analyzeResult = Invoke-PowerAppsChecker –ClientApplicationId ‘48131848-3b81-44f7-a999-d8362b391f25’ –TenantId ‘290055c6-7eb1-4ec4-93e6-81f053d13f76’ –Ruleset $rulesetToUse –FileUnderAnalysis “C:\PowerApps\Test_1_0_0_1_managed.zip” –Output “C:\PowerApps\Result” -Verbose

Give the required consent

We can see the results download at the path specified

Result is in JSON format

IssueSummary to get the quick overview

Get all the details here

https://docs.microsoft.com/en-in/powershell/powerapps/overview?view=pa-ps-latest

Hope it helps..

Using PowerApps Solution Checker from the PowerApps maker portal

The PowerApps Solution Checker feature released for general availability on May 2019, can be used to perform static analysis of the Unmanaged solution for components like plugin, web resources, custom workflow activities and provide guidelines and recommendations around the issues found.

To get started à

Sign in to PowerApps maker portal

https://make.powerapps.com/home

Select the Solutions in the left navigation pane and click on Install to install the Solution checker.

Click on GET IT NOW from the AppSource, specify the instance and the PowerApps Checker Solution will be installed in that Instance.

This will install the PowerApps Checker solution for the selected instance.

After the installation is done, we’d see the Solution checker menu enabled for the unmanaged solution.

Click on Run to run the test

We can see the results in the portal and can download the same as shown below.

Result of running it against another solution in which we are still using Xrm.Page object model à

The results will be available in both Excel and CSV format on the download

csv à

Excel will include a report as wellà

In the next post, we will see how to use the PowerApps Checker PowerShell Module to validate the solutions.

https://nishantrana.me/2019/07/12/using-the-powerapps-checker-powershell-module-to-validate-the-solution/

Hope it helps..

Fixed – Package Deployer (USD) not connecting to CRM Organization

Hi, while trying to set up USD in the Dynamics 365 Online environment

We were facing the issue with the USD’s Package Deployer, after login, it was showing the Organizations but on trying to connect to them, it was again taking back to the login screen.

This was because we were using below old version of the Package Deployer

Dynamics365-USD-2.2.0.755-PackageDeployer

To get it working as suggested by Microsoft we had to update the registry and add the following key – “SchUseStrongCrpto

This makes the .NET application, in our case, the older version of the Package Deployer to use TLS 1.2 required for connecting to Version 9.0 of Dynamics 365.

After making the registry change, we were able to move forward.

We will not be facing the same issue with newer version of USD

https://community.dynamics.com/365/customerservice/b/unifiedservicedeskblog/posts/unified-service-desk-4-1-general-availability

Hope it helps.

Thanks Microsoft for the MVP (Business Applications) award once again!

Thanks Microsoft for this recognition and thanks to all the wonderful and passionate Dynamics 365 (CRM) professionals who have inspired and motivated me and others for several years, to keep learning and contributing in the community and to grow in the process!

Fixed – Workflows not firing “Waiting For Resources” in Dynamics 365 On-Premise

Recently in one of our environments, we started getting the issue that all our workflows were getting stuck at “Waiting for resources”.

As usual first step was to check if Microsoft Dynamics 365 Asynchronous Processing Service is running it or not.

The service was disabled, so we enabled it. But still, it didn’t fix the issue.

Next thing we tried was as suggested in the below article

https://www.powerobjects.com/blog/2013/03/28/how-to-fix-a-crm-workflow-stuck-in-progress/

The value for AsyncSdkRootDomain was blank which we updated followed by a restart of the service. Still no luck.

Eventually, we came to know that Servers setting for the roles Full Server were in the disabled state inside the Deployment Manager for the organization.

The reason CRM was still working because these services (including IIS Web Site) were already manually started earlier, however, the status was still disabled for this setting within Deployment Manager. (These settings were done by the network team who were planning to create the replica of these machines, and they wanted to disable the applications and our CRM technical team was unaware of it.)

Enabling it fixed the issue for it.

Hope it helps..

Fixed – DTS_E_PROCESSINPUTFAILED. The Process input method on component “Script Component” failed with error code 0x80131501 in SSIS

Recently I had written an article for Nigel Frank that list down step by step process of using XML Source Component of KingswaySoft for integration with Dynamics 365 CE

https://www.nigelfrank.com/blog/integrate-dynamics-365-for-customer-engagement-with-xml/

We have used XML Source Component to read the XML files.

The packages that we developed were running fine from Visual Studio SSDT but on deployment for one of our package that was using Script Component we were getting the below error while running from within SQL.

After a lot of debugging and spending a good amount of time to figure out the issue, we realized that the value of one of the input columns was not being passed to Script Component from XML Source component i.e. _ParentKeyField

This is a special column which XML Source Component adds for the child records through which we can associate it to the parent record.

This happens when we are running it from SQL and only for the Script Component. This worked fine while running it from within SSDT and in other packages even from SQL when we weren’t using Script Component.

As a quick fix, we applied XLST Transformation to put the same tag for the child records also and to refer that instead of _ParentKeyField

In parallel, we also asked the same question to the KingswaySoft Support team (info@kingswaysoft.com)

One thing I would like to explicitly mention is that KingswaySoft support team is one of the best out there, not only you will get the response immediately, but also their team is very knowledgeable.

Below is the response we got

As suggested after setting the RunInOptimizedMode property to False for the Data Flow components the issue got fixed.

This property indicates whether the Data Flow task runs in optimized mode (RunInOptimizedMode property). Optimized mode improves performance by removing unused columns, outputs, and components from the data flow.

Hope it helps..

Fixed – Script Component has encountered an exception in user code. Value cannot be null. Parameter name: keyword in SSIS

Recently while trying to use KingswaySoft’ s CRM Connection Manager in the Script Component we got the below error

error

Turned out the issue was because of the wrong version of KingswaySoft.IntegrationToolkit.DynamicsCrm assembly being referred.

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\KingswaySoft.IntegrationToolkit.DynamicsCrm

Referencing the correct one fixed it.

Hope it helps..

Error while updating organization information: Microsoft.Crm.CrmReportingException: Unknown exception thrown by report server —> System.Web.Services.Protocols.SoapException: An internal error occurred on the report server while trying to import organization in Dynamics 365 On-Premise

Recently while after restoring the database while trying to import the organization we got the below error

Checking the Report Server log,

we found the below detail

Throwing Microsoft.ReportingServices.Library.InvalidReportServerDatabaseException: , Microsoft.ReportingServices.Library.InvalidReportServerDatabaseException: The version of the report server database is either in a format that is not valid, or it cannot be read. The found version is ‘2017’. The expected version is ‘178’.;

We can use the below commands to check the DB Version


The Database that we were restoring had the following version 178 as mentioned in the error


And in our destination server where we were had restored and imported the organization, it was 2017.

We tried out a few of the things mentioned in the forums, eventually what worked for us was to create a new Report Server database in the Destination server.

https://social.technet.microsoft.com/wiki/contents/articles/32360.sspr-troubleshooting-the-version-of-the-report-server-database-is-either-in-a-format-that-is-not-valid-or-it-cannot-be-read.aspx

https://www.sqlservercentral.com/forums/topic/the-version-of-the-report-server-database-is-either-in-a-format-that-is-not-valid-or-it-cannot-be-read-the-found-version-is-164-the-expected-version-i

This created the database with the version expected and our import was successful.

Also, refer the below blog posts

https://www.magnetismsolutions.com/blog/paulnieuwelaar/2014/10/08/data-encryption-errors-after-restoring-microsoft-dynamics-crm-database

http://rafaeldontalgoncalez.com/2018/11/the-version-of-the-report-server-database-is-either-in-a-format-that-is-not-valid-or-it-cannot-be-read-the-found-version-is-164-the-expected-version-is-165-rsinvalidreportserverdatabase

https://www.crmviking.com/2016/02/backup-and-restore-strategies-for-crm.html

Hope it helps..

Fixed – ExecuteMultiple Request batch size exceeds the maximum batch size allowed error while deleting records in Dynamics 365 On-Premise

Recently while trying to delete records we were getting the below error

It was occurring when we were selecting more than 20 records for deletion.

Turned out in the MSCRM_CONFIG database, somebody had updated the value to 20 of ExecuteMultipleMaxBatchSize column in the DeploymentProperties table

We updated it to its default value 1000 to get this fixed.

Hope it helps..