census-instrumentation / opencensus-python

A stats collection and distributed tracing framework
Apache License 2.0
668 stars 250 forks source link

PowerShell script.: SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] while querying app insights metrics. #1216

Closed Tejas25Jan closed 1 year ago

Tejas25Jan commented 1 year ago

az monitor app-insights query --app $ApplicationId --analytics-query $query --offset 1d | ConvertFrom-Json is failing with error in PowerShell script. az : ERROR: Error occurred in request., SSLError: HTTPSConnectionPool(host='api.applicationinsights.io', port=443): Max retries exceeded with url: /v1/apps/e****-d-4-9-51*****/query (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)'))) At line:6 char:17

... $response = az monitor app-insights query --app $ApplicationId --anal ...

CategoryInfo : NotSpecified: (ERROR: Error oc..._ssl.c:997)'))):String) [], RemoteException
FullyQualifiedErrorId : NativeCommandError
Certificate verification failed. This typically happens when using Azure CLI behind a proxy that intercepts traffic with a self-signed certificate. Please add this certificate to
the trusted CA bundle. More info: https://docs.microsoft.com/cli/azure/use-cli-effectively#work-behind-a-proxy.
Cannot index into a null array.
At line:7 char:5

$impactedRows = $response.tables[0];

CategoryInfo : InvalidOperation: (:) [], RuntimeException FullyQualifiedErrorId : NullArray

lzchen commented 1 year ago

This is not an Opencensus SDK issue.