Op
Storage Azure

OpenAS2 on Windows Server 2025 on Azure User Guide

| Product: OpenAS2 on Windows Server 2025

Overview

This guide covers the deployment and use of OpenAS2 on Windows Server 2025 on Microsoft Azure, using cloudimg's virtual machine image from the Azure Marketplace.

OpenAS2 is an open source (GNU GPL v3) Java implementation of AS2 (RFC 4130), the protocol businesses use to exchange EDI documents (X12, EDIFACT) and other files with their trading partners over HTTP. Every message is signed and encrypted with the two sides' certificates, and the receiver answers with a signed receipt (an MDN) that proves the file arrived intact. This image runs OpenAS2 as a Windows service, ready to receive on port 10080, with keys, passwords and a tracking database made for your VM alone at its first boot.

The image is Microsoft Windows Server 2025 Datacenter with the Desktop Experience (the full graphical interface), Gen2, x64, built from Microsoft's own image on the Azure Marketplace (MicrosoftWindowsServer:WindowsServer:2025-datacenter-g2, version 26100.33828.261112). The Windows Server licence is included in the VM price and billed by Microsoft.

What's included:

  • OpenAS2 4.15.0, upstream's own binary release (OpenAS2Server-4.15.0.zip), unmodified, its checksum verified when the image was built, in C:\Program Files\OpenAS2\
  • Eclipse Temurin 21 JRE (21.0.13+2, Adoptium build 21.0.13.1+2) in C:\Program Files\OpenAS2\jre\, used by OpenAS2 alone
  • OpenAS2 running as the Windows service OpenAS2 ("OpenAS2 Server", Apache Commons Daemon procrun) under its own virtual service account NT SERVICE\OpenAS2, never LocalSystem: started at boot and restarted if it ever stops
  • The AS2 receiver on TCP port 10080 and the asynchronous MDN receiver on TCP port 10081
  • This VM's own AS2 keys, made at its first boot: three 3072-bit RSA key pairs with self-signed SHA-256 certificates (your station MyCompany_OID, and the two example partners) in a PKCS#12 keystore with a random password. No key ships in the image, so no two VMs share one
  • A random password for the H2 message-tracking database, and both passwords in C:\ProgramData\openas2-credentials.txt, readable only by SYSTEM and Administrators (config.xml, which holds them for the service, is readable by the service account too)
  • Upstream's settings made safe: unsigned messages are refused, the remote command console, the REST API and the H2 database's TCP server are off, received files, headers and receipts are stored under names made of the date and a random id (never a name the sender chose), and the example partnerships use AES-256 encryption and SHA-256 signatures
  • A self-test, C:\Program Files\OpenAS2\cloudimg\openas2-selftest.ps1, that sends a signed and encrypted AS2 message from your station to itself and checks the signed receipt
  • Windows Firewall rule group OpenAS2, allowing TCP 10080 and 10081 in, and a rule blocking the OpenAS2 service from Azure's platform addresses (168.63.129.16 and 169.254.0.0/16)
  • Windows Server 2025 Datacenter, Desktop Experience, version 24H2, build 26100.33828, with Microsoft's November 2026 cumulative update. Windows Update ran during the build and reported nothing pending when the image was captured on 1 December 2026
  • The Azure VM agent, so Azure features such as Reset password and Run command work
  • Accelerated networking supported (on sizes that offer it), Trusted Launch and NVMe sizes supported
  • cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Platform: Microsoft Azure (Gen2 Hyper-V; Trusted Launch, NVMe and accelerated networking supported) Administrator account: the user name and password you choose when you deploy the VM. There is no default Windows password on this image. Configuration: C:\ProgramData\OpenAS2\config\config.xml and partnerships.xml

Prerequisites

  1. An Azure subscription
  2. A Remote Desktop client: Remote Desktop Connection (mstsc) on Windows, Windows App (formerly Microsoft Remote Desktop) on macOS, or Remmina on Linux
  3. The public IP address of the machine you will connect from, so you can allow Remote Desktop from that address only
  4. The public IP addresses your trading partners send AS2 from (they can tell you), so you can open port 10080 to them only

Recommended size: Standard_B2ms (2 vCPUs, 8 GiB memory). OpenAS2's Java heap is capped at 1 GB, enough for a typical trading-partner workload.

Step 1: Deploy the Virtual Machine

Option A: Azure Portal

  1. In the Azure Marketplace, search for "OpenAS2 on Windows Server 2025 cloudimg"
  2. Select the offer and click Create
  3. Configure the basics:
  4. Subscription and Resource group: select or create
  5. Virtual machine name and Region: your choice
  6. Size: Standard_B2ms recommended
  7. Under Administrator account, enter a Username and a Password that you choose. Azure refuses reserved names such as "administrator", "admin" and "guest"
  8. Under Inbound port rules, allow RDP (3389). Azure then opens port 3389 to the whole internet, so restrict it straight after deployment (step 8)
  9. On the Networking tab, consider a static public IP address: your trading partners will configure your AS2 URL with it
  10. Click Review + create, then Create
  11. When the deployment finishes, open the VM's Networking (Network settings) page:
  12. edit the inbound rule for port 3389: set Source to My IP address (or your office or VPN address range)
  13. add an inbound rule for TCP 10080 with Source set to your trading partners' IP addresses; add 10081 as well only if a partner sends its receipts asynchronously

Option B: Azure CLI

Accept the offer terms once per subscription, then create the VM with no inbound rules. Leave out --admin-password and the CLI asks for the password, which keeps it out of your shell history:

az vm image terms accept --urn cloudimg1647283583153:openas2-windows-server:default:latest

az vm create \
  --resource-group myResourceGroup \
  --name my-openas2 \
  --image cloudimg1647283583153:openas2-windows-server:default:latest \
  --size Standard_B2ms \
  --admin-username <your-admin-name> \
  --public-ip-sku Standard \
  --nsg-rule NONE

Then allow Remote Desktop from your own address and AS2 from your partners' addresses only, and read the VM's public address:

az network nsg rule create \
  --resource-group myResourceGroup \
  --nsg-name my-openas2NSG \
  --name allow-rdp-from-my-ip \
  --priority 1000 \
  --direction Inbound --access Allow --protocol Tcp \
  --destination-port-ranges 3389 \
  --source-address-prefixes <your-public-ip>/32

az network nsg rule create \
  --resource-group myResourceGroup \
  --nsg-name my-openas2NSG \
  --name allow-as2-from-partners \
  --priority 1010 \
  --direction Inbound --access Allow --protocol Tcp \
  --destination-port-ranges 10080 \
  --source-address-prefixes <partner-ip-1>/32 <partner-ip-2>/32

az vm show --resource-group myResourceGroup --name my-openas2 --show-details --query publicIps -o tsv

Step 2: Connect with Remote Desktop

  1. Open your Remote Desktop client and connect to the VM's public IP address
  2. Windows: run mstsc, enter the IP address and click Connect
  3. macOS: in Windows App, add a PC with the IP address
  4. Linux: in Remmina, create an RDP connection to the IP address
  5. When asked for credentials, sign in as <vm-name>\<your-admin-name> with the password you set at deployment. On Windows, choose More choices, then Use a different account
  6. Accept the certificate warning: the VM uses a self-signed Remote Desktop certificate

Windows may show its privacy settings screen at your first sign-in; choose your settings and click Accept.

OpenAS2 does not need you to stay signed in: it runs as a Windows service from the moment the VM starts. Open Windows PowerShell as administrator (right-click the Start button, then Terminal (Admin)) for the steps below.

Step 3: Check that OpenAS2 is running

Get-Service OpenAS2 | Format-Table Name, DisplayName, Status, StartType -AutoSize
Get-CimInstance Win32_Service -Filter "Name='OpenAS2'" | Format-List StartName, PathName
Get-NetTCPConnection -State Listen -LocalPort 10080, 10081 | Format-Table LocalAddress, LocalPort, State -AutoSize

On a new VM:

Name    DisplayName     Status StartType
----    -----------     ------ ---------
OpenAS2 OpenAS2 Server Running Automatic

StartName : NT SERVICE\OpenAS2
PathName  : "C:\Program Files\OpenAS2\bin\commons-daemon\amd64\prunsrv.exe" //RS//OpenAS2

LocalAddress LocalPort  State
------------ ---------  -----
::               10081 Listen
::               10080 Listen

The service runs prunsrv.exe (Apache Commons Daemon), which starts OpenAS2's Java runtime inside its own process, as the account NT SERVICE\OpenAS2:

An elevated PowerShell window over Remote Desktop: the OpenAS2 service Running and Automatic as NT SERVICE\OpenAS2, listening on TCP 10080 and 10081, and its prunsrv.exe process owned by NT SERVICE\OpenAS2

Step 4: Your AS2 station and certificate

Your VM's first boot made its AS2 set-up and wrote the details your trading partners need to C:\ProgramData\openas2-credentials.txt:

Get-Content C:\ProgramData\openas2-credentials.txt
# OpenAS2 4.15.0 on Windows Server 2025 by cloudimg: this VM's own AS2 set-up, made at first boot.
# Guide: https://www.cloudimg.co.uk/guides/openas2-on-windows-server-2025-azure/
# Give your trading partners AS2_LOCAL_STATION_ID, AS2_RECEIVER_URL and the certificate AS2_PUBLIC_CERT; keep the
# passwords to yourself (config.xml holds them for the service).

AS2_LOCAL_STATION_ID=MyCompany_OID
AS2_RECEIVER_URL=http://<your VM public IP or DNS name>:10080
AS2_ASYNC_MDN_URL=http://<your VM public IP or DNS name>:10081
AS2_PUBLIC_CERT=C:\ProgramData\OpenAS2\mycompany.cer
AS2_KEYSTORE_FILE=C:\ProgramData\OpenAS2\as2_certs.p12
AS2_KEYSTORE_ALIASES=mycompany (your station), partnera and partnerb (the example partners)
AS2_KEYSTORE_PASSWORD=<hidden>
AS2_TRACKING_DB=jdbc:h2:C:/ProgramData/OpenAS2/DB/openas2 (stop the OpenAS2 service before opening it)
AS2_TRACKING_DB_USER=sa
AS2_TRACKING_DB_PASSWORD=<hidden>

The two passwords are shown here as <hidden>; on your VM they are this VM's own random values. Where the file says <your VM public IP or DNS name>, use your VM's public IP address (Step 1) or a DNS name you point at it.

The keystore holds three key pairs, each made on your VM:

$env:OA2_KSPW = (Select-String -Path C:\ProgramData\openas2-credentials.txt -Pattern '^AS2_KEYSTORE_PASSWORD=(.*)$').Matches[0].Groups[1].Value
& 'C:\Program Files\OpenAS2\jre\bin\keytool.exe' -list -keystore C:\ProgramData\OpenAS2\as2_certs.p12 -storepass:env OA2_KSPW
Remove-Item Env:\OA2_KSPW
Keystore type: PKCS12
Keystore provider: SUN

Your keystore contains 3 entries

mycompany, Dec 1, 2026, PrivateKeyEntry, 
Certificate fingerprint (SHA-256): 73:93:32:2D:BC:5C:C9:19:95:22:AB:99:1C:03:D4:BE:4B:CC:AB:C9:5B:96:C2:82:E1:15:7C:3C:9C:9D:EA:CF
partnera, Dec 1, 2026, PrivateKeyEntry, 
Certificate fingerprint (SHA-256): 12:F3:73:E3:F0:92:A0:09:A7:04:0A:1A:56:95:94:16:E6:EC:E9:9C:12:18:DB:15:BB:E9:B6:96:37:2E:38:8F
partnerb, Dec 1, 2026, PrivateKeyEntry, 
Certificate fingerprint (SHA-256): 62:70:1D:60:60:92:85:F5:47:60:AD:32:0D:2D:55:73:28:A3:7A:CA:77:1B:76:D2:03:4B:05:9F:E4:59:7D:89

mycompany is your station's key. partnera and partnerb belong to upstream's two example partners: partnera lets the self-test (Step 5) send a message from your station to itself. A real partner's entry holds only their certificate (Step 7).

Your public certificate, C:\ProgramData\OpenAS2\mycompany.cer, is the file you send your trading partners:

New-Object Security.Cryptography.X509Certificates.X509Certificate2 'C:\ProgramData\OpenAS2\mycompany.cer' | Format-List Subject, NotBefore, NotAfter, Thumbprint
Subject    : CN=as2.mycompany.local, OU=AS2, O=MyCompany, C=US
NotBefore  : 12/1/2026 11:52:46 PM
NotAfter   : 11/28/2036 11:52:46 PM
Thumbprint : 6719F00AC011CAA6A6E328C6737778669CF5B787

It is valid for ten years, with a 3072-bit RSA key and a SHA-256 signature:

An elevated PowerShell window: the station ID, receiver URLs and public certificate path from the credentials file, and the certificate's subject, ten-year validity, thumbprint, 3072-bit key and sha256RSA signature

The main settings in config.xml show what the image turns on and off:

Select-String -Path C:\ProgramData\OpenAS2\config\config.xml -Pattern 'port="1008|reject_unsigned|command.processor.enabled|tcp_server_start'
console.command.processor.enabled="false"
restapi.command.processor.enabled="false"
module.AS2ReceiverModule.http.port="10080"
module.AS2MDNReceiverModule.http.port="10081"
msg_tracking.tcp_server_start="false"
reject_unsigned_messages="true"
enabled="$properties.console.command.processor.enabled$"/>
enabled="$properties.restapi.command.processor.enabled$"
tcp_server_start="$properties.msg_tracking.tcp_server_start$"

Step 5: Run the self-test

The self-test drops a small EDI file in the outbox for the example partner PartnerA_OID. OpenAS2 signs and encrypts it, sends it over AS2 to its own receiver on port 10080, receives, decrypts and verifies it, and answers with a signed receipt. The script waits for both and checks the receipt is signed and says processed:

& 'C:\Program Files\OpenAS2\cloudimg\openas2-selftest.ps1'
SELFTEST_OK message 20261202000345907-GCTwmED6Sz2VypwSj7tXOQieie received, decrypted and verified; MDN 20261202000345933-xFWlAfIoSDyEJsH0DgPvlwieie

OpenAS2 made its data folders as it went:

Get-ChildItem C:\ProgramData\OpenAS2\data -Directory -Recurse | Select-Object -ExpandProperty FullName
C:\ProgramData\OpenAS2\data\mdn
C:\ProgramData\OpenAS2\data\MyCompany_OID-PartnerA_OID
C:\ProgramData\OpenAS2\data\outbox
C:\ProgramData\OpenAS2\data\pendinginfoMDN3
C:\ProgramData\OpenAS2\data\pendingMDN3
C:\ProgramData\OpenAS2\data\resend
C:\ProgramData\OpenAS2\data\temp
C:\ProgramData\OpenAS2\data\mdn\2026-12-01
C:\ProgramData\OpenAS2\data\mdn\2026-12-02
C:\ProgramData\OpenAS2\data\MyCompany_OID-PartnerA_OID\inbox
C:\ProgramData\OpenAS2\data\MyCompany_OID-PartnerA_OID\msgheaders
C:\ProgramData\OpenAS2\data\MyCompany_OID-PartnerA_OID\msgheaders\2026-12-01
C:\ProgramData\OpenAS2\data\MyCompany_OID-PartnerA_OID\msgheaders\2026-12-02
C:\ProgramData\OpenAS2\data\outbox\error
C:\ProgramData\OpenAS2\data\outbox\PartnerA_OID
C:\ProgramData\OpenAS2\data\outbox\error\2026-12-01
C:\ProgramData\OpenAS2\data\outbox\error\2026-12-01\PartnerA_OID

The received file is in the inbox for that pair of stations, and its headers and the receipt beside it:

An elevated PowerShell window: the self-test reporting SELFTEST_OK, and the received message and its headers listed in the MyCompany_OID-PartnerA_OID inbox and msgheaders folders

OpenAS2's own log shows each step of the exchange (the latest log is C:\ProgramData\OpenAS2\logs\log-<date>.txt):

Get-Content (Get-ChildItem C:\ProgramData\OpenAS2\logs -Filter 'log-*.txt' | Sort-Object LastWriteTime | Select-Object -Last 1).FullName -Tail 12
23:58:57.248 [AS2DirectoryPollingModule] INFO  org.openas2.processor.sender.AS2SenderModule -- Connecting to: http://localhost:10080
23:58:58.161 [pool-3-thread-1] INFO  org.openas2.processor.receiver.AS2ReceiverHandler -- received 2331 bytes in 0.17 seconds at 133.926 KBps 127.0.0.1 53281
23:58:58.265 [pool-3-thread-1] INFO  org.openas2.processor.receiver.AS2MDNReceiverHandler -- DISPOSITION MIC ALG: SHA-256   IMPORTANCE: optional
23:58:58.275 [pool-3-thread-1] INFO  org.openas2.util.IOUtil -- Created directory C:\ProgramData\OpenAS2\data\temp
23:58:58.411 [pool-3-thread-1] INFO  org.openas2.processor.storage.MessageFileModule -- stored message to C:\ProgramData\OpenAS2\data\MyCompany_OID-PartnerA_OID\inbox\20261201235858271-lvyeDLmMTSe5MgLMT0smuAieie
23:58:58.415 [pool-3-thread-1] INFO  org.openas2.processor.storage.MessageFileModule -- stored headers to C:\ProgramData\OpenAS2\data\MyCompany_OID-PartnerA_OID\msgheaders\2026-12-01\20261201235858412-ip8q4u7sjSVWaoGBq2uddsAieie
23:58:58.425 [pool-3-thread-1] INFO  org.openas2.processor.receiver.AS2MDNReceiverHandler -- DISPOSITION MIC ALG: SHA-256   IMPORTANCE: optional
23:58:58.501 [AS2DirectoryPollingModule] INFO  org.openas2.processor.sender.AS2SenderModule -- Message sent and response received in 474 milliseconds
23:58:58.521 [pool-3-thread-1] INFO  org.openas2.processor.sender.MDNSenderModule -- sent MDN [automatic-action/mdn-sent-automatically; processed]
23:58:58.528 [AS2DirectoryPollingModule] INFO  org.openas2.util.AS2Util -- Partner PartnerA_OID responded with MDN [automatic-action/MDN-sent-automatically; processed]
23:58:58.530 [AS2DirectoryPollingModule] INFO  org.openas2.util.AS2Util -- Message sent and MDN received successfully.
23:58:58.532 [AS2DirectoryPollingModule] INFO  org.openas2.util.AS2Util -- Pending MDN MSG FILE deleted: C:\ProgramData\OpenAS2\data\pendingMDN3\20261201235855+0000-415-MyCompany_OID_PartnerA_OID_cloudimg-selftest-8874c394e935409a97a10a77cae9614a.edi

(Each line on your VM ends with the message's id in square brackets, left out here.)

Step 6: The firewall

Windows Firewall blocks every inbound connection that no rule allows. The rule group OpenAS2 allows TCP 10080 (AS2) and 10081 (asynchronous receipts) in; Azure's network security group (Step 1) decides who may reach them:

Get-NetFirewallRule -Group OpenAS2 | Get-NetFirewallPortFilter | Format-Table Protocol, LocalPort -AutoSize
Protocol LocalPort     
-------- ---------     
TCP      {10080, 10081}

An elevated PowerShell window: the Domain, Private and Public firewall profiles enabled with inbound Block, and the OpenAS2 rule allowing TCP 10080 and 10081 in

A second rule group, OpenAS2 outbound, stops the OpenAS2 service from reaching Azure's platform addresses (the WireServer 168.63.129.16 and the link-local range 169.254.0.0/16, which holds the instance metadata service). An AS2 sender may ask for its receipt at any URL it likes, and your trading partners are never at those addresses. Everything else, such as your partners' AS2 URLs, is allowed out.

Step 7: Add a real trading partner

You and your partner exchange three things: your AS2 ID, AS2 URL and certificate (Step 4) for theirs. Then, on the VM:

  1. Import the partner's certificate (say C:\Users\<you>\Downloads\acme.cer) into the keystore under an alias of your choice:

powershell $env:OA2_KSPW = (Select-String -Path C:\ProgramData\openas2-credentials.txt -Pattern '^AS2_KEYSTORE_PASSWORD=(.*)$').Matches[0].Groups[1].Value & 'C:\Program Files\OpenAS2\jre\bin\keytool.exe' -importcert -noprompt -alias acme -file C:\Users\<you>\Downloads\acme.cer -keystore C:\ProgramData\OpenAS2\as2_certs.p12 -storepass:env OA2_KSPW Remove-Item Env:\OA2_KSPW

  1. Describe the partner and both directions in C:\ProgramData\OpenAS2\config\partnerships.xml (open it in Notepad as administrator). Copy the example PartnerA entries and change the names, AS2 ID, alias and URL:

```xml

```

Use the encryption and signing algorithms your partner supports (AES128, AES192 or AES256; SHA-256, SHA-384 or SHA-512). To use your own organisation's AS2 ID instead of MyCompany_OID, change as2_id on the MyCompany partner, and tell your partners.

  1. Restart the service so it reads both files at once: Restart-Service OpenAS2

To send a file, copy it into C:\ProgramData\OpenAS2\data\outbox\ACME_AS2\ (create the folder if it is not there yet). OpenAS2 checks the folder every 5 seconds and sends what it finds; a file it could not send goes to data\outbox\error\.

Files you receive from Acme land in C:\ProgramData\OpenAS2\data\ACME_AS2-MyCompany_OID\inbox\, under a name made of the date and a random id; the AS2 headers that came with each are in msgheaders\ beside it. A message that is refused (unsigned, or from an AS2 ID with no partnership) is kept in data\inbox\error\.

Asynchronous receipts: if a partner wants to send its receipts back separately, set as2_async_mdn_url in config.xml to http://<your VM public IP or DNS name>:10081 and uncomment the as2_receipt_option attribute in your partnership, then open 10081 to that partner (Step 1).

HTTPS: to receive over HTTPS, put a TLS certificate and key in a PKCS#12 file, set ssl_keystore and ssl_keystore_password in config.xml, set module.AS2ReceiverModule.https.enabled to true (its port is module.AS2ReceiverModule.https.port), allow that port in Windows Firewall and the network security group, and restart the service.

Step 8: Keeping Windows and OpenAS2 up to date

Windows: Windows Update is on, as in Microsoft's image. Check for updates in Settings > Windows Update, and plan restarts: OpenAS2 starts again by itself after a restart, and a partner sending while the VM restarts retries (OpenAS2 itself retries up to resend_max_retries times).

OpenAS2: new versions and their release notes are on GitHub and SourceForge. An upgrade replaces the .jar files in C:\Program Files\OpenAS2\lib\; your configuration, keys and messages in C:\ProgramData\OpenAS2\ stay as they are. Read the release notes for configuration changes first, then from an elevated PowerShell window, with the new release unpacked in $env:TEMP\openas2-new:

Stop-Service OpenAS2
Remove-Item 'C:\Program Files\OpenAS2\lib\*.jar'
Copy-Item $env:TEMP\openas2-new\lib\*.jar 'C:\Program Files\OpenAS2\lib\'
Start-Service OpenAS2
& 'C:\Program Files\OpenAS2\cloudimg\openas2-selftest.ps1'

The self-test's SELFTEST_OK line confirms the new version sends and receives.

Server Components

Component Version or setting Where
OpenAS2 4.15.0 (upstream's binary release) C:\Program Files\OpenAS2\lib\
Java runtime Eclipse Temurin 21.0.13+2 JRE C:\Program Files\OpenAS2\jre\
Service OpenAS2 ("OpenAS2 Server"), procrun, NT SERVICE\OpenAS2, Automatic, restarted on failure Services
AS2 receiver HTTP, TCP 10080 config.xml, firewall group "OpenAS2"
Asynchronous MDN receiver HTTP, TCP 10081 config.xml, firewall group "OpenAS2"
AS2 keys three 3072-bit RSA keys made at first boot, PKCS#12 C:\ProgramData\OpenAS2\as2_certs.p12
Message tracking H2 2.5.252 embedded database, its TCP server off C:\ProgramData\OpenAS2\DB\
Windows Server 2025 Datacenter, Desktop Experience, 24H2, build 26100.33828

Filesystem Layout

Path What it holds
C:\Program Files\OpenAS2\ lib\ (OpenAS2 and its libraries), bin\commons-daemon\ (procrun), jre\, config-template\ (the image's starting configuration), cloudimg\openas2-selftest.ps1, LICENSE.txt (GPL v3), README.txt
C:\ProgramData\OpenAS2\config\ config.xml (made at first boot, holds this VM's passwords), partnerships.xml, logback.xml, commands.xml
C:\ProgramData\OpenAS2\as2_certs.p12, mycompany.cer This VM's keystore and your public certificate
C:\ProgramData\OpenAS2\data\ outbox\<partner AS2 ID>\ (to send), <sender>-<receiver>\inbox\ and msgheaders\ (received), mdn\ (receipts), inbox\error\ (refused)
C:\ProgramData\OpenAS2\DB\, logs\, temp\ The tracking database, the logs (log-<date>.txt and procrun's), the service's temporary files
C:\ProgramData\openas2-credentials.txt Your station's details and the two passwords (SYSTEM and Administrators only)
C:\ProgramData\openas2-firstboot.log, openas2-firstboot.done What the one-time first-boot task did, and the marker it wrote when it finished

C:\ProgramData\OpenAS2\ is readable only by SYSTEM, Administrators and the service account (which may modify it). The OS disk is Microsoft's 127 GB Windows disk (C:, NTFS).

Managing the Service

From an elevated PowerShell window:

Restart-Service OpenAS2
Get-Service OpenAS2 | Format-Table Name, Status, StartType -AutoSize

Stop-Service OpenAS2 and Start-Service OpenAS2 stop and start it; to keep it stopped across restarts, also run Set-Service OpenAS2 -StartupType Disabled (and -StartupType Automatic to undo). Messages your partners send while it is stopped are refused at the network, and their AS2 software retries them later.

On Startup

At the first start of your VM, the scheduled task \cloudimg\OpenAS2 first boot (SYSTEM) runs once:

  1. It waits until Windows setup and Azure have finished setting up the VM
  2. It checks C:\ProgramData\OpenAS2 holds only the image's configuration files, with its locked-down permissions
  3. It makes this VM's keystore password and database password, the three key pairs and your public certificate, writes config.xml from the image's template, and creates the tracking database
  4. It writes C:\ProgramData\openas2-credentials.txt, created with its permissions already in place
  5. It sets the service to Automatic, starts it and waits until it listens on 10080 and 10081
  6. It writes C:\ProgramData\openas2-firstboot.done, then deletes its own task and script
Get-Content C:\ProgramData\openas2-firstboot.log

It runs only once, so there is nothing to turn off. A failure leaves the task in place, so it tries again at the next start.

Troubleshooting

The service is not running, or openas2-firstboot.done is missing

The first-boot task may still be running: give it a few minutes after the VM first starts. Its log (above) shows how far it got; the service's own logs are in C:\ProgramData\OpenAS2\logs\.

A partner's message is refused

Look at the latest C:\ProgramData\OpenAS2\logs\log-<date>.txt, and at the refused copy in data\inbox\error\. The usual causes: the AS2-From or AS2-To ID does not match a partnership in partnerships.xml exactly (IDs are case-sensitive); the message is not signed (this image refuses unsigned messages); or the partner's certificate in the keystore is not the one they sign with.

Your message to a partner fails

The log names the step that failed. Check the partner's as2_url is reachable from the VM (Test-NetConnection as2.acme.example -Port 4080), that their certificate is in the keystore under the x509_alias your partner entry names, and that they have your current certificate. A file that could not be sent is moved to data\outbox\error\.

Forgot the Windows password

Use Reset password on the VM's page in the Azure portal.

Security Recommendations

  • Open port 10080 to your trading partners' addresses only (Step 1), and Remote Desktop to your own, or use Azure Bastion
  • Use HTTPS (Step 7) when a partner supports it: AS2 signs and encrypts the message itself, but HTTPS also hides its headers
  • Keep your private keys on this VM. Send partners only mycompany.cer; never copy as2_certs.p12 or the credentials file off the VM
  • Once your own partners work, you may remove the example partner PartnerB and its partnerships from partnerships.xml; the self-test uses PartnerA
  • Keep Windows Update on, and read OpenAS2's release notes for security fixes

Support

cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours, covering deployment, Remote Desktop access, the AS2 set-up, trading partner configuration and upgrades.

All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.