Last year in Canada alone, 45,000 children disappeared. Scary statistics. In order to maximize the percentage of found a solution was developed using Xamarin and Azure, which we describe under the cat.

Cycle of Microsoft Technical Case Studies
1.
Power BI Embedded, IoT and machine learning for processing brain thermograms .
2.
As in Canada, looking for missing children .
3.
Internet of things in archeology .
4. Loading ...
Introduction
Modern children on “you” with high technologies, they use them for games, communication and study. But with great opportunities comes a great responsibility from both the parents and the children themselves. It is necessary to constantly monitor with whom children communicate and exchange information on the Internet, otherwise misfortune can happen. Amanda Pick, director of the Canadian Missing Children Search Society (MCSC) and her team work tirelessly to prevent misfortunes. They pay special attention to online resources, as attackers are increasingly using them to implement their plans.
')
Bringing every child home is the main goal of the
MCSC (Canadian Missing Children Search Society), a non-profit association with headquarters in Calgary. One of the tasks is to collect information about the child (for example, the last known location and contacts) and transfer it to representatives of local law enforcement agencies.
MCSC works closely not only with the Calgary Municipality and the police, but also with Microsoft. Recently, a joint workshop was held that helped participants understand how Azure, Xamarin, and DevOps best practices will help them quickly and efficiently collect and provide police with information about children who are unaccounted for.
The result of the seminar was an application created on the basis of the following services and techniques:
- Azure features
- Azure Storage Services
- continuous integration;
- infrastructure as a code methodology;
- Visual Studio Team Services;
- Xamarin tools.
The goal of the four-day workshop was to begin using Azure at the MCSC to obtain information about the child’s last known whereabouts, their contacts and social media (for example, Twitter and Facebook).
Formulation of the problem
During the meeting with Amanda and the MCSC team, we studied the problems associated with collecting information about the missing child. It is enough just to find out, for example, what the child was wearing and where he was last seen, but sometimes it took several days or even weeks to get other detailed information.
The Microsoft Canada team has set itself the task of speeding up the collection of additional information. Our goal was to automate the search for information about the child on the Internet by extracting data from his accounts in social networks.

The first half of the day was spent on drawing up a diagram of the current process of transferring to the police information about the missing child.

That's what it was:
- Provide parents and / or children with the opportunity to register their social network accounts in the MCSC database.
- If a registered child goes missing, he or his parent can use the Child Finder solution (via Azure functions) to see the last known location of the child with whom he has contacted and talked about. To do this, it is necessary to use the hashtag #hfm in the social network feed (help find me - “help find me”).
- The Child Finder solution will get all the necessary information directly through the social media API.
- Azure will send the collected information directly to law enforcement agencies, notifying them of the missing child in the relevant area and providing additional information collected through social media.
- Law enforcement representatives will use Azure Active Directory Authentication to enter the application. This ensures that all collected data will be available only to those who have the appropriate rights and powers.
- The application will be available reports and additional information about missing children.
The hashtag #hfm can be used only by those who have access (username and password) to the account. This restriction guarantees the privacy of the child, since only the child himself or people he trusts (for example, his parents) can activate the Azure function to control his account in social networks.
Representatives of the MSCS and the Calgary police were asked to exercise: chart the value stream. This helped them realize the need to optimize and accelerate existing approaches to finding information. This approach confirmed its effectiveness, even taking into account the fact that a completely new process was implemented in the solution. Based on the scheme, a map of resources for specialists was formed.

The team then prepared a data flow diagram for the proposed project. One of the main tasks was to ensure security and provide tools for independent work, due to the confidentiality of the information collected and sent. Twitter OAuth support was implemented so that the child and / or his parents could activate account monitoring. Account data collection is activated using the hashtag #hfm. An entry screen for law enforcement officials was also implemented.
Project Goals
The project implemented for MCSC is based on the following technologies.
Azure web app
- On the basis of Azure, a portal has been created for parents or children who wish to register social network accounts in order to monitor them.
- Azure features were used to monitor registered social media accounts after finding a special hashtag (Azure features allow you to run small pieces of code in the cloud. To solve a specific task, you can write other code that does not require infrastructure or even an entire application to execute).
- When a hashtag is detected, all metadata (location, time and date) and the results of the analysis of messages will be collected and sent to law enforcement agencies using a special mobile application Xamarin.
Xamarin mobile application
- Authentication rules have been developed so that only authorized personnel can gain access.
- Law enforcement representatives receive notifications of new reports and can use applications to view the relevant metadata and the results of the analysis of messages.
- MCSC representatives will also be informed via the same application and will be able to assist in the work of law enforcement agencies.
Devops
- An exercise describing the value stream helped to form a process diagram, as well as a scheme for collecting and distributing information from the database through the Azure web app and the Xamarin mobile app.
- GitHub infrastructure storage (Azure features), authentication (Azure web portal), and client (Xamarin) have been used throughout the project.
- To speed development and deployment, continuous integration flows have been created.
- The infrastructure as a code methodology was used to deploy the environment and components to ensure integrity.
Decisions, steps and results
Process
The child (or his parent) registers a social network account on
the MCSC website , confirming its consent to monitoring. This functionality is implemented as a Node.js application called authorization, which is currently connected to Twitter.

In addition, Azure Logic is used to intercept messages with the #hfm hashtag. The application adds such messages to the service bus queue.
When a message appears in this queue, the Azure function analyzes it and checks against the repository of authorization information in DocumentDB. If the author of the message is registered in the database, the message is added to the next queue, otherwise it is simply ignored.
From the next queue, another Azure function retrieves the message and complements the data. Currently, the process adds location information received from the device from which the tweet was sent, or determined based on the IP address of this device. The added message is added to the third queue.
In the final step, the Azure function saves the message in the appropriate format in DocumentDB.
Upon completion of the operations performed by the Azure functions, the supplemented data will be available to the client through the REST API. The API provides access to information from a user account and data collected from social networks. This API is implemented in a Node.js file that runs on an instance of an Azure web application. The same API is also responsible for authentication in the client application.
The Xamarin mobile app, used by search teams and police, connects to the REST API, allowing you to visualize data and even track the location (if relevant information is available). You can use this application only after authorization. In the next release, reports on all missing children will be published on a centralized information panel, which redirects information to law enforcement agencies within the specified area.
Methods for solving the tasks
The following tools were used in this work.
GitHub - to store all source code released under the Apache license. By placing the source code in the public domain, we connect everyone to this important work and give a wider circle of users the opportunity to use similar systems to search for missing people or to solve other problems related to identifying and tracking people’s locations.
Visual Studio Team Services helped provide support for continuous integration builds and the deployment process. The project team members were in Toronto and Calgary. Thanks to VSTS, they could share code and participate in collaboration.
The Azure platform provided the most simple, cost-effective and scalable services. Given the current set of requirements for processes and storage systems, the solution must handle huge amounts of data with minimal delays.
The Node.js application collects data about self-registration of users who want access to the hashtag. This page can be customized to customer needs.
The process of receiving data allows you to quickly find content that is independently registered by the user. In the current version, we decided to use the Logic App, since it costs much less than the long-running Azure function. A logic app accesses Twitter every 30 seconds. When a tweet with the desired hashtag is detected, the application adds this tweet to the processing queue.
The subsequent process builds on robust Azure functions and queues to ensure proper processing even in the event of errors. Azure features also provide high scalability and minimize costs. Each stage of the process has its own task: to begin with, it is necessary to determine whether the author of the tweet is registered. If such a user is not registered, the message is simply ignored without making copies, which guarantees confidentiality. Further it is necessary to request additional information. In the current version, we focused on adding geospatial data, but you can include other information. Finally, the element is retrieved from the last queue and placed in the DocumentDB database, which is accessed via the REST API using the Xamarin client.
The Xamarin.Forms form helped provide support for Android, iOS and Windows OS deployments, while ensuring a uniform view for users on all available devices and an optimized deployment process. The client application provides data in a convenient format. Due to the full support of REST in Xamarin, we connect to the REST API, import data and display it as a list. The client application allows you to view data (or “cases”) and sort them by the states: “open”, “in the archive” and “viewed”. If geolocation data is present in the selected case, the application will show on the map the last known location of the social network user. In addition, the application uses the MVVM pattern — a standard architecture that RedBit uses in its mobile applications. The RedBit development team helped integrate some of the components of the MVVM Light source code.

Further steps
Facebook / Instagram app . The system supports several channels of various social networks. Data from these networks will be embedded in one process with its own characteristics.
Twitter app . Currently, the logic application uses the JefKingTweets account as the interaction point. In the future, the application will be transferred to the MCSC account.
The frequency of processing tweets in the application of logic . Currently, data is received about once every 30 seconds; this interval can be changed if necessary.
Azure function to add data . The system may collect additional contextual information that will be useful to search teams. For example, you can upload a user's tweets history to find out who his friends are and where he liked to go. You can track new tweets for the next 48 hours and try to determine your location. You can also monitor other geolocation tags that will help locate the child.
Automatically configure the Azure feature . During the project, the Azure feature was configured manually. In the future, in order to simplify management and increase security, automatic configuration will be implemented using Visual Studio Team Services.
DevOps Method
Below we discuss the techniques of DevOps, which were used in the implementation of the project.
Value stream mapping
This exercise is typically performed on an existing set of processes and actions related to the development of a specific solution. In this case, we studied the existing process and listened to suggestions for improvement from representatives of the MCSC, the police and the Calgary municipality. As mentioned earlier, the project team made the diagrams and carefully studied the features of Azure and the client application. It was possible not only to identify opportunities for optimization, but also to realize them in order to accelerate the development of the solution and achieve a high level of automation. As a result of Value stream mapping, the following functions are added to this project:
- Authentication in the mobile application . With its help, law enforcement officials receive secure access to data on missing children, which the Azure feature transmits from your Twitter account.
- Twitter profile picture . The image has been added to the report, as it can also help in finding the missing child.
GitHub Repository
A new organization on GitHub and several repositories have been created to simplify and speed up the work of the teams of specialists participating in the project.

As a result, the repositories were created:
- authorization: client authorization in a social network;
- client: development of the Xamarin application;
- client-api: API for client devices;
- client-registration: registration of push notifications;
- infrastructure: Azure infrastructure;
- messaging: sending and processing server messages.
Continuous integration
To speed build and deployment, we created four continuous integration streams in Visual Studio Team Services:
- client-api-ci;
- messaging-ci;
- authorization-ci;
- Infra-DEV-CI.

Each of them includes tasks to create the correct assembly, including npm, gulp, Grunt, and others (depending on the language and type of assembly). Xamarin client applications are deployed using HockeyApp solution in Visual Studio Team Services.
Continuous deployment
Four release control queues have been created so that the team can create software within short cycles. This approach provides the possibility of release at any time. The HockeyApp platform provided additional flexibility, since applications are delivered directly to devices, there is no need to place a client application in the store. This approach speeds up all processes and reduces the costs and risks associated with deploying changes, allowing you to install incremental updates for applications in a production environment.

Infrastructure as a code
The infrastructure for the solution is created using a set of JSON templates that are used to deploy the environment and other components that are required by the solution. JSON templates are uploaded to the infrastructure repository on GitHub, they are subject to the same build and release management process as the rest of the source code. This process ensures consistent deployment for a group of resources in a development, test, and production environment.

Conclusion
The project team has successfully developed a registration procedure for identifying users, a process for collecting, processing and supplementing data, an API and an application for client devices.
These components will help MCSC to quickly create and optimize their services. Thanks to the application of the DevOps technique, the process of optimization and expansion of possibilities is considerably accelerated.

In addition, during the course of the work, the project team successfully obtained GPS data from Twitter and Facebook and presented this data in the Xamarin application.
In the process of developing the structural scheme of the project, the need to create an information panel for the central office was identified, so that information could be checked before sending it to local law enforcement agencies. This feature will be implemented in the next release.
Representatives of MCSC, the police and the Calgary Municipality appreciated the possibility of continuous improvement of the code, the deployment of additional functions through GitHub and the transfer of applications to mobile devices using HockeyApp.
We remind you that you can try Microsoft Azure for free
here .
If you see an inaccuracy of the translation, please report this to private messages.