Technology Blog Posts by Members
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
roddsrod
Explorer
1,903

Script Overview

The provided PowerShell (Core, 6+) script simplifies the setup of SAP Integration Suite by automating 95% of the required steps. It is designed to work in environments with no existing subaccounts entitled to the Integration Suite¹, ensuring compliance with SAP's restriction of one Integration Suite per global account.

A global account is required, tutorial and manual steps can be found hereherehere or here.

While you can use the script straight away after new trial account creation (it is advisable to directly delete subaccount after global account creation, as it comes paired with it) which will greatly facilitate the whole process, this is mostly aimed at trial accounts holders and learners, due to the common issue of the Integration Suite being randomly disabled in trial accounts, this script was created to tackle the seamless creation of a new subaccount with the Integration Suite enabled. It ensures that users can quickly set up a new working environment without hassle, saving time and effort. (Do not forget to delete previously provisioned subaccount first, to release the "stuck" Integration Suite provisioning)

Step-by-Step Breakdown

1. Prerequisites Check

The script begins by verifying the availability of required CLI tools (btp and cf). If missing, it offers to install them based on the operating system (Windows, MacOS, or Linux)². This ensures compatibility across platforms.

  • Key Functions: Checks if CLI tools exist and installs them automatically.
  • Supports: Windows, MacOS, and Linux environments.

2. Reading Credentials

The script reads user credentials from a file (credentials.txt) or prompts for manual entry if the file is missing. It also provides an option to save credentials for future use.

  • Key Function: Handles credential input and storage.
  • User-Friendly: Ensures a seamless login experience.

3. Logging into SAP BTP

Using the provided credentials, the script logs into SAP BTP via the CLI. It extracts details about the active global account and validates its correctness.

  • Interactive: Allows users to select a global account if needed.
  • Validation: Ensures correct targeting of accounts.

4. Creating Subaccounts

The script creates a new subaccount within the selected region. A unique subdomain is generated using the global account ID and timestamp. The script waits until the subaccount is ready before proceeding.

  • Automated: Generates unique subdomains for each subaccount.
  • Monitored: Tracks subaccount readiness in real-time.

5. Enabling Cloud Foundry Environment

The script enables Cloud Foundry by creating an environment instance with trial parameters. It monitors the environment's status until it becomes active and then logs into Cloud Foundry using user credentials.

  • Key Outputs: Cloud Foundry API Endpoint, Organization Name, Space Creation (e.g., "dev").
  • Seamless Setup: Fully automates Cloud Foundry configuration.

6. Adding Service Entitlements

The script assigns entitlements for required services like Integration Suite, SAP Build Apps, and Process Integration Runtime. It differentiates between plans requiring an amount (trial, free) versus those that need enabling. (Build Apps and App Studio are also added but not required for Integration Suite, it is just added to already be there as myself was actually playing with it)

  • Services Configured: Integration Flow, API Management, App Studio Trial, Integration Suite Trial.
  • Flexible: Supports multiple service plans dynamically.

7. Creating Service Subscriptions

The script creates subscription for Integration Suite and monitors its readiness before assigning roles or creating instances.

  • Proactive Monitoring: Ensures proper provisioning before proceeding.
  • Error-Free: Prevents misconfigurations by validating readiness.

8. Assigning Role Collections

The script assigns role collections to users for managing integration scenarios effectively. It happens in 2 steps, first time it only assigns Integration Provisioner role in order to allow access to Integration Suite and enable capabilities, second time it will assign all available roles listed based on the capabilities enabled.

  • Comprehensive Roles: Includes all necessary permissions for integration management.
  • Dynamic Assignment: Iterates through available roles for assignment.

9. Creating Service Instances

The script creates service instances for Process Integration Runtime:

  • Integration Flow Instance: Used for building integration scenarios.
  • API Instance: Provides access to APIs for integration development.

10. Generating Service Keys

The service keys are created for accessing runtime services securely. Key details such as tokenurl, clientid, and clientsecret are extracted for future use. (service keys are only created for Integration Flow service, not the API service, API service has been created for easiness, but not the keys, keep that in mind, if you also need API keys you will have to create them separately)

  • Secure Access: Ensures safe and reliable connections to runtime services.
  • Key Details: Includes essential credentials for integration scenarios.

Final Summary

The PowerShell script streamlines SAP Integration Suite deployment by automating complex tasks while maintaining flexibility for manual inputs when necessary. It ensures efficient setup with minimal intervention, making it an invaluable tool for developers and administrators alike.

  • User Details: Displays user-specific configurations.
  • Global Account Information: Provides details about the targeted global account.
  • Subaccount Settings: Summarizes subaccount configurations and entitlements.
  • Cloud Foundry Environment: Highlights organization, spaces, and API endpoints.
  • Role Collections Assigned: Lists all roles provisioned for integration management.
  • Access Links: Offers direct links to the Integration Suite for activating capabilities like "Cloud Integration."

Link to scripthttps://github.com/roddsrod/SAP-BTP-CPI/tree/main 

Flow:

bBDxrKX6DZMCh8LetWv8h

¹ . we can have one or more subaccounts present in the global account, just that non of them can have an integration suite assignement, even expired. SAP kind of randomly disables Integration Suite on Trial accounts but assignment stays, hence the need to completely delete the subaccount in order to create new Integration Suite. In light of that, do not forget to regularly export your flows, as once the Integration Suite is disabled you will lose all your flows, then once you create new subaccount with new Suite you can import all your flows again.

² . btp and cf tools are retrieved from scipt github instead of SAP repositories to ensure script consistency in case SAP decides to change tools or links, you can retrieve them from SAP repos instead if you wish and extract executables to the same folder as the script,
BTP: https://tools.hana.ondemand.com/#cloud-btpcli
CF: https://github.com/cloudfoundry/cli

 

 - Please feel free to pitch in any improvement ideas or notify of any unforeseen issue -

 

4 Comments