Azure function networking setting

Faisal Qazi 0 Reputation points
2024-08-28T17:32:53.0733333+00:00

Azure function networking (Site access and rules) (Advanced tool site) setting Unmatched rule action to Deny. Unable to find setting in Terraform to set to Deny.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,095 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,631 Reputation points Microsoft Employee
    2024-08-30T01:52:13+00:00

    Hi @Faisal Qazi

    I'm not sure if you came across https://learn.microsoft.com/en-us/answers/questions/1242936/how-to-set-advanced-tool-site-access-restrictions; but you should be able to use the scm_ip_restriction block within the azurerm_function_app.

    Here's an example Terraform configuration:

    provider "azurerm" {
      features {}
    }
    
    resource "azurerm_resource_group" "example" {
      name     = "example-resources"
      location = "East US"
    }
    
    resource "azurerm_function_app" "example" {
      name                       = "example-function-app"
      location                   = azurerm_resource_group.example.location
      resource_group_name        = azurerm_resource_group.example.name
      app_service_plan_id        = azurerm_app_service_plan.example.id
      storage_account_name       = azurerm_storage_account.example.name
      storage_account_access_key = azurerm_storage_account.example.primary_access_key
    
      site_config {
        scm_ip_restriction {
          ip_address = "10.0.1.0/24"
          action     = "Deny"
        }
      }
    }
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.