Now create the actual twins (instances):
# Upload models az dt model create --adt-name adt-warehouse-<unique> \ --models models/*.json az dt model list --adt-name adt-warehouse-<unique> -o table hands-on azure digital twins read online
Azure Digital Twins (ADT) gives that data context . It knows that Sensor 47 belongs to Room 312 , which is on the North Wing of Floor 3 , and that room contains a Server Rack . If the temperature rises, ADT understands the impact . Now create the actual twins (instances): # Upload
Azure Digital Twins isn't just a database—it's the of your physical world. Go build something intelligent. Azure Digital Twins isn't just a database—it's the
# --- Compute Logic --- # If temp > 30C, find the parent Zone and mark it as "overheated" if new_temp > 30.0: # Query to find parent Zone query = f"SELECT zone FROM digitaltwins zone JOIN sensor RELATED zone.hasSensor WHERE sensor.$dtId = 'sensor_id'" zones = service_client.query_twins(query) for zone in zones: # Add a computed property zone_patch = ["op": "add", "path": "/alert", "value": "Overheating"] service_client.update_digital_twin(zone['$dtId'], zone_patch) logging.info(f"Alert set on zone zone['$dtId']")
The Problem: You have a building, a factory, or a logistics center. Sensors are streaming data, but the data is "dumb"—it’s just a timestamp and a number. A temperature of 22°C in isolation means nothing.