Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,19 @@
|
|
| 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 |
-
|
| 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(
|
| 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')
|
| 22 |
|
|
@@ -52,4 +49,3 @@ function_url = st.text_input('Function URL')
|
|
| 52 |
if st.button('Call Azure Function'):
|
| 53 |
response = requests.get(function_url)
|
| 54 |
st.write('Function Response:', response.text)
|
| 55 |
-
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
from azure.cosmos import CosmosClient, PartitionKey
|
| 4 |
from azure.storage.blob import BlobServiceClient
|
| 5 |
import requests
|
|
|
|
| 6 |
|
| 7 |
# Environment Variables
|
| 8 |
+
COSMOS_CONNECTION_STRING = os.getenv('COSMOS_CONNECTION_STRING')
|
|
|
|
| 9 |
BLOB_STORAGE_CONNECTION_STRING = os.getenv('BLOB_STORAGE_CONNECTION_STRING')
|
| 10 |
|
| 11 |
# Initialize Azure Cosmos DB Client
|
| 12 |
+
cosmos_client = CosmosClient.from_connection_string(COSMOS_CONNECTION_STRING)
|
| 13 |
|
| 14 |
# Initialize Azure Blob Storage Client
|
| 15 |
blob_service = BlobServiceClient.from_connection_string(BLOB_STORAGE_CONNECTION_STRING)
|
| 16 |
|
|
|
|
| 17 |
# Streamlit UI
|
| 18 |
st.title('Azure Services Integration with Streamlit')
|
| 19 |
|
|
|
|
| 49 |
if st.button('Call Azure Function'):
|
| 50 |
response = requests.get(function_url)
|
| 51 |
st.write('Function Response:', response.text)
|
|
|