Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,21 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
from azure.cosmos import CosmosClient, PartitionKey
|
| 3 |
from azure.storage.blob import BlobServiceClient
|
| 4 |
import requests
|
| 5 |
from azure.identity import DefaultAzureCredential
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Streamlit UI
|
| 15 |
st.title('Azure Services Integration with Streamlit')
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import os
|
| 3 |
from azure.cosmos import CosmosClient, PartitionKey
|
| 4 |
from azure.storage.blob import BlobServiceClient
|
| 5 |
import requests
|
| 6 |
from azure.identity import DefaultAzureCredential
|
| 7 |
|
| 8 |
+
# Environment Variables
|
| 9 |
+
COSMOS_ACCOUNT_URL = os.getenv('COSMOS_ACCOUNT_URL')
|
| 10 |
+
COSMOS_ACCOUNT_KEY = os.getenv('COSMOS_ACCOUNT_KEY')
|
| 11 |
+
BLOB_STORAGE_CONNECTION_STRING = os.getenv('BLOB_STORAGE_CONNECTION_STRING')
|
| 12 |
+
|
| 13 |
+
# Initialize Azure Cosmos DB Client
|
| 14 |
+
cosmos_client = CosmosClient(COSMOS_ACCOUNT_URL, credential=DefaultAzureCredential())
|
| 15 |
+
|
| 16 |
+
# Initialize Azure Blob Storage Client
|
| 17 |
+
blob_service = BlobServiceClient.from_connection_string(BLOB_STORAGE_CONNECTION_STRING)
|
| 18 |
+
|
| 19 |
|
| 20 |
# Streamlit UI
|
| 21 |
st.title('Azure Services Integration with Streamlit')
|