Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13951

Using azure-sdk-for-python and MetricsQueryClient(credential).query_resource method produces a warning: 'InsecureRequestWarning: Unverified HTTPS requ

$
0
0

I have a python script where I want to check transaction number for my storage account, I am using:

`cred = DefaultAzureCredential()    client_metrics = MetricsQueryClient(cred)#the response is provided as timeseries data with daily number of transactions for past 30 daysresponse = client_metrics.query_resource(    resource_id,    metric_names=["Transactions"],    timespan=timedelta(days=30),    granularity=timedelta(days=1),    aggregations=[MetricAggregationType.TOTAL])`

When I run it I'm getting a warning:

/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host 'management.azure.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warningswarnings.warn(

I have run it locally (VS Code, Windows) and on Github Actions (using OIDC), and keep getting the same warning (with different path at the beginning), but only when I run with |& tee -a output.txt to collect both stdout and stderr.

I am quite new to Azure and APIs in general, how can I make the connection safer?


Viewing all articles
Browse latest Browse all 13951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>