AI Python Apps for Azure Cosmos DB, Azure Blob Storage, Azure Container Registry, and Azure Container Apps
- Create an azure subscription, azure resource group, azure cosmos db, azure blob storage account.
- Download Azure Storage Explorer and Azurite for ABS.
- Download document db quick start.
https://www.youtube.com/playlist?list=PLHgX2IExbFos07Jf1iT2gg94A2IArbmLC
https://github.com/AaronCWacker/AI-Azure-Cosmos-DB-Azure-Blob-Storage
- Inspect Data Explorer. Which Features Do you See?
- New Container
- New Database
- New SQL Query
- Open Query
- New Stored Procedure
- New Item
- Upload Item
- Inspect Storage Explorer. Enumerate Features.
- Storage Accounts
- Blob Containers
- File Shares
- Queues
- Tables
- Emulator (Download Azurite for local ABS Development
Create a streamlit python app that uses Azure Cosmos DB (ACDB) and Azure Blob Storage (ABS) to connect to Azure and run queries and save and download file resources and data. The UI should include the following sidebar buttons adding appropriate emojis. Create two expanders with emojis on labels one to contain the ACDB UI Elements and one for the ABS UI Elements. For ACDB use this list of ffeatures to each create a button for: 1. New Container 2. New Database 3. New SQL Query 4. Open Query 5. New Stored Procedure 6. New Item 7. Upload Item For ABS use this list of features to each create a button for: 1. Storage Accounts 2. Blob Containers 3. File Shares 4. Queues 5. Tables 6. Emulator (Download Azurite for local ABS Development import the required python libraries for both Azure Cosmos DB and Azure Blob Storage. Add basic UI to Supply a Connection String and Primary Key for ABS. Do the Same to create basic UI connectivity to Azure Cosmos DB. For both of those create the UI elements in center area with streamlit wide and keep the two expanders open by default on streamlit sidebar.
import streamlit as st
# Import Azure libraries (placeholder, you will need to replace with actual libraries)
# from azure.storage.blob import BlobServiceClient
# from azure.cosmos import CosmosClient
# Function to create ACDB buttons
def create_acdb_buttons():
st.button("๐๏ธ New Container")
st.button("๐พ New Database")
st.button("๐ New SQL Query")
st.button("๐ Open Query")
st.button("๐ New Stored Procedure")
st.button("โ New Item")
st.button("โฌ๏ธ Upload Item")
# Function to create ABS buttons
def create_abs_buttons():
st.button("๐ฆ Storage Accounts")
st.button("๐๏ธ Blob Containers")
st.button("๐ File Shares")
st.button("๐ Queues")
st.button("๐ Tables")
st.button("๐งช Emulator (Download Azurite)")
# UI for Azure Blob Storage connectivity
def abs_connectivity_ui():
st.text_input("ABS Connection String", "Enter your connection string here")
st.text_input("ABS Primary Key", "Enter your primary key here")
# UI for Azure Cosmos DB connectivity
def acdb_connectivity_ui():
st.text_input("ACDB Connection String", "Enter your connection string here")
st.text_input("ACDB Primary Key", "Enter your primary key here")
# Main app layout
def main():
st.sidebar.title("Azure Integration App")
# ACDB Expander
with st.sidebar.expander("Azure Cosmos DB ๐", expanded=True):
create_acdb_buttons()
# ABS Expander
with st.sidebar.expander("Azure Blob Storage ๐๏ธ", expanded=True):
create_abs_buttons()
# Main area for ABS and ACDB connectivity
st.title("Azure Connectivity")
with st.container():
st.header("Azure Blob Storage Connectivity")
abs_connectivity_ui()
st.header("Azure Cosmos DB Connectivity")
acdb_connectivity_ui()
if __name__ == "__main__":
main()