命名空间:microsoft.graph.identityGovernance
重要
Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
创建新的 customTaskExtension 对象。
此 API 可用于以下国家级云部署。
| 全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
| ✅ |
✅ |
✅ |
✅ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 |
最低特权权限 |
更高特权权限 |
| 委派(工作或学校帐户) |
LifecycleWorkflows-CustomExt.ReadWrite.All |
LifecycleWorkflows.ReadWrite.All |
| 委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
| 应用程序 |
LifecycleWorkflows-CustomExt.ReadWrite.All |
LifecycleWorkflows.ReadWrite.All |
重要
调用用户还需要指定 Azure 逻辑应用的以下 Azure 资源管理器角色之一:逻辑应用参与者、参与者或所有者。
重要
在具有工作或学校帐户的委托方案中,必须为登录用户分配受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。
生命周期工作流管理员 是此作支持的最低特权角色。
HTTP 请求
POST /identityGovernance/lifecycleWorkflows/customTaskExtensions
| 名称 |
说明 |
| Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-Type |
application/json. 必需。 |
请求正文
在请求正文中,提供 customTaskExtension 对象的 JSON 表示形式。
在创建自定义 TaskExtension 时,可以指定以下属性。
响应
如果成功,此方法在 201 Created 响应正文中返回响应代码和 microsoft.graph.identityGovernance.customTaskExtension 对象。
示例
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/customTaskExtensions
Content-Type: application/json
Content-length: 588
{
"displayName": "Grant manager access to mailbox and OneDrive",
"description": "Grant manager access to mailbox and OneDrive",
"endpointConfiguration": {
"@odata.type": "#microsoft.graph.logicAppTriggerEndpointConfiguration",
"subscriptionId": "c500b67c-e9b7-4ad2-a90d-77d41385ae55",
"resourceGroupName": "RG-LCM",
"logicAppWorkflowName": "ManagerAccess"
},
"authenticationConfiguration": {
"@odata.type": "#microsoft.graph.azureAdTokenAuthentication",
"resourceId": "542dc01a-0b5d-4edc-b3f9-5cfe6393f557"
},
"clientConfiguration": {
"@odata.type": "#microsoft.graph.customExtensionClientConfiguration",
"maximumRetries": 1,
"timeoutInMilliseconds": 1000
},
"callbackConfiguration": {
"@odata.type": "#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration",
"timeoutDuration": "PT5M"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.IdentityGovernance;
using Microsoft.Graph.Beta.Models;
var requestBody = new CustomTaskExtension
{
DisplayName = "Grant manager access to mailbox and OneDrive",
Description = "Grant manager access to mailbox and OneDrive",
EndpointConfiguration = new LogicAppTriggerEndpointConfiguration
{
OdataType = "#microsoft.graph.logicAppTriggerEndpointConfiguration",
SubscriptionId = "c500b67c-e9b7-4ad2-a90d-77d41385ae55",
ResourceGroupName = "RG-LCM",
LogicAppWorkflowName = "ManagerAccess",
},
AuthenticationConfiguration = new AzureAdTokenAuthentication
{
OdataType = "#microsoft.graph.azureAdTokenAuthentication",
ResourceId = "542dc01a-0b5d-4edc-b3f9-5cfe6393f557",
},
ClientConfiguration = new CustomExtensionClientConfiguration
{
OdataType = "#microsoft.graph.customExtensionClientConfiguration",
MaximumRetries = 1,
TimeoutInMilliseconds = 1000,
},
CallbackConfiguration = new CustomTaskExtensionCallbackConfiguration
{
OdataType = "#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration",
TimeoutDuration = TimeSpan.Parse("PT5M"),
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.LifecycleWorkflows.CustomTaskExtensions.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsidentitygovernance "github.com/microsoftgraph/msgraph-beta-sdk-go/models/identitygovernance"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodelsidentitygovernance.NewCustomTaskExtension()
displayName := "Grant manager access to mailbox and OneDrive"
requestBody.SetDisplayName(&displayName)
description := "Grant manager access to mailbox and OneDrive"
requestBody.SetDescription(&description)
endpointConfiguration := graphmodels.NewLogicAppTriggerEndpointConfiguration()
subscriptionId := "c500b67c-e9b7-4ad2-a90d-77d41385ae55"
endpointConfiguration.SetSubscriptionId(&subscriptionId)
resourceGroupName := "RG-LCM"
endpointConfiguration.SetResourceGroupName(&resourceGroupName)
logicAppWorkflowName := "ManagerAccess"
endpointConfiguration.SetLogicAppWorkflowName(&logicAppWorkflowName)
requestBody.SetEndpointConfiguration(endpointConfiguration)
authenticationConfiguration := graphmodels.NewAzureAdTokenAuthentication()
resourceId := "542dc01a-0b5d-4edc-b3f9-5cfe6393f557"
authenticationConfiguration.SetResourceId(&resourceId)
requestBody.SetAuthenticationConfiguration(authenticationConfiguration)
clientConfiguration := graphmodels.NewCustomExtensionClientConfiguration()
maximumRetries := int32(1)
clientConfiguration.SetMaximumRetries(&maximumRetries)
timeoutInMilliseconds := int32(1000)
clientConfiguration.SetTimeoutInMilliseconds(&timeoutInMilliseconds)
requestBody.SetClientConfiguration(clientConfiguration)
callbackConfiguration := graphmodelsidentitygovernance.NewCustomTaskExtensionCallbackConfiguration()
timeoutDuration , err := abstractions.ParseISODuration("PT5M")
callbackConfiguration.SetTimeoutDuration(&timeoutDuration)
requestBody.SetCallbackConfiguration(callbackConfiguration)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
customTaskExtensions, err := graphClient.IdentityGovernance().LifecycleWorkflows().CustomTaskExtensions().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.identitygovernance.CustomTaskExtension customTaskExtension = new com.microsoft.graph.beta.models.identitygovernance.CustomTaskExtension();
customTaskExtension.setDisplayName("Grant manager access to mailbox and OneDrive");
customTaskExtension.setDescription("Grant manager access to mailbox and OneDrive");
LogicAppTriggerEndpointConfiguration endpointConfiguration = new LogicAppTriggerEndpointConfiguration();
endpointConfiguration.setOdataType("#microsoft.graph.logicAppTriggerEndpointConfiguration");
endpointConfiguration.setSubscriptionId("c500b67c-e9b7-4ad2-a90d-77d41385ae55");
endpointConfiguration.setResourceGroupName("RG-LCM");
endpointConfiguration.setLogicAppWorkflowName("ManagerAccess");
customTaskExtension.setEndpointConfiguration(endpointConfiguration);
AzureAdTokenAuthentication authenticationConfiguration = new AzureAdTokenAuthentication();
authenticationConfiguration.setOdataType("#microsoft.graph.azureAdTokenAuthentication");
authenticationConfiguration.setResourceId("542dc01a-0b5d-4edc-b3f9-5cfe6393f557");
customTaskExtension.setAuthenticationConfiguration(authenticationConfiguration);
CustomExtensionClientConfiguration clientConfiguration = new CustomExtensionClientConfiguration();
clientConfiguration.setOdataType("#microsoft.graph.customExtensionClientConfiguration");
clientConfiguration.setMaximumRetries(1);
clientConfiguration.setTimeoutInMilliseconds(1000);
customTaskExtension.setClientConfiguration(clientConfiguration);
com.microsoft.graph.beta.models.identitygovernance.CustomTaskExtensionCallbackConfiguration callbackConfiguration = new com.microsoft.graph.beta.models.identitygovernance.CustomTaskExtensionCallbackConfiguration();
callbackConfiguration.setOdataType("#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration");
PeriodAndDuration timeoutDuration = PeriodAndDuration.ofDuration(Duration.parse("PT5M"));
callbackConfiguration.setTimeoutDuration(timeoutDuration);
customTaskExtension.setCallbackConfiguration(callbackConfiguration);
com.microsoft.graph.models.identitygovernance.CustomTaskExtension result = graphClient.identityGovernance().lifecycleWorkflows().customTaskExtensions().post(customTaskExtension);
const options = {
authProvider,
};
const client = Client.init(options);
const customTaskExtension = {
displayName: 'Grant manager access to mailbox and OneDrive',
description: 'Grant manager access to mailbox and OneDrive',
endpointConfiguration: {
'@odata.type': '#microsoft.graph.logicAppTriggerEndpointConfiguration',
subscriptionId: 'c500b67c-e9b7-4ad2-a90d-77d41385ae55',
resourceGroupName: 'RG-LCM',
logicAppWorkflowName: 'ManagerAccess'
},
authenticationConfiguration: {
'@odata.type': '#microsoft.graph.azureAdTokenAuthentication',
resourceId: '542dc01a-0b5d-4edc-b3f9-5cfe6393f557'
},
clientConfiguration: {
'@odata.type': '#microsoft.graph.customExtensionClientConfiguration',
maximumRetries: 1,
timeoutInMilliseconds: 1000
},
callbackConfiguration: {
'@odata.type': '#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration',
timeoutDuration: 'PT5M'
}
};
await client.api('/identityGovernance/lifecycleWorkflows/customTaskExtensions')
.version('beta')
.post(customTaskExtension);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\IdentityGovernance\CustomTaskExtension;
use Microsoft\Graph\Beta\Generated\Models\LogicAppTriggerEndpointConfiguration;
use Microsoft\Graph\Beta\Generated\Models\AzureAdTokenAuthentication;
use Microsoft\Graph\Beta\Generated\Models\CustomExtensionClientConfiguration;
use Microsoft\Graph\Beta\Generated\Models\IdentityGovernance\CustomTaskExtensionCallbackConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CustomTaskExtension();
$requestBody->setDisplayName('Grant manager access to mailbox and OneDrive');
$requestBody->setDescription('Grant manager access to mailbox and OneDrive');
$endpointConfiguration = new LogicAppTriggerEndpointConfiguration();
$endpointConfiguration->setOdataType('#microsoft.graph.logicAppTriggerEndpointConfiguration');
$endpointConfiguration->setSubscriptionId('c500b67c-e9b7-4ad2-a90d-77d41385ae55');
$endpointConfiguration->setResourceGroupName('RG-LCM');
$endpointConfiguration->setLogicAppWorkflowName('ManagerAccess');
$requestBody->setEndpointConfiguration($endpointConfiguration);
$authenticationConfiguration = new AzureAdTokenAuthentication();
$authenticationConfiguration->setOdataType('#microsoft.graph.azureAdTokenAuthentication');
$authenticationConfiguration->setResourceId('542dc01a-0b5d-4edc-b3f9-5cfe6393f557');
$requestBody->setAuthenticationConfiguration($authenticationConfiguration);
$clientConfiguration = new CustomExtensionClientConfiguration();
$clientConfiguration->setOdataType('#microsoft.graph.customExtensionClientConfiguration');
$clientConfiguration->setMaximumRetries(1);
$clientConfiguration->setTimeoutInMilliseconds(1000);
$requestBody->setClientConfiguration($clientConfiguration);
$callbackConfiguration = new CustomTaskExtensionCallbackConfiguration();
$callbackConfiguration->setOdataType('#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration');
$callbackConfiguration->setTimeoutDuration(new \DateInterval('PT5M'));
$requestBody->setCallbackConfiguration($callbackConfiguration);
$result = $graphServiceClient->identityGovernance()->lifecycleWorkflows()->customTaskExtensions()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
$params = @{
displayName = "Grant manager access to mailbox and OneDrive"
description = "Grant manager access to mailbox and OneDrive"
endpointConfiguration = @{
"@odata.type" = "#microsoft.graph.logicAppTriggerEndpointConfiguration"
subscriptionId = "c500b67c-e9b7-4ad2-a90d-77d41385ae55"
resourceGroupName = "RG-LCM"
logicAppWorkflowName = "ManagerAccess"
}
authenticationConfiguration = @{
"@odata.type" = "#microsoft.graph.azureAdTokenAuthentication"
resourceId = "542dc01a-0b5d-4edc-b3f9-5cfe6393f557"
}
clientConfiguration = @{
"@odata.type" = "#microsoft.graph.customExtensionClientConfiguration"
maximumRetries = 1
timeoutInMilliseconds = 1000
}
callbackConfiguration = @{
"@odata.type" = "#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration"
timeoutDuration = "PT5M"
}
}
New-MgBetaIdentityGovernanceLifecycleWorkflowCustomTaskExtension -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.identity_governance.custom_task_extension import CustomTaskExtension
from msgraph_beta.generated.models.logic_app_trigger_endpoint_configuration import LogicAppTriggerEndpointConfiguration
from msgraph_beta.generated.models.azure_ad_token_authentication import AzureAdTokenAuthentication
from msgraph_beta.generated.models.custom_extension_client_configuration import CustomExtensionClientConfiguration
from msgraph_beta.generated.models.identity_governance.custom_task_extension_callback_configuration import CustomTaskExtensionCallbackConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CustomTaskExtension(
display_name = "Grant manager access to mailbox and OneDrive",
description = "Grant manager access to mailbox and OneDrive",
endpoint_configuration = LogicAppTriggerEndpointConfiguration(
odata_type = "#microsoft.graph.logicAppTriggerEndpointConfiguration",
subscription_id = "c500b67c-e9b7-4ad2-a90d-77d41385ae55",
resource_group_name = "RG-LCM",
logic_app_workflow_name = "ManagerAccess",
),
authentication_configuration = AzureAdTokenAuthentication(
odata_type = "#microsoft.graph.azureAdTokenAuthentication",
resource_id = "542dc01a-0b5d-4edc-b3f9-5cfe6393f557",
),
client_configuration = CustomExtensionClientConfiguration(
odata_type = "#microsoft.graph.customExtensionClientConfiguration",
maximum_retries = 1,
timeout_in_milliseconds = 1000,
),
callback_configuration = CustomTaskExtensionCallbackConfiguration(
odata_type = "#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration",
timeout_duration = "PT5M",
),
)
result = await graph_client.identity_governance.lifecycle_workflows.custom_task_extensions.post(request_body)
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/lifecycleWorkflows/customTaskExtensions/$entity",
"id": "ee2590e4-4572-4820-a397-969ecd7bd6a9",
"displayName": "Grant manager access to mailbox and OneDrive",
"description": "Grant manager access to mailbox and OneDrive",
"createdDateTime": "2022-08-24T22:37:46.1790566Z",
"lastModifiedDateTime": "2022-08-24T22:37:46.179062Z",
"endpointConfiguration": {
"@odata.type": "#microsoft.graph.logicAppTriggerEndpointConfiguration",
"subscriptionId": "c500b67c-e9b7-4ad2-a90d-77d41385ae55",
"resourceGroupName": "RG-LCM",
"logicAppWorkflowName": "ManagerAccess"
},
"authenticationConfiguration": {
"@odata.type": "#microsoft.graph.azureAdTokenAuthentication",
"resourceId": "542dc01a-0b5d-4edc-b3f9-5cfe6393f557"
},
"clientConfiguration": {
"@odata.type": "#microsoft.graph.customExtensionClientConfiguration",
"maximumRetries": 1,
"timeoutInMilliseconds": 1000
},
"callbackConfiguration": {
"@odata.type": "#microsoft.graph.identityGovernance.customTaskExtensionCallbackConfiguration",
"timeoutDuration": "PT5M"
}
}