Azure: Chapter 5
Internet of Things (IoT)
Loosely defined, the Internet of Things (IoT) describes connected devices equipped with sensors that collect data and send that data to an endpoint for logging, processing, and/or other actions.
imagine a connected house where the refrigerator, oven, microwave, lighting systems, garage door, thermostat, and security system all collect and send data to a central app or service to enable the homeowner to monitor and potentially control the function of all of these systems.
consider an automobile manufacturer that builds sensors into its vehicles to monitor performance and sends that data to Azure for real‐time analytics. These scenarios are examples of IoT.
Consider a manufacturing floor where sensors track the manufacturing process and send data back to a centralized system that operators and engineers use to monitor and control the manufacturing process.
Azure IoT Hub
Azure IoT Hub is an Azure‐hosted service that functions as a message hub for bidirectional communication between your deployed IoT devices and Azure services. IoT Hub supports multiple protocols and open source software development kits (SDKs), enabling it to integrate most IoT devices. IoT Hub is highly scalable, which means it can integrate billions of devices.
IoT Hub supports multiple communication and control functions, including the following:
Device‐to‐cloud telemetry to collect data
Device‐to‐cloud file upload to collect and transfer data
Request/reply methods for controlling devices from the cloud
Monitoring
In summary, IoT Hub is the service that integrates your IoT devices and other Azure services. However, IoT Hub does not provide analysis services or dashboards for viewing device state or analyzing data. That is where IoT Central comes in.
Azure IoT Central (cont)
Central provides that simplification through device templates, which allow you to connect to new devices without any coding in IoT Central. IoT Central creates the dashboards, alerts, and other visualization and management elements based on the template. The device just needs to be compatible with the device template specifications. So, if you deploy 1,000 Model RG12 Gold Widgets, you use the corresponding template—which already “knows” how to connect to that device type—to connect to and begin managing those 1,000 devices, all without writing a single line of code.
Azure Sphere
Azure Sphere is an integrated IoT solution that consists of three key parts:
Azure Sphere micro‐controller units (MCUs): The MCU is a hardware component built into the IoT device that processes the OS and signals from attached sensors.
Management software: A custom Linux operating system that manages communication with the security service and runs the vendor's device software.
Azure Sphere Security Service (AS3): This Azure service handles certificate‐based device authentication to Azure, ensures that the device has not been compromised, and pushes OS and other software updates to the device as needed.
Artificial Intelligence
Wikipedia defines artificial intelligence (AI) as “any device that perceives its environment and takes actions that maximize its chance of successfully achieving its goals.” Generally speaking, AI systems simulate human intelligence to process vast amounts of data to learn and problem solve.
AI falls into two broad categories: deep learning and machine learning.
Deep learning uses a system modeled on the human mind to enable the service to discover information, learn, and grow.
Machine learning is a data science technique that uses data to train a data model, test the model for relative accuracy, and then apply the model to new data. A properly trained model should then be able to accurately forecast behaviors, events, and outcomes basZed on its analysis of past data elements.
Azure offers 3 services using AI
Azure Machine Learning
Azure Cognitive Services
Azure Bot Service
Azure Cognitive Services
Azure Cognitive Services provides machine learning models designed to interact with humans and execute cognitive functions that humans would normally do, such as recognizing images. The following list summarizes the services available within Azure Cognitive Services:
Language: Use Azure Cognitive Services to process natural language to determine, for example, the user's sentiment or what the user is requesting or asking.
Speech: Use Cognitive Services to convert speech into text or text into speech. Speech services can also translate from one language to another, as well as recognize and verify a speaker.
Vision: This service provides identification and recognition services for analyzing images, videos, and similar visual data.
Decision: Use this service to personalize a user experience with recommendations, monitor and remove offensive content, and evaluate time‐series data for abnormalities.
Azure Cognitive Services includes a broad range of prebuilt machine learning models that you can use with very little coding. You can also create custom models when needed.
Azure Bot Service
Azure Bot Service enables you to create and use virtual agents to interact with users by answering questions, gathering information, and potentially initiating activities through other Azure services. Azure Bot Service can use other services such as Cognitive Services to understand what users are asking and respond accordingly.
Serverless Computing
Serverless computing enables you to run code without deploying and managing a server to host and run that code. Although ultimately there is a server running your code, that server is abstracted, meaning you have no visibility to or ability to directly interact with the server. Instead, you focus solely on the code and its function. In addition to simplifying management of the solution, Azure handles scaling when needed. In addition, you pay only for the resources used by the code.
Azure offers two primary serverless computing services,
Azure Functions
Azure Logic Apps
Azure Functions
The Azure Functions service enables you to host a single method or function that runs in response to an event such as a queued message, HTTP request, or timer event. You can use any of several programming languages, such as Python, Java, JavaScript, C#, and PowerShell, to create functions. Like many other services, the Azure Functions service scales automatically, enabling your function to scale to meet changes in demand without any interaction or configuration by your developers. Perhaps best of all, you pay only for the time and resources needed while a function is running.
Generally, an Azure function is stateless, meaning it does not store its state from execution to execution. Instead, it executes the same every time it responds to an event. You can configure a function to maintain state by connecting an Azure storage account to the function, enabling it to store its state between executions. You can also use an extension called Durable Functions to chain together functions and maintain their state while the functions are executing.
Azure Functions is an excellent solution for building small blocks of code that run for a very short period in response to a triggering event
Azure Logic Apps
Functions are great for very discrete processing tasks, but when you need something much more complex, like a workflow or a process, Azure Logic Apps is a good solution. Logic Apps enables you to create no‐code and low‐code solutions hosted in Azure to automate and orchestrate tasks, business processes, and workflows. Like Functions, Logic Apps are serverless in that you focus on the app rather than the underlying server or resources needed to maintain and run the app.
You build Logic Apps using a web‐based design environment. Like many workflow solutions, Logic Apps lets you build the app by connecting triggers to actions with various connections. For example, a message arriving in a queue is a trigger. The event you associate with that trigger might be passing the message to another Azure service through that service's connection. Whatever the situation, simply understand that Logic Apps gives you the ability to graphically create low‐code and no‐code complex workflows using a web‐based design environment.
DevOps
Software development can be a complex and time‐consuming process that uses IT services but is not always well integrated into IT. The term DevOps describes process, practices, and services designed to integrate development and IT with the end goal of simplifying and streamlining development efforts while maintaining high quality. For example, assume your development team needs to develop and deploy a new application that will require 20 virtual machines of various types. DevOps services help simplify and automate that deployment process.
Azure DevOps Services
Azure DevOps is not a single service but rather a group of services designed to enable and support development at multiple stages in the development process. The services include the following:
Azure Artifacts: Provides a repository for storing development artifacts such as compiled source code. Artifacts can be used by other services for testing or deployment.
Azure Boards: Provides capabilities for managing development projects and individual items, including user stories, backlog items, tasks, features, and bugs.
Azure Pipelines: Enables you to automatically build and test code projects.
Azure Repos: A source‐code repository for publishing and collaborating on development projects.
Azure Test Plans: Provides an automated testing tool for testing code.
GitHub and GitHub Actions
GitHub is a popular code repository for open source software that enables code sharing, development collaboration, review and discussion, documentation, and other collaboration mechanisms for sharing and collaborating on open source code projects. GitHub Actions provides workflow automation services.
GitHub and GitHub Actions offer many of the same functions as Azure DevOps, and these services can integrate. In general, GitHub is the appropriate choice for collaborating on open source projects and DevOps is the appropriate choice for enterprise/internal projects.
Azure DevTest Labs
Azure DevTest Labs automates the deployment, configuration, and decommissioning of virtual machines and other Azure resources. For example, let's assume you need to deploy 20 virtual machines of various types in a test subnet with specific network security groups and other resources. You can use DevTest Labs to automate that deployment, and when testing is complete, you can decommission all of those services so that you pay only for the resources you need for testing while you are actually testing them. All of this can be largely automated, greatly simplifying the development testing process.
DevTest Labs can use Azure Resource Manager (ARM) templates to deploy nearly any type of Azure resource, enabling your development team to model application environments and quickly provision and decommission not only the servers but support resources as well. However, DevTest Labs does not provide monitoring, alerting, or telemetry services to monitor those resources.
Exam Essentials
Internet of Things The IoT‐related services in Azure enable you to build complex IoT solutions. Azure IoT Hub functions as a hub for bidirectional communication between IoT devices and Azure services. IoT Central builds on IoT Hub to provide visualization, control, and management features for IoT devices. Azure Sphere enables you to deploy and manage IoT solutions through custom devices using a combination of integrated microcontroller units, management software, and certificate‐based security services, ensuring a secure IoT solution tailored to your organization's needs.
Machine Learning and AI Azure Machine Learning consists of a collection of Azure services and tools that you use to train and validate AI models. Azure Cognitive Services provides a comprehensive set of machine learning models to execute cognitive functions that humans would normally do, such as recognizing images, performing speech‐to‐text and text‐to‐speech functions, and translating languages. Azure Bot Service enables you to create and use virtual agents to interact with users, answering questions, gathering information, and initiating corresponding activities.
Development and Serverless Computing With Azure Functions, you can create simple, typically stateless bits of code that execute in response to events. With the addition of a storage account, you can make functions stateful, maintaining their state between executions. Azure Logic Apps, also a serverless computing solution, enables you to build low‐code and no‐code workflow and process solutions using a web‐based design interface.
DevOps features in Azure are designed to simplify code development and collaboration. Azure DevOps Services consists of several services for code management, testing, and deployment. GitHub and GitHub Actions provide many of the same types of features but are targeted and open source projects. Finally, Azure DevTest Labs provides the means for development teams to easily deploy virtual machines and other Azure services for code testing, then quickly and easily decommission those resources when testing is completed