stephaneey / azure-apim-extension

Full Azure API Management suite and more VSTS extension
MIT License
66 stars 48 forks source link

API Management TLS 1.0/1.1 Connection ERROR #127

Open btejedor opened 2 years ago

btejedor commented 2 years ago

Error connecting Api Management via TLS 1.0/1.2 from azure devops task "Create or Update Product" and "Create or Update API"

Trace:

2022-08-05T08:29:40.5172679Z ##[debug]POST https://login.windows.net/***/oauth2/token with -1-byte payload 2022-08-05T08:29:40.7623310Z 2022-08-05T08:29:40.7661676Z ##[debug]Leaving C:\vstsagent\A1_work_tasks\apim_3b398826-5e89-4a34-a708-f801fc9ba1c3\3.0.0\apim.ps1. 2022-08-05T08:29:40.7713234Z ##[debug]Caught exception from task script. 2022-08-05T08:29:40.7748225Z ##[debug]Error record: **2022-08-05T08:29:40.9015363Z ##[debug]Invoke-WebRequest : {"error":"invalid_request","error_description":"AADSTS1002016: You are using TLS version 1.0, 1.1 and/or 3DES cipher which are deprecated to improve the security posture of Azure AD. Your TenantID is: ***. Please refer to https://go.microsoft.com/fwlink/?linkid=2161187 and conduct needed actions to remediate the issue. For further questions, please contact your administrator.\r\nTrace ID: d594ab8a-904c-4cac-87d3-f295e2743300\r\nCorrelation ID: 5bdc1d74-40f9-4066-ab8a-6e0e3224f801\r\nTimestamp: 2022-08-05 08:29:40Z","error_codes":[1002016],"timestamp":"2022-08-05 08:29:40Z","trace_id":"d594ab8a-904c-4cac-87d3-f295e2743300","correlation_id":"5bdc1d74-40f9-4066-ab8a-6e0e3224f801"} 2022-08-05T08:29:40.9027089Z ##[debug]At C:\vstsagent\A1_work_tasks\apim_3b398826-5e89-4a34-a708-f801fc9ba1c3\3.0.0\apim.ps1:77 char:10 2022-08-05T08:29:40.9041096Z ##[debug]+ ... $resp=Invoke-WebRequest -UseBasicParsing -Uri "https://login.wi ... 2022-08-05T08:29:40.9055231Z ##[debug]+ ~~~~~~~~~~~~~ 2022-08-05T08:29:40.9068358Z ##[debug] + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption 2022-08-05T08:29:40.9217334Z ##[debug] + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand 2022-08-05T08:29:40.9244427Z ##[debug]Script stack trace: 2022-08-05T08:29:40.9286852Z ##[debug]at , C:\vstsagent\A1_work_tasks\apim_3b398826-5e89-4a34-a708-f801fc9ba1c3\3.0.0\apim.ps1: line 77 2022-08-05T08:29:40.9302235Z ##[debug]at , : line 1 2022-08-05T08:29:40.9315487Z ##[debug]at , : line 22 2022-08-05T08:29:40.9328966Z ##[debug]at , : line 18 2022-08-05T08:29:40.9341029Z ##[debug]at , : line 1 2022-08-05T08:29:40.9361196Z ##[debug]Exception: 2022-08-05T08:29:40.9524120Z ##[debug]System.Net.WebException: The remote server returned an error: (400) Bad Request.** 2022-08-05T08:29:40.9539752Z ##[debug] at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request) 2022-08-05T08:29:40.9553816Z ##[debug] at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()

btejedor commented 2 years ago

@stephaneey can you help me with this issue please?

Thanks!

lufa12 commented 2 years ago

Hello,

I have the same issues. Thanks for help

btejedor commented 2 years ago

@lufa12 the solution is adding a new agent job Azure Pipelines / windows-latest and add all the tasks wich connect to Api Management, this agent job connect with TLS 1.2