#### 6.1.5 Application in Microsoft Azure Cloud
The semantic type enables IoT Central, which can make some kind of assumption about how to treat the value. The capabilities we can assign to our models are:  
* _properties_--data fields that represent the state of the device;
* _telemetry_--telemetry (measurements) from sensors;
* _command_--methods that users can execute on the device (e.g., control commands). The structure of our device named _conveyor-system1_ is as follows, where the first entry is the system name and the second entry is the capability type: turnOn (_command_), turnOff (_command_), produced (_telemetry_), entered (_telemetry_), on_line (_telemetry_), temperature (_telemetry_), location (_property_). The device connection is handled using SAS (Shared access signature) authentication. We connect our device model in the cloud to Node-RED using scope ID, Device ID and Primary key data. We can then view the data that our cloud application receives. Notice Figure 14, where we can see three values that our cloud is receiving--_Totally produced_, _Entered on line_ and _Currently on line_. _Totally produced_ means how many products have been produced and submitted for shipment. _Entered on line_ is the number of semi-finished products (pieces of raw material) placed on the conveyor belt. _Currently on line_ is the number of actual semi-finished and finished products on the belt. There is also a map that can show where a given production is taking place. Next to it is a graph that shows us the air temperature in that factory. Since our production line is not real, we just simulate the temperature by generating random values in Node-RED in the range of 18 to 25. We can also send a signal from Node-RED during the application run that the air temperature is 100 degrees Celsius. In this case, we have implemented an **event (alarm)** on the Azure IoT Central side, which ensures that an email is sent to the authorised personnel. This demonstrates the basic form of **data processing and evaluation** based upon which the event is executed. Events in Azure IoT Central can be selected from predefined types or custom functions can be programmed using Azure Functions (serverless architecture). We will briefly describe how the data are sent in Node-RED, using the example of the generation of temperature values (Figure 15). We start by using the _timestamp_ node, which provides us with the cyclic execution of a given program flow. Next, we use the _random_ node (named _Temperature_ in Figure 15), which generates random integers from 18 to 25. This node goes into its own _temperature_ function, where we insert an identifier  
Figure 14: Dashboard in Azure IoT Central. into the _msg.payload_ of our message that is identical to the identifier of the temperature variable in the cloud on the given device model (twin). We also have an _inject 100_ node ready, which we can manually push to send a temperature value of 100 degrees Celsius to simulate a fire on the production floor. Finally, the whole branch goes into the _Azure IoT Central_ node where the device ID on the cloud and the access key is defined. In addition to this, the communication protocol is also defined here, in our case it is MQTT. One can also communicate over AMQP or HTTPS. We use the _azure-iot-central 1.6.0_ library. We can also **intervene** in our virtual production system using the cloud application. We demonstrated this by implementing the ability to emergency **pause and start the line**. In Figure 14, we can see the buttons in the upper right corner that provide this. First of all, it is needed to configure in Azure IoT Central node what commands this node listens for. In our case, these will be _turnOff_ and _turnOn_. Another important element is the JavaScript functions that will respond to these commands from the cloud application (Figure 16). These functions must be registered in the context of our Node-RED flow (_flow context_). This is carried out (in the case of line suspend) using command flow.set('turnOff','turnOff); The Azure IoT Central node takes care of the rest.