-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (18 loc) · 693 Bytes
/
main.py
File metadata and controls
25 lines (18 loc) · 693 Bytes
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
from azure.storage.blob import BlobServiceClient
import os
blob_conn_str = os.getenv('BLOBCONNSTR')
blob_container = os.getenv('BLOBCONTAINER')
def read_week_config():
week_config = "config_semana.txt"
blob_service_client = BlobServiceClient.from_connection_string(blob_conn_str)
container_client = blob_service_client.get_container_client(blob_container)
try:
blob_client = container_client.get_blob_client(week_config)
# Read the content of the blob
blob_data = blob_client.download_blob().readall()
except:
return None
data = blob_data.decode("utf-8")
data = data.replace(" ", "")
data = data.split(",")
return data