This message was deleted.
# azure
s
This message was deleted.
t
Which resource would you use in the template?
m
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
Yeah, it should be the same in Azure-Native
👍 1
m
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-nativewebCustomApi 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
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
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
Copy code
"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
m
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
I assume the spec is wrong then. Do you want to ask this in https://github.com/Azure/azure-rest-api-specs/issues ?
👍 1