49
loading...
This website collects cookies to deliver better user experience
brew tap azure/functions
brew install azure-functions-core-tools@3
brew update && brew install azure-cli
az login
func --version
to check that the Azure Functions Core Tools are version 3.x.az --version
to check that the Azure CLI version is 2.4 or later.az login
to sign in to Azure and verify an active subscription.dotnet --list-sdks
to check that .NET Core SDK version 3.1.x is installedfunc new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"
func start
http://localhost:7071/api/HttpExample?name=Mohamad
az login
az group create --name AzFunctionsDeepDive-rg --location uksouth
az storage account create --name azfuncstoragemldemo --location uksouth --resource-group AzFunctionsDeepDive-rg --sku Standard_LRS
az functionapp create --resource-group AzFunctionsDeepDive-rg --consumption-plan-location uksouth --runtime dotnet --functions-version 3 --name azfuncmldemo1 --storage-account azfuncstoragemldemo
func azure functionapp publish azfuncmldemo1
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
brew update
brew update && brew install azure-cli
az login
# we need to specify the provider that we are going to use
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=2.67.0"
}
}
}
provider "azurerm" {
features {
}
}
resource "azurerm_resource_group" "az_func_rg" {
name = "azure-functions-demo-rg"
location = "uksouth"
}
resource "azurerm_storage_account" "azfuncstorage" {
name = "azurefuncstoragesyt"
resource_group_name = azurerm_resource_group.az_func_rg.name
location = azurerm_resource_group.az_func_rg.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_app_service_plan" "az-func-sp" {
name = "azure-functions-service-plan"
location = azurerm_resource_group.az_func_rg.location
resource_group_name = azurerm_resource_group.az_func_rg.name
kind = "Linux"
reserved = true
sku {
tier = "Dynamic"
size = "Y1"
}
}
resource "azurerm_function_app" "supper-az-func" {
name = "super-azure-functions"
location = azurerm_resource_group.az_func_rg.location
resource_group_name = azurerm_resource_group.az_func_rg.name
app_service_plan_id = azurerm_app_service_plan.az-func-sp.id
storage_account_name = azurerm_storage_account.azfuncstorage.name
storage_account_access_key = azurerm_storage_account.azfuncstorage.primary_access_key
os_type = "linux"
}
az login # to login
terraform init
terraform plan
terraform apply
terraform destroy
49