Friday, November 28, 2025

Configuring CSP for Dynamics 365 Event Registration Forms with hCaptcha on Power Pages

When embedding Dynamics 365 event registration forms that use hCaptcha on Power Pages, you need to configure the Content Security Policy (CSP) correctly to ensure the form loads and functions as expected.

Required CSP Directives

Add the following CSP directives to allow the form and hCaptcha to load without violations:

connect-src

'self' https://content.powerapps.com https://*.microsoft.com https://cxppusa1formui01cdnsa01-endpoint.azureedge.net https://public-apj.mkt.dynamics.com

default-src

'self' https://cxppusa1formui01cdnsa01-endpoint.azureedge.net https://public-apj.mkt.dynamics.com https://*.hcaptcha.com

font-src

'self' https://fonts.googleapis.com https://fonts.gstatic.com https://*.sharepointonline.com http://*.cdn.office.net https://*.microsoft.com https://content.powerapps.com

form-action

'self'

frame-ancestors

'self' https://*.hcaptcha.com

frame-src

'self' https://*.hcaptcha.com

img-src

'self' data: https://content.powerapps.com https://*.microsoft.com https://*.azureedge.net https://public-apj.mkt.dynamics.com

object-src

https://cxppusa1formui01cdnsa01-endpoint.azureedge.net

script-src

'self' 'unsafe-inline' 'unsafe-eval' https://*.microsoft.com https://content.powerapps.com https://cxppusa1formui01cdnsa01-endpoint.azureedge.net https://public-apj.mkt.dynamics.com https://www.gstatic.com https://www.google.com https://*.hcaptcha.com

style-src

'self' 'unsafe-inline' https://fonts.googleapis.com https://*.microsoft.com https://content.powerapps.com

Tip

Always verify these settings in your Power Pages site configuration and test the form to ensure hCaptcha renders properly without CSP violations.

Thursday, May 2, 2024

Permission error when running "Power Platform Backup Environment" in Azure DevOps

 When we run action "Power Platform Backup Environment" in Azure Devops with an App Registration account, we get the error "Principal with id '...' for application *** does not have permission to access the path 'https://10.0.1.21:20414/providers/Microsoft.BusinessAppPlatform/environments/.../backups?api-version=2020-08-01' in tenant ...". This means this account is missing the permission to run the backup. However we cannot setup the permission for it in Power Platform Admin Center for Microsoft 365 Admin Center. You can setup this permission by using powershell with the guideline in this link: https://learn.microsoft.com/en-us/power-platform/admin/powershell-create-service-principal#registering-an-admin-management-application


$appId = "CLIENT_ID_FROM_AZURE_APP"

# Login interactively with a tenant administrator for Power Platform
Add-PowerAppsAccount -Endpoint prod -TenantID $tenantId 

# Register a new application, this gives the SPN / client application same permissions as a tenant admin
New-PowerAppManagementApp -ApplicationId $appId

 After that, the action can run successfully.

Thursday, March 21, 2024

Error (ESLint) i.CLIEngine is not a constructor in Visual Studio 2019

To correct the ESLint error 'i.CLIEngine is not a constructor' in Visual Studio 2019 with ESLint version 8.57.0, you can follow these steps:


1. Navigate to the following file path and open the file in a text editor: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\ServiceHub\Services\TypeScriptLintingService\TypeScriptLintingService.all.js. It is recommended to create a backup of the original file before proceeding.


2. Locate the function e.prototype.eslint within the file and replace it with the following code:


e.prototype.eslint = function(e) {

return new Promise(async (resolve) => {

try {

var config = JSON.parse(e);

var ESLintModule = this.dynamicRequire(config.linterPath + n.sep + "node_modules" + n.sep + "eslint");

var results = [];


if (ESLintModule.ESLint) {

var options = {

cwd: config.projectRoot,

resolvePluginsRelativeTo: config.linterPath

};


var eslintInstance = new ESLintModule.ESLint(options);

results = await eslintInstance.lintText(config.fileContents, { filePath: config.fileName });

} else {

var optionsLegacy = {

cwd: config.projectRoot,

ignorePattern: ["wwwroot/lib/**", "**/node_modules/**", "**/bower_components/**", "**/jspm_packages/**"],

resolvePluginsRelativeTo: config.linterPath

};


if (config.parserPath) {

optionsLegacy.parser = config.parserPath;

}


results = new ESLintModule.CLIEngine(optionsLegacy).executeOnText(config.fileContents, config.fileName).results;

}


var report = results[0];

if (report) {

report.messages.forEach(this.addRuleIdToParseError);

var validMessages = report.messages.filter((message) => message.ruleId != null);

validMessages.forEach(this.addLocationInfoFromSourceCode);

resolve({ lintMessages: validMessages });

} else {

resolve({});

}

} catch (error) {

resolve({ errorMessage: error.message });

}

});

}


3. After making the changes, save the file and restart Visual Studio to apply the update.


Saturday, July 15, 2023

Power Automate Desktop error: The request content is not valid and could not be deserialized: 'Unexpected character encountered while parsing value: %. Path '', line 0, position 0.'

 When you use "Invoke web service" action with URL that has special character "%", you can escape this character with "%%". But when you run, this error happens.

I got this error and I tried many methods. Only one method helped me to solve this. I turned the option "Encode request body" to Off in the Advanced setting of "Invoke web service" action.








Sunday, September 12, 2021

Tips for setting lookup value of using Dynamics 365 Web API

 Working with Dynamics 365 CRM, when you set a value for lookup field, maybe you will get the error “Invalid property ‘your_field' was found in entity ‘the_entity’. ---> Microsoft.OData.ODataException: Does not support untyped value in non-open type” or error “An undeclared property ‘your_field' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.”. This means you are not setting this field incorrectly.

The first situation is you are not using the field schema name.

The second situation is you are not setting it correctly. There are several situations with the lookup field to do this:

  • Non-activity entity/table, single lookup field (lookup to only one table)

entity[<your_schema_field_name>@odata.bind] = “/<entity_logical_name in plural>(<entity_id>)”

For example: A custom field new_account lookups to account table

entity[new_accountid@odatabind] = “/accounts(b2ce603e-5bb9-eb11-8236-0022481736ba)”

  • Activity entity/table, single lookup field

entity[<your_schema_field_name>_<ActivityName>@odata.bind] = “/<entity_logical_name in plural>(<entity_id>)”

For example:

entity[new_accountid_PhoneCall@odatabind] = “/accounts(b2ce603e-5bb9-eb11-8236-0022481736ba)”

entity[new_accountid_Task@odatabind] = “/accounts(b2ce603e-5bb9-eb11-8236-0022481736ba)" 

  • For regarding field

entity[<your_schema_field_name>_<entity_lookup_logical_name>@odata.bind] = “/<entity_logical_name in plural>(<entity_id>)”

For example:

entity[regardingobjectid_account@odatabind] = “/accounts(b2ce603e-5bb9-eb11-8236-0022481736ba)” 

Sunday, June 20, 2021

Error 0x80131500 when installing SQL Server Integration Service Project Extension in Visual Studio 2019

If you install SQL Server Integration Service Project extension in Visual Studio 2019 and get this error 0x80131500, you can check the log in folder  %TEMP%\SsdtisSetup. From the log detail of files in this folder, you can know more about the error detail.

Monday, June 14, 2021

Container with WSL

  • Install Docker with WSL
With WSL 2, we can setup Docket Desktop and enable WSL 2 based engine.

First you install WSL 2. Then you download Docker Desktop from https://www.docker.com/products/docker-desktop and install it. After that, you have to log out and log in again to run Docker Desktop. Then, right click on the Docker icon on the system tray and select Setting. Enable the option Use the WSL 2 based engine to configure Docker run under WSL 2 rather than a Virtual Machine.


 For the tab Resources, we can configure which Linux distro to access Docker from.

  • Setup Kubernetes
In the Docker Desktop settings, we can enable the Kubernetes option to setup the Kubernetes cluster.






Sunday, June 13, 2021

WSL Tips

  • Access Linux files from Windows
            After installing WSL and Linux distro, if you type \\WSL$ on the address bar of Windows Explorer, you can see all Linux distro that are installed on your machine. And from that, you can access to the file system of the Linux distro from Windows.

 

  • Access Windows files from Linux
            WSL automatically mount the Windows drive as /mnt. To access C drive, we can use /mnt/c
  • Export/Import a Distro
            If we work with multiple projects and each project need different set of tools, then we can clone the base distro by export and import with a new name.
            Export: wsl --export ...
            Import: wsl --import ...
  • Create a custom Distro from a docker container
    • Firstly, we pull a container from Docker hub 
    • Second step is to start the container with docker run  command.
    • Third step: we add user for WSL
                    useradd -m YOURUSERNAME
                    passwd YOURUSERNAME
    • Then we add /etc/wsl.conf file to let WSL know the user we created
                    echo -e "[user] \ndefault=YOURUSERNAME" > /etc/wsl.conf
    • If we want to add more configuration, we can add at this step.
    • After finish adding the configurations, we can export the Docker container to the Tar file using docker export command.
    • Then we use wsl --import  command to import the Tar file. And now we have a new Distro to run.
  • Create a custom Distro from a docker container using Docker file
            For the manual steps above, we can build a Docker file to create a custom Distro.

Thursday, June 10, 2021

Quote

 “Take the first step in faith. You don't have to see the whole staircase, just take the first step.”

― Martin Luther King Jr.

Sunday, May 16, 2021

How to run Visual Studio Code with WSL

Install Visual Studio Code on Windows.

Then make sure we install Visual Studio Code extension Remote - WSL.

Optional step: Windows has a new terminal tool that is good to communicate with Linux running in WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations. You can install it here or github.

From the WSL command line tool, in the source code folder, we can start Visual Studio Code using command Code .

And from Windows, we can edit and compile source code in WSL.

Windows Subsystem for Linux

Windows Subsystem for Linux is a great tool that let developers try Linux tools, applications directly in Windows. The Linux kernel and Windows kernel can now share system resources, such as memory and CPU. 
I am trying some open sources that cannot run on Windows. They are working well with WSL2.
  • Rocket.Chat: I compiled and run successfully.
  • Apache Airflow: Run successfully.
Beside that, from Windows, developers can use tools to code or interact with the applications, source code in WSL system. Some are:
  • Windows Terminal supports console to Linux system. 
  • Visual Studio Code supports development with source code in Linux system.

Sunday, August 28, 2016

Collection

"You take the blue pill, the story ends. You wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit-hole goes."
―Morpheus (Matrix)

Monday, June 8, 2015

The HTTP Filter DLL DefaultAddonFilter.dll failed to load. The data is the error.

Today, I had this error on my Dynamics CRM server and tried solution in this link (http://ms-crm-2011-beta.blogspot.com/2011/09/could-not-load-all-isapi-filters-for.html) but the error still existed. Maybe this is not my situation.
Then I opened "Uninstall or change a program" of Windows and recognized that the library "Microsoft Visual C++ 2013 Redistributable(x64)" was missing. So I downloaded it from Microsoft download website and installed it. And it fixed the error.

Monday, August 13, 2012

Map SkyDrive as a Network Folder


  1. Open Windows Explorer. Select 'Computer' icon to show the ‘Computer’ area.
  2. Right click in an empty space, choose ‘Add a network location’.
  3. Step through the wizard, select "Choose a custom network location" and click Next.
  4. When you get to the part asking for a network address, open your SkyDrive site by web browser(Firefox, IE, ...).
  5. Select any item in your SkyDrive site, choose "Share Folder" on the right-hand side, then "Get a link", then View only. In the resulting window, copy the text from ‘resid=’ to the ! character. For example: With https://skydrive.live.com/redir?resid=84E1C29A3B9BFF72!107&authkey=!AFzutdlXCsRf2vU, the text will be 84E1C29A3B9BFF72
  6. Go back to your Add Network Location wizard, and enter the following in the network address: https://d.docs.live.net/<copied text>/
  7. Click Next. And it will pop up a dialog to ask for your login information to SkyDrive. Enter information and OK.
  8. Finish the wizard, and enter a name for your SkyDrive location.
  9. Now, you now have a Shortcut to SkyDrive without being worry about your hard disk space.

Monday, February 13, 2012

How to check IIS process in Windows Task Manager

If there are many websites deployed on the same IIS using different pools. There processes will be shown in Windows Task Manager with the same name w3wp.exe


There is a way to recognize those processes.
1. Open cmd window.
2. Go to windows system32 folder.
    <code>cd C:\WINDOWS\system32</code>

3. Run this line
    <code>cscript iisapp.vbs</code>

Configuring CSP for Dynamics 365 Event Registration Forms with hCaptcha on Power Pages

When embedding Dynamics 365 event registration forms that use hCaptcha on Power Pages , you need to configure the Content Sec...