-
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
azurerm_logic_app_standard throws error when working on private network #13780
Comments
Seeing the same issue on firewall protected storage accounts when provisioning the file share outside of the logic app resource and setting it using However, I am able to use the same fileshare when deploying the logic app using ARM and it works correctly. So a work around is to use deploy the fileshare and then deploy the logic app using azurerm_resource_group_template_deployment |
hi @dylanmorley any idea about above error? |
Hi! We're seeing the same error when attempting to deploy a logic_app_standard to an App Service Environment v3 with both the ASE v3 and the storage account in a private network and fully network isolated. We create all four private endpoint types for the storage account as instructed in the microsoft docs. Note especially the purple box with the link to an ARM template that successfully deploys a logic app in this case. Unfortunately, doing the same thing with the terraform provider fails at the logic app creation step due to inability to access the storage account: (the example takes 3+ hours to deploy because of the long creation time of ASE v3 and ASP)
We have also set the logic app parameters like the ARM template does, as described in this tech community post, that is:
Side Note: according to Microsoft's response to a ticket, it is not possible to share an ASE v3 between function apps and logic apps, you need to deploy a separate ASE v3 for logic apps to a separate subnet. I am not aware this is mentioned anywhere in the docs. Here is the complete code used to deploy the example, with some state storage and provider settings left out for privacy reasons, but it should still work as-is:
Just tried with v2.83.0 this morning, and the error still happens. |
I went through similar issues when I was first working on this, there's a comment from me here Azure/Azure-Functions#1361 (comment) and a nice explanation of what's going on under the hood from Jeff Hollan here How I'm currently doing this - I explicitly create the file share myself, and give that to the application settings. rather than relying on the underlying function app/app service infra to create the file share for me, e.g. 1 - Create storage account, no network restrictions I find with this order, I get a consistent and repeatable create and destroy process resource "azurerm_storage_account" "storage" {
name = var.storage_account_name
location = "northeurope"
resource_group_name = var.resource_group_name
account_tier = "Standard"
account_replication_type = "ZRS"
tags = var.tags
}
resource "random_string" "random_share_name" {
length = 15
special = false
lower = true
upper = false
}
resource "azurerm_storage_share" "storage" {
name = random_string.random_share_name.result
storage_account_name = azurerm_storage_account.storage.name
}
resource "azurerm_logic_app_standard" "logic_application" {
name = var.workflow_name
location = var.azure_location
resource_group_name = local.resource_group_name
app_service_plan_id = azurerm_app_service_plan.plan.id
storage_account_name = azurerm_storage_account.storage.name
storage_account_access_key = azurerm_storage_account.storage.primary_access_key
storage_account_share_name = azurerm_storage_share.storage.name
https_only = true
use_extension_bundle = false
app_settings = {
"FUNCTIONS_V2_COMPATIBILITY_MODE" = "true"
"APPLICATIONINSIGHTS_CONNECTION_STRING" = local.insights_connection_string
"APPINSIGHTS_INSTRUMENTATIONKEY" = var.instrumentation_key
"FUNCTIONS_WORKER_RUNTIME" = "node"
"WEBSITE_NODE_DEFAULT_VERSION" = "~12"
"WEBSITE_CONTENTOVERVNET" = var.use_vnet
}
site_config {
vnet_route_all_enabled = true
}
identity {
type = "SystemAssigned"
}
}
resource "azurerm_app_service_virtual_network_swift_connection" "logic_vnet" {
app_service_id = azurerm_logic_app_standard.logic_application.id
subnet_id = var.logic_app_subnet_id
}
resource "azurerm_storage_account_network_rules" "storage_rules" {
storage_account_id = azurerm_storage_account.storage.id
depends_on = [
azurerm_app_service_virtual_network_swift_connection.logic_vnet
]
default_action = "Deny"
virtual_network_subnet_ids = var.storage_account_subnet_ids
} I'll take a look at the linked issue/fix to 13566 and see if that's something we can bring over to this resource |
While this works on a technology level, there's a compliance & security issue. Specifically in our case, that means we would have to use a separate new storage account for every new Logic App - as the old one may contain customer/sensitive data in its workflow checkpoints, and it would thus not be acceptable to lift its network restrictions (even temporarily).
Thank you, very much appreciated. |
hey guys I created a PR #13964 to fix this issue Baically the problem is the app_settings creation order Currently the app settings defined in
The problem is there are some app_settings must be defined at creation time for example in order to create a logic app using storage account with private endpoints |
This functionality has been released in v2.84.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
Terraform (and AzureRM Provider) Version
Terraform Configuration Files
Description / Feedback
i would expect that the service would create without this error
Expected Behavior
terraform will complete as expected!
Actual Behavior
azurerm_logic_app_standard.fun-logic-app: Creating...
Error: web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="BadRequest" Message="Creation of storage file share failed with: 'The remote server returned an error: (403) Forbidden.'. Please check if the storage account is accessible." Details=[{"Message":"Creation of storage file share failed with: 'The remote server returned an error: (403) Forbidden.'. Please check if the storage account is accessible."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"99022","Message":"Creation of storage file share failed with: 'The remote server returned an error: (403) Forbidden.'. Please check if the storage account is accessible.","MessageTemplate":"Creation of storage file share failed with: '{0}'. Please check if the storage account is accessible.","Parameters":["The remote server returned an error: (403) Forbidden."]}}]
on test.tf line 44, in resource "azurerm_logic_app_standard" "fun-logic-app":
44: resource "azurerm_logic_app_standard" "fun-logic-app" {
References
this is identical to this issue
#13566
The text was updated successfully, but these errors were encountered: