cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jpragsdale
Frequent Visitor

Add Custom Connector to DLP

We currently have a DLP policy in place.  I have created a custom connector for MS Graph to pull in data.  I need to add the custom connector to the allowed section of the DLP policy.

 

I have found a few articles that reference adding the connector via PowerShell.  I have run the following in PowerShell:

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell

Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber 

 

Along with:

Add-PowerAppsAccount and

$pass = ConvertTo-SecureString "password" -AsPlainText -Force Add-PowerAppsAccount -Username foo@bar.com -Password $pass

 

I always receive the same error:

Add-PowerAppsAccount : Method invocation failed because
[Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext] does not contain a method named 'AcquireToken'.
At line:1 char:1
+ Add-PowerAppsAccount
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Add-PowerAppsAccount], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound,Add-PowerAppsAccount

 

Has anyone else encountered this and have a solution?  Or better yet an alternate way to add the custom connector to a DLP policy?

 

Thanks!

 

3 REPLIES 3
poweractivate
Super User II
Super User II

 @jpragsdale

 

Did you try instead Add-CustomConnectorToPolicy

 

from 

 

https://www.powershellgallery.com/packages/Microsoft.PowerApps.Administration.PowerShell/2.0.33

 

Note: You may first need to create the Policy using

 

New-AdminDlpPolicy

 

then use it in Add-CustomConnectorToPolicy

 

See if it works better for you this way.

 

Hi @poweractivate ,

 

I tried the MS PowerShell to add the Custom Connector.

Add-CustomConnectorToPolicy

 

And the Custom Connector is also Added 

 

			"apiGroups": {
				"hbi": {
					"description": "Business data only",
					"apis": [
						{
							"id": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
							"name": "SharePoint",
							"type": "Microsoft.PowerApps/apis"
						},
						{
							"id": "/providers/Microsoft.PowerApps/apis/shared_oracle",
							"name": "Oracle Database",
							"type": "Microsoft.PowerApps/apis"
						},
						{
							"id": "/providers/Microsoft.PowerApps/apis/shared_office365users",
							"name": "Office 365 Users",
							"type": "Microsoft.PowerApps/apis"
						},
						{
							"id": "/providers/Microsoft.PowerApps/scopes/admi n/environments/a9127745-5d3d-4377-b323-b4a849d70491/apis/shared_hardi-20api-20demo-5f93fc6c8c53644c57-5f7af40c7bcce25e65",
							"name": "shared_hardi-20api-20demo-5f93fc6c8c53644c57-5f7af40c7bcce25e65",
							"type": "Microsoft.PowerApps/apis"
						}
					]
				},

 

The response also list down the Custom Connector Name: "shared_hardi-20api-20demo-5f93fc6c8c53644c57-5f7af40c7bcce25e65"

 

However if I added this custom connectors in the App, it shows the Data Policy error.

 

While adding the other 2 standard connectors works.

 

Can you provide hints where to search and correct the problem?

 

Thanks

 

 

 

hsu
Helper I
Helper I

I don't have the problem you mentioned above with the Add-PowerAppsAccount.

Perhaps you need to update the PowerShell cmdlets.

 

See:

https://flow.microsoft.com/en-us/blog/introducing-http-and-custom-connector-support-for-data-loss-pr...

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (55,911)