Reputation: 11
We have some logic apps which we are trying to get fully deployable via IaC, our go to IaC is terraform.
We have it deploying the majority of everything that is needed but one aspect I am struggling with is the api connections. We have a few API Connections used by the logic app to access things such as Storage, Sendgrid and SQL Server.
One of the things I am really struggling with is how to add an access policy to allow the logic app to use the connection.
I have searched everywhere on the internet and can't find how to add this access policy on my azapi_resource without adding it manually once the connection has been deployed. I've looked on the JSON of the deployed api connection both before and after adding the access policy and it doesn't change.
resource "azapi_resource" "storage" {
type = "Microsoft.Web/connections@2018-07-01-preview"
name = "apic-storage-${var.env}"
parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${var.resource_group_name}"
location = "uksouth"
schema_validation_enabled = false
response_export_values = ["properties.connectionRuntimeUrl"]
tags = var.tags
body = {
kind = "V2"
properties = {
api = {
id = data.azurerm_managed_api.azureblob.id
}
displayName = "apic-storage-${var.env}"
parameterValueSet = {
name = "managedIdentityAuth"
values = {}
}
}
}
}
Upvotes: 1
Views: 34