I am try to use the below code to connect to storage account blobs using the access token that has been generated against the below scope :
> scopes : ['https://storage.azure.com/user_impersonation']
> ```
>
>
> access token is correct since i am able to call the rest api for storage account to list the containers. But below code does not works as expected. Any help on this will be super helpful !!:
>
```python
>
> def list_containers_(access_token, page=1, page_size=10):
> try:
> account_url = "https://{}.blob.core.windows.net".format("userdatastore")
> blob_svc = BlobServiceClient(account_url=account_url, credential=access_token)
>
> containers = blob_svc.list_containers(include_metadata=True)
> total_length = 0
>
> container_data=[]
>
> for i in containers:
> if i["name"] in ["azure-webjobs-hosts", "azure-webjobs-secrets"]:
> continue
> i["metadata"]["name"] = i["name"]
> i["metadata"]["size"] = container_size(blob_svc, i["name"])
> container_data.append(i["metadata"])
> total_length += 1
>
>
> start_idx = (page - 1) * page_size
> end_idx = start_idx + page_size
> paginated_container_data = container_data[start_idx:end_idx]
>
> return paginated_container_data, {"total_length": total_length, "page_no": page, "page_size": page_size}
>
> except Exception as e:
> return str(e), 400
> ```
>
>
>