# Issues with SonarQube integration with Azure DevOps

**URL:** <https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312>\
**Category:** SonarQube Server / Community Build\
**Created:** [July 1, 2022, 8:08am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312 "2022-07-01T08:08:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross93](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@Ross93](https://community.sonarsource.com/u/Ross93)\
**Post date:** [July 1, 2022, 8:08am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/1 "2022-07-01T08:08:36Z")

</div>

Version: \* Developer Edition Version 9.2.1

We are trying to add integration between Azure DevOps services and SonarQube but falling over at the first hurdle.

We have SonarQube server setup on a virtual PC within the company network (accessible within the local network or via VPN).

I have created a PAT in DevOps with full access and attempted to setup the integration in SonarQube but when I enter ‘Check Confiugration’ I get the error:

‘Invalid Azure URL or Personal Access Token’

Both the URL and PAT are valid so I believe there must be an issue with the connection between SonarQube and Azure Devops. Could this be due to the location of the SonarQube server? Are other ports required to be opened outside of port 9000?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [July 1, 2022, 8:20am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/2 "2022-07-01T08:20:39Z")

</div>

Hey there.

The connection logging was greatly improved in SonarQube _v9.5_ ([SONAR-15064](https://jira.sonarsource.com/browse/SONAR-15064)), which is also currently the only supported version of SonarQube _v9.x_.

My first recommendation would be [upgrading](https://docs.sonarqube.org/latest/setup/upgrading/).

---

<div class="post-metadata">

**Author:** ![Ross93](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@Ross93](https://community.sonarsource.com/u/Ross93)\
**Post date:** [July 1, 2022, 9:34am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/3 "2022-07-01T09:34:52Z")

</div>

I’ll look into upgrading the server first to v9.5

---

<div class="post-metadata">

**Author:** ![Ross93](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@Ross93](https://community.sonarsource.com/u/Ross93)\
**Post date:** [August 10, 2022, 2:13pm UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/4 "2022-08-10T14:13:13Z")

</div>

Hi, I’ve since upgraded the server to v9.5. The issue still stands here is the log after pressing ‘Check Configuration’:

2022.08.10 15:12:24 ERROR web[AYKH/p8Xmt+VEz+hAABK][o.s.a.c.a.AzureDevOpsHttpClient] Unable to contact Azure DevOps server for request [[Azure DevOps Services | Sign In](https://dev.azure.com/coherent/_apis/projects?api-version=3.0)]: [Connection reset]

This is with Debug enabled:

2022.08.10 15:19:28 DEBUG web[AYKH/p8Xmt+VEz+hAABg][o.s.a.c.a.AzureDevOpsHttpClient] check pat : [[Azure DevOps Services | Sign In](https://dev.azure.com/coherent/_apis/projects?api-version=3.0)]  
2022.08.10 15:19:29 ERROR web[AYKH/p8Xmt+VEz+hAABg][o.s.a.c.a.AzureDevOpsHttpClient] Unable to contact Azure DevOps server for request [[Azure DevOps Services | Sign In](https://dev.azure.com/coherent/_apis/projects?api-version=3.0)]: [Connection reset]

---

<div class="post-metadata">

**Author:** ![Ross93](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@Ross93](https://community.sonarsource.com/u/Ross93)\
**Post date:** [August 11, 2022, 7:01am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/5 "2022-08-11T07:01:09Z")

</div>

Hi would it be possible to get some input on this? Is this issue due the sonarqube server being on virtual PC on the domain network? Do I need to contact IT to open certain ports? Is a reverse proxy required to be configured?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 11, 2022, 7:37am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/6 "2022-08-11T07:37:10Z")

</div>

Please do not bump threads after less than a day.

It looks like your server can’t get in touch with Azure DevOps – I would suggest you take SonarQube out of the picture entirely and test the connection using a tool like [SSLPoke](https://github.com/MichalHecko/SSLPoke).

---

<div class="post-metadata">

**Author:** ![Ross93](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@Ross93](https://community.sonarsource.com/u/Ross93)\
**Post date:** [August 11, 2022, 9:46am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/7 "2022-08-11T09:46:08Z")

</div>

Apologies, I’ve tried SSLPoke and get the errors:

```auto
java SSLPoke dev.azure.com 443

javax.net.ssl.SSLException: Connection reset
        at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:127)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:369)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:312)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:307)
        at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:144)
        at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1369)
        at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1278)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:401)
        at java.base/sun.security.ssl.SSLSocketImpl.ensureNegotiated(SSLSocketImpl.java:817)
        at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1183)
        at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1155)
        at SSLPoke.main(SSLPoke.java:23)
        Suppressed: java.net.SocketException: Connection reset by peer: socket write error
                at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
                at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
                at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
                at java.base/sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:83)
                at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:400)
                ... 10 more
Caused by: java.net.SocketException: Connection reset
        at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
        at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
        at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
        at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
        at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
        at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:110)
        ... 7 more

```

I just realised I used the wrong port there, it should be 9000: After doing the same command with port 9000, I get:

```auto
java SSLPoke dev.azure.com 9000

java.net.ConnectException: Connection timed out: connect
        at java.base/java.net.PlainSocketImpl.connect0(Native Method)
        at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.base/java.net.Socket.connect(Socket.java:608)
        at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:287)
        at java.base/sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:146)
        at java.base/sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88)
        at SSLPoke.main(SSLPoke.java:17)

```

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 11, 2022, 11:05am UTC](https://community.sonarsource.com/t/issues-with-sonarqube-integration-with-azure-devops/67312/8 "2022-08-11T11:05:25Z")

</div>

I don’t think the port should be 9000 for Azure DevOps – that’s the default port of your SonarQube instance, not Azure DevOps.

In any case it looks like a connectivity issue between your server and Azure, not something specific to SonarQube. You should engage your network/system administration team.
