[Azure] C# 透過 Microsoft.Azure.Management.Logic v4 列出執行的所有紀錄,透過程式執行 Trigger.

2021-01-22

上次文章介紹 C# 透過 Microsoft.Azure.Management.Logic v4 來控制已經建立的 Azure Logic App - 開關 Azure Logic App 服務 ,今天應該是最後一篇來介紹一下 Microsoft.Azure.Management.Logic v4 ,因為我就是紀錄一下,我需要用到的當然他功能不只如此只是我用到的只有這些..

前置作業,你得先安裝幾個 library : Microsoft.Azure.Management.Logic  , Microsoft.Azure.Management.ComputeMicrosoft.IdentityModel.Clients.ActiveDirectory

Step1. 請參考這篇文章 ( [Azure][C#] 產生有權限的憑證控制,透過 C# 控制 Azure 上面的服務 ) 拿到你需要的資訊(憑證) , 分別有 appId , password , tenant 這些都是後面步驟需要的。

Step2. 請參考 C# 透過 Microsoft.Azure.Management.Logic v4 來控制已經建立的 Azure Logic App - 開關 Azure Logic App 服務 裡面的 Step2 這樣你才可以拿到 Microsoft.Rest.ServiceClientCredentials


執行某個 Workflow Trigger:

記得要補上你的 SubscriptionId


取得所有執行紀錄:

result:

08585903343201841850512415882CU28@2021-01-21 23:42:45:Succeeded
08585903349203936697425213794CU19@2021-01-21 23:32:45:Succeeded
08585903355207553514099129443CU07@2021-01-21 23:22:44:Succeeded
08585903361208988283870134639CU22@2021-01-21 23:12:44:Succeeded
08585903367209787915036627742CU08@2021-01-21 23:02:44:Succeeded
08585903373215735328126165927CU06@2021-01-21 22:52:43:Succeeded
08585903379216495095882023482CU09@2021-01-21 22:42:43:Succeeded
08585903385219257981087136155CU14@2021-01-21 22:32:43:Succeeded
08585903391221054892962678784CU09@2021-01-21 22:22:43:Succeeded
08585903397223066482870369970CU19@2021-01-21 22:12:43:Succeeded
08585903403223950656858428771CU10@2021-01-21 22:02:43:Succeeded
08585903409227444333398911487CU29@2021-01-21 21:52:42:Succeeded
08585903415228511257742847005CU20@2021-01-21 21:42:42:Succeeded
08585903421232709615168358051CU14@2021-01-21 21:32:42:Succeeded
08585903427233625267059111830CU15@2021-01-21 21:22:42:Succeeded
08585903433235101069636246211CU03@2021-01-21 21:12:41:Succeeded
08585903439236243144486976148CU31@2021-01-21 21:02:41:Succeeded
08585903445237791233977486086CU26@2021-01-21 20:52:41:Succeeded
08585903451239214335925807079CU31@2021-01-21 20:42:41:Succeeded

@左邊的這邊號號是對應 你在 portal 那邊這個編號

這一系列先寫到這其實也才兩篇,原因是因為解決我目前需要的狀況,還有就是我個人覺得,單純我個人覺得,這遲早有一天會改,因為這 API 感覺進步空間還不小..


reference:

https://docs.microsoft.com/zh-tw/dotnet/api/microsoft.azure.management.logic.iworkflowtriggersoperations.runwithhttpmessagesasync?view=azure-dotnet

https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Microsoft.Azure.Management.Logic/4.1.0/api/Microsoft.Azure.Management.Logic/Microsoft.Azure.Management.Logic.IWorkflowTriggersOperations.html


當麻許的超技八 2014 | Donma Hsu Design.