Flosse73
Flosse73

Reputation: 1

Azure logic apps REST API

I'm trying to automatically deploy an azure logic app with a managed connector to 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. 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.

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

I think the URI is right, because like mentioned above, the GET request is working. 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.

I know there is a powershell script out there that can establish the connection, but I would prefer to do it this way.

Upvotes: 0

Views: 612

Answers (1)

PramodValavala
PramodValavala

Reputation: 6647

The access and refresh tokens are not actually exposed via the ARM REST APIs to update in this manner. 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.

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.

Upvotes: 0

Related Questions