Artificial Intelligence Blogs Posts
cancel
Showing results for 
Search instead for 
Did you mean: 

Why a PowerShell GUI for SAP AI Core?

SAP AI Core is the backbone of SAP's generative AI runtime. It hosts orchestration deployments, manages resource group isolation, and serves AI capabilities across SAP applications and custom workloads. In addition to the capabilities available in SAP AI Launchpad, there is often a need for a scriptable interface to perform common lifecycle operations programmatically, including resource group management, deployment administration, status inspection, and resource cleanup.
 

This PowerShell Code Sample is a single .ps1 file that opens a native Windows Forms GUI. It connects to the SAP AI Core REST API using a service key you paste in at launch. Credentials are held in memory only and are never written to disk.

Prerequisites

What You Need Before You Start

You need an active SAP AI Core service instance with at least one service key, and a Windows machine with PowerShell 5.1 or later.

Requirement Details

SAP BTP AccountGlobal account with entitlement for SAP AI Core (extended plan recommended)
SAP AI Core Service InstanceCreated in a Cloud Foundry space; plan: extended
Service KeyAt least one service key on the instance — you will copy the JSON credentials
Windows 10 / 11PowerShell 5.1 ships built-in; no additional runtime needed
Execution PolicyRun Set-ExecutionPolicy -Scope CurrentUser RemoteSigned if scripts are blocked
 
New to SAP AI Core? Use the Set Up Account for SAP AI Core booster in SAP BTP Cockpit. It creates a subaccount, assigns entitlements, provisions the service instance, and generates a service key in four guided steps.

Getting Connected

Connecting to SAP AI Core

When you launch the script, a Connect to SAP AI Core dialog opens immediately. All you need is the JSON from your SAP AI Core service key.

Step 1 — Copy the Service Key JSON from BTP Cockpit

Navigate to your subaccount in SAP BTP Cockpit, go to Services → Instances and Subscriptions, open your SAP AI Core instance, click the service key name under Credentials, and click Copy JSON.

SAP BTP Cockpit — Credentials dialog for the SAP AI Core instance. Click "Copy JSON" to copy the service key to the clipboard.


Step 2 — Launch the Script and Paste Your Credentials

Right-click SAP AI Core PowerShell Code Sample.ps1 and choose Run with PowerShell, or open a PowerShell window and run .\SAP AI Core PowerShell Code Sample.ps1. The Connect dialog appears. Paste the JSON into the SERVICE KEY JSON text area and click Connect (or press Ctrl+Enter).

Connect dialog on first launch — paste your service key JSON here.
 
Security note: The JSON is parsed into in-memory variables (clientId, clientSecret, tokenUrl, aiApiUrl). Nothing is persisted to disk. Clicking Disconnect clears all variables from memory.

 

Resource Groups

Managing Resource Groups

Resource groups are the primary isolation boundary in SAP AI Core. Each one gets its own namespace for configurations, deployments, artifacts, and secrets. After connecting, the Resource Groups tab loads automatically.

Resource Groups tab after connecting — the "default" resource group is shown as PROVISIONED.

Creating a New Resource Group

Click + New Resource Group. An inline form expands above the list. Enter a Resource Group ID (lowercase letters, digits, and hyphens only). The Document Grounding checkbox is available if your tenant supports it and defaults to disabled.

New Resource Group form — enter an ID and optionally enable Document Grounding, then click Create Resource Group.

Click Create Resource Group. New groups appear in PROVISIONING status first, then move to PROVISIONED within seconds once the namespace is ready on the cluster.

Other Actions

  • Refresh — re-queries /v2/admin/resourceGroups and repaints the grid.
  • Delete Selected — prompts for confirmation, then deletes the selected resource group.
  • View JSON — shows the raw API response for the selected row, including labels and metadata.

 

Configurations

Orchestration Configurations

An orchestration configuration links a resource group to the SAP AI Core orchestration scenario. Every deployment is based on a configuration, so you need at least one per resource group before you can deploy.

Switch to the Configurations tab and select a resource group from the dropdown. The grid loads all configurations scoped to that group.

Configurations tab — the "orchestration" configuration listed with its scenario, executable, and configuration ID.

Creating a New Configuration

Click + New Configuration. The inline form has three fields:

  • Resource Group — pre-selected from the dropdown.
  • Configuration Name — defaults to orchestration, the recommended value matching the SAP AI Core orchestration scenario.
  • Version — defaults to 0.0.1.

The Scenario and Executable fields are locked to orchestration — the only valid values for the orchestration scenario on the extended plan.

New Orchestration Configuration form — name defaults to "orchestration", scenario and executable are locked.

Click Create Configuration. The list refreshes automatically. Select the new row and click Deploy Selected to create a deployment from it — the tool switches to the Deployments tab automatically.

 

Deployments

Deployments

The Deployments tab shows all deployments for the selected resource group, including deployment ID, current status, target status, configuration ID, and last modified time.

Deployment in PENDING status immediately after creation — target status is RUNNING.
 
 
Deployment transitions to RUNNING — the orchestration endpoint is live.
 

Lifecycle Actions

Action When Available API Call

StopDeployment is RUNNINGPATCH /v2/lm/deployments/{id} with targetStatus: STOPPED
ResumeDeployment is STOPPEDPATCH /v2/lm/deployments/{id} with targetStatus: RUNNING
DeleteAny state (prompts confirmation)DELETE /v2/lm/deployments/{id}
View JSONAlwaysGET /v2/lm/deployments/{id} — full API response
Tip: Click Refresh after a Stop or Resume action. SAP AI Core processes lifecycle changes asynchronously — a deployment may briefly show PENDING before reaching its target state.

Get Started

Download and Run

The sample is distributed as a single ZIP containing SAP AI Core PowerShell Code Sample.ps1. No installation, no dependencies beyond what ships with Windows.

 
  1. Download the ZIP
    Unzip SAP AI Core PowerShell Code Sample.zip to any folder.
  2. Allow script execution (once, per user)
    Open PowerShell and run: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
  3. Run the script
    Right-click SAP AI Core PowerShell Code Sample.ps1 → Run with PowerShell, or from a terminal: .\SAP AI Core PowerShell Code Sample.ps1
  4. Paste your service key and connect
    Copy the credentials JSON from SAP BTP Cockpit, paste it into the dialog, and click Connect.

Ready to Try It?

Download the script, connect with your service key, and manage your SAP AI Core resources from the desktop in under two minutes.
Download PowerShell Code Sample

See and end-to-end video how to use this in context with SAP Business One

 

Labels in this area