Credential error when running azure script step

Hey @andersfaber,

Great news Paraic managed to guide you to a part way solution, to be honest usually if the issue is TLS related it does show in the error message and a google of the CloseError: ClientSecretCredential authentication failed error you were getting did not mention TLS so good spot by Paraic there.

As for the verification, yes Octopus uses TLS 1.2 as default so that would be why that works from the infrastructure > Accounts screen, from your screenshot of your step it looks like you are running the Azure Script on the Octopus Server but using the tools installed on the worker. This would mean if you are getting the same error on the Octopus Server when running outside of Octopus and you add the [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 line to it and it works…you would need to add that system wide registry key and reboot for Octopus to pick up that PowerShell will now use TLS 1.2.

I am sorry I do not have better news for you but Octopus can only use what is on that box at the time if you are running that script using the tools on the worker so you will need to force the use of TLS 1.2 for powershell in order to get this to work.

Reach out if you set that system wide registry key and reboot and this still does not work as we can dig a bit deeper but I am confident doing that will fix this issue.

Kind Regards,
Clare

1 Like