You can deploy preconfigured solutions that implement common Internet of Things (IoT) scenarios to Microsoft Azure using your Azure subscription. You can use preconfigured solutions:
- as a starting point for your own IoT solution.
- to learn about the most common patterns in IoT solution design and development.
Each preconfigured solution implements a common IoT scenario and is a complete, end-to-end implementation. You can deploy the Azure IoT Suite Connected factory preconfigured solution from https://www.azureiotsuite.com, following the guidance outlined in this document. In addition, you can download the complete source code from this repository to customize and extend the solution to meet your specific requirements.
The Connected factory Preconfigured Solution illustrates how you can get started with your Industrie 4.0 digital transformation. It brings together key Azure IoT services to enable the following features: OPC UA data ingestion, OPC UA server management, rules and actions and Azure Time Series Insights.
When using the build.ps1 script for deployment, it is recommended that you use a new deployment name each time you deploy the connected factory solution.
It takes approximately 14 minutes to complete the deployment.
After you have successfully deployed the solution and the web application launches the first time it takes approximately 3 minutes for data to show in the solution dashboard.
Connected factory supports the Bing Maps API to show factory locations in the dashboard. Please check the Connected factory FAQ for more details.
The configuration of the Connected factory preconfigured solution is handled in more detail here.
If you want to add a new gateway to the Connected factory, please follow the instructions on this page.
To upload and start the simulation in the VM, we are adding a public IP interface before we upload the VM scripts and executables. This interface is removed after the operation is completed. The network interface of the VM is protected by a network security group, which allows only outgoing connections on ports 5671 (AMPQS), 8883 (MQTTS) and 443 (TLS). For the upload operation, the rule is extended to also allow incoming connections on port 22 (SSH). In the directory Simulation/Factory, you will find several PowerShell scripts, which allow you to add/remove public IP address or enable/disable the SSH allow rule for the VM. If you need to change the configuration of the production line VM to allow inbound connections, e.g. to login via SSH, please make sure you are running a vulnerability check on the VM first and also install the latest patches by following the instructions on the Ubuntu website.
- IoT Suite documentation
- Frequently asked questions for IoT Suite
- Permissions on the azureiotsuite.com site. This includes instructions for adding co-administrators to your preconfigured solution.
- Connectedfactory: contains the source code for the complete preconfigured solution, including the solution portal web app and the simulated factories.
- Choose your edition
- Any of these editions will work
- Whatever edition you choose to install please ensure that you have selected:
- ASP.NET and web development and Azure development workloads in the Web and Cloud section of the Visual Studio installer
- .NET Core cross-platform development component in the Other Toolsets section of the Visual Studio installer
- Install dotnet Core for Visual Studio 2017 from here.
- Choose the SDK Installer
- Install the latest Azure Command Line tools for PowerShell from here.
- Scroll down the page to the command line tools section, in the PowerShell section choose Windows install
- Install additional PowerShell cmdlets:
- Search for Windows PowerShell in Start
- Right click on result Windows PowerShell and choose Run as Administrator
- In PowerShell (Administrator mode)
- Install PSCX PowerShell cmdlets V3.2.2 on your system by "Install-Module PSCX -AllowClobber"
- Choose Y to message "install from Powershell gallery if prompted"
- Install-Module Posh-SSH on your system by "Install-Module Posh-SSH -AllowClobber"
- Choose Y to message "install from Powershell gallery if prompted"
- Install PSCX PowerShell cmdlets V3.2.2 on your system by "Install-Module PSCX -AllowClobber"
- Update your PowerShell profile or session environemnt
- To build PCS MSBuild.exe must be in the path.
- For releases prior to v1.0.1706.0 change the $env:PATH variable:
- $env:PATH=$env:PATH+";C:\Program Files (x86)\MSBuild\14.0\Bin;"
- For releases starting with v1.0.1706.0 change the $env:PATH variable depending on the Visual Studio edition as these samples show for Enterprise and Community edition:
- Enterprise
- $env:path = $env:path + ";C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin;"
- $env:VisualStudioVersion="15.0"
- $env:VSToolsPath="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0"
- Community
- $env:path = $env:path + ";C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin;"
- $env:VisualStudioVersion="15.0"
- $env:VSToolsPath="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0"
- Enterprise
Open a PowerShell Windows and check they environment variable settings are correct for:
- $env:path
- $env:VisualStudioVersion
- $env:VSToolsPath
Verify then that the required PowerShell modules are installed the following PowerShell commands:
- Get-InstalledModule PSCX
- Get-InstalledModule Posh-SSH
- Find-Module AzureRm.
If one of these commands does report nothing back, something went wrong in your preparation.
- Search for Windows PowerShell in Start
- The Connected factory repository is here.
- Ensure that you have cloned the latest version of this repository before building via the build script by verifying that the content of VERSION.txt in your local clone of the repository is the same as the content of this file.
- To build and deploy the solution into the cloud:
- Run the following script from the root of your cloned repository:
./build.ps1 cloud -DeploymentName <your deployment name> -Configuration [release | debug ]
- Deployment naming rules - Length 4 - 64, Case insensitive, supports alphanumeric, underscore and hypens are all valid characters
- More detailed help on the build script is available by typing get-help
.\build.ps1 - detailed
- Sign in with your Azure account credentials when prompted
- Select the Azure Subscription to use
- All your subscription will be shown in a list
- Enter the number of the subscription you wish to use
- If you only have one subscription it will be automatically selected
- Choose Azure Location to use
- List of available locations will be displayed to you
- Enter the number of the location you wish to use
- Location will be stored for future use
- Select an Active Directories to use
- List of available Active directories will be provided to you
- Enter the number of the active directory you wish to use
- When script completes successfully it will open a browser tab with the web app launched
There are more parameters available in the build.ps1 script. Please use get-help .\build.ps1 -detailed
to get more information on them
- Open a PowerShell command prompt
- Log in to your Azure Account and select the subscription the solution was deployed to by:
Select-AzureRmSubscription -SubscriptionName <subscription name the solution was deployed to>
- Change to the root directory of the cloned repository
- Run the following script from the root of your cloned repository:
.\build.ps1 delete -DeploymentName <your deployment name>
- This will delete all Azure resources of your deployment as well as the local configuration files
- If you receive a message in PowerShell on execution policy not being set, do the following:
- Search for Windows PowerShell in Start
- Right click on result Windows PowerShell and choose Run as Administrator
- In PowerShell (Administrator) run:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
- If you see a message in PowerShell
Security warning Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run C:\MyConnectedFactoryClone\build.ps1? [D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): Do you want to run this script?
- Choose R
- On first run if sign in does not work, please try it again
If you see an message Invoke-RestMethod : {"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."}}}
This can be ignored, it is displayed when the user doesn't have administrator privileges to the active directory, the Script will continue to execute
Have ideas for how we can improve Azure IoT? Give us Feedback.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.