├── .gitattributes ├── .gitignore ├── Example001_SimpleHelloWorld ├── .funcignore ├── .gitignore ├── .vscode │ ├── extensions.json │ ├── settings.json │ └── tasks.json ├── DelphiFunctionApp │ ├── DelphiAzure.WebModule.dfm │ ├── DelphiAzure.WebModule.pas │ ├── DelphiFunctionApp.dpr │ ├── DelphiFunctionApp.dproj │ └── DelphiFunctionApp.res ├── DelphiTrigger │ └── function.json ├── host.json └── proxies.json ├── Example002_ParsingRequestParameters ├── .funcignore ├── .gitignore ├── .vscode │ ├── extensions.json │ ├── settings.json │ └── tasks.json ├── DelphiFunctionApp │ ├── DelphiAzure.WebModule.dfm │ ├── DelphiAzure.WebModule.pas │ ├── DelphiFunctionApp.dpr │ ├── DelphiFunctionApp.dproj │ └── DelphiFunctionApp.res ├── DelphiTrigger │ └── function.json ├── host.json └── proxies.json ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * binary 3 | 4 | # Declare text files that will always have CRLF line endings on checkout 5 | *.gitattributes text eol=lf diff 6 | *.gitignore text eol=lf diff 7 | 8 | *.txt text eol=crlf diff 9 | *.md text eol=crlf diff 10 | *.xml text eol=crlf diff 11 | *.json text eol=crlf diff 12 | *.manifest text eol=crlf diff 13 | *.rc text eol=crlf diff 14 | *.bat text eol=crlf diff 15 | 16 | *.pas text eol=crlf diff 17 | *.inc text eol=crlf diff 18 | *.dfm text eol=crlf diff 19 | *.fmx text eol=crlf diff 20 | *.dpr text eol=crlf diff 21 | *.dpk text eol=crlf diff 22 | *.dproj text eol=crlf diff 23 | *.groupproj text eol=crlf diff 24 | *.deployproj text eol=crlf diff 25 | *.plist text eol=lf diff -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | *.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | *.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | *.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | *.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | *.delphilsp.json 60 | 61 | # Delphi history and backups 62 | __history/ 63 | __recovery/ 64 | *.~* 65 | 66 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 67 | *.stat 68 | 69 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss 70 | modules/ -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/.funcignore: -------------------------------------------------------------------------------- 1 | .git* 2 | .vscode 3 | local.settings.json 4 | test -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Azure Functions artifacts 3 | bin 4 | obj 5 | appsettings.json 6 | local.settings.json -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": ".", 3 | "azureFunctions.projectLanguage": "Custom", 4 | "azureFunctions.projectRuntime": "~3", 5 | "debug.internalConsoleOptions": "neverOpen" 6 | } -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "func", 6 | "command": "host start", 7 | "problemMatcher": "$func-watch", 8 | "isBackground": true 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/DelphiFunctionApp/DelphiAzure.WebModule.dfm: -------------------------------------------------------------------------------- 1 | object wmAzureFunction: TwmAzureFunction 2 | OldCreateOrder = False 3 | Actions = < 4 | item 5 | Default = True 6 | Name = 'DefaultHandler' 7 | PathInfo = '/' 8 | OnAction = WebModule1DefaultHandlerAction 9 | end> 10 | Height = 230 11 | Width = 415 12 | end 13 | -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/DelphiFunctionApp/DelphiAzure.WebModule.pas: -------------------------------------------------------------------------------- 1 | (* 2 | Demonstration of a simple HelloWorld Azure Functions App 3 | Written by: Glenn Dufke 4 | Copyright (c) 2021 5 | Version 0.1 6 | License: Apache 2.0 7 | *) 8 | 9 | unit DelphiAzure.WebModule; 10 | 11 | interface 12 | 13 | uses 14 | System.SysUtils, 15 | System.Classes, 16 | Web.HTTPApp; 17 | 18 | type 19 | TwmAzureFunction = class(TWebModule) 20 | procedure WebModule1DefaultHandlerAction(Sender: TObject; 21 | Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); 22 | private 23 | { Private declarations } 24 | public 25 | { Public declarations } 26 | end; 27 | 28 | var 29 | WebModuleClass: TComponentClass = TwmAzureFunction; 30 | FunctionRequested: Boolean = False; 31 | 32 | implementation 33 | 34 | {%CLASSGROUP 'System.Classes.TPersistent'} 35 | 36 | {$R *.dfm} 37 | 38 | uses 39 | System.JSON; 40 | 41 | procedure TwmAzureFunction.WebModule1DefaultHandlerAction(Sender: TObject; 42 | Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); 43 | const 44 | cJSON = 'application/json'; 45 | var 46 | LJSONObject: TJSONObject; 47 | begin 48 | LJSONObject := TJSONObject.Create; 49 | try 50 | LJSONObject.AddPair('HelloWorldFunction', TJSONBool.Create(False)); 51 | if Request.PathInfo.Equals('/api/DelphiTrigger') then 52 | begin 53 | Response.ContentType := cJSON; 54 | Response.Content := LJSONObject.ToJSON; 55 | FunctionRequested := True; 56 | end; 57 | finally 58 | LJSONObject.Free; 59 | end; 60 | end; 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/DelphiFunctionApp/DelphiFunctionApp.dpr: -------------------------------------------------------------------------------- 1 | (* 2 | Demonstration of a simple HelloWorld Azure Functions App 3 | Written by: Glenn Dufke 4 | Copyright (c) 2021 5 | Version 0.1 6 | License: Apache 2.0 7 | *) 8 | 9 | program DelphiFunctionApp; 10 | 11 | {$APPTYPE CONSOLE} 12 | 13 | uses 14 | System.SysUtils, 15 | System.Types, 16 | IPPeerServer, 17 | IPPeerAPI, 18 | IdHTTPWebBrokerBridge, 19 | Web.WebReq, 20 | Web.WebBroker, 21 | DelphiAzure.WebModule in 'DelphiAzure.WebModule.pas' {wmAzureFunction: TWebModule}; 22 | 23 | {$R *.res} 24 | 25 | function BindPort(APort: Integer): Boolean; 26 | var 27 | LTestServer: IIPTestServer; 28 | begin 29 | Result := True; 30 | try 31 | LTestServer := PeerFactory.CreatePeer(string.Empty, IIPTestServer) as IIPTestServer; 32 | LTestServer.TestOpenPort(APort, nil); 33 | except 34 | Result := False; 35 | end; 36 | end; 37 | 38 | function CheckPort(APort: Integer): Integer; 39 | begin 40 | if BindPort(APort) then 41 | Result := APort 42 | else 43 | Result := 0; 44 | end; 45 | 46 | procedure StartServer(const AServer: TIdHTTPWebBrokerBridge); 47 | begin 48 | if not AServer.Active then 49 | begin 50 | if CheckPort(AServer.DefaultPort) > 0 then 51 | begin 52 | AServer.Bindings.Clear; 53 | AServer.Active := True; 54 | end; 55 | end; 56 | end; 57 | 58 | procedure StopServer(const AServer: TIdHTTPWebBrokerBridge); 59 | begin 60 | if AServer.Active then 61 | begin 62 | AServer.Active := False; 63 | AServer.Bindings.Clear; 64 | end; 65 | end; 66 | 67 | procedure RunServer(APort: Integer); 68 | var 69 | LServer: TIdHTTPWebBrokerBridge; 70 | LCustomPortEnv: string; 71 | LTargetPort: integer; 72 | begin 73 | // Under the Function Apps Runtime, an environment variable with a custom port is exposed 74 | // We try to catch this port and use this instead of the default port 75 | LCustomPortEnv := GetEnvironmentVariable('FUNCTIONS_CUSTOMHANDLER_PORT'); 76 | if LCustomPortEnv.IsEmpty then 77 | LTargetPort := APort 78 | else 79 | LTargetPort := LCustomPortEnv.ToInteger; 80 | 81 | LServer := TIdHTTPWebBrokerBridge.Create(nil); 82 | try 83 | LServer.DefaultPort := LTargetPort; 84 | StartServer(LServer); 85 | while True do 86 | begin 87 | if FunctionRequested then 88 | begin 89 | { 90 | // This is not necessary, however if you want to perform an action, 91 | // once the request has been processed, you could do it here. 92 | if LServer.Active then 93 | begin 94 | StopServer(LServer); 95 | break 96 | end 97 | else 98 | break 99 | } 100 | end; 101 | end; 102 | finally 103 | LServer.Free; 104 | end; 105 | end; 106 | 107 | begin 108 | try 109 | if WebRequestHandler <> nil then 110 | begin 111 | WebRequestHandler.WebModuleClass := WebModuleClass; 112 | RunServer(8080); 113 | end; 114 | except 115 | on E: Exception do 116 | Writeln(E.ClassName, ': ', E.Message); 117 | end 118 | end. 119 | -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/DelphiFunctionApp/DelphiFunctionApp.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {8AF71A1E-B49D-4275-99E4-5DBC95E7C15C} 4 | 19.2 5 | None 6 | True 7 | Debug 8 | Win32 9 | 129 10 | Console 11 | DelphiFunctionApp.dpr 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Base 49 | true 50 | 51 | 52 | true 53 | Base 54 | true 55 | 56 | 57 | true 58 | Base 59 | true 60 | 61 | 62 | true 63 | Cfg_1 64 | true 65 | true 66 | 67 | 68 | true 69 | Base 70 | true 71 | 72 | 73 | true 74 | Cfg_2 75 | true 76 | true 77 | 78 | 79 | .\bin\HelloWorld-$(Platform)-$(Config) 80 | ..\ 81 | false 82 | false 83 | false 84 | false 85 | false 86 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 87 | $(BDS)\bin\delphi_PROJECTICON.ico 88 | $(BDS)\bin\delphi_PROJECTICNS.icns 89 | DelphiFunctionApp 90 | 91 | 92 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 93 | Debug 94 | android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar 95 | 96 | 97 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 98 | Debug 99 | android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar 100 | 101 | 102 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 103 | iPhoneAndiPad 104 | true 105 | Debug 106 | $(MSBuildProjectName) 107 | 108 | 109 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 110 | iPhoneAndiPad 111 | true 112 | 113 | 114 | RESTComponents;emsclientfiredac;DataSnapFireDAC;FireDACADSDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;inetdb;emsedge;fmx;FireDACIBDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;soapserver;bindengine;CloudService;FireDACOracleDriver;FireDACMySQLDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndySystem;FireDACDb2Driver;FireDACInfxDriver;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;rtl;emsserverresource;DbxClientDriver;CustomIPTransport;bindcomp;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;dbrtl;IndyProtocols;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) 115 | /usr/bin/xterm -e "%debuggee%" 116 | (None) 117 | 118 | 119 | CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 120 | Debug 121 | 122 | 123 | DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;MARSClient.FireDAC;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;svnui;DataSnapFireDAC;FireDACADSDriver;frx27;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;RaizeComponentsVcl;FmxTeeUI;emsedge;RaizeComponentsVclDb;fmx;FireDACIBDriver;fmxdae;vcledge;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;frxTee27;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;FMXfrxDB27;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;frxDB27;FMXfrx27;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;OverbyteIcsD104Run;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;ibxbindings;DBXSybaseASADriver;CustomIPTransport;vcldsnap;MARSClient.Core;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;frxe27;TeeUI;dmvcframeworkRT;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dmvcframeworkDT;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;FMXAppWizard;DataSnapServerMidas;$(DCC_UsePackage) 124 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 125 | Debug 126 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 127 | 1033 128 | (None) 129 | 130 | 131 | DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;RaizeComponentsVcl;FmxTeeUI;emsedge;RaizeComponentsVclDb;fmx;FireDACIBDriver;fmxdae;vcledge;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;OverbyteIcsD104Run;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;ibxbindings;DBXSybaseASADriver;CustomIPTransport;vcldsnap;MARSClient.Core;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) 132 | 133 | 134 | DEBUG;$(DCC_Define) 135 | true 136 | false 137 | true 138 | true 139 | true 140 | 141 | 142 | false 143 | 1033 144 | 145 | 146 | false 147 | RELEASE;$(DCC_Define) 148 | 0 149 | 0 150 | 151 | 152 | 1033 153 | 154 | 155 | 156 | MainSource 157 | 158 | 159 |
wmAzureFunction
160 | dfm 161 | TWebModule 162 |
163 | 164 | Cfg_2 165 | Base 166 | 167 | 168 | Base 169 | 170 | 171 | Cfg_1 172 | Base 173 | 174 |
175 | 176 | Delphi.Personality.12 177 | Console 178 | 179 | 180 | 181 | DelphiFunctionApp.dpr 182 | 183 | 184 | Embarcadero C++Builder Office 2000 Servers Package 185 | Embarcadero C++Builder Office XP Servers Package 186 | Microsoft Office 2000 Sample Automation Server Wrapper Components 187 | Microsoft Office XP Sample Automation Server Wrapper Components 188 | 189 | 190 | 191 | 192 | 193 | true 194 | 195 | 196 | 197 | 198 | true 199 | 200 | 201 | 202 | 203 | true 204 | 205 | 206 | 207 | 208 | DelphiFunctionApp.exe 209 | true 210 | 211 | 212 | 213 | 214 | 1 215 | 216 | 217 | 0 218 | 219 | 220 | 221 | 222 | classes 223 | 1 224 | 225 | 226 | classes 227 | 1 228 | 229 | 230 | 231 | 232 | res\xml 233 | 1 234 | 235 | 236 | res\xml 237 | 1 238 | 239 | 240 | 241 | 242 | library\lib\armeabi-v7a 243 | 1 244 | 245 | 246 | 247 | 248 | library\lib\armeabi 249 | 1 250 | 251 | 252 | library\lib\armeabi 253 | 1 254 | 255 | 256 | 257 | 258 | library\lib\armeabi-v7a 259 | 1 260 | 261 | 262 | 263 | 264 | library\lib\mips 265 | 1 266 | 267 | 268 | library\lib\mips 269 | 1 270 | 271 | 272 | 273 | 274 | library\lib\armeabi-v7a 275 | 1 276 | 277 | 278 | library\lib\arm64-v8a 279 | 1 280 | 281 | 282 | 283 | 284 | library\lib\armeabi-v7a 285 | 1 286 | 287 | 288 | 289 | 290 | res\drawable 291 | 1 292 | 293 | 294 | res\drawable 295 | 1 296 | 297 | 298 | 299 | 300 | res\values 301 | 1 302 | 303 | 304 | res\values 305 | 1 306 | 307 | 308 | 309 | 310 | res\values-v21 311 | 1 312 | 313 | 314 | res\values-v21 315 | 1 316 | 317 | 318 | 319 | 320 | res\values 321 | 1 322 | 323 | 324 | res\values 325 | 1 326 | 327 | 328 | 329 | 330 | res\drawable 331 | 1 332 | 333 | 334 | res\drawable 335 | 1 336 | 337 | 338 | 339 | 340 | res\drawable-xxhdpi 341 | 1 342 | 343 | 344 | res\drawable-xxhdpi 345 | 1 346 | 347 | 348 | 349 | 350 | res\drawable-xxxhdpi 351 | 1 352 | 353 | 354 | res\drawable-xxxhdpi 355 | 1 356 | 357 | 358 | 359 | 360 | res\drawable-ldpi 361 | 1 362 | 363 | 364 | res\drawable-ldpi 365 | 1 366 | 367 | 368 | 369 | 370 | res\drawable-mdpi 371 | 1 372 | 373 | 374 | res\drawable-mdpi 375 | 1 376 | 377 | 378 | 379 | 380 | res\drawable-hdpi 381 | 1 382 | 383 | 384 | res\drawable-hdpi 385 | 1 386 | 387 | 388 | 389 | 390 | res\drawable-xhdpi 391 | 1 392 | 393 | 394 | res\drawable-xhdpi 395 | 1 396 | 397 | 398 | 399 | 400 | res\drawable-mdpi 401 | 1 402 | 403 | 404 | res\drawable-mdpi 405 | 1 406 | 407 | 408 | 409 | 410 | res\drawable-hdpi 411 | 1 412 | 413 | 414 | res\drawable-hdpi 415 | 1 416 | 417 | 418 | 419 | 420 | res\drawable-xhdpi 421 | 1 422 | 423 | 424 | res\drawable-xhdpi 425 | 1 426 | 427 | 428 | 429 | 430 | res\drawable-xxhdpi 431 | 1 432 | 433 | 434 | res\drawable-xxhdpi 435 | 1 436 | 437 | 438 | 439 | 440 | res\drawable-xxxhdpi 441 | 1 442 | 443 | 444 | res\drawable-xxxhdpi 445 | 1 446 | 447 | 448 | 449 | 450 | res\drawable-small 451 | 1 452 | 453 | 454 | res\drawable-small 455 | 1 456 | 457 | 458 | 459 | 460 | res\drawable-normal 461 | 1 462 | 463 | 464 | res\drawable-normal 465 | 1 466 | 467 | 468 | 469 | 470 | res\drawable-large 471 | 1 472 | 473 | 474 | res\drawable-large 475 | 1 476 | 477 | 478 | 479 | 480 | res\drawable-xlarge 481 | 1 482 | 483 | 484 | res\drawable-xlarge 485 | 1 486 | 487 | 488 | 489 | 490 | res\values 491 | 1 492 | 493 | 494 | res\values 495 | 1 496 | 497 | 498 | 499 | 500 | 1 501 | 502 | 503 | 1 504 | 505 | 506 | 0 507 | 508 | 509 | 510 | 511 | 1 512 | .framework 513 | 514 | 515 | 1 516 | .framework 517 | 518 | 519 | 0 520 | 521 | 522 | 523 | 524 | 1 525 | .dylib 526 | 527 | 528 | 1 529 | .dylib 530 | 531 | 532 | 0 533 | .dll;.bpl 534 | 535 | 536 | 537 | 538 | 1 539 | .dylib 540 | 541 | 542 | 1 543 | .dylib 544 | 545 | 546 | 1 547 | .dylib 548 | 549 | 550 | 1 551 | .dylib 552 | 553 | 554 | 1 555 | .dylib 556 | 557 | 558 | 0 559 | .bpl 560 | 561 | 562 | 563 | 564 | 0 565 | 566 | 567 | 0 568 | 569 | 570 | 0 571 | 572 | 573 | 0 574 | 575 | 576 | 0 577 | 578 | 579 | 0 580 | 581 | 582 | 0 583 | 584 | 585 | 0 586 | 587 | 588 | 589 | 590 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 591 | 1 592 | 593 | 594 | 595 | 596 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 597 | 1 598 | 599 | 600 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 601 | 1 602 | 603 | 604 | 605 | 606 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 607 | 1 608 | 609 | 610 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 611 | 1 612 | 613 | 614 | 615 | 616 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 617 | 1 618 | 619 | 620 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 621 | 1 622 | 623 | 624 | 625 | 626 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 627 | 1 628 | 629 | 630 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 631 | 1 632 | 633 | 634 | 635 | 636 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 637 | 1 638 | 639 | 640 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 641 | 1 642 | 643 | 644 | 645 | 646 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 647 | 1 648 | 649 | 650 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 651 | 1 652 | 653 | 654 | 655 | 656 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 657 | 1 658 | 659 | 660 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 661 | 1 662 | 663 | 664 | 665 | 666 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 667 | 1 668 | 669 | 670 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 671 | 1 672 | 673 | 674 | 675 | 676 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 677 | 1 678 | 679 | 680 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 681 | 1 682 | 683 | 684 | 685 | 686 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 687 | 1 688 | 689 | 690 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 691 | 1 692 | 693 | 694 | 695 | 696 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 697 | 1 698 | 699 | 700 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 701 | 1 702 | 703 | 704 | 705 | 706 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 707 | 1 708 | 709 | 710 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 711 | 1 712 | 713 | 714 | 715 | 716 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 717 | 1 718 | 719 | 720 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 721 | 1 722 | 723 | 724 | 725 | 726 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 727 | 1 728 | 729 | 730 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 731 | 1 732 | 733 | 734 | 735 | 736 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 737 | 1 738 | 739 | 740 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 741 | 1 742 | 743 | 744 | 745 | 746 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 747 | 1 748 | 749 | 750 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 751 | 1 752 | 753 | 754 | 755 | 756 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 757 | 1 758 | 759 | 760 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 761 | 1 762 | 763 | 764 | 765 | 766 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 767 | 1 768 | 769 | 770 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 771 | 1 772 | 773 | 774 | 775 | 776 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 777 | 1 778 | 779 | 780 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 781 | 1 782 | 783 | 784 | 785 | 786 | 1 787 | 788 | 789 | 1 790 | 791 | 792 | 793 | 794 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 795 | 1 796 | 797 | 798 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 799 | 1 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 1 808 | 809 | 810 | 1 811 | 812 | 813 | 1 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | Contents\Resources 822 | 1 823 | 824 | 825 | Contents\Resources 826 | 1 827 | 828 | 829 | 830 | 831 | library\lib\armeabi-v7a 832 | 1 833 | 834 | 835 | library\lib\arm64-v8a 836 | 1 837 | 838 | 839 | 1 840 | 841 | 842 | 1 843 | 844 | 845 | 1 846 | 847 | 848 | 1 849 | 850 | 851 | 1 852 | 853 | 854 | 1 855 | 856 | 857 | 0 858 | 859 | 860 | 861 | 862 | library\lib\armeabi-v7a 863 | 1 864 | 865 | 866 | 867 | 868 | 1 869 | 870 | 871 | 1 872 | 873 | 874 | 875 | 876 | Assets 877 | 1 878 | 879 | 880 | Assets 881 | 1 882 | 883 | 884 | 885 | 886 | Assets 887 | 1 888 | 889 | 890 | Assets 891 | 1 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | False 907 | False 908 | False 909 | False 910 | True 911 | False 912 | True 913 | False 914 | 915 | 916 | 12 917 | 918 | 919 | 920 | 921 |
922 | -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/DelphiFunctionApp/DelphiFunctionApp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-kungfu/Delphi-AzureFunctionApps/db88335cb19342bb265edd0a752d1c24cd6320f6/Example001_SimpleHelloWorld/DelphiFunctionApp/DelphiFunctionApp.res -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/DelphiTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "type": "httpTrigger", 6 | "direction": "in", 7 | "name": "req", 8 | "methods": [ 9 | "get", 10 | "post" 11 | ] 12 | }, 13 | { 14 | "type": "http", 15 | "direction": "out", 16 | "name": "res" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | }, 11 | "extensionBundle": { 12 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 13 | "version": "[2.*, 3.0.0)" 14 | }, 15 | "customHandler": { 16 | "description": { 17 | "defaultExecutablePath": "delphifunctionapp.exe", 18 | "workingDirectory": "", 19 | "arguments": [] 20 | }, 21 | "enableForwardingHttpRequest": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Example001_SimpleHelloWorld/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/proxies", 3 | "proxies": {} 4 | } 5 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/.funcignore: -------------------------------------------------------------------------------- 1 | .git* 2 | .vscode 3 | local.settings.json 4 | test -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Azure Functions artifacts 3 | bin 4 | obj 5 | appsettings.json 6 | local.settings.json -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": ".", 3 | "azureFunctions.projectLanguage": "Custom", 4 | "azureFunctions.projectRuntime": "~3", 5 | "debug.internalConsoleOptions": "neverOpen" 6 | } -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "func", 6 | "command": "host start", 7 | "problemMatcher": "$func-watch", 8 | "isBackground": true 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/DelphiFunctionApp/DelphiAzure.WebModule.dfm: -------------------------------------------------------------------------------- 1 | object wmAzureFunction: TwmAzureFunction 2 | OldCreateOrder = False 3 | Actions = < 4 | item 5 | Default = True 6 | Name = 'DefaultHandler' 7 | PathInfo = '/' 8 | OnAction = WebModule1DefaultHandlerAction 9 | end> 10 | Height = 230 11 | Width = 415 12 | end 13 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/DelphiFunctionApp/DelphiAzure.WebModule.pas: -------------------------------------------------------------------------------- 1 | (* 2 | Demonstration of a Parse Query Params Azure Functions App 3 | Written by: Glenn Dufke 4 | Copyright (c) 2021 5 | Version 0.1 6 | License: Apache 2.0 7 | *) 8 | 9 | unit DelphiAzure.WebModule; 10 | 11 | interface 12 | 13 | uses 14 | System.SysUtils, 15 | System.Classes, 16 | Web.HTTPApp; 17 | 18 | type 19 | TwmAzureFunction = class(TWebModule) 20 | procedure WebModule1DefaultHandlerAction(Sender: TObject; 21 | Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); 22 | private 23 | { Private declarations } 24 | public 25 | { Public declarations } 26 | end; 27 | 28 | var 29 | WebModuleClass: TComponentClass = TwmAzureFunction; 30 | FunctionRequested: Boolean = False; 31 | 32 | implementation 33 | 34 | {%CLASSGROUP 'System.Classes.TPersistent'} 35 | 36 | {$R *.dfm} 37 | 38 | uses 39 | System.JSON; 40 | 41 | procedure TwmAzureFunction.WebModule1DefaultHandlerAction(Sender: TObject; 42 | Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); 43 | const 44 | cJSON = 'application/json'; 45 | var 46 | LJSONObject: TJSONObject; 47 | begin 48 | LJSONObject := TJSONObject.Create; 49 | try 50 | if Request.PathInfo.Equals('/api/DelphiTrigger') then 51 | begin 52 | if Request.QueryFields.Count = 3 then 53 | begin 54 | LJSONObject.AddPair('PersonName', TJSONString.Create(Request.QueryFields.Values['Name'])); 55 | LJSONObject.AddPair('PersonAge', TJSONNumber.Create(Request.QueryFields.Values['Age'].ToDouble)); 56 | LJSONObject.AddPair('PersonIsAdult', TJSONBool.Create(Request.QueryFields.Values['Adult'].ToBoolean)); 57 | end 58 | else 59 | LJSONObject.AddPair('Error', 'Not enough parameters'); 60 | Response.ContentType := cJSON; 61 | Response.Content := LJSONObject.ToJSON; 62 | FunctionRequested := True; 63 | end; 64 | finally 65 | LJSONObject.Free; 66 | end; 67 | end; 68 | 69 | end. 70 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/DelphiFunctionApp/DelphiFunctionApp.dpr: -------------------------------------------------------------------------------- 1 | (* 2 | Demonstration of a Parse Query Params Azure Functions App 3 | Written by: Glenn Dufke 4 | Copyright (c) 2021 5 | Version 0.1 6 | License: Apache 2.0 7 | *) 8 | 9 | program DelphiFunctionApp; 10 | 11 | {$APPTYPE CONSOLE} 12 | 13 | uses 14 | System.SysUtils, 15 | System.Types, 16 | IPPeerServer, 17 | IPPeerAPI, 18 | IdHTTPWebBrokerBridge, 19 | Web.WebReq, 20 | Web.WebBroker, 21 | DelphiAzure.WebModule in 'DelphiAzure.WebModule.pas' {wmAzureFunction: TWebModule}; 22 | 23 | {$R *.res} 24 | 25 | function BindPort(APort: Integer): Boolean; 26 | var 27 | LTestServer: IIPTestServer; 28 | begin 29 | Result := True; 30 | try 31 | LTestServer := PeerFactory.CreatePeer(string.Empty, IIPTestServer) as IIPTestServer; 32 | LTestServer.TestOpenPort(APort, nil); 33 | except 34 | Result := False; 35 | end; 36 | end; 37 | 38 | function CheckPort(APort: Integer): Integer; 39 | begin 40 | if BindPort(APort) then 41 | Result := APort 42 | else 43 | Result := 0; 44 | end; 45 | 46 | procedure StartServer(const AServer: TIdHTTPWebBrokerBridge); 47 | begin 48 | if not AServer.Active then 49 | begin 50 | if CheckPort(AServer.DefaultPort) > 0 then 51 | begin 52 | AServer.Bindings.Clear; 53 | AServer.Active := True; 54 | end; 55 | end; 56 | end; 57 | 58 | procedure StopServer(const AServer: TIdHTTPWebBrokerBridge); 59 | begin 60 | if AServer.Active then 61 | begin 62 | AServer.Active := False; 63 | AServer.Bindings.Clear; 64 | end; 65 | end; 66 | 67 | procedure RunServer(APort: Integer); 68 | var 69 | LServer: TIdHTTPWebBrokerBridge; 70 | LCustomPortEnv: string; 71 | LTargetPort: integer; 72 | begin 73 | // Under the Function Apps Runtime, an environment variable with a custom port is exposed 74 | // We try to catch this port and use this instead of the default port 75 | LCustomPortEnv := GetEnvironmentVariable('FUNCTIONS_CUSTOMHANDLER_PORT'); 76 | if LCustomPortEnv.IsEmpty then 77 | LTargetPort := APort 78 | else 79 | LTargetPort := LCustomPortEnv.ToInteger; 80 | 81 | LServer := TIdHTTPWebBrokerBridge.Create(nil); 82 | try 83 | LServer.DefaultPort := LTargetPort; 84 | StartServer(LServer); 85 | while True do 86 | begin 87 | if FunctionRequested then 88 | begin 89 | { 90 | // This is not necessary, however if you want to perform an action, 91 | // once the request has been processed, you could do it here. 92 | if LServer.Active then 93 | begin 94 | StopServer(LServer); 95 | break 96 | end 97 | else 98 | break 99 | } 100 | end; 101 | end; 102 | finally 103 | LServer.Free; 104 | end; 105 | end; 106 | 107 | begin 108 | try 109 | if WebRequestHandler <> nil then 110 | begin 111 | WebRequestHandler.WebModuleClass := WebModuleClass; 112 | RunServer(8080); 113 | end; 114 | except 115 | on E: Exception do 116 | Writeln(E.ClassName, ': ', E.Message); 117 | end 118 | end. 119 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/DelphiFunctionApp/DelphiFunctionApp.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {8AF71A1E-B49D-4275-99E4-5DBC95E7C15C} 4 | 19.2 5 | None 6 | True 7 | Debug 8 | Win32 9 | 129 10 | Console 11 | DelphiFunctionApp.dpr 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Base 49 | true 50 | 51 | 52 | true 53 | Base 54 | true 55 | 56 | 57 | true 58 | Base 59 | true 60 | 61 | 62 | true 63 | Cfg_1 64 | true 65 | true 66 | 67 | 68 | true 69 | Base 70 | true 71 | 72 | 73 | true 74 | Cfg_2 75 | true 76 | true 77 | 78 | 79 | .\bin\ParseParams-$(Platform)-$(Config) 80 | ..\ 81 | false 82 | false 83 | false 84 | false 85 | false 86 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 87 | $(BDS)\bin\delphi_PROJECTICON.ico 88 | $(BDS)\bin\delphi_PROJECTICNS.icns 89 | DelphiFunctionApp 90 | 91 | 92 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 93 | Debug 94 | android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar 95 | 96 | 97 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 98 | Debug 99 | android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar 100 | 101 | 102 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 103 | iPhoneAndiPad 104 | true 105 | Debug 106 | $(MSBuildProjectName) 107 | 108 | 109 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 110 | iPhoneAndiPad 111 | true 112 | 113 | 114 | RESTComponents;emsclientfiredac;DataSnapFireDAC;FireDACADSDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;inetdb;emsedge;fmx;FireDACIBDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;soapserver;bindengine;CloudService;FireDACOracleDriver;FireDACMySQLDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndySystem;FireDACDb2Driver;FireDACInfxDriver;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;rtl;emsserverresource;DbxClientDriver;CustomIPTransport;bindcomp;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;dbrtl;IndyProtocols;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) 115 | /usr/bin/xterm -e "%debuggee%" 116 | (None) 117 | 118 | 119 | CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 120 | Debug 121 | 122 | 123 | DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;MARSClient.FireDAC;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;svnui;DataSnapFireDAC;FireDACADSDriver;frx27;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;RaizeComponentsVcl;FmxTeeUI;emsedge;RaizeComponentsVclDb;fmx;FireDACIBDriver;fmxdae;vcledge;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;frxTee27;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;FMXfrxDB27;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;frxDB27;FMXfrx27;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;OverbyteIcsD104Run;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;ibxbindings;DBXSybaseASADriver;CustomIPTransport;vcldsnap;MARSClient.Core;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;frxe27;TeeUI;dmvcframeworkRT;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dmvcframeworkDT;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;FMXAppWizard;DataSnapServerMidas;$(DCC_UsePackage) 124 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 125 | Debug 126 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 127 | 1033 128 | (None) 129 | 130 | 131 | DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;tethering;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;RaizeComponentsVcl;FmxTeeUI;emsedge;RaizeComponentsVclDb;fmx;FireDACIBDriver;fmxdae;vcledge;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;OverbyteIcsD104Run;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;ibxbindings;DBXSybaseASADriver;CustomIPTransport;vcldsnap;MARSClient.Core;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) 132 | 133 | 134 | DEBUG;$(DCC_Define) 135 | true 136 | false 137 | true 138 | true 139 | true 140 | 141 | 142 | false 143 | 1033 144 | 145 | 146 | false 147 | RELEASE;$(DCC_Define) 148 | 0 149 | 0 150 | 151 | 152 | 1033 153 | 154 | 155 | 156 | MainSource 157 | 158 | 159 |
wmAzureFunction
160 | dfm 161 | TWebModule 162 |
163 | 164 | Cfg_2 165 | Base 166 | 167 | 168 | Base 169 | 170 | 171 | Cfg_1 172 | Base 173 | 174 |
175 | 176 | Delphi.Personality.12 177 | Console 178 | 179 | 180 | 181 | DelphiFunctionApp.dpr 182 | 183 | 184 | Embarcadero C++Builder Office 2000 Servers Package 185 | Embarcadero C++Builder Office XP Servers Package 186 | Microsoft Office 2000 Sample Automation Server Wrapper Components 187 | Microsoft Office XP Sample Automation Server Wrapper Components 188 | 189 | 190 | 191 | 192 | 193 | true 194 | 195 | 196 | 197 | 198 | true 199 | 200 | 201 | 202 | 203 | true 204 | 205 | 206 | 207 | 208 | DelphiFunctionApp.exe 209 | true 210 | 211 | 212 | 213 | 214 | 1 215 | 216 | 217 | 0 218 | 219 | 220 | 221 | 222 | classes 223 | 1 224 | 225 | 226 | classes 227 | 1 228 | 229 | 230 | 231 | 232 | res\xml 233 | 1 234 | 235 | 236 | res\xml 237 | 1 238 | 239 | 240 | 241 | 242 | library\lib\armeabi-v7a 243 | 1 244 | 245 | 246 | 247 | 248 | library\lib\armeabi 249 | 1 250 | 251 | 252 | library\lib\armeabi 253 | 1 254 | 255 | 256 | 257 | 258 | library\lib\armeabi-v7a 259 | 1 260 | 261 | 262 | 263 | 264 | library\lib\mips 265 | 1 266 | 267 | 268 | library\lib\mips 269 | 1 270 | 271 | 272 | 273 | 274 | library\lib\armeabi-v7a 275 | 1 276 | 277 | 278 | library\lib\arm64-v8a 279 | 1 280 | 281 | 282 | 283 | 284 | library\lib\armeabi-v7a 285 | 1 286 | 287 | 288 | 289 | 290 | res\drawable 291 | 1 292 | 293 | 294 | res\drawable 295 | 1 296 | 297 | 298 | 299 | 300 | res\values 301 | 1 302 | 303 | 304 | res\values 305 | 1 306 | 307 | 308 | 309 | 310 | res\values-v21 311 | 1 312 | 313 | 314 | res\values-v21 315 | 1 316 | 317 | 318 | 319 | 320 | res\values 321 | 1 322 | 323 | 324 | res\values 325 | 1 326 | 327 | 328 | 329 | 330 | res\drawable 331 | 1 332 | 333 | 334 | res\drawable 335 | 1 336 | 337 | 338 | 339 | 340 | res\drawable-xxhdpi 341 | 1 342 | 343 | 344 | res\drawable-xxhdpi 345 | 1 346 | 347 | 348 | 349 | 350 | res\drawable-xxxhdpi 351 | 1 352 | 353 | 354 | res\drawable-xxxhdpi 355 | 1 356 | 357 | 358 | 359 | 360 | res\drawable-ldpi 361 | 1 362 | 363 | 364 | res\drawable-ldpi 365 | 1 366 | 367 | 368 | 369 | 370 | res\drawable-mdpi 371 | 1 372 | 373 | 374 | res\drawable-mdpi 375 | 1 376 | 377 | 378 | 379 | 380 | res\drawable-hdpi 381 | 1 382 | 383 | 384 | res\drawable-hdpi 385 | 1 386 | 387 | 388 | 389 | 390 | res\drawable-xhdpi 391 | 1 392 | 393 | 394 | res\drawable-xhdpi 395 | 1 396 | 397 | 398 | 399 | 400 | res\drawable-mdpi 401 | 1 402 | 403 | 404 | res\drawable-mdpi 405 | 1 406 | 407 | 408 | 409 | 410 | res\drawable-hdpi 411 | 1 412 | 413 | 414 | res\drawable-hdpi 415 | 1 416 | 417 | 418 | 419 | 420 | res\drawable-xhdpi 421 | 1 422 | 423 | 424 | res\drawable-xhdpi 425 | 1 426 | 427 | 428 | 429 | 430 | res\drawable-xxhdpi 431 | 1 432 | 433 | 434 | res\drawable-xxhdpi 435 | 1 436 | 437 | 438 | 439 | 440 | res\drawable-xxxhdpi 441 | 1 442 | 443 | 444 | res\drawable-xxxhdpi 445 | 1 446 | 447 | 448 | 449 | 450 | res\drawable-small 451 | 1 452 | 453 | 454 | res\drawable-small 455 | 1 456 | 457 | 458 | 459 | 460 | res\drawable-normal 461 | 1 462 | 463 | 464 | res\drawable-normal 465 | 1 466 | 467 | 468 | 469 | 470 | res\drawable-large 471 | 1 472 | 473 | 474 | res\drawable-large 475 | 1 476 | 477 | 478 | 479 | 480 | res\drawable-xlarge 481 | 1 482 | 483 | 484 | res\drawable-xlarge 485 | 1 486 | 487 | 488 | 489 | 490 | res\values 491 | 1 492 | 493 | 494 | res\values 495 | 1 496 | 497 | 498 | 499 | 500 | 1 501 | 502 | 503 | 1 504 | 505 | 506 | 0 507 | 508 | 509 | 510 | 511 | 1 512 | .framework 513 | 514 | 515 | 1 516 | .framework 517 | 518 | 519 | 0 520 | 521 | 522 | 523 | 524 | 1 525 | .dylib 526 | 527 | 528 | 1 529 | .dylib 530 | 531 | 532 | 0 533 | .dll;.bpl 534 | 535 | 536 | 537 | 538 | 1 539 | .dylib 540 | 541 | 542 | 1 543 | .dylib 544 | 545 | 546 | 1 547 | .dylib 548 | 549 | 550 | 1 551 | .dylib 552 | 553 | 554 | 1 555 | .dylib 556 | 557 | 558 | 0 559 | .bpl 560 | 561 | 562 | 563 | 564 | 0 565 | 566 | 567 | 0 568 | 569 | 570 | 0 571 | 572 | 573 | 0 574 | 575 | 576 | 0 577 | 578 | 579 | 0 580 | 581 | 582 | 0 583 | 584 | 585 | 0 586 | 587 | 588 | 589 | 590 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 591 | 1 592 | 593 | 594 | 595 | 596 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 597 | 1 598 | 599 | 600 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 601 | 1 602 | 603 | 604 | 605 | 606 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 607 | 1 608 | 609 | 610 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 611 | 1 612 | 613 | 614 | 615 | 616 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 617 | 1 618 | 619 | 620 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 621 | 1 622 | 623 | 624 | 625 | 626 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 627 | 1 628 | 629 | 630 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 631 | 1 632 | 633 | 634 | 635 | 636 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 637 | 1 638 | 639 | 640 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 641 | 1 642 | 643 | 644 | 645 | 646 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 647 | 1 648 | 649 | 650 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 651 | 1 652 | 653 | 654 | 655 | 656 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 657 | 1 658 | 659 | 660 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 661 | 1 662 | 663 | 664 | 665 | 666 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 667 | 1 668 | 669 | 670 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 671 | 1 672 | 673 | 674 | 675 | 676 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 677 | 1 678 | 679 | 680 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 681 | 1 682 | 683 | 684 | 685 | 686 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 687 | 1 688 | 689 | 690 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 691 | 1 692 | 693 | 694 | 695 | 696 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 697 | 1 698 | 699 | 700 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 701 | 1 702 | 703 | 704 | 705 | 706 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 707 | 1 708 | 709 | 710 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 711 | 1 712 | 713 | 714 | 715 | 716 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 717 | 1 718 | 719 | 720 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 721 | 1 722 | 723 | 724 | 725 | 726 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 727 | 1 728 | 729 | 730 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 731 | 1 732 | 733 | 734 | 735 | 736 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 737 | 1 738 | 739 | 740 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 741 | 1 742 | 743 | 744 | 745 | 746 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 747 | 1 748 | 749 | 750 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 751 | 1 752 | 753 | 754 | 755 | 756 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 757 | 1 758 | 759 | 760 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 761 | 1 762 | 763 | 764 | 765 | 766 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 767 | 1 768 | 769 | 770 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 771 | 1 772 | 773 | 774 | 775 | 776 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 777 | 1 778 | 779 | 780 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 781 | 1 782 | 783 | 784 | 785 | 786 | 1 787 | 788 | 789 | 1 790 | 791 | 792 | 793 | 794 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 795 | 1 796 | 797 | 798 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 799 | 1 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 1 808 | 809 | 810 | 1 811 | 812 | 813 | 1 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | Contents\Resources 822 | 1 823 | 824 | 825 | Contents\Resources 826 | 1 827 | 828 | 829 | 830 | 831 | library\lib\armeabi-v7a 832 | 1 833 | 834 | 835 | library\lib\arm64-v8a 836 | 1 837 | 838 | 839 | 1 840 | 841 | 842 | 1 843 | 844 | 845 | 1 846 | 847 | 848 | 1 849 | 850 | 851 | 1 852 | 853 | 854 | 1 855 | 856 | 857 | 0 858 | 859 | 860 | 861 | 862 | library\lib\armeabi-v7a 863 | 1 864 | 865 | 866 | 867 | 868 | 1 869 | 870 | 871 | 1 872 | 873 | 874 | 875 | 876 | Assets 877 | 1 878 | 879 | 880 | Assets 881 | 1 882 | 883 | 884 | 885 | 886 | Assets 887 | 1 888 | 889 | 890 | Assets 891 | 1 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | False 907 | False 908 | False 909 | False 910 | True 911 | False 912 | True 913 | False 914 | 915 | 916 | 12 917 | 918 | 919 | 920 | 921 |
922 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/DelphiFunctionApp/DelphiFunctionApp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-kungfu/Delphi-AzureFunctionApps/db88335cb19342bb265edd0a752d1c24cd6320f6/Example002_ParsingRequestParameters/DelphiFunctionApp/DelphiFunctionApp.res -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/DelphiTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "type": "httpTrigger", 6 | "direction": "in", 7 | "name": "req", 8 | "methods": [ 9 | "get", 10 | "post" 11 | ] 12 | }, 13 | { 14 | "type": "http", 15 | "direction": "out", 16 | "name": "res" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | }, 11 | "extensionBundle": { 12 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 13 | "version": "[2.*, 3.0.0)" 14 | }, 15 | "customHandler": { 16 | "description": { 17 | "defaultExecutablePath": "delphifunctionapp.exe", 18 | "workingDirectory": "", 19 | "arguments": [] 20 | }, 21 | "enableForwardingHttpRequest": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Example002_ParsingRequestParameters/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/proxies", 3 | "proxies": {} 4 | } 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Delphi-AzureFunctionApps 2 | Demo examples of how to take advantage of Azure Function Apps with #Delphi 3 | 4 | This repository contains demo examples of how you can set up an Azure Functions App in Delphi. 5 | 6 | Read the blog post [here](https://code-kungfu.com/delphi-demystified/9-getting-started-with-azure-function-apps-in-delphi.html) 7 | 8 | Or watch the webinar hosted on the Embarcadero YouTube Channel [here](https://youtu.be/NihVuXeW5Qo) 9 | 10 | Feel free to fork and improve on the demos. 11 | Pull requests are accepted with bug fixes and new examples. 12 | If you submit a new example, please follow the folder naming standard. 13 | Thank you, and happy hacking! 14 | 15 | 16 | License: Apache 2.0 17 | See the LICENSE file. 18 | --------------------------------------------------------------------------------