https://pulumi.com logo
#azure
Title
# azure
q

quiet-hairdresser-18834

01/12/2022, 5:30 PM
Anyone create an API Connection with an on premise data gateway via pulumi?
Copy code
const connection = new web.Connection("SqlConnection", {
    connectionName: "SqlServer",
    resourceGroupName: resourceGroup,
    properties: {
        displayName: "SqlServer",
        api: {
            id: apiId,
        },
        parameterValues: {
             server: sqlServer,
             database: "Logicapps",
             username: sqlUsername,
             password: sqlPassword,
             authType: "basic",
             //gateway: {
             //    id: "/subscriptions/"+ subscriptionId +"/resourceGroups/rg-LogicApps-DPTS/providers/Microsoft.Web/connectionGateways/gtwyvmsqlServer" 
             //}, 
             "gateway": "/subscriptions/" + subscriptionId + "/resourceGroups/rg-LogicApps-DPTS/providers/Microsoft.Web/connectionGateways/gtwyvmsqlServer",
        },
    },
});
The ARM templates I have seen (https://techcommunity.microsoft.com/t5/integrations-on-azure-blog/arm-template-for-creating-api-connection-to-on-premise-sql/ba-p/1450911) looks like it wants to create via
Copy code
gateway: {
  id: "/path/to/resource"
}
but when I try to mimic that in pulumi I get a casting exception and the docs (https://www.pulumi.com/registry/packages/azure-native/api-docs/web/connection/#apiconnectiondefinitionproperties) say that this field is a key:value field. Is there some sort of notation that can be used to send this or am I missing something?
3 Views