A simple key-value storage implementation using Azure Blob Storage as backend.
- Key-value storage with string values
- Automatic container creation
- Time marker functionality
- Thread-safe operations
pip install az-func-statefrom azfuncstate import AzFuncState
# Initialize with your connection string
conn_str = "YOUR_CONNECTION_STRING"
state = AzFuncState(connection_string=conn_str, container_name="mystate")
# Basic key-value operations
state.set("user:123", "active")
status = state.get("user:123") # Returns "active"
# Time marker operations
state.set_time_marker("last_updated")
last_update = state.get_time_marker("last_updated")Initialize the state storage.
connection_string: Azure Storage account connection stringcontainer_name: Name of the container to use
Store a key-value pair.
Retrieve a value by key. Returns None if key doesn't exist.
Store current UTC timestamp under the given key.
Retrieve a stored timestamp. Raises ValueError if key doesn't exist.
- Python 3.12+
- azure-storage-blob package