Spaces:
Running
Running
Update backup1.app.py
Browse files- backup1.app.py +4 -2
backup1.app.py
CHANGED
@@ -9,6 +9,7 @@ SUBSCRIPTION_ID = "003fba60-5b3f-48f4-ab36-3ed11bc40816"
|
|
9 |
# You'll need to set these environment variables or use Azure Key Vault
|
10 |
DATABASE_NAME = os.environ.get("COSMOS_DATABASE_NAME")
|
11 |
CONTAINER_NAME = os.environ.get("COSMOS_CONTAINER_NAME")
|
|
|
12 |
|
13 |
def insert_record(record):
|
14 |
try:
|
@@ -26,7 +27,8 @@ if 'logged_in' not in st.session_state:
|
|
26 |
|
27 |
if not st.session_state.logged_in:
|
28 |
st.subheader("π Login")
|
29 |
-
input_key = st.text_input("Enter your Cosmos DB Primary Key", type="password")
|
|
|
30 |
if st.button("π Login"):
|
31 |
if input_key:
|
32 |
st.session_state.primary_key = input_key
|
@@ -66,7 +68,7 @@ else:
|
|
66 |
# Logout button
|
67 |
if st.button("πͺ Logout"):
|
68 |
st.session_state.logged_in = False
|
69 |
-
st.
|
70 |
|
71 |
# Display connection info
|
72 |
st.sidebar.subheader("π Connection Information")
|
|
|
9 |
# You'll need to set these environment variables or use Azure Key Vault
|
10 |
DATABASE_NAME = os.environ.get("COSMOS_DATABASE_NAME")
|
11 |
CONTAINER_NAME = os.environ.get("COSMOS_CONTAINER_NAME")
|
12 |
+
Key = os.environ.get("Key")
|
13 |
|
14 |
def insert_record(record):
|
15 |
try:
|
|
|
27 |
|
28 |
if not st.session_state.logged_in:
|
29 |
st.subheader("π Login")
|
30 |
+
#input_key = st.text_input("Enter your Cosmos DB Primary Key", type="password")
|
31 |
+
input_key = Key
|
32 |
if st.button("π Login"):
|
33 |
if input_key:
|
34 |
st.session_state.primary_key = input_key
|
|
|
68 |
# Logout button
|
69 |
if st.button("πͺ Logout"):
|
70 |
st.session_state.logged_in = False
|
71 |
+
st.rerun()
|
72 |
|
73 |
# Display connection info
|
74 |
st.sidebar.subheader("π Connection Information")
|