New-NCentralConnection Issues with Az.Storage Module
I recently found that the line of code below causes some Microsoft Az module commands to throw a general exception with the message: "An error occurred while sending the request."
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
I received this when trying to call "Get-AzStorageTable" after using New-NCentralConnection. I was able to workaround the issue by manually setting the ServerCertificateValidationCallback to the default value of $null before using any commands in the Az.Storage module.
Workaround:
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = $null
OK. I will see if I can switch this before every request and reset afterwards. Thx. for troubleshooting ;-) .
This was also preventing me from running any Invoke-WebRequest or Invoke-RestMethod commands later in my script. Using the workaround after establishing the connection allows the rest of my script to work. Additional calls to the PS-NCentral module also work.
Thx. for testing. I will remove the setting from PS-NCentral 1.6 since it does not seem to make a difference to PS-NCentral.