diff --git a/azure-functions/app/.gitignore b/azure-functions/app/.gitignore
new file mode 100644
index 00000000..3c3f4e6a
--- /dev/null
+++ b/azure-functions/app/.gitignore
@@ -0,0 +1,264 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# Azure Functions localsettings file
+local.settings.json
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+#*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
\ No newline at end of file
diff --git a/azure-functions/app/Program.cs b/azure-functions/app/Program.cs
new file mode 100644
index 00000000..c76837e4
--- /dev/null
+++ b/azure-functions/app/Program.cs
@@ -0,0 +1,7 @@
+using Microsoft.Extensions.Hosting;
+
+var host = new HostBuilder()
+ .ConfigureFunctionsWorkerDefaults()
+ .Build();
+
+host.Run();
diff --git a/azure-functions/app/Properties/launchSettings.json b/azure-functions/app/Properties/launchSettings.json
new file mode 100644
index 00000000..00526ab4
--- /dev/null
+++ b/azure-functions/app/Properties/launchSettings.json
@@ -0,0 +1,9 @@
+{
+ "profiles": {
+ "app": {
+ "commandName": "Project",
+ "commandLineArgs": "--port 7245",
+ "launchBrowser": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/azure-functions/app/app.csproj b/azure-functions/app/app.csproj
new file mode 100644
index 00000000..d8b09843
--- /dev/null
+++ b/azure-functions/app/app.csproj
@@ -0,0 +1,27 @@
+
+
+ net6.0
+ v4
+ Exe
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+ Never
+
+
+
+
+
+
\ No newline at end of file
diff --git a/azure-functions/app/host.json b/azure-functions/app/host.json
new file mode 100644
index 00000000..809a3f20
--- /dev/null
+++ b/azure-functions/app/host.json
@@ -0,0 +1,11 @@
+{
+ "version": "2.0",
+ "logging": {
+ "applicationInsights": {
+ "samplingSettings": {
+ "isEnabled": true,
+ "excludedTypes": "Request"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/azure-functions/app/swift.cs b/azure-functions/app/swift.cs
new file mode 100644
index 00000000..6947fa2a
--- /dev/null
+++ b/azure-functions/app/swift.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Net;
+using Microsoft.Azure.Functions.Worker;
+using Microsoft.Azure.Functions.Worker.Http;
+using Microsoft.Extensions.Logging;
+using System.Data.SqlClient;
+
+namespace app
+{
+ public class swift
+ {
+ private readonly ILogger _logger;
+
+ public swift(ILoggerFactory loggerFactory)
+ {
+ _logger = loggerFactory.CreateLogger();
+ }
+
+ [Function("swift")]
+ public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req)
+ {
+ _logger.LogInformation("C# HTTP trigger function processed a request.");
+ string connetionString;
+ var connValue = Environment.GetEnvironmentVariable("connString");
+ var response = req.CreateResponse(HttpStatusCode.OK);
+ response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
+ SqlConnection cnn ;
+ connetionString = connValue;
+ cnn = new SqlConnection(connetionString);
+ try
+ {
+ cnn.Open();
+ Console.WriteLine("Connection Open ! ");
+ response.WriteString("Welcome to Azure Functions, Connection Open !");
+ cnn.Close();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine("Can not open connection ! ");
+ response.WriteString("Welcome to Azure Functions, Can not open connection !");
+ }
+ cnn.Close();
+
+ return response;
+ }
+ }
+}
diff --git a/azure-functions/infra/azure_storage.tf b/azure-functions/infra/azure_storage.tf
new file mode 100644
index 00000000..8f7b2a15
--- /dev/null
+++ b/azure-functions/infra/azure_storage.tf
@@ -0,0 +1,7 @@
+resource "azurerm_storage_account" "funcs" {
+ name = "azfunc${random_string.random.result}"
+ resource_group_name = var.resource_group
+ location = var.location
+ account_tier = "Standard"
+ account_replication_type = "LRS"
+}
\ No newline at end of file
diff --git a/azure-functions/infra/main.tf b/azure-functions/infra/main.tf
new file mode 100644
index 00000000..4470e80d
--- /dev/null
+++ b/azure-functions/infra/main.tf
@@ -0,0 +1,38 @@
+provider "azurerm" {
+ version = "= 3.21.1"
+ features {}
+}
+
+provider "random" {}
+
+resource "random_string" "random" {
+ length = 8
+ special = false
+ min_lower = 8
+}
+
+resource "random_password" "password" {
+ length = 16
+ special = true
+ override_special = "!#$%&*()-_=+[]{}<>:?"
+}
+
+resource "azurerm_app_service_plan" "funcs" {
+ name = "azfunc-service-plan${random_string.random.result}"
+ location = var.location
+ resource_group_name = var.resource_group
+
+ sku {
+ tier = var.app_service_tier
+ size = var.app_service_size
+ }
+}
+
+resource "azurerm_function_app" "funcs" {
+ name = "azfunc${random_string.random.result}"
+ location = var.location
+ resource_group_name = var.resource_group
+ app_service_plan_id = azurerm_app_service_plan.funcs.id
+ storage_account_name = azurerm_storage_account.funcs.name
+ storage_account_access_key = azurerm_storage_account.funcs.primary_access_key
+}
\ No newline at end of file
diff --git a/azure-functions/infra/mssql.tf b/azure-functions/infra/mssql.tf
new file mode 100644
index 00000000..3868434e
--- /dev/null
+++ b/azure-functions/infra/mssql.tf
@@ -0,0 +1,24 @@
+resource "azurerm_mssql_server" "main" {
+ name = "${var.mssql_server_name}-${random_string.random.result}"
+ resource_group_name = var.resource_group
+ location = var.location
+ version = var.mssql_server_version
+ administrator_login = var.mssql_server_username
+ administrator_login_password = random_password.password.result
+ minimum_tls_version = var.mssql_Server_minimum_tls_version
+
+ tags = var.tags
+}
+
+resource "azurerm_mssql_database" "main" {
+ name = "${var.mssql_server_name}-db"
+ server_id = azurerm_mssql_server.main.id
+ collation = var.mssql_db_collation
+ max_size_gb = var.mssql_db_max_size_gb
+ read_scale = var.mssql_read_scale
+ sku_name = var.mssql_db_sku_name
+ zone_redundant = var.mssql_db_zone_redundant
+ tags = var.tags
+ min_capacity = 0.5
+ auto_pause_delay_in_minutes = 60
+}
diff --git a/azure-functions/infra/output.tf b/azure-functions/infra/output.tf
new file mode 100644
index 00000000..67c50578
--- /dev/null
+++ b/azure-functions/infra/output.tf
@@ -0,0 +1,9 @@
+output "function_app" {
+ value = "${azurerm_function_app.funcs.name}"
+}
+
+output "database_connection_string" {
+ value = "Server=tcp:${azurerm_mssql_server.main.name}.database.windows.net,1433;Initial Catalog=${azurerm_mssql_database.main.name};Persist Security Info=False;User ID=${var.mssql_server_username};Password=${random_password.password.result};MultipleActiveResultSets=True;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
+ sensitive = true
+}
+
diff --git a/azure-functions/infra/variables.tf b/azure-functions/infra/variables.tf
new file mode 100644
index 00000000..b396c86e
--- /dev/null
+++ b/azure-functions/infra/variables.tf
@@ -0,0 +1,75 @@
+variable "resource_group" {
+ type = string
+ description = "Azure Resource Group Name"
+ default = ""
+}
+
+variable "location" {
+ type = string
+ description = "Azure Region Location"
+ default = "Southeast Asia"
+}
+
+variable "app_service_tier" {
+ type = string
+ description = "Tier of app service plan"
+ default = "Standard"
+}
+
+variable "app_service_size" {
+ type = string
+ description = "Tier of app service plan"
+ default = "S1"
+}
+
+#SQL Server Variables
+variable "mssql_server_name" {
+ description = "The name of the Microsoft SQL Server. This needs to be globally unique within Azure."
+ default = "mysqltest"
+}
+
+variable "mssql_server_version" {
+ description = "The version for the new server. Valid values are: 2.0 (for v11 server) and 12.0 (for v12 server)."
+ default = "12.0"
+}
+
+variable "mssql_server_username" {
+ description = "The administrator login name for the new server. Required unless azuread_authentication_only in the azuread_administrator block is true. When omitted, Azure will generate a default username which cannot be subsequently changed. Changing this forces a new resource to be created."
+ default = "dbadmin"
+}
+
+variable "mssql_Server_minimum_tls_version" {
+ description = "The Minimum TLS Version for all SQL Database and SQL Data Warehouse databases associated with the server. Valid values are: 1.0, 1.1 , 1.2 and Disabled. Defaults to 1.2."
+ default = "1.2"
+}
+
+variable "tags" {
+ description = "A mapping of tags to assign to the resource."
+ default = null
+}
+
+#SQL DB Variables
+variable "mssql_db_collation" {
+ description = "Specifies the collation of the database. Changing this forces a new resource to be created."
+ default = "SQL_Latin1_General_CP1_CI_AS"
+}
+
+variable "mssql_db_max_size_gb" {
+ description = " The max size of the database in gigabytes."
+ default = 4
+}
+
+variable "mssql_read_scale" {
+ description = " If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases."
+ default = false
+}
+
+variable "mssql_db_zone_redundant" {
+ description = "Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases."
+ default = false
+}
+
+variable "mssql_db_sku_name" {
+ description = "Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created."
+ default = "GP_S_Gen5_1"
+}