Bitbucket Pipeline to Build and Deploy on Windows Server hosted in Azure
Asked by Alshafaraz Gazi:

Hi There

I am a newbie to creating pipelines and am trying to build and deploy a NodeJS app to a Windows server.

What would be an optimal solution apart from using Windows Runner on the server? I tried via OpenSSH but couldn't get the fingerprint for the server. I have my private and public keys all in place.

Is there a setting I am missing regarding my server configuration?

Appreciate your time and assistance.


Answers:
author: Theodora Boudale
body: Hi [@Alshafaraz Gazi](/t5/user/viewprofilepage/user-id/5381000),

You mentioned that you couldn't the fingerprint for the server. Just to confirm, are you trying to fetch the fingerprint from **Repository settings \> PIPELINES SSH Keys** of the repo?

What kind of error do you see when you try to add the fingerprint?

If the server is behind a firewall, you may need to allowlist the IP addresses used by bitbucket.org and by Pipelines build environments, see here, sections **Valid IP addresses for bitbucket.org, api.bitbucket.org, and altssh.bitbucket.org** and **Valid IP addresses for Bitbucket Pipelines build environments**:

* <https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>

In case you use a different port to connect to your server via SSH (different than the standard port for SSH, port 22), please ensure you specify the port also along with the domain name or IP address when you fetch the fingerprint.

Kind regards,  
Theodora

comments: author: Alshafaraz Gazi
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) No error pops up.  

I move my attention towards using a windows runner but that to gives me an error:  

PS C:\\Users\\foesacct\\atlassian-bitbucket-pipelines-runner\\bin\> .\\start.ps1 -accountUuid '{c86250f1-3a21-4a63-9e94-2250e3d9441a}' -repositoryUuid '{700e17cc-e2c3-4134-8549-0588e2487c53}' -runnerUuid '{8d0df606-c01f-5fda-9f55-65a139fed95a}' -OAuthClientId tsYU7PzgXHyUzIRpHnREz0PhWOYGM3n0 -OAuthClientSecret ATOAOyIz1T0V8wqmAT3kUSvnmn3o1fzIabmvf9Lht7QhQkv5yqsuGOAZ9oAqCDRuUUkDB7010E47 -workingDirectory '..\\temp'  
Error: A JNI error has occurred, please check your installation and try again  
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/atlassian/pipelines/runner/core/ApplicationImpl has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0  
at java.lang.ClassLoader.defineClass1(Native Method)  
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)  
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)  
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)  
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)  
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)  
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)  
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)  
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)  

I have Java 11 installed on the machine and I even have restarted the server several times still gives the same error:  

<br />

Java version gives:  

PS C:\\Users\\foesacct\\atlassian-bitbucket-pipelines-runner\\bin\> java -version  
openjdk version "1.8.0_302"  
OpenJDK Runtime Environment (Temurin)(build 1.8.0_302-b08)  
OpenJDK 64-Bit Server VM (Temurin)(build 25.302-b08, mixed mode)  


author: Theodora Boudale
body: Hi [@Alshafaraz Gazi](/t5/user/viewprofilepage/user-id/5381000),

The error message indicates that this version of the Java Runtime only recognizes class file versions up to 52.0, which corresponds to Java 8.

I don't know if you have multiple versions of Java installed on this machine, but it looks like your server is using the Java 8 version. If you have multiple versions of Java installed, you can try uninstalling the older version so that your server uses the newer one.

Kind regards,  
Theodora


Tags: azure

bitbucket-cloud

cloud

server