Featured

Recent Posts


Fixed – AADSTS7000218: The request body must contain the following parameter: ‘client_assertion’ or ‘client_secret

While trying to access Azure resources using UsernamePasswordCredential credential we were getting the below error https://docs.microsoft.com/en-us/dotnet/api/azure.identity.usernamepasswordcredential?view=azure-dotnet Azure.Identity.AuthenticationFailedException: ‘UsernamePasswordCredential authentication failed: A configuration issue is preventing authentication – check the error message from the server for details.You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000218: The request body … Continue reading “Fixed – AADSTS7000218: The request body must contain the following parameter: ‘client_assertion’ or ‘client_secret”

Fixed – AADSTS65001: The user or administrator has not consented to use the application with ID

The below error occurs for the application registered with Azure AD (Delegated Permissions), which requires either user or an administrator’s consent for the permissions it needs. “Azure.Identity.AuthenticationFailedException: ‘UsernamePasswordCredential authentication failed: AADSTS65001: The user or administrator has not consented to use the application with ID ‘9ea6c0e6-5ab5-4816-b787-5391cd41fd7b’ named ‘MyKVApp’. Send an interactive authorization request for this user … Continue reading “Fixed – AADSTS65001: The user or administrator has not consented to use the application with ID”

Read Secret from Azure Key Vault using SecretClient (UsernamePasswordCredential)– C#

In the previous post, we used ClientSecretCredential Token Credential to read the secret from the Key Vault. In this post, we’d use UsernamePasswordCredential class instead. Login to Azure Portal – https://portal.azure.com/ Here we have generated a Secret named secret1 inside MyKeyVaultCRM We have also provided Get – Secret permission to the below User account Also, … Continue reading “Read Secret from Azure Key Vault using SecretClient (UsernamePasswordCredential)– C#”

Read Secret from Azure Key Vault using SecretClient class – Console App C#

Azure Key Vault can save 3 different types of information. Keys – Encryption keys (asymmetric – public/private), can be created in Key Vault or imported, stored in software or HSD Secrets – unstructured text, can be created or imported, stored in the software. Certificates – can be created or imported, contains 3 part – cert … Continue reading “Read Secret from Azure Key Vault using SecretClient class – Console App C#”

Creating Better PCF Component – Part 2

Originally posted on Temmy Wahyu Raharjo:
When I was writing this post, I felt the environment that I set up did not enhance my ability to write code. The reason for this is because I use jsdom, which is a mock object for the HTML component. Because it is not a real object of HTML, my focus…

Use AzCopy to transfer files from local drive to Azure Blog Storage

AzCopy is a command-line utility that can be used for copying data to and from the storage accounts. Download the appropriate version of the tool – https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10#download-azcopy We’d upload the files to the following container Below will be the source files Let us login first (here we are using Azure Active Directory to authorize AzCopy, … Continue reading “Use AzCopy to transfer files from local drive to Azure Blog Storage”

Transfer files from local drive to Azure Blob using Azure Blob Upload Task – SSIS

Similar to Premium File Transfer Task, The Azure Blob Upload Task component can be used to easily transfer files from local drive to Azure Blob storage. https://docs.microsoft.com/en-us/sql/integration-services/control-flow/azure-blob-upload-task Let us take a simple example to see it in action. Here we will pick the folder Customer and its subfolders along with the files inside it and … Continue reading “Transfer files from local drive to Azure Blob using Azure Blob Upload Task – SSIS”

Fixed – authorizationpermissionmismatch Azure Blob Storage

We got the below error while trying to transfer files to Azure Blob Storage using AzCopy INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission -> github.com/Azure/azure-storage-blob-go/azblob.newStorageError, /home/vsts/go/pkg/mod/github.com/!azure/azure-storage-blob-go@v0.10.1-0.20201022074806-8d8fc11be726/azblob/zc_storage_error.go:42 ===== RESPONSE ERROR (ServiceCode=AuthorizationPermissionMismatch) ===== Description=This request is not authorized to perform this operation using this permission. RequestId:43ee21af-501e-0055-30ef-c07ec3000000 Time:2020-11-22T16:51:42.0459952Z, … Continue reading “Fixed – authorizationpermissionmismatch Azure Blob Storage”

Transfer files from local drive to Azure Blob using Premium File Transfer Task – SSIS

The Premium File Transfer Task component of KingswaySoft can be used to easily transfer files from local drive to Azure Blob storage. https://www.kingswaysoft.com/products/ssis-productivity-pack/help-manual/premium-file-pack/premium-file-transfer-task Let us take a simple example to see it in action. Here we will pick the folder Customers and its subfolders along with the files inside it and will transfer it’s content … Continue reading “Transfer files from local drive to Azure Blob using Premium File Transfer Task – SSIS”

Use CrmServiceClient to execute web request against Web API – Dynamics 365

In the previous post we saw how to use CrmServiceClient to connect to CDS using Authentication Type – OAuth and execute web request using Organization.svc service https://nishantrana.me/2020/11/09/sample-code-to-connect-to-cds-dynamics-365-ce-using-oauth/ Here we will extend the same example to execute web request using Web API. Create the contact record with first name and last name populated Retrieve first name … Continue reading “Use CrmServiceClient to execute web request against Web API – Dynamics 365”

Process Optimization – Dynamics 365 CE / CRM / CDS SSIS Integration toolkit – KingswaySoft

Process Optimizations is a new feature added in the CDS / CRM Destination Component of KingswaySoft’s SSIS Integration Toolkit as part of November 2020 Release. Check other posts on SSIS and Dynamics 365 https://nishantrana.me/2020/10/16/ssis-kingswaysoft-and-dynamics-365/ These options if enabled, will turn off or disable plugin, workflow, entity auditing during pre-execution temporarily, during the writing process, and … Continue reading “Process Optimization – Dynamics 365 CE / CRM / CDS SSIS Integration toolkit – KingswaySoft”

System.FormatException: Input string was not in a correct format exception while registering Plugin in Dynamics 365

We might get the below error while trying to register a plugin. Cause – The plugin project was referring the .NET Framework 4.7.2 And the latest version of Microsoft.CrmSdk.CoreAssemblies – (Sept 29, 2020) Resolution – Changing it to 4.6.2 fixed it. Details- Unhandled Exception: System.ServiceModel.FaultException An unexpected error occurred. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, … Continue reading “System.FormatException: Input string was not in a correct format exception while registering Plugin in Dynamics 365”

Changes in CDS / CRM Destination Component – SSIS Integration Toolkit for Dynamics 365

With version 20.2 November 2020 release, there have few updates added to the KingwaySoft’s CDS/CRM Destination Component, few are changes in the label and others are metadata changes, that one should be aware of before updating. Check Post on SSIS and Dynamics 365 https://nishantrana.me/2020/10/16/ssis-kingswaysoft-and-dynamics-365/ Label changes. Version 20.1 – Version 20.2 – CrmRecordId renamed to … Continue reading “Changes in CDS / CRM Destination Component – SSIS Integration Toolkit for Dynamics 365”

Sample code to connect to CDS / Dynamics 365 / CE using OAuth

Sample code for quick reference for connecting to CDS through a console application using OAuth Add the NuGet package for Microsoft.CrmSdk.XrmTooling.CoreAssembly in the project. Xrm.Tooling is the preferred way to connect to CDS, because of many benefits – we can define connection string, thread safety, support for X.509 certificate authentication, support for secure storage of … Continue reading “Sample code to connect to CDS / Dynamics 365 / CE using OAuth”

Extract attachment from Notes in Dynamics 365 / CE / CDS – SSIS (KingswaySoft)

Recently we were exploring ways of extracting attachment from notes to a local drive for our case entity. We also wanted to organize it based on Case Number. For this, we used KingswaySoft’s SSIS components. Other posts on SSIS and Dynamics 365 – https://nishantrana.me/2018/11/26/ssis-and-microsoft-dynamics-365/ This is how our final package looked like For CDS Source, … Continue reading “Extract attachment from Notes in Dynamics 365 / CE / CDS – SSIS (KingswaySoft)”

An error occurred when processing the security tokens in the message:You are using Ws-Tust authentication which has been deprecated and no longer supported in your environment. Please use oAuth2.0 authentication in Dynamics 365 / CDS

While trying to connect to Dynamics 365 instance through Online Federation authentication type (deprecated) using CDS/ CRM connection manager of KingswaySoft For Console App – https://nishantrana.me/2020/11/09/sample-code-to-connect-to-cds-dynamics-365-ce-using-oauth/ you would get the below error – KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmServiceException: CRM service call returned an error: An error occurred when processing the security tokens in the message:You are using Ws-Tust authentication … Continue reading “An error occurred when processing the security tokens in the message:You are using Ws-Tust authentication which has been deprecated and no longer supported in your environment. Please use oAuth2.0 authentication in Dynamics 365 / CDS”

Traffic information in the map component – 2020 Release Wave 2

The interactive Map component (preview) can now be enabled to show traffic information like traffic congestion, incidents, traffic flow using red, yellow, and green colors. Before we can use the Map component (preview), we need to first enable it for the environment. Navigate to the admin portal – https://admin.powerplatform.microsoft.com/ Within features, enable the Geospatial services … Continue reading “Traffic information in the map component – 2020 Release Wave 2”

Upcoming updates to Export to Data Lake Service – 2020 Release Wave 2

As we know – Export to Data Lake service enables continues replication of CDS entity data to Azure Data Lake Gen 2 Below are some the interesting update coming to it – Configurable Snapshot Interval – currently the snapshots are created hourly– which will be configurable. Cross Tenant Support – Currently Azure Data Lake Gen2 … Continue reading “Upcoming updates to Export to Data Lake Service – 2020 Release Wave 2”

Manage Parent Child Cases in CRM

Originally posted on crmcooking:
In Microsoft Dynamics CRM you can manage multiple cases efficiently using parent and child cases. If you want to records same issue for multiple customers, you can open a primary case called parent case and then create a secondary case called child case. Please consider the following scenario. Multiple customers are…

Improved duplicate detection and merge experience in Dynamics 365 for Sales– 2020 Release Wave 2

2020 Release Wave 2 brings improvement in duplicate detection and merge capabilities. Check other posts on Release 2020 Wave 2 To enable it, navigate to – Settings > Data Management > Duplicate Detection Settings Enable it – With this enabled, the user can see why a record is being flagged as duplicate, it also allows users … Continue reading “Improved duplicate detection and merge experience in Dynamics 365 for Sales– 2020 Release Wave 2”

D365 CE: Show/Hide and Enable/Disable same field placed in multiple tabs using JavaScript

Originally posted on Ajit Patra:
We often put the same fields in different tabs based on business requirements. To Hide/Show such fields we need to use below script: var formContext = executionContext.getFormContext(); formContext.getAttribute(“fieldName”).controls.forEach( function (control, i) {      control.setVisible(false/true); }); Similarly, to Enable/Disable such fields we need to use below script: formContext.getAttribute(“fieldName”).controls.forEach( function (control,…

Snapshot in Azure Data Lake (Dynamics 365 / CDS)

In the previous post, we saw how to export CDS data to Azure Data Lake Gen 2 https://nishantrana.me/2020/09/07/export-data-from-common-data-service-to-azure-data-lake-storage-gen2/ Here let us have a look how the sync and snapshot work. We have already done the configuration and have synced the Account and Contact entity. As the diagram depicts – there is initial sync followed by … Continue reading “Snapshot in Azure Data Lake (Dynamics 365 / CDS)”

Replicate / Export Dynamics 365 (CDS) data – different options

The most common use case to export Dynamics 365 or Common Data Service data to an external database/datastore is to have more control over the data (without going through API route) with the ability to run analytics such as Power BI Reporting, Machine Learning, Data Warehousing, Integration, etc. For analytics, we can also use our … Continue reading “Replicate / Export Dynamics 365 (CDS) data – different options”

What are the Different Ways to connect from Azure to On-Premise SQL Server?

Originally posted on Microsoft Azure Articles..:
Here I would like to list down the different ways to connect from Azure to On-Premise SQL Server. VPN We can create a site-to-site VPN for connecting from Azure to On-Premise.  Here the VPN device on Azure takes care of transmitting the request to the On-Premise network. https://docs.microsoft.com/en-us/office365/enterprise/connect-an-on-premises-network-to-a-microsoft-azure-virtual-network Azure…

Loading…

Something went wrong. Please refresh the page and/or try again.

Advertisements

Fixed – AADSTS7000218: The request body must contain the following parameter: ‘client_assertion’ or ‘client_secret


While trying to access Azure resources using UsernamePasswordCredential credential we were getting the below error

https://docs.microsoft.com/en-us/dotnet/api/azure.identity.usernamepasswordcredential?view=azure-dotnet

Azure.Identity.AuthenticationFailedException: ‘UsernamePasswordCredential authentication failed: A configuration issue is preventing authentication – check the error message from the server for details.You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000218: The request body must contain the following parameter: ‘client_assertion’ or ‘client_secret’.

Trace ID: ef6c9e2b-862a-4a8b-9519-9a9072d23301

Correlation ID: 5f9bae95-e45a-4da5-b27c-ad9704e7334e

Timestamp: 2020-11-28 05:58:05Z’

This was because Allow public client flows was disabled for the application registered in Azure AD.

Enabling it fixed the issues for us.

https://docs.microsoft.com/en-gb/azure/active-directory/develop/scenario-desktop-acquire-token?tabs=dotnet#username-and-password

More on ROPC

https://nishantrana.me/2019/08/23/connect-to-dynamics-365-web-api-using-oauth-2-0-resource-owner-password-credential-ropc/

Hope it helps..

Working with large CDS datasets in Power Automate Flows and Logic Apps


EVOLVED365

During the last 12 months I have been busy working on projects and lost my way a little bit on writing and sharing my experiences with the community. However on a positive note I learned a lot of new things during that period and now I’ve got some great content planned and waiting to be shared with you all.

Some of those learnings were around working with large CDS datasets in Microsoft Power Automate Flows and Azure Logic Apps. Here are some of those easy to learn tips, tricks, guidelines and limitations that will help you for sure.

Connecting to a Common Data Service (CDS) environment

There are two main connectors you can use. “Common Data Service” connector and “Common Data Service (current environment)” connector. Let’s look at few points to consider when selecting a connector for your workflow.

Common Data Service connector Common Data Service (current…

View original post 1,303 more words

Fixed – AADSTS65001: The user or administrator has not consented to use the application with ID


The below error occurs for the application registered with Azure AD (Delegated Permissions), which requires either user or an administrator’s consent for the permissions it needs.

“Azure.Identity.AuthenticationFailedException: ‘UsernamePasswordCredential authentication failed: AADSTS65001: The user or administrator has not consented to use the application with ID ‘9ea6c0e6-5ab5-4816-b787-5391cd41fd7b’ named ‘MyKVApp’. Send an interactive authorization request for this user and resource.”

The below setting specifies that all users can allow applications to access the organization’s data on their behalf.


Here the admin can grant the consent through the portal as shown below from Home > App > API Permissions



or can also use Consent URL

https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/grant-admin-consent#construct-the-url-for-granting-tenant-wide-admin-consent

https://login.microsoftonline.com/{tenant-id}/adminconsent?client_id={client-id}


When trying to access the consent URL using another non-admin user, we might get the below message, which means that only the admin can provide the required consent.


Signing in with the Admin account presents the below message for granting the app the required permissions.


Admin can also revoke the admin consent (along with the permission as shown below) from the portal as shown below through Remove admin consent option.


Get all the details here –

https://docs.microsoft.com/en-us/azure/active-directory/develop/application-consent-experience#consent-and-permissions

Hope it helps..


User multiplexing- SSIS (KingswaySoft) + Dynamics 365 CE / CDS / Dataverse


Must read article on managing API limits

Thanks – Gustaf Westerlund

Read Secret from Azure Key Vault using SecretClient (UsernamePasswordCredential)– C#


In the previous post, we used ClientSecretCredential Token Credential to read the secret from the Key Vault. In this post, we’d use UsernamePasswordCredential class instead.

Login to Azure Portal –

https://portal.azure.com/

Here we have generated a Secret named secret1 inside MyKeyVaultCRM

We have also provided GetSecret permission to the below User account

Also, we have registered an app

And enabled All public client flows for generating the token using username and password.

Let us create a console app to read the secret.

Add the following NuGet packages to the project.

Get the Vault URI and Directory ID (tenant id)

And the Client Id of the App registered

Sample source code:

We are using SecretClient class here.

Get all the details here

https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.Identity/1.4.0-beta.1/api/index.html

Hope it helps..

Read Secret from Azure Key Vault using SecretClient class – Console App C#


Azure Key Vault can save 3 different types of information.

  • Keys – Encryption keys (asymmetric – public/private), can be created in Key Vault or imported, stored in software or HSD
  • Secrets – unstructured text, can be created or imported, stored in the software.
  • Certificates – can be created or imported, contains 3 part – cert metadata, key and secret

Key Vault provides data protection – at rest, in transit, and use.

Key Vault provides Application Security i.e. instead of saving secrets hardcoded in the application, or the configuration files, the secrets can be stored in Key Vault.

Login to Azure Portal

https://portal.azure.com/

Here we have generated a Secret named MyCRMKey inside MyDynamics365KeyVault

We have also provided GetSecret permission to the MyApp application registered in the Azure AD.

Let us create a console app to read the secret.

Add the following NuGet packages to the project.

Get the Vault URI and Directory ID (tenant id)

And the Client Id of the App registered

Sample source code:

We are using SecretClient class here.

Get all the details here

https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.Identity/1.4.0-beta.1/api/index.html

Hope it helps..