-
Notifications
You must be signed in to change notification settings - Fork 5
/
Blob_Storage.py
34 lines (21 loc) · 863 Bytes
/
Blob_Storage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from azure.storage.blob import PublicAccess
from azure.storage.blob import BlobServiceClient
import os
connection_string="xxxxxx"
SAS_token= "xxxx"
BLOB_Service_SAS_token="xxxx"
from azure.storage.blob import BlobServiceClient
blob_service_client = BlobServiceClient(
account_url="https://xxxxx.blob.core.windows.net/",
credential=SAS_token
)
from azure.storage.blob import BlobClient
blob = BlobClient.from_connection_string(conn_str=connection_string, container_name="xxxx", blob_name="nodes.html")
with open("./nodes.html", "rb") as data:
blob.upload_blob(data)
#upload CSV
from azure.storage.blob import BlobClient
df.to_csv('csvSample.csv')
blob = BlobClient.from_connection_string(conn_str=connection_string, container_name="xxxx", blob_name="csvSample.csv")
with open("./csvSample.csv", "rb") as data:
blob.upload_blob(data)