Skip to content

Add production-ready Azure Functions Terraform module - #34

Draft
llama90 with Copilot wants to merge 3 commits into
mainfrom
copilot/create-azure-functions-module
Draft

Add production-ready Azure Functions Terraform module#34
llama90 with Copilot wants to merge 3 commits into
mainfrom
copilot/create-azure-functions-module

Conversation

Copilot AI commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Type of Change

  • New module
  • Module enhancement
  • Bug fix
  • Docs / tooling only
  • Other (please describe):

Checklist

  • CI checks passed (terraform validate / tflint / trivy / terraform-docs)
  • No breaking changes, or breaking changes are documented

Module Information

Module Path: terraform/azure

Purpose:
Deploy Azure Functions with configurable runtime, scaling, monitoring, and identity management.

Key Resources:

  • azurerm_storage_account - Required backing storage for function state
  • azurerm_service_plan - Compute plan (Consumption/Premium/Dedicated)
  • azurerm_linux_function_app / azurerm_windows_function_app - Function runtime (OS-conditional)
  • azurerm_application_insights - Optional monitoring and telemetry

Implementation Details

Runtime Support

  • .NET (6/7/8) with isolated runtime option
  • Node.js (16/18/20), Python (3.8-3.11, Linux only)
  • Java (8/11/17), PowerShell (7.2/7.4)

Security Defaults

  • HTTPS-only traffic, TLS 1.2 minimum
  • FTPS disabled, managed identity support
  • Application Insights enabled by default

Scaling Options

  • Y1 (Consumption), EP1/2/3 (Premium), B/S/P SKUs (Dedicated)

Example Usage

module "api_function" {
  source = "github.com/your-org/infra-modules//terraform/azure?ref=v1.0.0"

  function_app_name      = "my-api-func"
  resource_group_name    = "my-rg"
  location               = "East US"
  storage_account_name   = "myapifunc12345"
  app_service_plan_name  = "my-plan"

  runtime_stack              = "dotnet"
  runtime_version            = "8"
  use_dotnet_isolated_runtime = true
  
  identity_type = "SystemAssigned"
  sku_name      = "EP1"  # Premium for production

  tags = {
    Environment = "production"
  }
}

Additional Notes

Based on terraform/s3 reference implementation. Azure provider v4.0+ requires authentication for plan operations—tests validate structure but may show auth errors in CI without credentials.

Six test scenarios cover Node.js, .NET with identity, Python with CORS, Java on Windows, PowerShell, and minimal configuration.


Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint-api.hashicorp.com
    • Triggering command: /usr/local/bin/terraform terraform version (dns block)
    • Triggering command: /usr/local/bin/terraform terraform fmt -recursive terraform/azure/ (dns block)
    • Triggering command: /usr/local/bin/terraform terraform init -backend=false (dns block)
  • get.trivy.dev
    • Triggering command: /usr/bin/curl curl -w %{http_code} -sL -o /tmp/tmp.HCgFiYepIt/trivy_0.68.2_Linux-64bit.tar.gz REDACTED (dns block)
  • https://api.github.com/repos/terraform-linters/tflint-ruleset-aws/releases/tags/v0.31.0
    • Triggering command: /usr/local/bin/tflint tflint --init --config=terraform/.tflint.hcl (http block)
  • login.microsoftonline.com
    • Triggering command: .terraform/providers/registry.terraform.io/hashicorp/azurerm/4.57.0/linux_amd64/terraform-provider-azurerm_v4.57.0_x5 .terraform/providers/registry.terraform.io/hashicorp/azurerm/4.57.0/linux_amd64/terraform-provider-azurerm_v4.57.0_x5 -u bin/WALinuxAgent-2.15.0.1-py3.12.egg -collect-logs (dns block)
    • Triggering command: .terraform/providers/registry.terraform.io/hashicorp/azurerm/4.57.0/linux_amd64/terraform-provider-azurerm_v4.57.0_x5 .terraform/providers/registry.terraform.io/hashicorp/azurerm/4.57.0/linux_amd64/terraform-provider-azurerm_v4.57.0_x5 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Create a production-ready Terraform module for Azure Functions under terraform/azure/, using terraform/s3/ as the reference implementation.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 18, 2025 23:29
Co-authored-by: llama90 <6668548+llama90@users.noreply.github.com>
…pported Windows Python runtime

Co-authored-by: llama90 <6668548+llama90@users.noreply.github.com>
Copilot AI changed the title [WIP] Create production-ready Terraform module for Azure Functions Add production-ready Azure Functions Terraform module Dec 18, 2025
Copilot AI requested a review from llama90 December 18, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants