Skip to content

manukanne/tutorial-az-func-iac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy an Azure Function using Bicep

This project illustrates how an Azure Function can be deployed as IaC via Bicep.

Description

The project provides the following Bicep templates:

  • Function App (without settings)
  • App Service Plan
  • Storage Account
  • Application Insights
  • Key Vault
  • Function App Settings

The individual resources can be found under the bicep/templates folder, these are all linked and deployed from the main.bicep file.

For more detailed information, please checkout my blog post 😃

Azure Function Resources Overview

Getting Started

Perquisites

  • Azure Account with an active subscription. In case you do not have an Azure Account, go ahead and create one for free here
  • Azure CLI
  • Bicep Tools for Azure CLI and VS Code

How to deploy the templates

Create a parameter file

The example parameter file looks like this:

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
      "storageAccountName": {
        "value": "stvm<storage-account-name>"
      },
      "storageAccountSku": {
        "value": "Standard_LRS"
      },
      "applicationInsightsName": {
          "value": "appi-<application-insights-name>"
      },
      "planName": {
          "value": "plan-<plan-name>"
      },
      "planOS": {
          "value": "Linux|Windows"
      },
      "functionAppName": {
          "value": "func-<plan-name>"
      },
      "functionAppRuntime": {
          "value": "dotnet|python|node|java"
      },
      "keyVaultName": {
          "value": "kv-<key-vault-name>"
      },
      "keyVaultSku": {
          "value": "standard"
      },
      "databaseConnectionString": {
          "value": ""
      }
    }
  }

Create a resource group

az group create -n <name> - <location>

ℹ️ If you want to deploy to an existing resource group, you can skip this step.

Deployment

az deployment group create \
  --name <deployment-name> \
  --resource-group <resource-group-name> \
  --template-file bicep\main.bicep
  --parameters @<path-to-parameters>

ℹ️ Before using the deployment command, please call az login and specify the subscription you want to use.

Authors

Contributors names and contact info:

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages