How to change api-version connecting Azure Confidential Ledger in python?

Amin 1 Reputation point
2022-10-11T18:59:48.267+00:00

I connect to "Azure Confidential Ledger" with the following code:

from azure.confidentialledger import ConfidentialLedgerClient  
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient  
from azure.identity import DefaultAzureCredential  
  
identity_client = ConfidentialLedgerCertificateClient()  
network_identity = identity_client.get_ledger_identity(  
    ledger_id="testACL"  
)  
  
ledger_tls_cert_file_name = "ledger_certificate.pem"  
with open(ledger_tls_cert_file_name, "w") as cert_file:  
    cert_file.write(network_identity["ledgerTlsCertificate"])  
  
credential = DefaultAzureCredential()  
ledger_client = ConfidentialLedgerClient(  
    endpoint="https://testACL.confidential-ledger.azure.com",  
    credential=credential,  
    ledger_certificate_path=ledger_tls_cert_file_name  
)  
  
ranged_result = ledger_client.list_ledger_entries()  
  
for i, r in enumerate(ranged_result):  
    print(i, r)  

However, the error description is as follow:

Traceback (most recent call last): File "X", line 23, in for i, r in enumerate(ranged_result):

File "C:\Users\Administrator.venv\lib\site-packages\azure\core\paging.py", line 128, in next return next(self._page_iterator)

File "C:\Users\Administrator.venv\lib\site-packages\azure\core\paging.py", line 76, in next self._response = self._get_next(self.continuation_token)

File "C:\Users\Administrator.venv\lib\site-packages\azure\confidentialledger_operations_operations.py", line 732, in get_next raise HttpResponseError(response=response) azure.core.exceptions.HttpResponseError: (QueryParameterError) Parsed api-version 2022-05-13 is not available. Please use one of the following versions: 2022-04-20-preview,0.1-preview Code: QueryParameterError Message: Parsed api-version 2022-05-13 is not available. Please use one of the following versions: 2022-04-20-preview,0.1-preview

How should I change "api-version" from "2022-05-13" to "2022-04-20-preview"?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,526 questions
{count} votes