如何在 .net 8 环境中使用 ServiceClient SDK 获取电源自动化中存在的流列表

问题描述 投票:0回答:1

我在 PowerAutomate 中创建了某些流程。某些 Outlook 配置文件已连接到此 Power Automate 帐户。 Som azure 云帐户已连接到它。当应用程序托管在 Azure AD B2C 上时,如何以租户身份访问以支持自动化流程? 任何指导表示赞赏。

我不知道从哪里获取

的值
url,userName,password,AppId,RedirectUri.
I simply want list of all flows in my power automate.
[HttpPost]
[Route("test")]
public Task<IActionResult> GetTestData()
{
    string url = "url";
    string userName = "someusername";
    string password = "somepassword";

    // This service connection string uses the info provided above.
    // The AppId and RedirectUri are provided for sample code testing.
    string connectionString = $@"
           AuthType = OAuth;
           Url = {url};
           UserName = {userName};
           Password = {password};
           AppId = ajdchkajs;
           RedirectUri =sdfsfjskjdfksd;
           LoginPrompt=Auto;
           RequireNewInstance = True";
    //RedirectUri = app://58145B91-0C36-4500-8554-080854F2AC97;

    IOrganizationService service = new ServiceClient(connectionString);

    var response = (WhoAmIResponse)service.Execute(new WhoAmIRequest());


    return null;
}
azure-web-app-service azure-ad-b2c power-automate power-platform dynamics-crm-sdk
1个回答
0
投票

您只能通过

IOrganizationService
界面列出已添加到 Dataverse 解决方案的 Power Automate 流。这些流在
workflow
表中获得一个条目。

以下是您可以使用 XRM 工具箱中的 SQL 4 CDS 插件执行的查询:

select
    w.name,
    w.typename,
    w.category,
    w.categoryname,
    w.modename,
    w.scopename,
    w.runasname,
    w.ismanaged,
    w.statuscode,
    w.statuscodename,
    w.createdbyname,
    w.modifiedbyname,
    w.createdon,
    w.modifiedon
from
    workflow w
where
    w.type = 1
    and w.ismanaged = 0
    and w.category = 5 -- PA Flow
    and w.statecode = 1 -- Active
order by
    w.name
© www.soinside.com 2019 - 2024. All rights reserved.