https://pulumi.com logo
Title
m

mysterious-australia-14256

06/29/2021, 10:36 AM
Are there any dedicated modules to assist with creating an Azure Logic App Custom Connector or will I need to use a template deployment?
t

tall-librarian-49374

06/29/2021, 10:44 AM
Which resource would you use in the template?
m

mysterious-australia-14256

06/29/2021, 10:58 AM
I am trying to deploy a custom connector (from here). Looks like it is classified as "Microsoft.Web/customApis" so will have a dig in to that in the Pulumi Docs.
t

tall-librarian-49374

06/29/2021, 10:59 AM
Yeah, it should be the same in Azure-Native
👍 1
m

mysterious-australia-14256

06/29/2021, 2:13 PM
Struggling a bit with what to pass in for the swagger property in customapipropertiesdefinition. I am trying to pass in a string containing the swagger JSON read from a text file but am getting azure-native:web:CustomApi resource has a problem: 'properties.swagger' should be of type '' but got a string What can I pass in here? The docs just say 'object'
Looks like a JsonDocument doesn't work either
t

tall-librarian-49374

06/29/2021, 2:24 PM
Hmm… based on the “any” type in the docs, I suspect it wants a Dictionary<string, object>
An object with arbitrary properties (so, a dictionary in C#)
m

mysterious-australia-14256

06/29/2021, 2:55 PM
Just in case anyone else stumbles across this, it will also accept JsonDocument,RootElement.
🙏 1
OK I've managed to get this to deploy with all of the correct swagger etc. I am struggling to get the connection parameters section of the deployment to work though (i.e. the equivalent to line 18 here) This is the relevant code from the original ARM template
"connectionParameters": {
  "api_key": {
    "type": "securestring",
    "uiDefinition": {
      "displayName": "API Key",
      "description": "The API Key for this api",
      "tooltip": "Provide your API Key",
      "constraints": {
        "tabIndex": 2,
        "clearText": false,
        "required": "true"
      }
    }
  }
},
I can't see how to set the UiDefinition section when the type is Securestring (as opposed to OauthSetting).
As far as I can see there isn't a way to achieve this and it prevents me from being able to edit the API Key for any connections based off of the new connector. A workaround is to deploy the connector then go in and edit it, specifying that it needs to use an API Key. This populates the missing uiDefinition and allows everything to work. Somewhat defeats the purpose of automated deployment though :(
t

tall-librarian-49374

06/30/2021, 10:51 AM
m

mysterious-australia-14256

06/30/2021, 11:04 AM
Yes I did try that but it adds it in the wrong location for an API Key. It doesn't place the uiDefinition section at the level of Type, it places it under the OAuth section
t

tall-librarian-49374

06/30/2021, 11:09 AM
I assume the spec is wrong then. Do you want to ask this in https://github.com/Azure/azure-rest-api-specs/issues ?
👍 1