Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-NCentralConnection Issues with Az.Storage Module #10

Open
ngiunta91 opened this issue Sep 12, 2022 · 3 comments
Open

New-NCentralConnection Issues with Az.Storage Module #10

ngiunta91 opened this issue Sep 12, 2022 · 3 comments

Comments

@ngiunta91
Copy link

ngiunta91 commented Sep 12, 2022

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

@ToschAutomatisering
Copy link
Owner

OK. I will see if I can switch this before every request and reset afterwards.
Thx. for troubleshooting ;-) .

@aaronh-nbit
Copy link

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.

@ToschAutomatisering
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants