PowerAutomate: Perform “Group By” operation on Data


Ajit Patra's avatarAjit Patra

In this post, we’ll see how we can perform aggregate function on data such as Sum or Count using PowerAutomate. Unlike LINQ in C# or SQL, it’s not very straight forward to do using PowerAutomate for which I thought of sharing the approach we had taken.

Recently, we got a requirement to calculate the sum of Quantity, after grouping the data on 5 columns NDISNumber, SupportDeliveredFrom, SupportNumber, ClaimType and CancellationReason in a custom entity Claim.

Below are the steps we followed to achieve the result:

Action: Initialize Variable(Variable)
Purpose: Hold the unique data of 5 columns based on which we need to group data.

Action: Initialize Variable(Variable)
Purpose: Resultant array to hold unique data along with sum of quantity

Initialize 5 variables to hold unique values of each group-by column inside Apply to each action we are going to use further. Please see…

View original post 564 more words

Always Encrypted feature in SQL Server


Always Encrypted is used for encryption at the column level rather than the entire database. It provides both data at rest as well in memory (in flight).

It is different from column (cell-level) and Transparent Data Encryption (TDE) which uses keys and certificates, which are stored in the database. In the case of Always Encrypted, keys are managed outside the database. SQL Server cannot decrypt on its own, as it is the client who encrypts / decrypts on the fly, separating those who own the data from the one who manages it.

To enable Always Encrypted we can use either T-SQL or the Always Encryption Wizard in SSMS. It supports both Randomized and Deterministic Encryption types.

  • Columns are encrypted using CEK – Column Encryption Key.
  • The encrypted versions of each CEK are stored in the database.
  • CMK – Column Master Key is used to encrypt all the CEKs.
  • Only the client possesses the CMK which is stored in either Azure Key Vault, Certificate Store, HSM.

SSMS Wizard generates both CEK and CMK. CMK is stored in the Client certificate or Azure Key Vault.

CMK is used to encrypt CEK. The encrypted CEK along with Path to CMK is what is stored in the database. So, the database has no way of decrypting the data.

Next SSMS Wizard begins the encryption process, where it creates a new temporary table, transfers the data from the table and encrypts it on the fly, and then drops and replaces the main table.

All of this occurs on the fly at the client side which is SSMS in this case.

The client will pass the ‘Column Encryption Setting=Enabled’ in the connection string, which fetches the Encrypted CEK and Path to CMK from the database.

The client uses the Path to CMK to get the CMK and uses it to decrypt the encrypted CEK received and then uses the CEK to decrypt the encrypted data.

To apply Always Encrypted, within SSMS, right-click the database and select Tasks > Encrypt Columns…

Below we have selected the Email Id column of MyContact table.

The below wizard step is used for generating CMK which can be either stored in Windows Certificate Store or Azure Key Vault with the client.

We can either run the encryption at that time or choose to generate a PowerShell Script which we can run later.

Below is the summary of steps that will be performed

  • Before encryption

  • After encryption

To decrypt here, at the client which is our SSMS in this case, right-click in the query window and select Connection > Choose Connection…


Specify column encryption setting=enabled in the Additional Connection Parameters tab.

We can see the actual data as the client SSMS in this case, peforms the decryption at the run time using the path to CMK and encrypted CEK details received from the database.

  • Usage within a console application –

Few points to consider while planning to use Always Encrypted –

https://www.sentryone.com/blog/aaronbertrand/t-sql-tuesday-69-always-encrypted-limitations

Reference – Pluralsight – SQL Server Course 

Hope it helps..

Error – Please unblock each locked file or unlock XrmToolBox.zip before extracting its content


We were getting the below error while trying to run the XrmToolBox.

One reason can be that at least one file is locked by Windows. Please unblock each locked files or unlock XrmToolBox.zip before extracting its content”

The resolution in our case was to reset the XrmToolBox installation i.e. deleting the content of

C:\users\appData\[loginname]\roaming\MsCrmTools\XrmToolBox

Get the details here

https://www.xrmtoolbox.com/documentation/for-users/reset-xrmtoolbox-installation/

Hope it helps..

Dynamic Data Masking (DDM) in SQL Server


Through the Dynamic Data Masking feature in SQL Server, we can hide the sensitive data by masking the data from the user who does not have permissions. (Here the data in the database is not changed).

There are 4 different functions to do that –

  • default – Entire column is masked.
  • partial – only works with string, for masking staring and / or ending characters of the column data.
  • email – shows only the first character of the column data and masks the rest.
  • random – only works with numeric, the column data is replaced by random values.

  • e.g. Create Table

  • e.g. Alter Table

  • To find the masking details applied on columns –

  • Mask permissions – 

  • Unmask and mask permission –

Granting UNMASK permission to the user allows to see the unmasked data.

  • For Azure SQL Database, we can enable and specify masking through the interface itself, select the Dynamic Data Masking option for the table, click on the Add mask button

Apply the masking format as needed.

Reference – Pluralsight – SQL Server Course 

Hope it helps..

Recent Posts


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

Advertisements

Power Automate vs Azure Logic Apps


Power Automate

Azure Logic Apps

Power Automate is built on top of Azure Logic Apps
It is a SaaS service for workflow automation across several different apps and SaaS services. It is a PaaS service for workflow automation across several different apps, SaaS services, and IaaS services for enterprise integration.
For more of self-service and simple integration scenarios. For complex/advanced integration scenarios
Targeted for Business User, Citizen Developers, Developers, IT Pros. Targeted for Developers and IT Pros.
Brower based designer and mobile app UI only


In-browser as well as Visual Studio
Office 365 Service / License / Subscription Azure Service / License / Subscription
Flow specific Connectors

Power Automate Premium Connectors

Logic App-specific Connectors – SAP, IBM MQ, IoT, Liquid.

Logic Apps Connectors

Power Automate are specific to an environment There is no environment concept, each logic app is an independent entity.
Pay by run Pay by action run and by connector run.
Button flow

Create a button flow

Modern Approvals

https://nishantrana.me/2020/08/31/approvals-power-automate-dynamics-365/

Flow can be extended as Logic Apps

Export flow and deploy to Logic Apps

Power Automate is supposed to be designed and tested in a non-production environment and then promoted to the production environment. The solution makes it possible with connectors requiring reconfiguration. Connection references can be considered here https://flow.microsoft.com/en-us/blog/move-flows-across-environments-without-resetting-connections/
Logic Apps has ALM possibilities.

Automate deployment of Azure Logic Apps

Admin Experience through Power Platform Admin Center. Admin experience through Azure Portal.

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓