简体   繁体   English

Azure 逻辑应用程序 REST API

[英]Azure logic apps REST API

I'm trying to automatically deploy an azure logic app with a managed connector to MS To Do.我正在尝试使用托管连接器将 azure 逻辑应用程序自动部署到 MS To Do。 The resourcegroup, the logic app itself and the api connection are deployed via Azure devops and to this point everything is working fine.资源组、逻辑应用程序本身和 api 连接通过 Azure devops 部署,到目前为止一切正常。 I also wrote some Javascript Code for retrieving an access token for the api connection, but I'm failing at calling the REST API for the updating the API connection. I also wrote some Javascript Code for retrieving an access token for the api connection, but I'm failing at calling the REST API for the updating the API connection. I looked up the MS documentation and was able to do the GET request for the resource, but the documentation for updating a resource is utter crap and I just don't get how to do it.我查阅了 MS 文档并能够对资源执行GET请求,但更新资源的文档完全是废话,我只是不知道该怎么做。

https://docs.microsoft.com/en-us/rest/api/resources/resources https://docs.microsoft.com/en-us/rest/api/resources/resources

I think the URI is right, because like mentioned above, the GET request is working.我认为 URI 是正确的,因为如上所述, GET请求正在工作。 Here's how it looks:这是它的外观:

PATCH/PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/O365I-Deployment-Test/providers/microsoft.web/connections/to-do?api-version=2015-08-01-preview

I just don't know what the body of the request should look like to update the api connection's access token.我只是不知道更新 api 连接的访问令牌的请求正文应该是什么样子。

I know there is a powershell script out there that can establish the connection, but I would prefer to do it this way.我知道有一个 powershell 脚本可以建立连接,但我更愿意这样做。

The access and refresh tokens are not actually exposed via the ARM REST APIs to update in this manner.访问和刷新令牌实际上并未通过 ARM REST API 公开,以便以这种方式更新。 You can however fetch the consent links, open to authorize and confirm the consent code acquired from the final redirect in the popup, which the powershell script showcases.但是,您可以获取同意链接,打开以授权并确认从弹出窗口中的最终重定向获得的同意代码,powershell 脚本展示了该代码。

The several ways to work around authorization are listed in the docs with the one requiring minimal setup is to re-use preauthorized connection resources, which works as long as they are in the same region as the logic app.文档中列出了解决授权的几种方法,其中一种需要最少设置的方法是重新使用预授权的连接资源,只要它们与逻辑应用程序位于同一区域即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM