-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logic Apps: support for connections #1691
Comments
hey @Kekedev Thanks for opening this issue :) So that we could understand the scope of this feature, do you have an example of the kind of fields available for a Logic App API Connection, such as an existing ARM Template? Thanks! |
azurerm_logic_app_api_connection
azurerm_logic_app_api_connection
Hi, thanks for the quick reply. 👍 Here is the template of my existing logic app that I want to automatize:
|
@Kekedev awesome thanks for confirming that. From the look of it this'd be an extension of the |
azurerm_logic_app_api_connection
Yes, actually when you create those through Azure portal, new resources object appear in my resource group. And within the schema of the app workflow it is only possible to find reference to those resource, and not the details of the resource creation themselves. Maybe that's also something that needs to be done on Azure side. |
From the looks of it, there will also need to be a new resource as I can't see an existing resource for the ARM side of things. Here's some examples I've used at work which creates the connections to be used by a logic app {
"type": "Microsoft.Web/connections",
"name": "[parameters('connections_servicebus_name')]",
"apiVersion": "2016-06-01",
"location": "northeurope",
"scale": null,
"properties": {
"displayName": "ServiceBus",
"api": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/',resourceGroup().location, '/managedApis/servicebus')]"
},
"parameterValues": {
"connectionString": "[listkeys(resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', parameters('serviceBusNamespace_name'), 'Listen'), '2017-04-01').primaryConnectionString]"
}
},
"dependsOn": []
} {
"type": "Microsoft.Web/connections",
"name": "[parameters('connections_documentdb_name')]",
"apiVersion": "2016-06-01",
"location": "northeurope",
"scale": null,
"properties": {
"displayName": "CosmosDB",
"api": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/',resourceGroup().location, '/managedApis/documentdb')]"
},
"parameterValues": {
"databaseAccount": "[parameters('databaseAccountsCache_name')]",
"accessKey": "[listKeys(resourceId('Microsoft.DocumentDb/databaseAccounts', parameters('databaseAccountsCache_name')), '2015-04-08').primaryMasterKey]"
}
},
"dependsOn": []
} {
"type": "Microsoft.Web/connections",
"name": "[variables('LogicApp_BlobStorageConnectionName')]",
"apiVersion": "2016-06-01",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"displayName": "BlobStorage",
"customParameterValues": {},
"parameterValues": {
"accountName": "[parameters('BlobStorageAccountName')]",
"accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('BlobStorageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]"
},
"api": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/', 'azureblob')]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('BlobStorageAccountName'))]"
]
} One of the main gotchas is the valid parameterValues entries depend on the type on connection, service bus, cosmos db etc. Thing's may have changed, but when I created a template a little while ago I had a hard time finding documentation for the valid entries. |
@scottrangerio @Kekedev thanks for that; given there's a bunch of different API connections we're probably best doing the same as we've done with the Logic App Actions/Triggers and having a type for the common ones, and then a "custom" one to allow folks to specify others - but it needs further investigation for sure :) |
I'm also facing missing connection enforce me to run terraform twice to complete logic app settings. original schema. "$connections": {
"value": {
"slack" : {
"connectionId": "/subscriptions/XXX-XXXresourceGroups/test/providers/Microsoft.Web/connections/slack-1",
"connectionName": "slack-1",
"id": "/subscriptions/XXX-XXX/providers/Microsoft.Web/locations/useast/managedApis/slack"
}
}
} terraform schema. resource "azurerm_logic_app_connection_custom" "slack" {
name = "slack"
logic_app_id = "${azurerm_logic_app_workflow.test.id}"
schema = <<SCHEMA
{
"connectionId": "/subscriptions/XXX-XXXresourceGroups/test/providers/Microsoft.Web/connections/slack-1",
"connectionName": "slack-1",
"id": "/subscriptions/XXX-XXX/providers/Microsoft.Web/locations/useast/managedApis/slack"
}
SCHEMA
} |
+1 Currently only fallback to arm template is possible. I'm I wrong? |
@guitarrapc I'm currently trying to configure a connection with slack in order to send alert notifications there in the future. Can you share, how did you eventually configure that connection? Why do you need to run terraform twice? |
@krysickij1 Because you cannnot run
|
@guitarrapc Thank you for a quick response. I have additional questions:
Do you mean by az portal or az cli? If the second is true - can you provide me with any documentation on how to do that?
I couldn't find any documentation on that topic here https://www.terraform.io/docs/providers/azurerm. Do you mean using the script posted by you above? |
I also would like to see support for API Connections in Logic Apps. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Our company is adopting Terraform as the standard for Azure scripting. I have a logic app that needs an ACI connection. Have you made any progress on this issue? It appears you need to be able to create the actual connection prior to referencing it in parameters.$connections. I don't see a function in azurerm for creating an ACI connection. |
@rkralston have a look at the Azure Sample here. Specifically this area of the terraform file. Hopefully that helps and gets you moving forward in lieu of this being fixed by Hashicorp. |
@brandonh-msft, just to be sure, there is no way with plain terraform script to deploy a Logic App Connection? |
None of which I'm aware. But it's a way of doing it until it's available in a more first-class fashion in terraform. |
We actually abandoned Logic apps over this and went with Functions. Logic
apps are over complicated when it comes to real world scenarios, they
should just retire them.
…On Fri, Jul 24, 2020, 11:03 AM Brandon H ***@***.***> wrote:
@brandonh-msft <https://github.com/brandonh-msft>, just to be sure, there
is no way with plain terraform script to deploy a Logic App Connection?
correct. But it's *a* way of doing it until it's available in a more
first-class fashion in terraform.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1691 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNCRHWUNUKBXA36EH6A7DDR5GWDPANCNFSM4FNBWJVA>
.
|
That's really frustrating. |
We can deploy connections using ARM templates. It stinks, but it works.
Just calling APIs from a function is 100% easier.
On Thu, Sep 3, 2020, 10:46 AM Guilherme Ramos Gouveia <
[email protected]> wrote:
… We actually abandoned Logic apps over this and went with Functions. Logic
apps are over complicated when it comes to real world scenarios, they
should just retire them.
… <#m_-1751850287361344604_>
On Fri, Jul 24, 2020, 11:03 AM Brandon H *@*.***> wrote: @brandonh-msft
<https://github.com/brandonh-msft> https://github.com/brandonh-msft, just
to be sure, there is no way with plain terraform script to deploy a Logic
App Connection? correct. But it's *a* way of doing it until it's
available in a more first-class fashion in terraform. — You are receiving
this because you commented. Reply to this email directly, view it on GitHub
<#1691 (comment)
<#1691 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABNCRHWUNUKBXA36EH6A7DDR5GWDPANCNFSM4FNBWJVA
.
That's really frustrating.
Definetely needed to map this resource into my terraform structure as my
team already created it via portal and we are using it extensively.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1691 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZELGSXPFQDD4UUST6W3DSD624RANCNFSM4FNBWJVA>
.
|
@rkralston Did that, but I'm now having some trouble with the authorization of this connection. |
This comment has been minimized.
This comment has been minimized.
Encountered this problem for the second time today. Looking at the documentation, there is a schema mentioned for "Microsoft.Web/connections". So, are their plans to do this? |
Started looking into this today, stumbled on Azure/azure-sdk-for-go#9393. Let's see whether something changed there. Without SDK support we can't do much here either unfortunately :( |
Seems this is still an issue, at least for me. I see in my terraform, I addind the workflow_schema and version (using the values found in terraform import. added $connections as a parameter following the 'map' syntax with that value "". seems native terraform support for azurerm_logic_app_action_custom only works for fairly simplistic actions that don't reach out and connect to anything. found this thread among others. tried azurerm_logic_app_connection_custom. failed, provider.azurerm doesn't support it. Looked at #7241. been open for almost a year now. It looks like the only way around this is the idea of embedding an ARM template within terraform, and doing the work to pass in parameters via terraform variables. It does work, but is ugly, purely because ARM is ugly. You can see https://shervyna.medium.com/deploying-logic-app-in-terraform-with-arm-template-ci-cd-e45295244872 for one solution. I've implemented a variant of this, only using (note the name attribute in that resource block doesn't seem to be used, the name of the logic app is really defined within the ARM template). resource "azurerm_template_deployment" "logicapp" { } I also modified the resource section for the "Microsoft.Logic/workflows", with "name": "[parameters('LogicApp_Name')]", As for the local.parameters_body? FYI, I created variables named prefix and environment with values I can overwrite in terraform via -var environment=qa It works, but again, as ugly as ARM templates, since it literally is ARM templates plus the terraform locals. |
Thanks to all the inputs above, I managed to terraform a few logic apps that connect to an sftp server and a blob storage.
That's part of the generated ARM template for a blob connection (in case of a logic app) from Azure. Notice the string parameter type in lowercase. (also validated by the schema per https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#) |
Hi, i am trying to create api connection through parameter options as per here but unable to do so and getting different error
Have tried multiple combinations but still getting these two error. Could you please help me out how to create API connection and associate with action? |
This unblocks hashicorp/terraform-provider-azurerm#1691 as the upstream issue hasn't been resolved Azure/azure-sdk-for-go#9393
This functionality has been released in v3.0.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
Add into Logic App Resource a resource that handles api connection creation and edition.
New or Affected Resource(s)
azurerm_logic_app_api_connection
(suggestion)
The text was updated successfully, but these errors were encountered: