From 243aefe2db248f27baea48f879b15128fe4967c3 Mon Sep 17 00:00:00 2001
From: Timna Brown <24630902+brown9804@users.noreply.github.com>
Date: Thu, 28 Aug 2025 21:03:24 -0600
Subject: [PATCH 01/10] base terraform template
---
terraform-infrastructure/README.md | 153 +++++++++++++++++++++++++++++
1 file changed, 153 insertions(+)
create mode 100644 terraform-infrastructure/README.md
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
new file mode 100644
index 0000000..40be684
--- /dev/null
+++ b/terraform-infrastructure/README.md
@@ -0,0 +1,153 @@
+# Azure Logic Apps - Terraform Infrastructure
+
+Costa Rica
+
+[](https://github.com/)
+[brown9804](https://github.com/brown9804)
+
+Last updated: 2025-07-17
+
+----------
+
+> This approach focuses on `setting up the required infrastructure via Terraform`. It allows for source control of not only the solution code, connections, and setups `but also the infrastructure itself`. This repository specifically focuses on SAP integration with Azure Logic Apps, supporting both Stateful and Stateless workflow configurations.
+
+
+
![Centered Image]()
+
+
+> The Terraform configuration supports both Stateful and Stateless Logic Apps, which have different characteristics:
+> - `Stateful Logic Apps`:
+> - Retain complete run history
+> - Support long-running workflows (up to 1 year)
+> - Maintain state between requests (can handle session cookies)
+> - Support built-in retry policies
+> - Use when session persistence or workflow history is needed
+> - `Stateless Logic Apps`:
+> - No run history stored (lower cost)
+> - Faster execution
+> - Limited to 5-minute maximum execution time
+> - No state maintained between requests
+> - Use for simple integrations without session requirements
+
+## Prerequisites
+
+- An `Azure subscription is required`. All other resources, including instructions for creating a Resource Group, are provided in this workshop.
+- `Contributor role assigned or any custom role that allows`: access to manage all resources, and the ability to deploy resources within subscription.
+- Please ensure that:
+ - [Terraform is installed on your local machine](https://developer.hashicorp.com/terraform/tutorials/azure-get-started/install-cli#install-terraform).
+ - [Install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) to work with both Terraform and Azure commands.
+
+## Overview
+
+Templates structure:
+
+```
+.
+├── README.md
+├────── main.tf
+├────── variables.tf
+├────── provider.tf
+├────── terraform.tfvars
+├────── outputs.tf
+```
+
+- main.tf `(Main Terraform configuration file)`: This file contains the core infrastructure code. It defines the resources you want to create, such as virtual machines, networks, and storage. It's the primary file where you describe your infrastructure in a declarative manner.
+- variables.tf `(Variable definitions)`: This file is used to define variables that can be used throughout your Terraform configuration. By using variables, you can make your configuration more flexible and reusable. For example, you can define variables for resource names, sizes, and other parameters that might change between environments.
+- provider.tf `(Provider configurations)`: Providers are plugins that Terraform uses to interact with cloud providers, SaaS providers, and other APIs. This file specifies which providers (e.g., AWS, Azure, Google Cloud) you are using and any necessary configuration for them, such as authentication details.
+- terraform.tfvars `(Variable values)`: This file contains the actual values for the variables defined in `variables.tf`. By separating variable definitions and values, you can easily switch between different sets of values for different environments (e.g., development, staging, production) without changing the main configuration files.
+- outputs.tf `(Output values)`: This file defines the output values that Terraform should return after applying the configuration. Outputs are useful for displaying information about the resources created, such as IP addresses, resource IDs, and other important details. They can also be used as inputs for other Terraform configurations or scripts.
+
+## Finding `principal_id` Using Azure CLI
+
+> The `principal_id` is typically the Object ID of a user, group, or service principal in Azure Entra ID (former AAD). You can find this ID in the Azure portal or by using the Azure CLI.
+
+Get the Object ID of list of Users:
+
+```sh
+az ad user list --query "[].{Name:displayName, ObjectId:id, Email:userPrincipalName}" --output table
+```
+
+
+
+Here is an example value for `admin_principal_id` which is Object ID you retrieved.
+
+```hcl
+admin_principal_id = "12345678-1234-1234-1234-1234567890ab"
+```
+
+## How to execute it
+
+```mermaid
+graph TD;
+ A[az login] --> B(terraform init)
+ B --> C{Terraform provisioning stage}
+ C -->|Review| D[terraform plan]
+ C -->|Order Now| E[terraform apply]
+ C -->|Delete Resource if needed| F[terraform destroy]
+```
+
+> [!IMPORTANT]
+> Please modify `terraform.tfvars` with your information, then run the following flow. If you need more visual guidance, please check the video that illustrates the provisioning steps.
+
+1. **Login to Azure**: This command logs you into your Azure account. It opens a browser window where you can enter your Azure credentials. Once logged in, you can manage your Azure resources from the command line.
+
+ > Go to the path where Terraform files are located:
+
+ ```sh
+ cd terraform-infrastructure
+ ```
+
+ ```sh
+ az login
+ ```
+
+
+
+
+
+2. **Initialize Terraform**: Initializes the working directory containing the Terraform configuration files. It downloads the necessary provider plugins and sets up the backend for storing the state.
+
+ ``` sh
+ terraform init
+ ```
+
+
+
+3. **Terraform Provisioning Stage**:
+
+ - **Review**: Creates an execution plan, showing what actions Terraform will take to achieve the desired state defined in your configuration files. It uses the variable values specified in `terraform.tfvars`.
+
+ ```sh
+ terraform plan -var-file terraform.tfvars
+ ```
+
+ > At the end, you will see a message in green if everything was executed successfully:
+
+
+
+ - **Order Now**: Applies the changes required to reach the desired state of the configuration. It prompts for confirmation before making any changes. It also uses the variable values specified in `terraform.tfvars`.
+
+ ```sh
+ terraform apply -var-file terraform.tfvars
+ ```
+
+ > At the end, you will see a message in green if everything was executed successfully:
+
+
+
+ - **Remove**: Destroys the infrastructure managed by Terraform. It prompts for confirmation before deleting any resources. It also uses the variable values specified in `terraform.tfvars`.
+
+ ```sh
+ terraform destroy -var-file terraform.tfvars
+ ```
+
+ > At the end, you will see a message in green if everything was executed successfully:
+
+
+
+
+
+

+
Refresh Date: 2025-07-17
+
+
From 3f40b5864af490cfa28b4e8b46f44196a4ab4a47 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 29 Aug 2025 03:03:39 +0000
Subject: [PATCH 02/10] Update last modified date in Markdown files
---
terraform-infrastructure/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
index 40be684..6f54a4f 100644
--- a/terraform-infrastructure/README.md
+++ b/terraform-infrastructure/README.md
@@ -5,7 +5,7 @@ Costa Rica
[](https://github.com/)
[brown9804](https://github.com/brown9804)
-Last updated: 2025-07-17
+Last updated: 2025-08-29
----------
From 99d24ce724e59d2d9fe07117164d2d66f66c32b4 Mon Sep 17 00:00:00 2001
From: Timna Brown <24630902+brown9804@users.noreply.github.com>
Date: Fri, 29 Aug 2025 06:26:06 -0600
Subject: [PATCH 03/10] refs
---
README.md | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 20410a2..56c2a35 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ Last updated: 2025-08-27
- [Enable stateful mode for stateless built-in connectors in Azure Logic Apps](https://learn.microsoft.com/en-us/azure/connectors/enable-stateful-affinity-built-in-connectors)
- [Connect to SAP from workflows in Azure Logic Apps](https://learn.microsoft.com/en-us/azure/logic-apps/connectors/sap?tabs=consumption)
- [Call external HTTP or HTTPS endpoints from workflows in Azure Logic Apps](https://learn.microsoft.com/en-us/azure///connectors/connectors-native-http?tabs=standard#known-issues)
+- [Differences between Standard single-tenant logic apps versus Consumption multitenant logic apps](https://learn.microsoft.com/en-us/azure/logic-apps/single-tenant-overview-compare)
@@ -33,7 +34,21 @@ Last updated: 2025-08-27
> [!NOTE]
-> When implementing SAP integration with Azure Logic Apps, understanding the difference between stateful and stateless modes is crucial, particularly for handling session cookies and maintaining state between requests.
+> When implementing SAP integration with Azure Logic App `Standard`, understanding the difference between stateful and stateless modes is crucial, particularly for handling session cookies and maintaining state between requests.
+
+`BAPI (Business Application Programming Interface)`
+
+| Feature | Stateful Mode (Maintains state between actions) | Stateless Mode (Executes each action independently) |
+|----------------------------------|----------------------------------------------------------|----------------------------------------------------------|
+| **Session Management** | Maintains session cookies (e.g., SAP login reused) | No session cookies retained (new login each time) |
+| **State Persistence** | Workflow remembers previous steps | No memory of past executions |
+| **Use Case** | SAP BAPI calls needing session continuity | Simple one-off SAP queries or triggers |
+| **Performance** | Slightly slower due to state tracking | Faster, lower resource usage |
+| **Durability** | Supports long-running workflows (can resume if paused) | Short-lived, no built-in resume capability |
+| **Complexity** | More setup and monitoring required | Easier to configure and maintain |
+| **Example Scenario** | SAP BAPI for creating a sales order (needs login reuse) | Fetching SAP data via trigger (no login reuse needed) |
+
+
> Logic Apps `doesn't maintain a cookie jar or session state between HTTP actions`. When extracting cookies from SAP responses, `Logic Apps may modify the format` in ways that cause authentication failures (403 Forbidden) in subsequent requests to SAP systems, which are `very particular about cookie formats`.
@@ -283,7 +298,7 @@ Last updated: 2025-08-27
-

-
Refresh Date: 2025-08-29
+

+
Refresh Date: 2025-08-28
From 4020247fec3a183597b67bd8354a9e7980478297 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 29 Aug 2025 12:26:20 +0000
Subject: [PATCH 04/10] Update last modified date in Markdown files
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 56c2a35..552f315 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Costa Rica
[](https://github.com/)
[brown9804](https://github.com/brown9804)
-Last updated: 2025-08-27
+Last updated: 2025-08-29
-----------------------------
From e0fcc511fdae859ccdf63681ebc3a91b8b255d5d Mon Sep 17 00:00:00 2001
From: Timna Brown <24630902+brown9804@users.noreply.github.com>
Date: Thu, 4 Sep 2025 20:56:34 -0600
Subject: [PATCH 05/10] Update README with cookie and CSRF management info
Added important note about cookie and CSRF token management.
---
README.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/README.md b/README.md
index 552f315..80b691b 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,11 @@ Last updated: 2025-08-29
-----------------------------
+> [!IMPORTANT]
+> Comparison of approaches for handling cookie and CSRF token management. For official guidance, support, or more detailed information, please refer to Microsoft's official documentation or contact Microsoft directly`: [Microsoft Sales and Support](https://support.microsoft.com/contactus?ContactUsExperienceEntryPointAssetId=S.HP.SMC-HOME)
+
+
+
List of References (Click to expand)
From 5b55fa5aa0f7935c29853dd1f28200afafbd174d Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 5 Sep 2025 02:56:46 +0000
Subject: [PATCH 06/10] Update visitor count
---
README.md | 4 ++--
terraform-infrastructure/README.md | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 80b691b..72efbf1 100644
--- a/README.md
+++ b/README.md
@@ -303,7 +303,7 @@ Last updated: 2025-08-29
-

-
Refresh Date: 2025-08-28
+

+
Refresh Date: 2025-09-05
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
index 6f54a4f..83a30fe 100644
--- a/terraform-infrastructure/README.md
+++ b/terraform-infrastructure/README.md
@@ -147,7 +147,7 @@ graph TD;
-

-
Refresh Date: 2025-07-17
+

+
Refresh Date: 2025-09-05
From 6b7cb5be5a5c4faef55602dcfb086d77aa86f950 Mon Sep 17 00:00:00 2001
From: Timna Brown <24630902+brown9804@users.noreply.github.com>
Date: Thu, 4 Sep 2025 20:57:17 -0600
Subject: [PATCH 07/10] Fix formatting in README for important note
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 72efbf1..cf1a3bf 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Last updated: 2025-08-29
-----------------------------
> [!IMPORTANT]
-> Comparison of approaches for handling cookie and CSRF token management. For official guidance, support, or more detailed information, please refer to Microsoft's official documentation or contact Microsoft directly`: [Microsoft Sales and Support](https://support.microsoft.com/contactus?ContactUsExperienceEntryPointAssetId=S.HP.SMC-HOME)
+> Comparison of approaches for handling cookie and CSRF token management. For official guidance, support, or more detailed information, please refer to Microsoft's official documentation or contact Microsoft directly: [Microsoft Sales and Support](https://support.microsoft.com/contactus?ContactUsExperienceEntryPointAssetId=S.HP.SMC-HOME)
From 41d9670666ec2866efca544bdef920ca87cbfb67 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 5 Sep 2025 02:57:29 +0000
Subject: [PATCH 08/10] Update last modified date in Markdown files
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index cf1a3bf..bb07f61 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Costa Rica
[](https://github.com/)
[brown9804](https://github.com/brown9804)
-Last updated: 2025-08-29
+Last updated: 2025-09-05
-----------------------------
From 6ab2a41715f308caf93865b004308fedb5b8be3d Mon Sep 17 00:00:00 2001
From: Timna Brown <24630902+brown9804@users.noreply.github.com>
Date: Sun, 8 Mar 2026 20:09:50 -0600
Subject: [PATCH 09/10] Enhance README with images and infrastructure details
Updated README to include new images and clarify infrastructure setup.
---
terraform-infrastructure/README.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
index 83a30fe..712a1f4 100644
--- a/terraform-infrastructure/README.md
+++ b/terraform-infrastructure/README.md
@@ -12,7 +12,11 @@ Last updated: 2025-08-29
> This approach focuses on `setting up the required infrastructure via Terraform`. It allows for source control of not only the solution code, connections, and setups `but also the infrastructure itself`. This repository specifically focuses on SAP integration with Azure Logic Apps, supporting both Stateful and Stateless workflow configurations.
-
![Centered Image]()
+

+
+
+
+
> The Terraform configuration supports both Stateful and Stateless Logic Apps, which have different characteristics:
From 0245ca409b4e401e535cb7a75380bf7b480d212f Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Mon, 9 Mar 2026 02:10:02 +0000
Subject: [PATCH 10/10] Update last modified date in Markdown files
---
terraform-infrastructure/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
index 712a1f4..68c020f 100644
--- a/terraform-infrastructure/README.md
+++ b/terraform-infrastructure/README.md
@@ -5,7 +5,7 @@ Costa Rica
[](https://github.com/)
[brown9804](https://github.com/brown9804)
-Last updated: 2025-08-29
+Last updated: 2026-03-09
----------