Skip to content

Commit

Permalink
azurerm_linux_function_app and azurerm_linux_function_app_slot re…
Browse files Browse the repository at this point in the history
…move `RequiredWith` constraints on app insights settings (#16134)
  • Loading branch information
jackofallops authored Mar 30, 2022
1 parent 61a1b54 commit 0640eee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 27 deletions.
36 changes: 12 additions & 24 deletions internal/services/appservice/helpers/function_app_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,17 @@ func SiteConfigSchemaLinuxFunctionApp() *pluginsdk.Schema {
},

"application_insights_key": {
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
RequiredWith: []string{
"site_config.0.application_insights_connection_string",
},
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
Description: "The Instrumentation Key for connecting the Linux Function App to Application Insights.",
},

"application_insights_connection_string": {
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
RequiredWith: []string{
"site_config.0.application_insights_key",
},
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
Description: "The Connection String for linking the Linux Function App to Application Insights.",
},
Expand Down Expand Up @@ -593,23 +587,17 @@ func SiteConfigSchemaWindowsFunctionApp() *pluginsdk.Schema {
},

"application_insights_key": {
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
RequiredWith: []string{
"site_config.0.application_insights_connection_string",
},
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
Description: "The Instrumentation Key for connecting the Windows Function App to Application Insights.",
},

"application_insights_connection_string": {
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
RequiredWith: []string{
"site_config.0.application_insights_key",
},
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
Description: "The Connection String for linking the Windows Function App to Application Insights.",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,6 @@ resource "azurerm_linux_function_app" "test" {
api_definition_url = "https://example.com/azure_function_app_def.json"
app_scale_limit = 3
// api_management_api_id = "" // TODO
application_insights_key = azurerm_application_insights.test.instrumentation_key
application_insights_connection_string = azurerm_application_insights.test.connection_string
container_registry_use_managed_identity = true
Expand Down Expand Up @@ -1964,7 +1963,6 @@ resource "azurerm_linux_function_app" "test" {
app_command_line = "whoami"
api_definition_url = "https://example.com/azure_function_app_def.json"
// api_management_api_id = "" // TODO
application_insights_key = azurerm_application_insights.test.instrumentation_key
application_insights_connection_string = azurerm_application_insights.test.connection_string
application_stack {
Expand Down Expand Up @@ -2097,7 +2095,6 @@ resource "azurerm_linux_function_app" "test" {
app_command_line = "whoami"
api_definition_url = "https://example.com/azure_function_app_def.json"
// api_management_api_id = "" // TODO
application_insights_key = azurerm_application_insights.test.instrumentation_key
application_insights_connection_string = azurerm_application_insights.test.connection_string
application_stack {
Expand Down

0 comments on commit 0640eee

Please sign in to comment.