Explainer
Why PI SDK needs a real PI Server endpoint for cloud tests
Short answer
No. No public PI Server accepts direct PI SDK connections on port 5450, so a cloud address alone never yields a read-only test endpoint. Use the managed VLE included with a paid PI Developers Club membership, deploy a licensed PI System on Azure or AWS, or build new code on AF SDK — and put the read-only boundary in the server-side identity, not the client code.
On this page
No. There is no public PI Server instance in the cloud that a PI SDK application can connect to for a read-only test, and the connection model explains why no vendor could safely publish one. A PI SDK client opens a session to a Data Archive, the historian service behind a PI System, over a fixed TCP port, and every endpoint that answers there belongs to a licensed, provisioned system. What you can test against falls into three routes — a managed training environment, your own cloud deployment, or a different client interface altogether — and the right one depends on how often you will run the test and what it must prove. This page sets out each route and what to arrange before you write the code.
Why a cloud address is not a test endpoint #
A PI SDK application does not browse to a URL. It opens a client session to a Data Archive on TCP port 5450, from an ephemeral source port on the client machine, and AVEVA's PI Server installation documentation describes that traffic as a series of connections, not one socket. No cloud Data Archive is published for public or anonymous reads — what answers on that port on the open internet is production or licensed infrastructure, and the vendor's developer guidance says so plainly when the question of a cloud test server comes up.
Reaching a port is also not the same as holding a session: the endpoint must be provisioned for you, resolvable from your client machine, and willing to authenticate the identity your process presents. A green port check sits one stage above the real test, which is the same gap described in why gRPC ingestion fails when the TCP port test still passes. Treat any address you were not given by the environment's administrator as out of bounds.
The endpoints that actually exist #
Three routes produce a real endpoint. None of them is anonymous.
| Route | What it gives the test | What you arrange first |
|---|---|---|
| Managed Training Cloud Environment (VLE) | A provisioned PI System run for training and development; access is included with a paid PI Developers Club membership | Confirmation of entitlement, the endpoint details, and the client locations the environment permits |
| Your own PI System on Azure or AWS | Full control over configuration, points, data and identity, on a deployment path the vendor has published for exactly this purpose | Licenses, the operating system and network path, test data, and an administrator who sets up identities |
| A cloud data service such as PI Cloud Connect | Its own documented client interface and authentication, not a Data Archive session | A rewritten test against the documented interface, where your goals allow it |
A browser sign-in to a training portal does not establish that code on your workstation can reach that environment's Data Archive: ask the administrator for the connection details and the permitted client location, then run the test from the machine that will execute it in real use. If the deployment route lands on AWS and the first login fails because the key never reached the instance, why ssh-keygen does not create authorized_keys on an AWS EC2 host is documented separately, and it is a login problem, not a PI one. When the goal is joining plant servers to a cloud PI System rather than exercising SDK code, the pattern in connecting on-premise OPC UA and SQL servers to a cloud PI System is the closer match.
One boundary is absolute: never expose a test Data Archive to the internet just to make your client's connection possible, because a reachable historian endpoint on the open internet is an attack surface for the OT network behind it.
Example: firewall rules for a PI SDK test client on Windows #
Inputs. The Data Archive accepts client sessions on TCP 5450, per AVEVA's PI Server installation documentation, which also states that the client initiates its connections from an ephemeral source port. The client machine is a Windows workstation, where the default dynamic port range runs from 49152 to 65535; administrators can move that range, so confirm it on the machine that runs the test before relying on it.
Rule in words. A stateful firewall needs one rule: allow outbound TCP to the Data Archive port, and connection tracking admits the return traffic on its own. A stateless filter, such as an access list on a router, cannot track the session, so it must judge each return packet by its fields — source port 5450, destination equal to the client's ephemeral port — and therefore has to admit the client's whole dynamic range as destinations.
Arithmetic. Ports in the default Windows dynamic range: 65535 − 49152 + 1 = 16384.
Result. The server side of this test opens exactly one port, 5450; a stateless client-side path opens 16384.
Decision. Write the rule stateful and never pin the client source port — a PI client opens a series of connections, so a port observed on the first connection is wrong for the second. If your network policy cannot express a 16384-port dynamic range on client machines, that network cannot host this test client as written, and the managed VLE, where connectivity is arranged for you, is the route that fits.
PI SDK or AF SDK: decide before you build the test #
AVEVA documents PI SDK as deprecated for development use and recommends AF SDK for all new software projects. AF SDK is the .NET library for Windows that reads AF and PI data, and AVEVA has released AF SDK support for .NET 8, so new code does not have to carry a deprecated interface into a new endpoint. The exception is documented in the other direction: AF SDK cannot be used with ModuleDB, PIModules and other legacy PI structures, so code that targets those — the vendor's guidance names legacy products such as PI Batch — still belongs on PI SDK.
The decision follows the code, not the preference. If the immediate goal is reproducing a fault in an existing PI SDK application, test its current interface first, because swapping the SDK mid-test changes the code under test and can hide the defect you started with. If you are starting new code, build on AF SDK and spend the setup effort on the endpoint and the identity, not on an interface the manufacturer has deprecated.
Prove the connection stage by stage #
A failed test looks like one blank screen, but it is five different faults. Separate the application's display from its connection state, and log the server, tag, time range and returned error for each attempt — with credentials kept out of that record.
| What you observe | Stage that failed | What settles it |
|---|---|---|
| The client library fails before any network traffic | Client components | The SDK is installed on the machine that executes the test, and the process loading it is configured to find it |
| The connection times out | Reachability | Name resolution on the client machine and the firewall path from the example above |
| The session is refused at login | Authentication | The identity the process presents, and how the server knows that identity |
| The session opens but the tag cannot be found | Visibility | The point exists and is visible to that identity |
| The tag resolves but no values return | Data or range | A known point, an expected value and timestamp, and a time range that contains them |
A timeout sends you to the network team, a refusal to the identity setup, and a denied read after a good login to the server's permissions. Change one variable at a time, and do not move to reading history until the application holds an authenticated session.
Make the test genuinely read-only #
Code that only calls read functions is not an access-control boundary; the server-side identity is. Have the administrator grant the test identity read on the points and data the test needs and nothing else, then prove both directions: one known tag returns its expected value and timestamp, and one write attempt is refused, as it should be. Follow the provisioning with a review of the effective permissions, because a shortcut taken during setup is how a test account ends up able to write production history. This is the same accounting that sets out SQL historian database permissions: the full six rights — read what the test needs and deny the rest, so the test can never alter the data it measures.
The decision, for each case #
One-off check that your PI SDK code can hold a session and read a value: use the managed Training Cloud Environment if your PI Developers Club membership covers it — confirm the entitlement, get the endpoint details and permitted client location from the administrator, and test from that machine. Repeatable integration testing against your own points, time ranges and identity setup: deploy a licensed PI System on Azure or AWS, keep it off the public internet, and run it like a small production system with its own administrator. New development: build on AF SDK from the first commit and reserve PI SDK for legacy ModuleDB-era targets such as PI Batch work. In every case the read-only boundary lives in the server-side identity, not in the client code.
Questions asked
Can PI Cloud Connect stand in for a PI Server in a PI SDK test?
No. A cloud data service exposes its own documented client interface and its own authentication, while PI SDK code speaks the Data Archive session protocol. Unless the vendor documents an exact path from your SDK code to that service, the service can test your integration logic but not the connection your application will use in service. Plan a Data Archive endpoint for the SDK test and treat the cloud service as a separate interface.
Is the training environment included with a PI Developers Club membership?
The vendor's developer program states that access to the Virtual Learning Environment is included with a paid PI Developers Club membership. The membership does not fix the other two inputs: the endpoint details and the client locations the environment permits come from the program or the environment administrator, so confirm both before you plan a test from a plant network or a corporate proxy.
Why does a TCP port test pass while the PI SDK connection still fails?
A port test proves one socket can open. A Data Archive client opens a series of connections, authenticates an identity, and only then resolves and reads points, so a green port check sits at the first stage alone. Work the stages in order — reachability, authentication, visibility, data — and record which stage failed before changing tag names or credentials.
Should I port the existing PI SDK application to AF SDK before testing?
Not for the test itself. If the goal is to reproduce a fault in the application you already have, run the test against its current interface; changing the SDK changes the code under test and can hide the defect you started with. For new code, start on AF SDK, which AVEVA recommends for all new projects, and keep PI SDK only where legacy structures such as ModuleDB or PIModules require it.
What makes a test account genuinely read-only?
Server-side permissions, not client code. Grant the identity read on the points and data the test needs, with no write or administrative rights, and verify both directions: a known tag returns its expected value and timestamp, and a write attempt is refused. A short effective-permission review afterwards catches rights granted during setup that the test should never have had.