Repository: hashicorp/terraform-provider-azurerm (Go)

Issue:
azurerm_logic_app_integration_account not allowing underscore in the name
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Community Note

<!--- Please keep this note for the community --->

* Please vote on this issue by adding a :thumbsup: [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the [contribution guide](https://github.com/hashicorp/terraform-provider-azurerm/blob/main/contributing/README.md) to help.

<!--- Thank you for keeping this note for the community --->


### Terraform Version

1.8.5

### AzureRM Provider Version

3.109.0

### Affected Resource(s)/Data Source(s)

azurerm_logic_app_integration_account 

### Terraform Configuration Files

```hcl
resource "azurerm_logic_app_integration_account_schema" "s850" {
  name                     = "X12_00401_850"
  resource_group_name      = azurerm_resource_group.main.name
  integration_account_name = azurerm_logic_app_integration_account.main.name
  content                  = file("../schemas/X12_00401_850.xsd")
}
```


### Debug Output/Panic Output

```shell
Error: "name" contains only letters, numbers, dots, parentheses and hyphens.
│ 
│   with azurerm_logic_app_integration_account_schema.s850,
│   on resources.tf line 26, in resource "azurerm_logic_app_integration_account_schema" "s850":
│   26:   name                     = "X12_00401_850"
```


### Expected Behaviour

The resource should be created as defined.  Underscore is supported because when I make these files in the portal they are created without issue.

### Actual Behaviour

Error above happens.

### Steps to Reproduce

terraform init
terraform plan

### Important Factoids

_No response_

### References

_No response_


Discussion:
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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.



Patch:
diff --git a/internal/services/logic/validate/integration_account_schema_name.go b/internal/services/logic/validate/integration_account_schema_name.go
index 2864af84f056..f9bfb3614d93 100644
--- a/internal/services/logic/validate/integration_account_schema_name.go
+++ b/internal/services/logic/validate/integration_account_schema_name.go
@@ -23,8 +23,8 @@ func IntegrationAccountSchemaName() pluginsdk.SchemaValidateFunc {
 			return
 		}
 
-		if !regexp.MustCompile(`^[A-Za-z0-9-().]+$`).MatchString(v) {
-			errors = append(errors, fmt.Errorf("%q contains only letters, numbers, dots, parentheses and hyphens.", k))
+		if !regexp.MustCompile(`^[A-Za-z0-9-()._]+$`).MatchString(v) {
+			errors = append(errors, fmt.Errorf("%q contains only letters, numbers, dots, parentheses, hyphens and underscores", k))
 			return
 		}
 


Test patch:
diff --git a/internal/services/logic/validate/integration_account_schema_name_test.go b/internal/services/logic/validate/integration_account_schema_name_test.go
index ead8bf9101a2..c1b322bca3fc 100644
--- a/internal/services/logic/validate/integration_account_schema_name_test.go
+++ b/internal/services/logic/validate/integration_account_schema_name_test.go
@@ -42,6 +42,10 @@ func TestIntegrationAccountSchemaName(t *testing.T) {
 			input: strings.Repeat("s", 81),
 			valid: false,
 		},
+		{
+			input: "a2-.()b_",
+			valid: true,
+		},
 	}
 
 	validationFunction := IntegrationAccountSchemaName()