Deploying File Mounts in Azure

I am deploying a File Mount in Azure using following code block:
resource “azapi_resource_action” “itp_storage_mount_config” {

# count = var.create_storage_mount ? 1 : 0

type = “Microsoft.Web/sites/config@2023-12-01”

resource_id = data.azapi_resource_id.config.id

method = “PUT”

body = {

name = "azurestorageaccounts"

properties = {

  ukitp = {

    type        = "FileShare"

    protocol    = "Smb"

    accountName = var.serviceacct_name  

    shareName   = var.file_system_itp_share_name

    accessKey   = "@AppSettingRef(SrvAcct_Pwd)"

    mountPath   = var.file_system_mount_path

    endpoint    = var.file_system_itp_endpoint  

  }

}

}

response_export_values = [

"properties.ukitp.mountPath",

"properties.ukitp.endpoint", 

"properties.ukitp.shareName",

"properties.ukitp.type",

"properties.ukitp.accountName",

"properties.ukitp.accessKey",

"properties.ukitp.protocol",

"name"

]

}

# Create the file share required for salespoints function app

resource “azurerm_storage_share” “bibitpsalespoints_content” {

name = “{var.environment}-{var.project}-func-{var.role}-{var.region}-content”

storage_account_name = data.azurerm_storage_account.functionapp.name

quota = “5000”

}

This is used in a Logic app. On subsequent deployments this error is thrown:
│ CreateOrUpdate: unexpected status 400 (400 Bad Request) with response:

│ {“Code”:“BadRequest”,“Message”:"The parameter ‘Endpoint’ has an invalid

│ value. Details: Endpoint cannot be empty for File Share storage

│ mounts.",“Target”:null,“Details”:[{“Message”:"The parameter ‘Endpoint’ has

│ an invalid value. Details: Endpoint cannot be empty for File Share storage

│ mounts."},{“Code”:“BadRequest”},{“ErrorEntity”:{“ExtendedCode”:“01033”,“MessageTemplate”:"The

│ parameter ‘{0}’ has an invalid value. Details:

│ {1}.",“Parameters”:[“Endpoint”,"Endpoint cannot be empty for File Share

│ storage mounts"],“Code”:“BadRequest”,“Message”:"The parameter ‘Endpoint’

│ has an invalid value. Details: Endpoint cannot be empty for File Share

│ storage mounts."}}],“Innererror”:null}

It looks like subsequent deployments attempt to create and/or update the the resource again, as though the TF State has not been maintained. Anyone come across this issue before, nb that we are using az api provider.

Thanks

Hello,

Same here, we used to deploy a CIFS share as a mount on a Logic App, this worked for months but since the latest azurerm provider upgrade (4.48) it shows the error 400 during TF apply,

│ Error: updating App Service (Subscription: “(redacted)”
│ Resource Group Name: “(redacted)”
│ Site Name: “(redacted)”): performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with response: {“Code”:“BadRequest”,“Message”:“The parameter ‘Endpoint’ has an invalid value. Details: Endpoint cannot be empty for File Share storage mounts.”,“Target”:null,“Details”:[{“Message”:“The parameter ‘Endpoint’ has an invalid value. Details: Endpoint cannot be empty for File Share storage mounts.”},{“Code”:“BadRequest”},{“ErrorEntity”:{“ExtendedCode”:“01033”,“MessageTemplate”:“The parameter ‘{0}’ has an invalid value. Details: {1}.”,“Parameters”:[“Endpoint”,“Endpoint cannot be empty for File Share storage mounts”],“Code”:“BadRequest”,“Message”:“The parameter ‘Endpoint’ has an invalid value. Details: Endpoint cannot be empty for File Share storage mounts.”}}],“Innererror”:null}

│ with module.(redacted).azurerm_logic_app_standard.lapp,
│ on modules\lapp-template\main.tf line 22, in resource “azurerm_logic_app_standard” “lapp”:
│ 22: resource “azurerm_logic_app_standard” “lapp” {

│ updating App Service (Subscription: “(redacted)”
│ Resource Group Name: “(redacted)”
│ Site Name: “(redacted)”): performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with response: {“Code”:“BadRequest”,“Message”:“The parameter ‘Endpoint’ has an invalid value. Details:
│ Endpoint cannot be empty for File Share storage mounts.”,“Target”:null,“Details”:[{“Message”:“The parameter ‘Endpoint’ has an invalid value. Details: Endpoint cannot be empty for File Share storage
│ mounts.”},{“Code”:“BadRequest”},{“ErrorEntity”:{“ExtendedCode”:“01033”,“MessageTemplate”:“The parameter ‘{0}’ has an invalid value. Details: {1}.”,“Parameters”:[“Endpoint”,“Endpoint cannot be empty for File
│ Share storage mounts”],“Code”:“BadRequest”,“Message”:“The parameter ‘Endpoint’ has an invalid value. Details: Endpoint cannot be empty for File Share storage mounts.”}}],“Innererror”:null}

Terraform version 1.11.2