连接器操作控制
您可以使用连接器操作控制来允许或阻止特定连接器中的单个动作或触发器。
重要提示
2025 年 2 月,连接器操作控制添加了对触发器的支持。 这可以通过 PowerShell 进行管理。 未来,Power Platform 管理中心也计划支持触发器。
通过 Power Platform 管理中心更改策略不会移除通过 PowerShell 添加的触发器。
以系统管理员身份登录到 Power Platform 管理中心。
在左侧导航窗格中,选择策略>数据策略。
选择一个策略,然后在命令栏上选择编辑策略。
在左侧,选择预生成连接器。
选择连接器旁边的更多操作,然后选择配置连接器>连接器操作。
使用侧面板允许或拒绝特定操作。
您还可以设置默认连接器操作设置,以允许或阻止将来添加到连接器的任何新连接器操作。
已知限制
触发器仅在 PowerShell 中受支持
目前仅通过 PowerShell 提供对允许和阻止单个触发器的支持。 计划将来为 Power Platform 管理中心提供支持。 有关如何允许已被 Power Automate 流使用的触发器的示例,请参阅识别受阻的 Power Automate 流。
管理员需要对 Power Apps 拥有制作者访问权限
代表管理员使用对 Power Apps 的调用来检索连接器操作列表。管理员必须登录到 Power Apps,并有权完成用户同意过程。 如果管理员无权访问 Power Apps,则不会检索连接器操作列表。
重新发布 Power Apps
2020 年 10 月 1 日之前发布的一些 Power Apps 需要重新发布连接器操作规则以强制执行数据丢失防护 (DLP)。
此脚本可以帮助管理员和制作者识别必须重新发布的应用程序。
Add-PowerAppsAccount
$GranularDLPDate = Get-Date -Date "2020-10-01 00:00:00Z"
ForEach ($app in Get-AdminPowerApp){
$versionAsDate = [datetime]::Parse($app.LastModifiedTime)
$olderApp = $versionAsDate -lt $GranularDLPDate
$wasBackfilled = $app.Internal.properties.executionRestrictions -ne $null -and $app.Internal.properties.executionRestrictions.dataLossPreventionEvaluationResult -ne $null -and ![string]::IsNullOrEmpty($app.Internal.properties.executionRestrictions.dataLossPreventionEvaluationResult.lastAdvancedBackfillDate)
If($($olderApp -and !$wasBackfilled)){
Write-Host "App must be republished to be Granular DLP compliant: " $app.AppName " " $app.Internal.properties.displayName " " $app.Internal.properties.owner.email
}
Else{
Write-Host "App is already Granular DLP compliant: " $app.AppName
}
}
连接器操作控制的 PowerShell 支持
使用 Get-AdminPowerAppConnectorAction
检索连接器的可用操作列表。
Get-AdminPowerAppConnectorAction
例如:
Get-AdminPowerAppConnectorAction -ConnectorName shared_msnweather
ID | 类型 | 属性 |
---|---|---|
TodaysForecast | Microsoft.ProcessSimple/apis/apiOperations | 获取指定位置当天的天气预报。 |
OnCurrentWeatherChange | Microsoft.ProcessSimple/apis/apiOperations | 当指定的天气测量发生变化时触发新的流。 |
CurrentWeather | Microsoft.ProcessSimple/apis/apiOperations | 获取某个位置的当前天气。 可见性=高级 |
TomorrowsForecast | Microsoft.ProcessSimple/apis/apiOperations | 获取指定地点明天的天气预报。 |
OnCurrentConditionsChange | Microsoft.ProcessSimple/apis/apiOperations | 当某个位置的条件发生变化时触发新的流。 |
为策略配置连接器操作规则
包含策略的连接器操作规则的对象在下面称为连接器配置。
连接器配置对象具有以下结构:
$ConnectorConfigurations = @{
connectorActionConfigurations = @( # array – one entry per connector
@{
connectorId # string
actionRules = @( # array – one entry per rule
@{
actionId # string
behavior # supported values: Allow/Block
}
)
defaultConnectorActionRuleBehavior # supported values: Allow/Block
}
)
}
检索 DLP 策略的现有连接器配置
Get-PowerAppDlpPolicyConnectorConfigurations
为 DLP 策略创建连接器配置
New-PowerAppDlpPolicyConnectorConfigurations
为 DLP 策略更新连接器配置
Set-PowerAppDlpPolicyConnectorConfigurations
示例
目标:
- 阻止连接器 MSN Weather 的 TodaysForecast 和 CurrentWeather 操作;允许所有其他操作。
- 允许连接器 GitHub 的 GetRepositoryById 操作;阻止所有其他操作。
备注
在以下 cmdlet 中,PolicyName 指的是唯一的 GUID。 您可以通过运行 Get-DlpPolicy cmdlet 来检索 DLP GUID。
$ConnectorConfigurations = @{
connectorActionConfigurations = @(
@{
connectorId = "/providers/Microsoft.PowerApps/apis/shared_msnweather"
actionRules = @(
@{
actionId = "TodaysForecast"
behavior = "Block"
},
@{
actionId = "CurrentWeather"
behavior = "Block"
}
)
defaultConnectorActionRuleBehavior = "Allow"
},
@{
connectorId = "/providers/Microsoft.PowerApps/apis/shared_github"
actionRules = @(
@{
actionId = "GetRepositoryById"
behavior = "Allow"
}
)
defaultConnectorActionRuleBehavior = "Block"
}
)
}
New-PowerAppDlpPolicyConnectorConfigurations -TenantId $TenantId -PolicyName $PolicyName -NewDlpPolicyConnectorConfigurations $ConnectorConfigurations