();
31 |
32 | log.LogInformation(string.Format("Sensor Id:{0}", sensorId));
33 | log.LogInformation(string.Format("Sensor Temperature:{0}", temperature));
34 |
35 | DigitalTwinsManager manager = new DigitalTwinsManager(adtAppId);
36 | manager.UpdateDigitalTwinProperty(sensorId, "temperature", temperature);
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/obj/project.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "dgSpecHash": "1d/O0Z96SAEsFmyolc5O86nYsHOzPgQls201eifMx3bzbhpe7LBgytBYHO6S3qNFXWYA97r0tD4NS2z2QI53vQ==",
4 | "success": true,
5 | "projectFilePath": "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp.csproj",
6 | "expectedPackageFiles": [
7 | "C:\\Users\\dtbadmin\\.nuget\\packages\\azure.core\\1.8.1\\azure.core.1.8.1.nupkg.sha512",
8 | "C:\\Users\\dtbadmin\\.nuget\\packages\\azure.digitaltwins.core\\1.2.1\\azure.digitaltwins.core.1.2.1.nupkg.sha512",
9 | "C:\\Users\\dtbadmin\\.nuget\\packages\\azure.identity\\1.3.0\\azure.identity.1.3.0.nupkg.sha512",
10 | "C:\\Users\\dtbadmin\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.0.0\\microsoft.bcl.asyncinterfaces.1.0.0.nupkg.sha512",
11 | "C:\\Users\\dtbadmin\\.nuget\\packages\\microsoft.identity.client\\4.22.0\\microsoft.identity.client.4.22.0.nupkg.sha512",
12 | "C:\\Users\\dtbadmin\\.nuget\\packages\\microsoft.identity.client.extensions.msal\\2.16.5\\microsoft.identity.client.extensions.msal.2.16.5.nupkg.sha512",
13 | "C:\\Users\\dtbadmin\\.nuget\\packages\\system.buffers\\4.5.0\\system.buffers.4.5.0.nupkg.sha512",
14 | "C:\\Users\\dtbadmin\\.nuget\\packages\\system.diagnostics.diagnosticsource\\4.6.0\\system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512",
15 | "C:\\Users\\dtbadmin\\.nuget\\packages\\system.memory\\4.5.3\\system.memory.4.5.3.nupkg.sha512",
16 | "C:\\Users\\dtbadmin\\.nuget\\packages\\system.numerics.vectors\\4.5.0\\system.numerics.vectors.4.5.0.nupkg.sha512",
17 | "C:\\Users\\dtbadmin\\.nuget\\packages\\system.security.cryptography.protecteddata\\4.5.0\\system.security.cryptography.protecteddata.4.5.0.nupkg.sha512",
18 | "C:\\Users\\dtbadmin\\.nuget\\packages\\system.text.json\\4.6.0\\system.text.json.4.6.0.nupkg.sha512",
19 | "C:\\Users\\dtbadmin\\.nuget\\packages\\system.threading.tasks.extensions\\4.5.2\\system.threading.tasks.extensions.4.5.2.nupkg.sha512"
20 | ],
21 | "logs": []
22 | }
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SensorApp/obj/project.assets.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "targets": {
4 | ".NETCoreApp,Version=v3.1": {}
5 | },
6 | "libraries": {},
7 | "projectFileDependencyGroups": {
8 | ".NETCoreApp,Version=v3.1": []
9 | },
10 | "packageFolders": {
11 | "C:\\Users\\dtbadmin\\.nuget\\packages\\": {}
12 | },
13 | "project": {
14 | "version": "1.0.0",
15 | "restore": {
16 | "projectUniqueName": "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\SensorApp.csproj",
17 | "projectName": "SensorApp",
18 | "projectPath": "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\SensorApp.csproj",
19 | "packagesPath": "C:\\Users\\dtbadmin\\.nuget\\packages\\",
20 | "outputPath": "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\obj\\",
21 | "projectStyle": "PackageReference",
22 | "configFilePaths": [
23 | "C:\\Users\\dtbadmin\\AppData\\Roaming\\NuGet\\NuGet.Config",
24 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
25 | ],
26 | "originalTargetFrameworks": [
27 | "netcoreapp3.1"
28 | ],
29 | "sources": {
30 | "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
31 | "https://api.nuget.org/v3/index.json": {}
32 | },
33 | "frameworks": {
34 | "netcoreapp3.1": {
35 | "targetAlias": "netcoreapp3.1",
36 | "projectReferences": {}
37 | }
38 | },
39 | "warningProperties": {
40 | "warnAsError": [
41 | "NU1605"
42 | ]
43 | }
44 | },
45 | "frameworks": {
46 | "netcoreapp3.1": {
47 | "targetAlias": "netcoreapp3.1",
48 | "imports": [
49 | "net461",
50 | "net462",
51 | "net47",
52 | "net471",
53 | "net472",
54 | "net48"
55 | ],
56 | "assetTargetFallback": true,
57 | "warn": true,
58 | "frameworkReferences": {
59 | "Microsoft.NETCore.App": {
60 | "privateAssets": "all"
61 | }
62 | },
63 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.103\\RuntimeIdentifierGraph.json"
64 | }
65 | }
66 | }
67 | }
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SensorApp/obj/SensorApp.csproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\SensorApp.csproj": {}
5 | },
6 | "projects": {
7 | "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\SensorApp.csproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\SensorApp.csproj",
11 | "projectName": "SensorApp",
12 | "projectPath": "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\SensorApp.csproj",
13 | "packagesPath": "C:\\Users\\dtbadmin\\.nuget\\packages\\",
14 | "outputPath": "C:\\Github\\SmartBuildingConsoleApp\\SensorApp\\obj\\",
15 | "projectStyle": "PackageReference",
16 | "configFilePaths": [
17 | "C:\\Users\\dtbadmin\\AppData\\Roaming\\NuGet\\NuGet.Config",
18 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
19 | ],
20 | "originalTargetFrameworks": [
21 | "netcoreapp3.1"
22 | ],
23 | "sources": {
24 | "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
25 | "https://api.nuget.org/v3/index.json": {}
26 | },
27 | "frameworks": {
28 | "netcoreapp3.1": {
29 | "targetAlias": "netcoreapp3.1",
30 | "projectReferences": {}
31 | }
32 | },
33 | "warningProperties": {
34 | "warnAsError": [
35 | "NU1605"
36 | ]
37 | }
38 | },
39 | "frameworks": {
40 | "netcoreapp3.1": {
41 | "targetAlias": "netcoreapp3.1",
42 | "imports": [
43 | "net461",
44 | "net462",
45 | "net47",
46 | "net471",
47 | "net472",
48 | "net48"
49 | ],
50 | "assetTargetFallback": true,
51 | "warn": true,
52 | "frameworkReferences": {
53 | "Microsoft.NETCore.App": {
54 | "privateAssets": "all"
55 | }
56 | },
57 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.103\\RuntimeIdentifierGraph.json"
58 | }
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/obj/SmartBuildingConsoleApp.csproj.nuget.dgspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "format": 1,
3 | "restore": {
4 | "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp.csproj": {}
5 | },
6 | "projects": {
7 | "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp.csproj": {
8 | "version": "1.0.0",
9 | "restore": {
10 | "projectUniqueName": "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp.csproj",
11 | "projectName": "SmartBuildingConsoleApp",
12 | "projectPath": "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp.csproj",
13 | "packagesPath": "C:\\Users\\dtbadmin\\.nuget\\packages\\",
14 | "outputPath": "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\obj\\",
15 | "projectStyle": "PackageReference",
16 | "configFilePaths": [
17 | "C:\\Users\\dtbadmin\\AppData\\Roaming\\NuGet\\NuGet.Config",
18 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
19 | ],
20 | "originalTargetFrameworks": [
21 | "netcoreapp3.1"
22 | ],
23 | "sources": {
24 | "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
25 | "https://api.nuget.org/v3/index.json": {}
26 | },
27 | "frameworks": {
28 | "netcoreapp3.1": {
29 | "targetAlias": "netcoreapp3.1",
30 | "projectReferences": {}
31 | }
32 | },
33 | "warningProperties": {
34 | "warnAsError": [
35 | "NU1605"
36 | ]
37 | }
38 | },
39 | "frameworks": {
40 | "netcoreapp3.1": {
41 | "targetAlias": "netcoreapp3.1",
42 | "dependencies": {
43 | "Azure.DigitalTwins.Core": {
44 | "target": "Package",
45 | "version": "[1.2.1, )"
46 | },
47 | "Azure.Identity": {
48 | "target": "Package",
49 | "version": "[1.3.0, )"
50 | }
51 | },
52 | "imports": [
53 | "net461",
54 | "net462",
55 | "net47",
56 | "net471",
57 | "net472",
58 | "net48"
59 | ],
60 | "assetTargetFallback": true,
61 | "warn": true,
62 | "frameworkReferences": {
63 | "Microsoft.NETCore.App": {
64 | "privateAssets": "all"
65 | }
66 | },
67 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.103\\RuntimeIdentifierGraph.json"
68 | }
69 | }
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/indoormapsmodule/Indoormap.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Indoor Maps App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
28 |
29 |
30 |
31 |
32 |
77 |
78 |
--------------------------------------------------------------------------------
/SmartBuildingSensorUpdater/SmartBuildingSensorUpdater/Properties/ServiceDependencies/local/storage1.arm.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "parameters": {
5 | "resourceGroupName": {
6 | "type": "string",
7 | "defaultValue": "DigitalTwinsBook",
8 | "metadata": {
9 | "_parameterType": "resourceGroup",
10 | "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
11 | }
12 | },
13 | "resourceGroupLocation": {
14 | "type": "string",
15 | "defaultValue": "westeurope",
16 | "metadata": {
17 | "_parameterType": "location",
18 | "description": "Location of the resource group. Resource groups could have different location than resources."
19 | }
20 | },
21 | "resourceLocation": {
22 | "type": "string",
23 | "defaultValue": "[parameters('resourceGroupLocation')]",
24 | "metadata": {
25 | "_parameterType": "location",
26 | "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
27 | }
28 | }
29 | },
30 | "resources": [
31 | {
32 | "type": "Microsoft.Resources/resourceGroups",
33 | "name": "[parameters('resourceGroupName')]",
34 | "location": "[parameters('resourceGroupLocation')]",
35 | "apiVersion": "2019-10-01"
36 | },
37 | {
38 | "type": "Microsoft.Resources/deployments",
39 | "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('dtbiotcentraltelemetry', subscription().subscriptionId)))]",
40 | "resourceGroup": "[parameters('resourceGroupName')]",
41 | "apiVersion": "2019-10-01",
42 | "dependsOn": [
43 | "[parameters('resourceGroupName')]"
44 | ],
45 | "properties": {
46 | "mode": "Incremental",
47 | "template": {
48 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
49 | "contentVersion": "1.0.0.0",
50 | "resources": [
51 | {
52 | "sku": {
53 | "name": "Standard_RAGRS",
54 | "tier": "Standard"
55 | },
56 | "kind": "StorageV2",
57 | "name": "dtbiotcentraltelemetry",
58 | "type": "Microsoft.Storage/storageAccounts",
59 | "location": "[parameters('resourceLocation')]",
60 | "apiVersion": "2017-10-01"
61 | }
62 | ]
63 | }
64 | }
65 | }
66 | ],
67 | "metadata": {
68 | "_dependencyType": "storage.azure"
69 | }
70 | }
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/SmartBuildingConsoleApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Always
16 |
17 |
18 | Always
19 |
20 |
21 | Always
22 |
23 |
24 | Always
25 |
26 |
27 | Always
28 |
29 |
30 | Always
31 |
32 |
33 | Always
34 |
35 |
36 | Always
37 |
38 |
39 | Always
40 |
41 |
42 | Always
43 |
44 |
45 | Always
46 |
47 |
48 | Always
49 |
50 |
51 | Always
52 |
53 |
54 | Always
55 |
56 |
57 | Always
58 |
59 |
60 | Always
61 |
62 |
63 | Always
64 |
65 |
66 | Always
67 |
68 |
69 | Always
70 |
71 |
72 | Always
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/AzureMapUpdater/AzureMapUpdater.cs:
--------------------------------------------------------------------------------
1 | // Default URL for triggering event grid function in the local environment.
2 | // http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}
3 | using System;
4 | using Microsoft.Azure.WebJobs;
5 | using Microsoft.Azure.WebJobs.Host;
6 | using Microsoft.Azure.EventGrid.Models;
7 | using Microsoft.Azure.WebJobs.Extensions.EventGrid;
8 | using Microsoft.Extensions.Logging;
9 | using System.Net.Http;
10 | using Newtonsoft.Json.Linq;
11 | using Newtonsoft.Json;
12 |
13 | namespace AzureMapUpdater
14 | {
15 | public static class AzureMapUpdater
16 | {
17 | private static string statesetID = Environment.GetEnvironmentVariable("statesetid");
18 | private static string subscriptionKey = Environment.GetEnvironmentVariable("subscriptionkey");
19 |
20 | [FunctionName("AzureMapUpdater")]
21 | public static void Run([EventGridTrigger] EventGridEvent eventGridEvent, ILogger log)
22 | {
23 | JObject message = (JObject)JsonConvert.DeserializeObject(eventGridEvent.Data.ToString());
24 |
25 | string twinId = eventGridEvent.Subject;
26 | string modelId = message["data"]["modelId"].ToString();
27 |
28 | //Parse updates to "space" twins
29 | if (modelId == "dtmi:com:smartbuilding:Sensor;1")
30 | {
31 | // Iterate through the properties that have changed
32 | foreach (var operation in message["data"]["patch"])
33 | {
34 | if (operation["op"].ToString() == "replace" && operation["path"].ToString() == "/temperature")
35 | {
36 | string value = operation["value"].ToString();
37 |
38 | log.LogInformation($"AZUREMAP-RECEIVED twinId:{twinId} modelId:{modelId} temperaturevalue:{value}");
39 |
40 | // Update the maps feature stateset
41 | UpdateMapStateset(twinId, value, log);
42 |
43 | }
44 | }
45 | }
46 | }
47 |
48 | static async void UpdateMapStateset(string featureId, string value, ILogger log)
49 | {
50 | HttpClient httpClient = new HttpClient();
51 |
52 | log.LogInformation($"AZUREMAP-START");
53 |
54 | try
55 | {
56 |
57 | var postcontent = new JObject(
58 | new JProperty(
59 | "States",
60 | new JArray(
61 | new JObject(
62 | new JProperty("keyName", "temperature"),
63 | new JProperty("value", value),
64 | new JProperty("eventTimestamp", DateTime.UtcNow.ToString("s"))))));
65 |
66 | log.LogInformation($"AZUREMAP-VALUES FeatureId:{featureId} Value:{value} Subscription-key:{subscriptionKey}");
67 |
68 | // think it need to be a putasync
69 | //var response = await httpClient.PostAsync(
70 | var response = await httpClient.PutAsync(
71 |
72 | $"https://eu.atlas.microsoft.com/featurestatesets/{statesetID}/featureStates/{featureId}?api-version=2.0&subscription-key={subscriptionKey}",
73 | new StringContent(postcontent.ToString()));
74 |
75 | string result = await response.Content.ReadAsStringAsync();
76 |
77 | log.LogInformation($"AZUREMAP-RESULT:{result}");
78 | }
79 | catch(Exception ex)
80 | {
81 | log.LogInformation($"AZUREMAP-UPDATEERROR error:{ex.Message}");
82 | }
83 |
84 | log.LogInformation($"AZUREMAP-END");
85 | }
86 |
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/obj/Debug/netcoreapp3.1/SmartBuildingConsoleApp.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\SmartBuildingConsoleApp.exe
2 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\SmartBuildingConsoleApp.deps.json
3 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\SmartBuildingConsoleApp.runtimeconfig.json
4 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\SmartBuildingConsoleApp.runtimeconfig.dev.json
5 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\SmartBuildingConsoleApp.dll
6 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\SmartBuildingConsoleApp.pdb
7 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Azure.Core.dll
8 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Azure.DigitalTwins.Core.dll
9 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Azure.Identity.dll
10 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Microsoft.Bcl.AsyncInterfaces.dll
11 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Microsoft.Identity.Client.dll
12 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Microsoft.Identity.Client.Extensions.Msal.dll
13 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\System.Security.Cryptography.ProtectedData.dll
14 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll
15 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.AssemblyInfoInputs.cache
16 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.AssemblyInfo.cs
17 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.csproj.CoreCompileInputs.cache
18 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.csproj.CopyComplete
19 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.dll
20 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.pdb
21 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.genruntimeconfig.cache
22 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter4\building.json
23 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter4\campus.json
24 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter4\floor.json
25 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter4\meetingroom.json
26 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter4\room.json
27 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter4\sensor.json
28 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter4\workarea.json
29 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter5\meetingroom.json
30 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter5\building.json
31 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter5\floor.json
32 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter5\airconditioningsystem.json
33 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter5\airconditioningsystemcontroller.json
34 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter5\airconditioningsystemunit.json
35 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter6\building.json
36 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter7\floor.json
37 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter7\meetingroom.json
38 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter7\room.json
39 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter7\sensor.json
40 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\bin\Debug\netcoreapp3.1\Models\chapter7\workarea.json
41 | C:\Github\SmartBuildingConsoleApp\SmartBuildingConsoleApp\obj\Debug\netcoreapp3.1\SmartBuildingConsoleApp.csprojAssemblyReference.cache
42 |
--------------------------------------------------------------------------------
/AzureMapUpdater/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # Azure Functions localsettings file
5 | local.settings.json
6 |
7 | # User-specific files
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # MSTest test Results
34 | [Tt]est[Rr]esult*/
35 | [Bb]uild[Ll]og.*
36 |
37 | # NUNIT
38 | *.VisualState.xml
39 | TestResult.xml
40 |
41 | # Build Results of an ATL Project
42 | [Dd]ebugPS/
43 | [Rr]eleasePS/
44 | dlldata.c
45 |
46 | # DNX
47 | project.lock.json
48 | project.fragment.lock.json
49 | artifacts/
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # NCrunch
117 | _NCrunch_*
118 | .*crunch*.local.xml
119 | nCrunchTemp_*
120 |
121 | # MightyMoose
122 | *.mm.*
123 | AutoTest.Net/
124 |
125 | # Web workbench (sass)
126 | .sass-cache/
127 |
128 | # Installshield output folder
129 | [Ee]xpress/
130 |
131 | # DocProject is a documentation generator add-in
132 | DocProject/buildhelp/
133 | DocProject/Help/*.HxT
134 | DocProject/Help/*.HxC
135 | DocProject/Help/*.hhc
136 | DocProject/Help/*.hhk
137 | DocProject/Help/*.hhp
138 | DocProject/Help/Html2
139 | DocProject/Help/html
140 |
141 | # Click-Once directory
142 | publish/
143 |
144 | # Publish Web Output
145 | *.[Pp]ublish.xml
146 | *.azurePubxml
147 | # TODO: Comment the next line if you want to checkin your web deploy settings
148 | # but database connection strings (with potential passwords) will be unencrypted
149 | #*.pubxml
150 | *.publishproj
151 |
152 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
153 | # checkin your Azure Web App publish settings, but sensitive information contained
154 | # in these scripts will be unencrypted
155 | PublishScripts/
156 |
157 | # NuGet Packages
158 | *.nupkg
159 | # The packages folder can be ignored because of Package Restore
160 | **/packages/*
161 | # except build/, which is used as an MSBuild target.
162 | !**/packages/build/
163 | # Uncomment if necessary however generally it will be regenerated when needed
164 | #!**/packages/repositories.config
165 | # NuGet v3's project.json files produces more ignoreable files
166 | *.nuget.props
167 | *.nuget.targets
168 |
169 | # Microsoft Azure Build Output
170 | csx/
171 | *.build.csdef
172 |
173 | # Microsoft Azure Emulator
174 | ecf/
175 | rcf/
176 |
177 | # Windows Store app package directories and files
178 | AppPackages/
179 | BundleArtifacts/
180 | Package.StoreAssociation.xml
181 | _pkginfo.txt
182 |
183 | # Visual Studio cache files
184 | # files ending in .cache can be ignored
185 | *.[Cc]ache
186 | # but keep track of directories ending in .cache
187 | !*.[Cc]ache/
188 |
189 | # Others
190 | ClientBin/
191 | ~$*
192 | *~
193 | *.dbmdl
194 | *.dbproj.schemaview
195 | *.jfm
196 | *.pfx
197 | *.publishsettings
198 | node_modules/
199 | orleans.codegen.cs
200 |
201 | # Since there are multiple workflows, uncomment next line to ignore bower_components
202 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
203 | #bower_components/
204 |
205 | # RIA/Silverlight projects
206 | Generated_Code/
207 |
208 | # Backup & report files from converting an old project file
209 | # to a newer Visual Studio version. Backup files are not needed,
210 | # because we have git ;-)
211 | _UpgradeReport_Files/
212 | Backup*/
213 | UpgradeLog*.XML
214 | UpgradeLog*.htm
215 |
216 | # SQL Server files
217 | *.mdf
218 | *.ldf
219 |
220 | # Business Intelligence projects
221 | *.rdl.data
222 | *.bim.layout
223 | *.bim_*.settings
224 |
225 | # Microsoft Fakes
226 | FakesAssemblies/
227 |
228 | # GhostDoc plugin setting file
229 | *.GhostDoc.xml
230 |
231 | # Node.js Tools for Visual Studio
232 | .ntvs_analysis.dat
233 |
234 | # Visual Studio 6 build log
235 | *.plg
236 |
237 | # Visual Studio 6 workspace options file
238 | *.opt
239 |
240 | # Visual Studio LightSwitch build output
241 | **/*.HTMLClient/GeneratedArtifacts
242 | **/*.DesktopClient/GeneratedArtifacts
243 | **/*.DesktopClient/ModelManifest.xml
244 | **/*.Server/GeneratedArtifacts
245 | **/*.Server/ModelManifest.xml
246 | _Pvt_Extensions
247 |
248 | # Paket dependency manager
249 | .paket/paket.exe
250 | paket-files/
251 |
252 | # FAKE - F# Make
253 | .fake/
254 |
255 | # JetBrains Rider
256 | .idea/
257 | *.sln.iml
258 |
259 | # CodeRush
260 | .cr/
261 |
262 | # Python Tools for Visual Studio (PTVS)
263 | __pycache__/
264 | *.pyc
--------------------------------------------------------------------------------
/SmartBuildingSensorUpdater/SmartBuildingSensorUpdater/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # Azure Functions localsettings file
5 | local.settings.json
6 |
7 | # User-specific files
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # MSTest test Results
34 | [Tt]est[Rr]esult*/
35 | [Bb]uild[Ll]og.*
36 |
37 | # NUNIT
38 | *.VisualState.xml
39 | TestResult.xml
40 |
41 | # Build Results of an ATL Project
42 | [Dd]ebugPS/
43 | [Rr]eleasePS/
44 | dlldata.c
45 |
46 | # DNX
47 | project.lock.json
48 | project.fragment.lock.json
49 | artifacts/
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # NCrunch
117 | _NCrunch_*
118 | .*crunch*.local.xml
119 | nCrunchTemp_*
120 |
121 | # MightyMoose
122 | *.mm.*
123 | AutoTest.Net/
124 |
125 | # Web workbench (sass)
126 | .sass-cache/
127 |
128 | # Installshield output folder
129 | [Ee]xpress/
130 |
131 | # DocProject is a documentation generator add-in
132 | DocProject/buildhelp/
133 | DocProject/Help/*.HxT
134 | DocProject/Help/*.HxC
135 | DocProject/Help/*.hhc
136 | DocProject/Help/*.hhk
137 | DocProject/Help/*.hhp
138 | DocProject/Help/Html2
139 | DocProject/Help/html
140 |
141 | # Click-Once directory
142 | publish/
143 |
144 | # Publish Web Output
145 | *.[Pp]ublish.xml
146 | *.azurePubxml
147 | # TODO: Comment the next line if you want to checkin your web deploy settings
148 | # but database connection strings (with potential passwords) will be unencrypted
149 | #*.pubxml
150 | *.publishproj
151 |
152 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
153 | # checkin your Azure Web App publish settings, but sensitive information contained
154 | # in these scripts will be unencrypted
155 | PublishScripts/
156 |
157 | # NuGet Packages
158 | *.nupkg
159 | # The packages folder can be ignored because of Package Restore
160 | **/packages/*
161 | # except build/, which is used as an MSBuild target.
162 | !**/packages/build/
163 | # Uncomment if necessary however generally it will be regenerated when needed
164 | #!**/packages/repositories.config
165 | # NuGet v3's project.json files produces more ignoreable files
166 | *.nuget.props
167 | *.nuget.targets
168 |
169 | # Microsoft Azure Build Output
170 | csx/
171 | *.build.csdef
172 |
173 | # Microsoft Azure Emulator
174 | ecf/
175 | rcf/
176 |
177 | # Windows Store app package directories and files
178 | AppPackages/
179 | BundleArtifacts/
180 | Package.StoreAssociation.xml
181 | _pkginfo.txt
182 |
183 | # Visual Studio cache files
184 | # files ending in .cache can be ignored
185 | *.[Cc]ache
186 | # but keep track of directories ending in .cache
187 | !*.[Cc]ache/
188 |
189 | # Others
190 | ClientBin/
191 | ~$*
192 | *~
193 | *.dbmdl
194 | *.dbproj.schemaview
195 | *.jfm
196 | *.pfx
197 | *.publishsettings
198 | node_modules/
199 | orleans.codegen.cs
200 |
201 | # Since there are multiple workflows, uncomment next line to ignore bower_components
202 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
203 | #bower_components/
204 |
205 | # RIA/Silverlight projects
206 | Generated_Code/
207 |
208 | # Backup & report files from converting an old project file
209 | # to a newer Visual Studio version. Backup files are not needed,
210 | # because we have git ;-)
211 | _UpgradeReport_Files/
212 | Backup*/
213 | UpgradeLog*.XML
214 | UpgradeLog*.htm
215 |
216 | # SQL Server files
217 | *.mdf
218 | *.ldf
219 |
220 | # Business Intelligence projects
221 | *.rdl.data
222 | *.bim.layout
223 | *.bim_*.settings
224 |
225 | # Microsoft Fakes
226 | FakesAssemblies/
227 |
228 | # GhostDoc plugin setting file
229 | *.GhostDoc.xml
230 |
231 | # Node.js Tools for Visual Studio
232 | .ntvs_analysis.dat
233 |
234 | # Visual Studio 6 build log
235 | *.plg
236 |
237 | # Visual Studio 6 workspace options file
238 | *.opt
239 |
240 | # Visual Studio LightSwitch build output
241 | **/*.HTMLClient/GeneratedArtifacts
242 | **/*.DesktopClient/GeneratedArtifacts
243 | **/*.DesktopClient/ModelManifest.xml
244 | **/*.Server/GeneratedArtifacts
245 | **/*.Server/ModelManifest.xml
246 | _Pvt_Extensions
247 |
248 | # Paket dependency manager
249 | .paket/paket.exe
250 | paket-files/
251 |
252 | # FAKE - F# Make
253 | .fake/
254 |
255 | # JetBrains Rider
256 | .idea/
257 | *.sln.iml
258 |
259 | # CodeRush
260 | .cr/
261 |
262 | # Python Tools for Visual Studio (PTVS)
263 | __pycache__/
264 | *.pyc
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | # Hands-on Azure Digital Twins
5 |
6 |
7 |
8 | This is the code repository for [Hands-on Azure Digital Twins](https://www.packtpub.com/iot-hardware/hands-on-azure-digital-twins?utm_source=github&utm_medium=repository&utm_campaign=9781801071383), published by Packt.
9 |
10 | **A practical guide to building distributed IoT solutions**
11 |
12 | ## What is this book about?
13 | In today’s world, clients are using more and more IoT sensors to monitor their business processes and assets. Think about collecting information like pressure from an engine to the temperature and light switch being turned on or off in a room. The data collected can be used to create smart solutions for predicting future trends, creating simulations, and drawing insights using visualization. This makes it beneficial for organizations to make digital twins, which are digital replicas of the real environment, to support these smart solutions.
14 |
15 | This book covers the following exciting features:
16 | * Understand the concept and architecture of Azure Digital Twins
17 | * Get to grips with installing and configuring the service and required tools
18 | * Understand the Digital Twin Definition Language (DTDL) and digital twin models
19 | * Explore the APIs and SDKs available to access the Azure Digital Twins services
20 | * Monitor, troubleshoot, and secure digital twins
21 | Discover how to build, design, and integrate applications with various Azure services
22 | Explore real-life scenarios with Azure Digital Twins
23 |
24 | If you feel this book is for you, get your [copy](https://www.amazon.com/dp/1801071381) today!
25 |
26 |
28 |
29 | ## Instructions and Navigations
30 | All of the code is organized into folders. For example, Chapter02.
31 |
32 | The code will look like the following:
33 | ```
34 | public string RelationshipId(string twinSourceId, string
35 | twinDestinationId)
36 | {
37 | return string.Format("{0}-{1}", twinSourceId,
38 | twinDestinationId);
39 | }
40 | ```
41 |
42 | **Following is what you need for this book:**
43 | This book is for Azure developers, Azure architects, and anyone who wants to learn more about how to implement IoT solutions using Azure Digital Twins and additional Azure services. Prior experience using the Azure Portal and a clear understanding of building applications using .NET will be helpful.
44 |
45 | With the following software and hardware list you can run all code files present in the book (Chapter 1-18).
46 | ### Software and Hardware List
47 | | Chapter | Software required | OS required |
48 | | -------- | ------------------------------------ | ----------------------------------- |
49 | | 2-15 | Microsoft Visual Studio Community 2019 | Windows, Mac OS X, and Linux (Any) |
50 | | 2-15 | Windows Azure CLI 2.30.0 | Windows, Mac OS X, and Linux (Any) |
51 | | 2-15 | Windows PowerShell 5.1.19041.1151 | Windows, Mac OS X, and Linux (Any) |
52 | | 2-15 | Node.js 14.15.4 | Windows, Mac OS X, and Linux (Any) |
53 | | 2-15 | Azure subscription | Windows, Mac OS X, and Linux (Any) |
54 |
55 | We also provide a PDF file that has color images of the screenshots/diagrams used in this book. [Click here to download it](https://static.packt-cdn.com/downloads/9781801071383_ColorImages.pdf).
56 |
57 | ### Related products
58 | * Building Industrial Digital Twins [[Packt]](https://www.packtpub.com/product/building-industrial-digital-twins/9781839219078?utm_source=github&utm_medium=repository&utm_campaign=9781839219078) [[Amazon]](https://www.amazon.com/dp/1839219076)
59 |
60 | * Industrial Digital Transformation [[Packt]](https://www.packtpub.com/product/industrial-digital-transformation/9781800207677?utm_source=github&utm_medium=repository&utm_campaign=9781800207677) [[Amazon]](https://www.amazon.com/dp/1800207670)
61 |
62 | ## Get to Know the Author
63 | **Alexander Meijers**
64 | Alexander Meijers is a professional who inspires, motivates, and supports others and helps them to innovate. His goal is to help organizations achieve more by creating, improving, and working smarter, with the aim of shortening business processes and improving the environment for employees.
65 | As global XR technology lead and Microsoft Windows MVP for mixed reality, working for Avanade, he understands business issues and translates them into logical solutions using technology. Additionally, he supports companies in applying emerging experiences during their digital transition journey.
66 | He works with technologies such as virtual, augmented, and mixed reality, in combination with cloud services including mixed reality services, Azure Digital Twins, and IoT, from the Microsoft Azure platform, Office 365, Power Platform, and Dynamics 365.
67 | His primary focus is manufacturing, utilities, and the engineering and construction sector. However, he certainly does not stay away from other sectors.
68 | He engages in speaking, writing books, blogging, and is an organizer of local and global events such as the Mixed Reality User Group in the Netherlands, and Global XR Talks and the Global XR Conference, both part of the GlobalXR.Community.
69 | In the last few months, he has designed and implemented a solution. Data is collected from IoT and Microsoft Dynamics 365 Field Service. An Azure Digital Twins service is built up dynamically by using Azure Functions, Azure Service Bus, and Logic Apps. A 3D visual is generated by using Microsoft HoloLens 2 as an augmentation device.
70 | Since January 2018, he has been a Windows Development MVP for the Mixed Reality category.
71 |
72 | ### Download a free PDF
73 |
74 | If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.
75 | https://packt.link/free-ebook/9781801071383
--------------------------------------------------------------------------------
/AzureMapUpdater/Properties/ServiceDependencies/AzureMapUpdater - Zip Deploy/profile.arm.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "metadata": {
5 | "_dependencyType": "function.windows.consumption"
6 | },
7 | "parameters": {
8 | "resourceGroupName": {
9 | "type": "string",
10 | "defaultValue": "DigitalTwinsBook",
11 | "metadata": {
12 | "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
13 | }
14 | },
15 | "resourceGroupLocation": {
16 | "type": "string",
17 | "defaultValue": "westeurope",
18 | "metadata": {
19 | "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
20 | }
21 | },
22 | "resourceName": {
23 | "type": "string",
24 | "defaultValue": "AzureMapUpdater",
25 | "metadata": {
26 | "description": "Name of the main resource to be created by this template."
27 | }
28 | },
29 | "resourceLocation": {
30 | "type": "string",
31 | "defaultValue": "[parameters('resourceGroupLocation')]",
32 | "metadata": {
33 | "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
34 | }
35 | }
36 | },
37 | "resources": [
38 | {
39 | "type": "Microsoft.Resources/resourceGroups",
40 | "name": "[parameters('resourceGroupName')]",
41 | "location": "[parameters('resourceGroupLocation')]",
42 | "apiVersion": "2019-10-01"
43 | },
44 | {
45 | "type": "Microsoft.Resources/deployments",
46 | "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
47 | "resourceGroup": "[parameters('resourceGroupName')]",
48 | "apiVersion": "2019-10-01",
49 | "dependsOn": [
50 | "[parameters('resourceGroupName')]"
51 | ],
52 | "properties": {
53 | "mode": "Incremental",
54 | "expressionEvaluationOptions": {
55 | "scope": "inner"
56 | },
57 | "parameters": {
58 | "resourceGroupName": {
59 | "value": "[parameters('resourceGroupName')]"
60 | },
61 | "resourceGroupLocation": {
62 | "value": "[parameters('resourceGroupLocation')]"
63 | },
64 | "resourceName": {
65 | "value": "[parameters('resourceName')]"
66 | },
67 | "resourceLocation": {
68 | "value": "[parameters('resourceLocation')]"
69 | }
70 | },
71 | "template": {
72 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
73 | "contentVersion": "1.0.0.0",
74 | "parameters": {
75 | "resourceGroupName": {
76 | "type": "string"
77 | },
78 | "resourceGroupLocation": {
79 | "type": "string"
80 | },
81 | "resourceName": {
82 | "type": "string"
83 | },
84 | "resourceLocation": {
85 | "type": "string"
86 | }
87 | },
88 | "variables": {
89 | "storage_name": "[toLower(concat('storage', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId))))]",
90 | "storage_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Storage/storageAccounts/', variables('storage_name'))]",
91 | "function_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/sites/', parameters('resourceName'))]"
92 | },
93 | "resources": [
94 | {
95 | "location": "[parameters('resourceGroupLocation')]",
96 | "name": "[variables('storage_name')]",
97 | "type": "Microsoft.Storage/storageAccounts",
98 | "apiVersion": "2017-10-01",
99 | "tags": {
100 | "[concat('hidden-related:', concat('/providers/Microsoft.Web/sites/', parameters('resourceName')))]": "empty"
101 | },
102 | "properties": {
103 | "supportsHttpsTrafficOnly": true
104 | },
105 | "sku": {
106 | "name": "Standard_LRS"
107 | },
108 | "kind": "Storage"
109 | },
110 | {
111 | "location": "[parameters('resourceLocation')]",
112 | "name": "[parameters('resourceName')]",
113 | "type": "Microsoft.Web/sites",
114 | "apiVersion": "2015-08-01",
115 | "dependsOn": [
116 | "[variables('storage_ResourceId')]"
117 | ],
118 | "kind": "functionapp",
119 | "properties": {
120 | "name": "[parameters('resourceName')]",
121 | "kind": "functionapp",
122 | "httpsOnly": true,
123 | "reserved": false
124 | },
125 | "identity": {
126 | "type": "SystemAssigned"
127 | },
128 | "resources": [
129 | {
130 | "name": "appsettings",
131 | "type": "config",
132 | "apiVersion": "2015-08-01",
133 | "dependsOn": [
134 | "[variables('function_ResourceId')]"
135 | ],
136 | "properties": {
137 | "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
138 | "WEBSITE_CONTENTSHARE": "[toLower(parameters('resourceName'))]",
139 | "AzureWebJobsDashboard": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
140 | "AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
141 | "FUNCTIONS_EXTENSION_VERSION": "~3",
142 | "FUNCTIONS_WORKER_RUNTIME": "dotnet"
143 | }
144 | }
145 | ]
146 | }
147 | ]
148 | }
149 | }
150 | }
151 | ]
152 | }
--------------------------------------------------------------------------------
/SmartBuildingSensorUpdater/SmartBuildingSensorUpdater/Properties/ServiceDependencies/IoTCentralTrigger - Zip Deploy/profile.arm.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3 | "contentVersion": "1.0.0.0",
4 | "metadata": {
5 | "_dependencyType": "function.windows.consumption"
6 | },
7 | "parameters": {
8 | "resourceGroupName": {
9 | "type": "string",
10 | "defaultValue": "DigitalTwinsBook",
11 | "metadata": {
12 | "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
13 | }
14 | },
15 | "resourceGroupLocation": {
16 | "type": "string",
17 | "defaultValue": "westeurope",
18 | "metadata": {
19 | "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
20 | }
21 | },
22 | "resourceName": {
23 | "type": "string",
24 | "defaultValue": "IoTCentralTrigger",
25 | "metadata": {
26 | "description": "Name of the main resource to be created by this template."
27 | }
28 | },
29 | "resourceLocation": {
30 | "type": "string",
31 | "defaultValue": "[parameters('resourceGroupLocation')]",
32 | "metadata": {
33 | "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
34 | }
35 | }
36 | },
37 | "resources": [
38 | {
39 | "type": "Microsoft.Resources/resourceGroups",
40 | "name": "[parameters('resourceGroupName')]",
41 | "location": "[parameters('resourceGroupLocation')]",
42 | "apiVersion": "2019-10-01"
43 | },
44 | {
45 | "type": "Microsoft.Resources/deployments",
46 | "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
47 | "resourceGroup": "[parameters('resourceGroupName')]",
48 | "apiVersion": "2019-10-01",
49 | "dependsOn": [
50 | "[parameters('resourceGroupName')]"
51 | ],
52 | "properties": {
53 | "mode": "Incremental",
54 | "expressionEvaluationOptions": {
55 | "scope": "inner"
56 | },
57 | "parameters": {
58 | "resourceGroupName": {
59 | "value": "[parameters('resourceGroupName')]"
60 | },
61 | "resourceGroupLocation": {
62 | "value": "[parameters('resourceGroupLocation')]"
63 | },
64 | "resourceName": {
65 | "value": "[parameters('resourceName')]"
66 | },
67 | "resourceLocation": {
68 | "value": "[parameters('resourceLocation')]"
69 | }
70 | },
71 | "template": {
72 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
73 | "contentVersion": "1.0.0.0",
74 | "parameters": {
75 | "resourceGroupName": {
76 | "type": "string"
77 | },
78 | "resourceGroupLocation": {
79 | "type": "string"
80 | },
81 | "resourceName": {
82 | "type": "string"
83 | },
84 | "resourceLocation": {
85 | "type": "string"
86 | }
87 | },
88 | "variables": {
89 | "storage_name": "[toLower(concat('storage', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId))))]",
90 | "storage_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Storage/storageAccounts/', variables('storage_name'))]",
91 | "function_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/sites/', parameters('resourceName'))]"
92 | },
93 | "resources": [
94 | {
95 | "location": "[parameters('resourceGroupLocation')]",
96 | "name": "[variables('storage_name')]",
97 | "type": "Microsoft.Storage/storageAccounts",
98 | "apiVersion": "2017-10-01",
99 | "tags": {
100 | "[concat('hidden-related:', concat('/providers/Microsoft.Web/sites/', parameters('resourceName')))]": "empty"
101 | },
102 | "properties": {
103 | "supportsHttpsTrafficOnly": true
104 | },
105 | "sku": {
106 | "name": "Standard_LRS"
107 | },
108 | "kind": "Storage"
109 | },
110 | {
111 | "location": "[parameters('resourceLocation')]",
112 | "name": "[parameters('resourceName')]",
113 | "type": "Microsoft.Web/sites",
114 | "apiVersion": "2015-08-01",
115 | "dependsOn": [
116 | "[variables('storage_ResourceId')]"
117 | ],
118 | "kind": "functionapp",
119 | "properties": {
120 | "name": "[parameters('resourceName')]",
121 | "kind": "functionapp",
122 | "httpsOnly": true,
123 | "reserved": false
124 | },
125 | "identity": {
126 | "type": "SystemAssigned"
127 | },
128 | "resources": [
129 | {
130 | "name": "appsettings",
131 | "type": "config",
132 | "apiVersion": "2015-08-01",
133 | "dependsOn": [
134 | "[variables('function_ResourceId')]"
135 | ],
136 | "properties": {
137 | "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
138 | "WEBSITE_CONTENTSHARE": "[toLower(parameters('resourceName'))]",
139 | "AzureWebJobsDashboard": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
140 | "AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
141 | "FUNCTIONS_EXTENSION_VERSION": "~3",
142 | "FUNCTIONS_WORKER_RUNTIME": "dotnet"
143 | }
144 | }
145 | ]
146 | }
147 | ]
148 | }
149 | }
150 | }
151 | ]
152 | }
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/Program.cs:
--------------------------------------------------------------------------------
1 | using Azure;
2 | using Azure.DigitalTwins.Core;
3 | using SmartBuildingConsoleApp.DigitalTwins;
4 | using SmartBuildingConsoleApp.Sensor;
5 | using System;
6 | using System.Collections.Generic;
7 |
8 | namespace SmartBuildingConsoleApp
9 | {
10 | class Program
11 | {
12 | public static void GenerateSensorData()
13 | {
14 | DigitalTwinsManager dtHelper = new DigitalTwinsManager();
15 |
16 | // generate sensor data
17 | TemperatureSensor sensor = new TemperatureSensor();
18 | Console.WriteLine("Temperature sensor");
19 | while (true)
20 | {
21 | double temperature = sensor.GetMeasurement();
22 | Console.WriteLine(string.Format("{0} degrees", temperature));
23 |
24 | dtHelper.UpdateDigitalTwinProperty("MeetingRoom1.01", "temperaturevalue", temperature);
25 |
26 | System.Threading.Thread.Sleep(1000);
27 | }
28 | }
29 |
30 |
31 | static void Main(string[] args)
32 | {
33 | DigitalTwinsManager dtHelper = new DigitalTwinsManager();
34 |
35 | //string[] paths = new string[] {
36 | //// "Models/chapter4/campus.json",
37 | //// "Models/chapter4/building.json",
38 | //// "Models/chapter4/floor.json",
39 | //// "Models/chapter4/room.json",
40 | //// "Models/chapter4/workarea.json",
41 | //"Models/chapter4/meetingroom.json"//,
42 | // "Models/chapter5/airconditioningsystemunit.json",
43 | // "Models/chapter5/airconditioningsystemcontroller.json",
44 | // "Models/chapter5/airconditioningsystem.json"
45 | //// "Models/chapter4/sensor.json"
46 | //};
47 | //dtHelper.CreateModels(paths);
48 | //Console.WriteLine("Models created");
49 |
50 | //DigitalTwinsManager dtHelper = new DigitalTwinsManager();
51 |
52 | //string[] paths = new string[] {
53 | // "Models/chapter6/building.json"
54 | //};
55 |
56 | //dtHelper.DeleteModel("dtmi:com:smartbuilding:Building;1");
57 | //dtHelper.CreateModels(paths);
58 | //Console.WriteLine("Model updated");
59 |
60 |
61 |
62 | //dtHelper.DeleteModel("dtmi:com:smartbuilding:Room;1");
63 |
64 | //DigitalTwinsModelData model = dtHelper.GetModel("dtmi:com:smartbuilding:Room;1");
65 | //Console.WriteLine(model.Id);
66 | //Console.WriteLine(model.LanguageDisplayNames["en"]);
67 |
68 | //var models = dtHelper.GetModels();
69 | //foreach (DigitalTwinsModelData model in models)
70 | //{
71 | // Console.WriteLine(model.Id);
72 | // Console.WriteLine(model.LanguageDisplayNames["en"]);
73 | //}
74 |
75 | //dtHelper.CreateDigitalTwin("Campus", "dtmi:com:smartbuilding:Campus;1");
76 | //dtHelper.CreateDigitalTwin("MainBuilding", "dtmi:com:smartbuilding:Building;1");
77 | //dtHelper.CreateDigitalTwin("GroundFloor", "dtmi:com:smartbuilding:Floor;1");
78 | //dtHelper.CreateDigitalTwin("MeetingRoom1.01", "dtmi:com:smartbuilding:Meetingroom;1");
79 |
80 | //dtHelper.UpdateDigitalTwin("MeetingRoom1.01", "occupied", true);
81 |
82 | //dtHelper.DeleteDigitalTwin("MeetingRoom1.01");
83 |
84 | //BasicDigitalTwin twin = dtHelper.GetDigitalTwin("MeetingRoom1.01");
85 | //bool occupied = false;
86 | //Boolean.TryParse(twin.Contents["occupied"].ToString(), out occupied);
87 | //if (occupied)
88 | //{
89 | // Console.WriteLine("the meeting room is occupied");
90 | //}
91 |
92 | //DigitalTwinsManager dtHelper = new DigitalTwinsManager();
93 |
94 | //var map = new Dictionary();
95 | //map.Add("MeetingRoom101", 21.3f);
96 | //map.Add("MeetingRoom102", 22.1f);
97 | //map.Add("MeetingRoom103", 20.9f);
98 |
99 | ////dtHelper.UpdateDigitalTwin("MainBuilding", "rooms", map);
100 | //dtHelper.UpdateDigitalTwinProperty("MainBuilding", "rooms", map);
101 |
102 | //DigitalTwinsManager dtHelper = new DigitalTwinsManager();
103 |
104 | //dtHelper.UpdateDigitalTwinProperty("GroundFloor", "floornumber", 1);
105 | //dtHelper.UpdateDigitalTwinProperty("GroundFloor", "lightson", true);
106 |
107 |
108 | // generate sensor data
109 | //System.Threading.Thread sensorThread = new System.Threading.Thread(GenerateSensorData);
110 | //sensorThread.Start();
111 |
112 | //DigitalTwinsManager dtHelper = new DigitalTwinsManager();
113 |
114 | //Dictionary properties = new Dictionary();
115 | //properties["level"] = 0;
116 |
117 | //dtHelper.CreateRelationship("MainBuilding", "GroundFloor", "has", null);
118 | //dtHelper.CreateRelationship("MainBuilding", "GroundFloor", "has", properties);
119 | ////dtHelper.DeleteRelationship("MainBuilding", "GroundFloor");
120 |
121 | //dtHelper.UpdateRelationship("MainBuilding", "GroundFloor", "level", 8);
122 |
123 |
124 | //BasicRelationship relationship = dtHelper.GetRelationship("MainBuilding", "GroundFloor");
125 | //if (relationship != null)
126 | //{
127 | // Console.WriteLine(relationship.Id);
128 | //}
129 |
130 | //Pageable relationships = dtHelper.ListRelationships("MainBuilding");
131 |
132 | //foreach (BasicRelationship relationship in relationships)
133 | //{
134 | // Console.WriteLine(relationship.Id);
135 |
136 | // foreach (string key in relationship.Properties.Keys)
137 | // {
138 | // Console.WriteLine(string.Format("{0}:{1}", key, relationship.Properties[key]));
139 | // }
140 | //}
141 |
142 | //Pageable result = dtHelper.QueryDigitalTwins("SELECT * FROM DIGITALTWINS");
143 |
144 | //foreach (BasicDigitalTwin item in result)
145 | //{
146 | // Console.WriteLine(item.Id);
147 | //}
148 |
149 | //Pageable> result = dtHelper.Query("SELECT BU,FL FROM DIGITALTWINS BU JOIN FL RELATED BU.has WHERE BU.$dtId='centralbuilding'");
150 |
151 | //foreach (Dictionary item in result)
152 | //{
153 | // BasicDigitalTwin BU = item["BU"] as BasicDigitalTwin;
154 | // BasicDigitalTwin FL = item["FL"] as BasicDigitalTwin;
155 |
156 | // Console.WriteLine(string.Format("{0}-{1}", BU.Id, FL.Id));
157 | //}
158 |
159 |
160 | dtHelper.QueryDigitalTwins("SELECT * FROM DIGITALTWINS", OnQueryResult);
161 |
162 | while(true) { }
163 | }
164 |
165 | public static void OnQueryResult(BasicDigitalTwin dt)
166 | {
167 | Console.WriteLine(dt.Id);
168 | }
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/bin/Debug/netcoreapp3.1/SmartBuildingConsoleApp.deps.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeTarget": {
3 | "name": ".NETCoreApp,Version=v3.1",
4 | "signature": ""
5 | },
6 | "compilationOptions": {},
7 | "targets": {
8 | ".NETCoreApp,Version=v3.1": {
9 | "SmartBuildingConsoleApp/1.0.0": {
10 | "dependencies": {
11 | "Azure.DigitalTwins.Core": "1.2.1",
12 | "Azure.Identity": "1.3.0"
13 | },
14 | "runtime": {
15 | "SmartBuildingConsoleApp.dll": {}
16 | }
17 | },
18 | "Azure.Core/1.8.1": {
19 | "dependencies": {
20 | "Microsoft.Bcl.AsyncInterfaces": "1.0.0",
21 | "System.Buffers": "4.5.0",
22 | "System.Diagnostics.DiagnosticSource": "4.6.0",
23 | "System.Memory": "4.5.3",
24 | "System.Numerics.Vectors": "4.5.0",
25 | "System.Text.Json": "4.6.0",
26 | "System.Threading.Tasks.Extensions": "4.5.2"
27 | },
28 | "runtime": {
29 | "lib/netstandard2.0/Azure.Core.dll": {
30 | "assemblyVersion": "1.8.1.0",
31 | "fileVersion": "1.800.121.6102"
32 | }
33 | }
34 | },
35 | "Azure.DigitalTwins.Core/1.2.1": {
36 | "dependencies": {
37 | "Azure.Core": "1.8.1",
38 | "System.Text.Json": "4.6.0"
39 | },
40 | "runtime": {
41 | "lib/netstandard2.0/Azure.DigitalTwins.Core.dll": {
42 | "assemblyVersion": "1.2.1.0",
43 | "fileVersion": "1.200.121.10402"
44 | }
45 | }
46 | },
47 | "Azure.Identity/1.3.0": {
48 | "dependencies": {
49 | "Azure.Core": "1.8.1",
50 | "Microsoft.Identity.Client": "4.22.0",
51 | "Microsoft.Identity.Client.Extensions.Msal": "2.16.5",
52 | "System.Memory": "4.5.3",
53 | "System.Security.Cryptography.ProtectedData": "4.5.0",
54 | "System.Text.Json": "4.6.0",
55 | "System.Threading.Tasks.Extensions": "4.5.2"
56 | },
57 | "runtime": {
58 | "lib/netstandard2.0/Azure.Identity.dll": {
59 | "assemblyVersion": "1.3.0.0",
60 | "fileVersion": "1.300.20.56202"
61 | }
62 | }
63 | },
64 | "Microsoft.Bcl.AsyncInterfaces/1.0.0": {
65 | "runtime": {
66 | "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": {
67 | "assemblyVersion": "1.0.0.0",
68 | "fileVersion": "4.700.19.46214"
69 | }
70 | }
71 | },
72 | "Microsoft.Identity.Client/4.22.0": {
73 | "runtime": {
74 | "lib/netcoreapp2.1/Microsoft.Identity.Client.dll": {
75 | "assemblyVersion": "4.22.0.0",
76 | "fileVersion": "4.22.0.0"
77 | }
78 | }
79 | },
80 | "Microsoft.Identity.Client.Extensions.Msal/2.16.5": {
81 | "dependencies": {
82 | "Microsoft.Identity.Client": "4.22.0",
83 | "System.Security.Cryptography.ProtectedData": "4.5.0"
84 | },
85 | "runtime": {
86 | "lib/netcoreapp2.1/Microsoft.Identity.Client.Extensions.Msal.dll": {
87 | "assemblyVersion": "2.16.5.0",
88 | "fileVersion": "2.16.5.0"
89 | }
90 | }
91 | },
92 | "System.Buffers/4.5.0": {},
93 | "System.Diagnostics.DiagnosticSource/4.6.0": {},
94 | "System.Memory/4.5.3": {},
95 | "System.Numerics.Vectors/4.5.0": {},
96 | "System.Security.Cryptography.ProtectedData/4.5.0": {
97 | "runtime": {
98 | "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {
99 | "assemblyVersion": "4.0.3.0",
100 | "fileVersion": "4.6.26515.6"
101 | }
102 | },
103 | "runtimeTargets": {
104 | "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {
105 | "rid": "win",
106 | "assetType": "runtime",
107 | "assemblyVersion": "4.0.3.0",
108 | "fileVersion": "4.6.26515.6"
109 | }
110 | }
111 | },
112 | "System.Text.Json/4.6.0": {},
113 | "System.Threading.Tasks.Extensions/4.5.2": {}
114 | }
115 | },
116 | "libraries": {
117 | "SmartBuildingConsoleApp/1.0.0": {
118 | "type": "project",
119 | "serviceable": false,
120 | "sha512": ""
121 | },
122 | "Azure.Core/1.8.1": {
123 | "type": "package",
124 | "serviceable": true,
125 | "sha512": "sha512-BoGOCcdRa4ngAxBcyyndauFWgId6/SETDJnd9+4iHtXZ9JsVA4hs8pvK0H2ml4MHWwaYPmpepd70reAUm2u52g==",
126 | "path": "azure.core/1.8.1",
127 | "hashPath": "azure.core.1.8.1.nupkg.sha512"
128 | },
129 | "Azure.DigitalTwins.Core/1.2.1": {
130 | "type": "package",
131 | "serviceable": true,
132 | "sha512": "sha512-TYoES6J3wZrTJLG+hzhX256KyLfqV2HbpquFXPCJItXa7XYSDt1QiJ/A4mU6HObVjT4Lu7I1XXwRUdgcio/I7A==",
133 | "path": "azure.digitaltwins.core/1.2.1",
134 | "hashPath": "azure.digitaltwins.core.1.2.1.nupkg.sha512"
135 | },
136 | "Azure.Identity/1.3.0": {
137 | "type": "package",
138 | "serviceable": true,
139 | "sha512": "sha512-l1SYfZKOFBuUFG7C2SWHmJcrQQaiXgBdVCycx4vcZQkC6efDVt7mzZ5pfJAFEJDBUq7mjRQ0RPq9ZDGdSswqMg==",
140 | "path": "azure.identity/1.3.0",
141 | "hashPath": "azure.identity.1.3.0.nupkg.sha512"
142 | },
143 | "Microsoft.Bcl.AsyncInterfaces/1.0.0": {
144 | "type": "package",
145 | "serviceable": true,
146 | "sha512": "sha512-K63Y4hORbBcKLWH5wnKgzyn7TOfYzevIEwIedQHBIkmkEBA9SCqgvom+XTuE+fAFGvINGkhFItaZ2dvMGdT5iw==",
147 | "path": "microsoft.bcl.asyncinterfaces/1.0.0",
148 | "hashPath": "microsoft.bcl.asyncinterfaces.1.0.0.nupkg.sha512"
149 | },
150 | "Microsoft.Identity.Client/4.22.0": {
151 | "type": "package",
152 | "serviceable": true,
153 | "sha512": "sha512-GlamU9rs8cSVIx9WSGv5QKpt66KkE+ImxNa/wNZZUJ3knt3PM98T9sOY8B7NcEfhw7NoxU2/0TSOcmnRSJQgqw==",
154 | "path": "microsoft.identity.client/4.22.0",
155 | "hashPath": "microsoft.identity.client.4.22.0.nupkg.sha512"
156 | },
157 | "Microsoft.Identity.Client.Extensions.Msal/2.16.5": {
158 | "type": "package",
159 | "serviceable": true,
160 | "sha512": "sha512-VlGUZEpF8KP/GCfFI59sdE0WA0o9quqwM1YQY0dSp6jpGy5EOBkureaybLfpwCuYUUjQbLkN2p7neUIcQCfbzA==",
161 | "path": "microsoft.identity.client.extensions.msal/2.16.5",
162 | "hashPath": "microsoft.identity.client.extensions.msal.2.16.5.nupkg.sha512"
163 | },
164 | "System.Buffers/4.5.0": {
165 | "type": "package",
166 | "serviceable": true,
167 | "sha512": "sha512-pL2ChpaRRWI/p4LXyy4RgeWlYF2sgfj/pnVMvBqwNFr5cXg7CXNnWZWxrOONLg8VGdFB8oB+EG2Qw4MLgTOe+A==",
168 | "path": "system.buffers/4.5.0",
169 | "hashPath": "system.buffers.4.5.0.nupkg.sha512"
170 | },
171 | "System.Diagnostics.DiagnosticSource/4.6.0": {
172 | "type": "package",
173 | "serviceable": true,
174 | "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==",
175 | "path": "system.diagnostics.diagnosticsource/4.6.0",
176 | "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512"
177 | },
178 | "System.Memory/4.5.3": {
179 | "type": "package",
180 | "serviceable": true,
181 | "sha512": "sha512-3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==",
182 | "path": "system.memory/4.5.3",
183 | "hashPath": "system.memory.4.5.3.nupkg.sha512"
184 | },
185 | "System.Numerics.Vectors/4.5.0": {
186 | "type": "package",
187 | "serviceable": true,
188 | "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==",
189 | "path": "system.numerics.vectors/4.5.0",
190 | "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512"
191 | },
192 | "System.Security.Cryptography.ProtectedData/4.5.0": {
193 | "type": "package",
194 | "serviceable": true,
195 | "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==",
196 | "path": "system.security.cryptography.protecteddata/4.5.0",
197 | "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512"
198 | },
199 | "System.Text.Json/4.6.0": {
200 | "type": "package",
201 | "serviceable": true,
202 | "sha512": "sha512-4F8Xe+JIkVoDJ8hDAZ7HqLkjctN/6WItJIzQaifBwClC7wmoLSda/Sv2i6i1kycqDb3hWF4JCVbpAweyOKHEUA==",
203 | "path": "system.text.json/4.6.0",
204 | "hashPath": "system.text.json.4.6.0.nupkg.sha512"
205 | },
206 | "System.Threading.Tasks.Extensions/4.5.2": {
207 | "type": "package",
208 | "serviceable": true,
209 | "sha512": "sha512-BG/TNxDFv0svAzx8OiMXDlsHfGw623BZ8tCXw4YLhDFDvDhNUEV58jKYMGRnkbJNm7c3JNNJDiN7JBMzxRBR2w==",
210 | "path": "system.threading.tasks.extensions/4.5.2",
211 | "hashPath": "system.threading.tasks.extensions.4.5.2.nupkg.sha512"
212 | }
213 | }
214 | }
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/DigitalTwins/DigitalTwinsManager.cs:
--------------------------------------------------------------------------------
1 | using Azure;
2 | using Azure.DigitalTwins.Core;
3 | using Azure.Identity;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.IO;
7 | using System.Text.Json;
8 |
9 | namespace SmartBuildingConsoleApp.DigitalTwins
10 | {
11 | public class DigitalTwinsManager
12 | {
13 | private static readonly string adtInstanceUrl = "https://DTBDigitalTwins.api.weu.digitaltwins.azure.net";
14 |
15 | private DigitalTwinsClient client;
16 |
17 | public DigitalTwinsManager()
18 | {
19 | Connect();
20 | }
21 |
22 | #region Connect and authentication
23 | public void Connect()
24 | {
25 | var cred = new DefaultAzureCredential();
26 | client = new DigitalTwinsClient(new Uri(adtInstanceUrl), cred);
27 | }
28 | #endregion
29 |
30 | #region Models
31 | public bool CreateModel(string path)
32 | {
33 | return CreateModels(new string[] { path });
34 | }
35 |
36 | public bool CreateModels(string[] path)
37 | {
38 | List dtdls = new List();
39 |
40 | foreach (string p in path)
41 | {
42 | using var modelStreamReader = new StreamReader(p);
43 | string dtdl = modelStreamReader.ReadToEnd();
44 |
45 | dtdls.Add(dtdl);
46 | }
47 |
48 | try
49 | {
50 | DigitalTwinsModelData[] models = client.CreateModels(dtdls.ToArray());
51 | }
52 | catch (RequestFailedException)
53 | {
54 | return false;
55 | }
56 |
57 | return true;
58 | }
59 |
60 | public void DeleteModel(string modelId)
61 | {
62 | try
63 | {
64 | client.DeleteModel(modelId);
65 | }
66 | catch (RequestFailedException)
67 | {
68 |
69 | }
70 | }
71 |
72 | public DigitalTwinsModelData GetModel(string modelId)
73 | {
74 | try
75 | {
76 | return client.GetModel(modelId);
77 | }
78 | catch (RequestFailedException)
79 | {
80 | return null;
81 | }
82 | }
83 |
84 | public Pageable GetModels()
85 | {
86 | GetModelsOptions options = new GetModelsOptions();
87 |
88 | return client.GetModels(options);
89 | }
90 | #endregion
91 |
92 | #region Digital Twins
93 | public bool CreateDigitalTwin(string twinId, string modelId)
94 | {
95 | BasicDigitalTwin digitalTwin = new BasicDigitalTwin();
96 | digitalTwin.Metadata = new DigitalTwinMetadata();
97 | digitalTwin.Metadata.ModelId = modelId;
98 | digitalTwin.Id = twinId;
99 |
100 | try
101 | {
102 | client.CreateOrReplaceDigitalTwin(twinId, digitalTwin);
103 | }
104 | catch (RequestFailedException)
105 | {
106 | return false;
107 | }
108 |
109 | return true;
110 | }
111 |
112 | public bool DeleteDigitalTwin(string twinId)
113 | {
114 | try
115 | {
116 | client.DeleteDigitalTwin(twinId);
117 | }
118 | catch (RequestFailedException)
119 | {
120 | return false;
121 | }
122 |
123 | return true;
124 | }
125 |
126 | public BasicDigitalTwin GetDigitalTwin(string twinId)
127 | {
128 | try
129 | {
130 | return client.GetDigitalTwin(twinId);
131 | }
132 | catch (RequestFailedException)
133 | {
134 | return null;
135 | }
136 | }
137 |
138 | public bool UpdateDigitalTwin(string twinId, string property, object value)
139 | {
140 | try
141 | {
142 | BasicDigitalTwin digitalTwin = client.GetDigitalTwin(twinId);
143 | digitalTwin.Contents[property] = value;
144 | client.CreateOrReplaceDigitalTwin(twinId, digitalTwin);
145 | }
146 | catch (RequestFailedException)
147 | {
148 | return false;
149 | }
150 |
151 | return true;
152 | }
153 |
154 | public void UpdateDigitalTwinProperty(string twinId, string property, object value)
155 | {
156 | JsonPatchDocument patch = null;
157 | try
158 | {
159 | patch = new JsonPatchDocument();
160 | patch.AppendAdd("/" + property, value);
161 | client.UpdateDigitalTwin(twinId, patch);
162 | }
163 | catch (RequestFailedException)
164 | {
165 | }
166 |
167 | patch = new JsonPatchDocument();
168 | patch.AppendReplace("/" + property, value);
169 | client.UpdateDigitalTwin(twinId, patch);
170 | }
171 |
172 | public bool UpdateDigitalTwin(string twinId, string property, Dictionary map)
173 | {
174 | try
175 | {
176 | JsonPatchDocument patch = new JsonPatchDocument();
177 | patch.AppendReplace(property, map);
178 |
179 | client.UpdateDigitalTwin(twinId, patch);
180 | }
181 | catch (RequestFailedException)
182 | {
183 | return false;
184 | }
185 |
186 | return true;
187 | }
188 |
189 |
190 | #endregion
191 |
192 | #region Relationships
193 | public string RelationshipId(string twinSourceId, string twinDestinationId)
194 | {
195 | return string.Format("{0}-{1}", twinSourceId, twinDestinationId);
196 | }
197 |
198 | public void CreateRelationship(string twinSourceId, string twinDestinationId, string description, Dictionary properties = null)
199 | {
200 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
201 |
202 | BasicRelationship relationship = new BasicRelationship
203 | {
204 | Id = "buildingFloorRelationshipId",
205 | SourceId = twinSourceId,
206 | TargetId = twinDestinationId,
207 | Name = description,
208 | Properties = properties
209 | };
210 |
211 | try
212 | {
213 | client.CreateOrReplaceRelationship(twinSourceId, relationShipId, relationship);
214 | }
215 | catch (RequestFailedException)
216 | {
217 | }
218 | }
219 |
220 | public void DeleteRelationship(string twinSourceId, string twinDestinationId)
221 | {
222 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
223 |
224 | try
225 | {
226 | client.DeleteRelationship(twinSourceId, relationShipId);
227 | }
228 | catch (RequestFailedException)
229 | {
230 | }
231 | }
232 |
233 | public BasicRelationship GetRelationship(string twinSourceId, string twinDestinationId)
234 | {
235 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
236 |
237 | try
238 | {
239 | Response relationship = client.GetRelationship(twinSourceId, relationShipId);
240 |
241 | return relationship.Value;
242 | }
243 | catch (RequestFailedException)
244 | {
245 | }
246 |
247 | return null;
248 | }
249 |
250 | public Pageable ListRelationships(string twinSourceId)
251 | {
252 | try
253 | {
254 | Pageable relationships = client.GetRelationships(twinSourceId);
255 |
256 | return relationships;
257 | }
258 | catch (RequestFailedException)
259 | {
260 | }
261 |
262 | return null;
263 | }
264 |
265 | public void UpdateRelationship(string twinSourceId, string twinDestinationId, string property, object value)
266 | {
267 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
268 |
269 | JsonPatchDocument patch = null;
270 | try
271 | {
272 | patch = new JsonPatchDocument();
273 | patch.AppendReplace("/" + property, value);
274 |
275 | client.UpdateRelationship(twinSourceId, relationShipId, patch);
276 | }
277 | catch (RequestFailedException)
278 | {
279 | }
280 | }
281 | #endregion
282 |
283 | #region Global
284 | public void ClearAll(string twinId)
285 | {
286 | Pageable relationships = ListRelationships(twinId);
287 |
288 | foreach(BasicRelationship relationship in relationships)
289 | {
290 | DeleteRelationship(relationship.SourceId, relationship.TargetId);
291 | }
292 |
293 | Pageable digitalTwins = QueryDigitalTwins("SELECT * FROM DIGITALTWINS");
294 |
295 | foreach(BasicDigitalTwin digitalTwin in digitalTwins)
296 | {
297 | DeleteDigitalTwin(digitalTwin.Id);
298 | }
299 | }
300 | #endregion
301 |
302 | #region Queries
303 |
304 | public Pageable> Query(string query)
305 | {
306 | Pageable> result = null;
307 |
308 | try
309 | {
310 | result = client.Query>(query);
311 | }
312 | catch(RequestFailedException)
313 | {
314 |
315 | }
316 |
317 | return result;
318 | }
319 |
320 | public Pageable QueryDigitalTwins(string query)
321 | {
322 | Pageable result = null;
323 | try
324 | {
325 | result = client.Query(query);
326 | }
327 | catch (RequestFailedException)
328 | {
329 | }
330 |
331 | return result;
332 | }
333 |
334 | public delegate void QueryResult(BasicDigitalTwin dt);
335 |
336 | public void QueryDigitalTwins(string query, QueryResult onQueryResult)
337 | {
338 | System.Threading.Tasks.Task task = System.Threading.Tasks.Task.Run(
339 | () => QueryDigitalTwinsAsync(query, onQueryResult));
340 | }
341 |
342 | public async void QueryDigitalTwinsAsync(string query, QueryResult onQueryResult)
343 | {
344 | AsyncPageable result = client.QueryAsync(query);
345 | try
346 | {
347 | await foreach (BasicDigitalTwin dt in result)
348 | {
349 | onQueryResult(dt);
350 | }
351 | }
352 | catch (RequestFailedException)
353 | {
354 | }
355 | }
356 |
357 | #endregion
358 | }
359 | }
360 |
--------------------------------------------------------------------------------
/SmartBuildingSensorUpdater/SmartBuildingSensorUpdater/DigitalTwins/DigitalTwinsManager.cs:
--------------------------------------------------------------------------------
1 | using Azure;
2 | using Azure.Core.Pipeline;
3 | using Azure.DigitalTwins.Core;
4 | using Azure.Identity;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.IO;
8 | using System.Net.Http;
9 | using System.Text.Json;
10 |
11 | namespace SmartBuildingConsoleApp.DigitalTwins
12 | {
13 | public class DigitalTwinsManager
14 | {
15 | private static readonly string adtInstanceUrl = "https://DTBDigitalTwins.api.weu.digitaltwins.azure.net";
16 |
17 | private DigitalTwinsClient client;
18 |
19 | public DigitalTwinsManager()
20 | {
21 | Connect();
22 | }
23 |
24 |
25 | public DigitalTwinsManager(string appId)
26 | {
27 | ManagedConnect(appId);
28 | }
29 |
30 | #region Connect and authentication
31 |
32 |
33 | public void ManagedConnect(string appId)
34 | {
35 | HttpClient httpClient = new HttpClient();
36 |
37 | var cred = new ManagedIdentityCredential(appId);
38 | client = new DigitalTwinsClient(new Uri(adtInstanceUrl), cred, new DigitalTwinsClientOptions { Transport = new HttpClientTransport(httpClient) });
39 | }
40 |
41 | public void Connect()
42 | {
43 | var cred = new DefaultAzureCredential();
44 | client = new DigitalTwinsClient(new Uri(adtInstanceUrl), cred);
45 | }
46 |
47 | #endregion
48 |
49 | #region Models
50 | public bool CreateModel(string path)
51 | {
52 | return CreateModels(new string[] { path });
53 | }
54 |
55 | public bool CreateModels(string[] path)
56 | {
57 | List dtdls = new List();
58 |
59 | foreach (string p in path)
60 | {
61 | using var modelStreamReader = new StreamReader(p);
62 | string dtdl = modelStreamReader.ReadToEnd();
63 |
64 | dtdls.Add(dtdl);
65 | }
66 |
67 | try
68 | {
69 | DigitalTwinsModelData[] models = client.CreateModels(dtdls.ToArray());
70 | }
71 | catch (RequestFailedException)
72 | {
73 | return false;
74 | }
75 |
76 | return true;
77 | }
78 |
79 | public void DeleteModel(string modelId)
80 | {
81 | try
82 | {
83 | client.DeleteModel(modelId);
84 | }
85 | catch (RequestFailedException)
86 | {
87 |
88 | }
89 | }
90 |
91 | public DigitalTwinsModelData GetModel(string modelId)
92 | {
93 | try
94 | {
95 | return client.GetModel(modelId);
96 | }
97 | catch (RequestFailedException)
98 | {
99 | return null;
100 | }
101 | }
102 |
103 | public Pageable GetModels()
104 | {
105 | GetModelsOptions options = new GetModelsOptions();
106 |
107 | return client.GetModels(options);
108 | }
109 | #endregion
110 |
111 | #region Digital Twins
112 | public bool CreateDigitalTwin(string twinId, string modelId)
113 | {
114 | BasicDigitalTwin digitalTwin = new BasicDigitalTwin();
115 | digitalTwin.Metadata = new DigitalTwinMetadata();
116 | digitalTwin.Metadata.ModelId = modelId;
117 | digitalTwin.Id = twinId;
118 |
119 | try
120 | {
121 | client.CreateOrReplaceDigitalTwin(twinId, digitalTwin);
122 | }
123 | catch (RequestFailedException)
124 | {
125 | return false;
126 | }
127 |
128 | return true;
129 | }
130 |
131 | public bool DeleteDigitalTwin(string twinId)
132 | {
133 | try
134 | {
135 | client.DeleteDigitalTwin(twinId);
136 | }
137 | catch (RequestFailedException)
138 | {
139 | return false;
140 | }
141 |
142 | return true;
143 | }
144 |
145 | public BasicDigitalTwin GetDigitalTwin(string twinId)
146 | {
147 | try
148 | {
149 | return client.GetDigitalTwin(twinId);
150 | }
151 | catch (RequestFailedException)
152 | {
153 | return null;
154 | }
155 | }
156 |
157 | public bool UpdateDigitalTwin(string twinId, string property, object value)
158 | {
159 | try
160 | {
161 | BasicDigitalTwin digitalTwin = client.GetDigitalTwin(twinId);
162 | digitalTwin.Contents[property] = value;
163 | client.CreateOrReplaceDigitalTwin(twinId, digitalTwin);
164 | }
165 | catch (RequestFailedException)
166 | {
167 | return false;
168 | }
169 |
170 | return true;
171 | }
172 |
173 | public void UpdateDigitalTwinProperty(string twinId, string property, object value)
174 | {
175 | JsonPatchDocument patch = null;
176 | try
177 | {
178 | patch = new JsonPatchDocument();
179 | patch.AppendAdd("/" + property, value);
180 | client.UpdateDigitalTwin(twinId, patch);
181 | }
182 | catch (RequestFailedException)
183 | {
184 | }
185 |
186 | patch = new JsonPatchDocument();
187 | patch.AppendReplace("/" + property, value);
188 | client.UpdateDigitalTwin(twinId, patch);
189 | }
190 |
191 | public bool UpdateDigitalTwin(string twinId, string property, Dictionary map)
192 | {
193 | try
194 | {
195 | JsonPatchDocument patch = new JsonPatchDocument();
196 | patch.AppendReplace(property, map);
197 |
198 | client.UpdateDigitalTwin(twinId, patch);
199 | }
200 | catch (RequestFailedException)
201 | {
202 | return false;
203 | }
204 |
205 | return true;
206 | }
207 |
208 |
209 | #endregion
210 |
211 | #region Relationships
212 | public string RelationshipId(string twinSourceId, string twinDestinationId)
213 | {
214 | return string.Format("{0}-{1}", twinSourceId, twinDestinationId);
215 | }
216 |
217 | public void CreateRelationship(string twinSourceId, string twinDestinationId, string description, Dictionary properties = null)
218 | {
219 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
220 |
221 | BasicRelationship relationship = new BasicRelationship
222 | {
223 | Id = "buildingFloorRelationshipId",
224 | SourceId = twinSourceId,
225 | TargetId = twinDestinationId,
226 | Name = description,
227 | Properties = properties
228 | };
229 |
230 | try
231 | {
232 | client.CreateOrReplaceRelationship(twinSourceId, relationShipId, relationship);
233 | }
234 | catch (RequestFailedException)
235 | {
236 | }
237 | }
238 |
239 | public void DeleteRelationship(string twinSourceId, string twinDestinationId)
240 | {
241 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
242 |
243 | try
244 | {
245 | client.DeleteRelationship(twinSourceId, relationShipId);
246 | }
247 | catch (RequestFailedException)
248 | {
249 | }
250 | }
251 |
252 | public BasicRelationship GetRelationship(string twinSourceId, string twinDestinationId)
253 | {
254 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
255 |
256 | try
257 | {
258 | Response relationship = client.GetRelationship(twinSourceId, relationShipId);
259 |
260 | return relationship.Value;
261 | }
262 | catch (RequestFailedException)
263 | {
264 | }
265 |
266 | return null;
267 | }
268 |
269 | public Pageable ListRelationships(string twinSourceId)
270 | {
271 | try
272 | {
273 | Pageable relationships = client.GetRelationships(twinSourceId);
274 |
275 | return relationships;
276 | }
277 | catch (RequestFailedException)
278 | {
279 | }
280 |
281 | return null;
282 | }
283 |
284 | public void UpdateRelationship(string twinSourceId, string twinDestinationId, string property, object value)
285 | {
286 | string relationShipId = RelationshipId(twinSourceId, twinDestinationId);
287 |
288 | JsonPatchDocument patch = null;
289 | try
290 | {
291 | patch = new JsonPatchDocument();
292 | patch.AppendReplace("/" + property, value);
293 |
294 | client.UpdateRelationship(twinSourceId, relationShipId, patch);
295 | }
296 | catch (RequestFailedException)
297 | {
298 | }
299 | }
300 | #endregion
301 |
302 | #region Global
303 | public void ClearAll(string twinId)
304 | {
305 | Pageable relationships = ListRelationships(twinId);
306 |
307 | foreach(BasicRelationship relationship in relationships)
308 | {
309 | DeleteRelationship(relationship.SourceId, relationship.TargetId);
310 | }
311 |
312 | Pageable digitalTwins = QueryDigitalTwins("SELECT * FROM DIGITALTWINS");
313 |
314 | foreach(BasicDigitalTwin digitalTwin in digitalTwins)
315 | {
316 | DeleteDigitalTwin(digitalTwin.Id);
317 | }
318 | }
319 | #endregion
320 |
321 | #region Queries
322 |
323 | public Pageable> Query(string query)
324 | {
325 | Pageable> result = null;
326 |
327 | try
328 | {
329 | result = client.Query>(query);
330 | }
331 | catch(RequestFailedException)
332 | {
333 |
334 | }
335 |
336 | return result;
337 | }
338 |
339 | public Pageable QueryDigitalTwins(string query)
340 | {
341 | Pageable result = null;
342 | try
343 | {
344 | result = client.Query(query);
345 | }
346 | catch (RequestFailedException)
347 | {
348 | }
349 |
350 | return result;
351 | }
352 |
353 | public delegate void QueryResult(BasicDigitalTwin dt);
354 |
355 | public void QueryDigitalTwins(string query, QueryResult onQueryResult)
356 | {
357 | System.Threading.Tasks.Task task = System.Threading.Tasks.Task.Run(
358 | () => QueryDigitalTwinsAsync(query, onQueryResult));
359 | }
360 |
361 | public async void QueryDigitalTwinsAsync(string query, QueryResult onQueryResult)
362 | {
363 | AsyncPageable result = client.QueryAsync(query);
364 | try
365 | {
366 | await foreach (BasicDigitalTwin dt in result)
367 | {
368 | onQueryResult(dt);
369 | }
370 | }
371 | catch (RequestFailedException)
372 | {
373 | }
374 | }
375 |
376 | #endregion
377 | }
378 | }
379 |
--------------------------------------------------------------------------------
/SmartBuildingConsoleApp/SmartBuildingConsoleApp/obj/project.assets.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "targets": {
4 | ".NETCoreApp,Version=v3.1": {
5 | "Azure.Core/1.8.1": {
6 | "type": "package",
7 | "dependencies": {
8 | "Microsoft.Bcl.AsyncInterfaces": "1.0.0",
9 | "System.Buffers": "4.5.0",
10 | "System.Diagnostics.DiagnosticSource": "4.6.0",
11 | "System.Memory": "4.5.3",
12 | "System.Numerics.Vectors": "4.5.0",
13 | "System.Text.Json": "4.6.0",
14 | "System.Threading.Tasks.Extensions": "4.5.2"
15 | },
16 | "compile": {
17 | "lib/netstandard2.0/Azure.Core.dll": {}
18 | },
19 | "runtime": {
20 | "lib/netstandard2.0/Azure.Core.dll": {}
21 | }
22 | },
23 | "Azure.DigitalTwins.Core/1.2.1": {
24 | "type": "package",
25 | "dependencies": {
26 | "Azure.Core": "1.8.1",
27 | "System.Text.Json": "4.6.0"
28 | },
29 | "compile": {
30 | "lib/netstandard2.0/Azure.DigitalTwins.Core.dll": {}
31 | },
32 | "runtime": {
33 | "lib/netstandard2.0/Azure.DigitalTwins.Core.dll": {}
34 | }
35 | },
36 | "Azure.Identity/1.3.0": {
37 | "type": "package",
38 | "dependencies": {
39 | "Azure.Core": "1.6.0",
40 | "Microsoft.Identity.Client": "4.22.0",
41 | "Microsoft.Identity.Client.Extensions.Msal": "2.16.5",
42 | "System.Memory": "4.5.3",
43 | "System.Security.Cryptography.ProtectedData": "4.5.0",
44 | "System.Text.Json": "4.6.0",
45 | "System.Threading.Tasks.Extensions": "4.5.2"
46 | },
47 | "compile": {
48 | "lib/netstandard2.0/Azure.Identity.dll": {}
49 | },
50 | "runtime": {
51 | "lib/netstandard2.0/Azure.Identity.dll": {}
52 | }
53 | },
54 | "Microsoft.Bcl.AsyncInterfaces/1.0.0": {
55 | "type": "package",
56 | "compile": {
57 | "ref/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": {}
58 | },
59 | "runtime": {
60 | "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": {}
61 | }
62 | },
63 | "Microsoft.Identity.Client/4.22.0": {
64 | "type": "package",
65 | "compile": {
66 | "ref/netcoreapp2.1/Microsoft.Identity.Client.dll": {}
67 | },
68 | "runtime": {
69 | "lib/netcoreapp2.1/Microsoft.Identity.Client.dll": {}
70 | }
71 | },
72 | "Microsoft.Identity.Client.Extensions.Msal/2.16.5": {
73 | "type": "package",
74 | "dependencies": {
75 | "Microsoft.Identity.Client": "4.22.0",
76 | "System.Security.Cryptography.ProtectedData": "4.5.0"
77 | },
78 | "compile": {
79 | "lib/netcoreapp2.1/Microsoft.Identity.Client.Extensions.Msal.dll": {}
80 | },
81 | "runtime": {
82 | "lib/netcoreapp2.1/Microsoft.Identity.Client.Extensions.Msal.dll": {}
83 | }
84 | },
85 | "System.Buffers/4.5.0": {
86 | "type": "package",
87 | "compile": {
88 | "ref/netcoreapp2.0/_._": {}
89 | },
90 | "runtime": {
91 | "lib/netcoreapp2.0/_._": {}
92 | }
93 | },
94 | "System.Diagnostics.DiagnosticSource/4.6.0": {
95 | "type": "package",
96 | "compile": {
97 | "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": {}
98 | },
99 | "runtime": {
100 | "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": {}
101 | }
102 | },
103 | "System.Memory/4.5.3": {
104 | "type": "package",
105 | "compile": {
106 | "ref/netcoreapp2.1/_._": {}
107 | },
108 | "runtime": {
109 | "lib/netcoreapp2.1/_._": {}
110 | }
111 | },
112 | "System.Numerics.Vectors/4.5.0": {
113 | "type": "package",
114 | "compile": {
115 | "ref/netcoreapp2.0/_._": {}
116 | },
117 | "runtime": {
118 | "lib/netcoreapp2.0/_._": {}
119 | }
120 | },
121 | "System.Security.Cryptography.ProtectedData/4.5.0": {
122 | "type": "package",
123 | "compile": {
124 | "ref/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {}
125 | },
126 | "runtime": {
127 | "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {}
128 | },
129 | "runtimeTargets": {
130 | "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {
131 | "assetType": "runtime",
132 | "rid": "win"
133 | }
134 | }
135 | },
136 | "System.Text.Json/4.6.0": {
137 | "type": "package",
138 | "compile": {
139 | "lib/netcoreapp3.0/System.Text.Json.dll": {}
140 | },
141 | "runtime": {
142 | "lib/netcoreapp3.0/System.Text.Json.dll": {}
143 | }
144 | },
145 | "System.Threading.Tasks.Extensions/4.5.2": {
146 | "type": "package",
147 | "compile": {
148 | "ref/netcoreapp2.1/_._": {}
149 | },
150 | "runtime": {
151 | "lib/netcoreapp2.1/_._": {}
152 | }
153 | }
154 | }
155 | },
156 | "libraries": {
157 | "Azure.Core/1.8.1": {
158 | "sha512": "BoGOCcdRa4ngAxBcyyndauFWgId6/SETDJnd9+4iHtXZ9JsVA4hs8pvK0H2ml4MHWwaYPmpepd70reAUm2u52g==",
159 | "type": "package",
160 | "path": "azure.core/1.8.1",
161 | "files": [
162 | ".nupkg.metadata",
163 | ".signature.p7s",
164 | "CHANGELOG.md",
165 | "README.md",
166 | "azure.core.1.8.1.nupkg.sha512",
167 | "azure.core.nuspec",
168 | "lib/net461/Azure.Core.dll",
169 | "lib/net461/Azure.Core.xml",
170 | "lib/net5.0/Azure.Core.dll",
171 | "lib/net5.0/Azure.Core.xml",
172 | "lib/netstandard2.0/Azure.Core.dll",
173 | "lib/netstandard2.0/Azure.Core.xml",
174 | "pkgicon.png"
175 | ]
176 | },
177 | "Azure.DigitalTwins.Core/1.2.1": {
178 | "sha512": "TYoES6J3wZrTJLG+hzhX256KyLfqV2HbpquFXPCJItXa7XYSDt1QiJ/A4mU6HObVjT4Lu7I1XXwRUdgcio/I7A==",
179 | "type": "package",
180 | "path": "azure.digitaltwins.core/1.2.1",
181 | "files": [
182 | ".nupkg.metadata",
183 | ".signature.p7s",
184 | "CHANGELOG.md",
185 | "README.md",
186 | "azure.digitaltwins.core.1.2.1.nupkg.sha512",
187 | "azure.digitaltwins.core.nuspec",
188 | "lib/netstandard2.0/Azure.DigitalTwins.Core.dll",
189 | "lib/netstandard2.0/Azure.DigitalTwins.Core.xml",
190 | "pkgicon.png"
191 | ]
192 | },
193 | "Azure.Identity/1.3.0": {
194 | "sha512": "l1SYfZKOFBuUFG7C2SWHmJcrQQaiXgBdVCycx4vcZQkC6efDVt7mzZ5pfJAFEJDBUq7mjRQ0RPq9ZDGdSswqMg==",
195 | "type": "package",
196 | "path": "azure.identity/1.3.0",
197 | "files": [
198 | ".nupkg.metadata",
199 | ".signature.p7s",
200 | "CHANGELOG.md",
201 | "README.md",
202 | "azure.identity.1.3.0.nupkg.sha512",
203 | "azure.identity.nuspec",
204 | "lib/netstandard2.0/Azure.Identity.dll",
205 | "lib/netstandard2.0/Azure.Identity.xml",
206 | "pkgicon.png"
207 | ]
208 | },
209 | "Microsoft.Bcl.AsyncInterfaces/1.0.0": {
210 | "sha512": "K63Y4hORbBcKLWH5wnKgzyn7TOfYzevIEwIedQHBIkmkEBA9SCqgvom+XTuE+fAFGvINGkhFItaZ2dvMGdT5iw==",
211 | "type": "package",
212 | "path": "microsoft.bcl.asyncinterfaces/1.0.0",
213 | "files": [
214 | ".nupkg.metadata",
215 | ".signature.p7s",
216 | "LICENSE.TXT",
217 | "THIRD-PARTY-NOTICES.TXT",
218 | "lib/net461/Microsoft.Bcl.AsyncInterfaces.dll",
219 | "lib/net461/Microsoft.Bcl.AsyncInterfaces.xml",
220 | "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll",
221 | "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.xml",
222 | "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll",
223 | "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.xml",
224 | "microsoft.bcl.asyncinterfaces.1.0.0.nupkg.sha512",
225 | "microsoft.bcl.asyncinterfaces.nuspec",
226 | "ref/net461/Microsoft.Bcl.AsyncInterfaces.dll",
227 | "ref/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll",
228 | "ref/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll",
229 | "useSharedDesignerContext.txt",
230 | "version.txt"
231 | ]
232 | },
233 | "Microsoft.Identity.Client/4.22.0": {
234 | "sha512": "GlamU9rs8cSVIx9WSGv5QKpt66KkE+ImxNa/wNZZUJ3knt3PM98T9sOY8B7NcEfhw7NoxU2/0TSOcmnRSJQgqw==",
235 | "type": "package",
236 | "path": "microsoft.identity.client/4.22.0",
237 | "files": [
238 | ".nupkg.metadata",
239 | ".signature.p7s",
240 | "lib/monoandroid10.0/Microsoft.Identity.Client.dll",
241 | "lib/monoandroid10.0/Microsoft.Identity.Client.xml",
242 | "lib/monoandroid90/Microsoft.Identity.Client.dll",
243 | "lib/monoandroid90/Microsoft.Identity.Client.xml",
244 | "lib/net45/Microsoft.Identity.Client.dll",
245 | "lib/net45/Microsoft.Identity.Client.xml",
246 | "lib/net461/Microsoft.Identity.Client.dll",
247 | "lib/net461/Microsoft.Identity.Client.xml",
248 | "lib/netcoreapp2.1/Microsoft.Identity.Client.dll",
249 | "lib/netcoreapp2.1/Microsoft.Identity.Client.xml",
250 | "lib/netstandard1.3/Microsoft.Identity.Client.dll",
251 | "lib/netstandard1.3/Microsoft.Identity.Client.xml",
252 | "lib/uap10.0/Microsoft.Identity.Client.dll",
253 | "lib/uap10.0/Microsoft.Identity.Client.pri",
254 | "lib/uap10.0/Microsoft.Identity.Client.xml",
255 | "lib/xamarinios10/Microsoft.Identity.Client.dll",
256 | "lib/xamarinios10/Microsoft.Identity.Client.xml",
257 | "lib/xamarinmac20/Microsoft.Identity.Client.dll",
258 | "lib/xamarinmac20/Microsoft.Identity.Client.xml",
259 | "microsoft.identity.client.4.22.0.nupkg.sha512",
260 | "microsoft.identity.client.nuspec",
261 | "ref/MonoAndroid10.0/Microsoft.Identity.Client.dll",
262 | "ref/MonoAndroid10.0/Microsoft.Identity.Client.xml",
263 | "ref/MonoAndroid9.0/Microsoft.Identity.Client.dll",
264 | "ref/MonoAndroid9.0/Microsoft.Identity.Client.xml",
265 | "ref/Xamarin.iOS10/Microsoft.Identity.Client.dll",
266 | "ref/Xamarin.iOS10/Microsoft.Identity.Client.xml",
267 | "ref/net45/Microsoft.Identity.Client.dll",
268 | "ref/net45/Microsoft.Identity.Client.xml",
269 | "ref/net461/Microsoft.Identity.Client.dll",
270 | "ref/net461/Microsoft.Identity.Client.xml",
271 | "ref/netcoreapp2.1/Microsoft.Identity.Client.dll",
272 | "ref/netcoreapp2.1/Microsoft.Identity.Client.xml",
273 | "ref/netstandard1.3/Microsoft.Identity.Client.dll",
274 | "ref/netstandard1.3/Microsoft.Identity.Client.xml",
275 | "ref/uap10.0/Microsoft.Identity.Client.dll",
276 | "ref/uap10.0/Microsoft.Identity.Client.xml",
277 | "ref/xamarinmac20/Microsoft.Identity.Client.dll",
278 | "ref/xamarinmac20/Microsoft.Identity.Client.xml"
279 | ]
280 | },
281 | "Microsoft.Identity.Client.Extensions.Msal/2.16.5": {
282 | "sha512": "VlGUZEpF8KP/GCfFI59sdE0WA0o9quqwM1YQY0dSp6jpGy5EOBkureaybLfpwCuYUUjQbLkN2p7neUIcQCfbzA==",
283 | "type": "package",
284 | "path": "microsoft.identity.client.extensions.msal/2.16.5",
285 | "files": [
286 | ".nupkg.metadata",
287 | ".signature.p7s",
288 | "lib/net45/Microsoft.Identity.Client.Extensions.Msal.dll",
289 | "lib/net45/Microsoft.Identity.Client.Extensions.Msal.xml",
290 | "lib/netcoreapp2.1/Microsoft.Identity.Client.Extensions.Msal.dll",
291 | "lib/netcoreapp2.1/Microsoft.Identity.Client.Extensions.Msal.xml",
292 | "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll",
293 | "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.xml",
294 | "microsoft.identity.client.extensions.msal.2.16.5.nupkg.sha512",
295 | "microsoft.identity.client.extensions.msal.nuspec"
296 | ]
297 | },
298 | "System.Buffers/4.5.0": {
299 | "sha512": "pL2ChpaRRWI/p4LXyy4RgeWlYF2sgfj/pnVMvBqwNFr5cXg7CXNnWZWxrOONLg8VGdFB8oB+EG2Qw4MLgTOe+A==",
300 | "type": "package",
301 | "path": "system.buffers/4.5.0",
302 | "files": [
303 | ".nupkg.metadata",
304 | ".signature.p7s",
305 | "LICENSE.TXT",
306 | "THIRD-PARTY-NOTICES.TXT",
307 | "lib/netcoreapp2.0/_._",
308 | "lib/netstandard1.1/System.Buffers.dll",
309 | "lib/netstandard1.1/System.Buffers.xml",
310 | "lib/netstandard2.0/System.Buffers.dll",
311 | "lib/netstandard2.0/System.Buffers.xml",
312 | "lib/uap10.0.16299/_._",
313 | "ref/net45/System.Buffers.dll",
314 | "ref/net45/System.Buffers.xml",
315 | "ref/netcoreapp2.0/_._",
316 | "ref/netstandard1.1/System.Buffers.dll",
317 | "ref/netstandard1.1/System.Buffers.xml",
318 | "ref/netstandard2.0/System.Buffers.dll",
319 | "ref/netstandard2.0/System.Buffers.xml",
320 | "ref/uap10.0.16299/_._",
321 | "system.buffers.4.5.0.nupkg.sha512",
322 | "system.buffers.nuspec",
323 | "useSharedDesignerContext.txt",
324 | "version.txt"
325 | ]
326 | },
327 | "System.Diagnostics.DiagnosticSource/4.6.0": {
328 | "sha512": "mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==",
329 | "type": "package",
330 | "path": "system.diagnostics.diagnosticsource/4.6.0",
331 | "files": [
332 | ".nupkg.metadata",
333 | ".signature.p7s",
334 | "LICENSE.TXT",
335 | "THIRD-PARTY-NOTICES.TXT",
336 | "lib/net45/System.Diagnostics.DiagnosticSource.dll",
337 | "lib/net45/System.Diagnostics.DiagnosticSource.xml",
338 | "lib/net46/System.Diagnostics.DiagnosticSource.dll",
339 | "lib/net46/System.Diagnostics.DiagnosticSource.xml",
340 | "lib/netstandard1.1/System.Diagnostics.DiagnosticSource.dll",
341 | "lib/netstandard1.1/System.Diagnostics.DiagnosticSource.xml",
342 | "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll",
343 | "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.xml",
344 | "lib/portable-net45+win8+wpa81/System.Diagnostics.DiagnosticSource.dll",
345 | "lib/portable-net45+win8+wpa81/System.Diagnostics.DiagnosticSource.xml",
346 | "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512",
347 | "system.diagnostics.diagnosticsource.nuspec",
348 | "useSharedDesignerContext.txt",
349 | "version.txt"
350 | ]
351 | },
352 | "System.Memory/4.5.3": {
353 | "sha512": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==",
354 | "type": "package",
355 | "path": "system.memory/4.5.3",
356 | "files": [
357 | ".nupkg.metadata",
358 | ".signature.p7s",
359 | "LICENSE.TXT",
360 | "THIRD-PARTY-NOTICES.TXT",
361 | "lib/netcoreapp2.1/_._",
362 | "lib/netstandard1.1/System.Memory.dll",
363 | "lib/netstandard1.1/System.Memory.xml",
364 | "lib/netstandard2.0/System.Memory.dll",
365 | "lib/netstandard2.0/System.Memory.xml",
366 | "ref/netcoreapp2.1/_._",
367 | "system.memory.4.5.3.nupkg.sha512",
368 | "system.memory.nuspec",
369 | "useSharedDesignerContext.txt",
370 | "version.txt"
371 | ]
372 | },
373 | "System.Numerics.Vectors/4.5.0": {
374 | "sha512": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==",
375 | "type": "package",
376 | "path": "system.numerics.vectors/4.5.0",
377 | "files": [
378 | ".nupkg.metadata",
379 | ".signature.p7s",
380 | "LICENSE.TXT",
381 | "THIRD-PARTY-NOTICES.TXT",
382 | "lib/MonoAndroid10/_._",
383 | "lib/MonoTouch10/_._",
384 | "lib/net46/System.Numerics.Vectors.dll",
385 | "lib/net46/System.Numerics.Vectors.xml",
386 | "lib/netcoreapp2.0/_._",
387 | "lib/netstandard1.0/System.Numerics.Vectors.dll",
388 | "lib/netstandard1.0/System.Numerics.Vectors.xml",
389 | "lib/netstandard2.0/System.Numerics.Vectors.dll",
390 | "lib/netstandard2.0/System.Numerics.Vectors.xml",
391 | "lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll",
392 | "lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml",
393 | "lib/uap10.0.16299/_._",
394 | "lib/xamarinios10/_._",
395 | "lib/xamarinmac20/_._",
396 | "lib/xamarintvos10/_._",
397 | "lib/xamarinwatchos10/_._",
398 | "ref/MonoAndroid10/_._",
399 | "ref/MonoTouch10/_._",
400 | "ref/net45/System.Numerics.Vectors.dll",
401 | "ref/net45/System.Numerics.Vectors.xml",
402 | "ref/net46/System.Numerics.Vectors.dll",
403 | "ref/net46/System.Numerics.Vectors.xml",
404 | "ref/netcoreapp2.0/_._",
405 | "ref/netstandard1.0/System.Numerics.Vectors.dll",
406 | "ref/netstandard1.0/System.Numerics.Vectors.xml",
407 | "ref/netstandard2.0/System.Numerics.Vectors.dll",
408 | "ref/netstandard2.0/System.Numerics.Vectors.xml",
409 | "ref/uap10.0.16299/_._",
410 | "ref/xamarinios10/_._",
411 | "ref/xamarinmac20/_._",
412 | "ref/xamarintvos10/_._",
413 | "ref/xamarinwatchos10/_._",
414 | "system.numerics.vectors.4.5.0.nupkg.sha512",
415 | "system.numerics.vectors.nuspec",
416 | "useSharedDesignerContext.txt",
417 | "version.txt"
418 | ]
419 | },
420 | "System.Security.Cryptography.ProtectedData/4.5.0": {
421 | "sha512": "wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==",
422 | "type": "package",
423 | "path": "system.security.cryptography.protecteddata/4.5.0",
424 | "files": [
425 | ".nupkg.metadata",
426 | ".signature.p7s",
427 | "LICENSE.TXT",
428 | "THIRD-PARTY-NOTICES.TXT",
429 | "lib/MonoAndroid10/_._",
430 | "lib/MonoTouch10/_._",
431 | "lib/net46/System.Security.Cryptography.ProtectedData.dll",
432 | "lib/net461/System.Security.Cryptography.ProtectedData.dll",
433 | "lib/netstandard1.3/System.Security.Cryptography.ProtectedData.dll",
434 | "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll",
435 | "lib/xamarinios10/_._",
436 | "lib/xamarinmac20/_._",
437 | "lib/xamarintvos10/_._",
438 | "lib/xamarinwatchos10/_._",
439 | "ref/MonoAndroid10/_._",
440 | "ref/MonoTouch10/_._",
441 | "ref/net46/System.Security.Cryptography.ProtectedData.dll",
442 | "ref/net461/System.Security.Cryptography.ProtectedData.dll",
443 | "ref/net461/System.Security.Cryptography.ProtectedData.xml",
444 | "ref/netstandard1.3/System.Security.Cryptography.ProtectedData.dll",
445 | "ref/netstandard2.0/System.Security.Cryptography.ProtectedData.dll",
446 | "ref/netstandard2.0/System.Security.Cryptography.ProtectedData.xml",
447 | "ref/xamarinios10/_._",
448 | "ref/xamarinmac20/_._",
449 | "ref/xamarintvos10/_._",
450 | "ref/xamarinwatchos10/_._",
451 | "runtimes/win/lib/net46/System.Security.Cryptography.ProtectedData.dll",
452 | "runtimes/win/lib/net461/System.Security.Cryptography.ProtectedData.dll",
453 | "runtimes/win/lib/netstandard1.3/System.Security.Cryptography.ProtectedData.dll",
454 | "runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll",
455 | "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512",
456 | "system.security.cryptography.protecteddata.nuspec",
457 | "useSharedDesignerContext.txt",
458 | "version.txt"
459 | ]
460 | },
461 | "System.Text.Json/4.6.0": {
462 | "sha512": "4F8Xe+JIkVoDJ8hDAZ7HqLkjctN/6WItJIzQaifBwClC7wmoLSda/Sv2i6i1kycqDb3hWF4JCVbpAweyOKHEUA==",
463 | "type": "package",
464 | "path": "system.text.json/4.6.0",
465 | "files": [
466 | ".nupkg.metadata",
467 | ".signature.p7s",
468 | "LICENSE.TXT",
469 | "THIRD-PARTY-NOTICES.TXT",
470 | "lib/net461/System.Text.Json.dll",
471 | "lib/net461/System.Text.Json.xml",
472 | "lib/netcoreapp3.0/System.Text.Json.dll",
473 | "lib/netcoreapp3.0/System.Text.Json.xml",
474 | "lib/netstandard2.0/System.Text.Json.dll",
475 | "lib/netstandard2.0/System.Text.Json.xml",
476 | "system.text.json.4.6.0.nupkg.sha512",
477 | "system.text.json.nuspec",
478 | "useSharedDesignerContext.txt",
479 | "version.txt"
480 | ]
481 | },
482 | "System.Threading.Tasks.Extensions/4.5.2": {
483 | "sha512": "BG/TNxDFv0svAzx8OiMXDlsHfGw623BZ8tCXw4YLhDFDvDhNUEV58jKYMGRnkbJNm7c3JNNJDiN7JBMzxRBR2w==",
484 | "type": "package",
485 | "path": "system.threading.tasks.extensions/4.5.2",
486 | "files": [
487 | ".nupkg.metadata",
488 | ".signature.p7s",
489 | "LICENSE.TXT",
490 | "THIRD-PARTY-NOTICES.TXT",
491 | "lib/MonoAndroid10/_._",
492 | "lib/MonoTouch10/_._",
493 | "lib/netcoreapp2.1/_._",
494 | "lib/netstandard1.0/System.Threading.Tasks.Extensions.dll",
495 | "lib/netstandard1.0/System.Threading.Tasks.Extensions.xml",
496 | "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll",
497 | "lib/netstandard2.0/System.Threading.Tasks.Extensions.xml",
498 | "lib/portable-net45+win8+wp8+wpa81/System.Threading.Tasks.Extensions.dll",
499 | "lib/portable-net45+win8+wp8+wpa81/System.Threading.Tasks.Extensions.xml",
500 | "lib/xamarinios10/_._",
501 | "lib/xamarinmac20/_._",
502 | "lib/xamarintvos10/_._",
503 | "lib/xamarinwatchos10/_._",
504 | "ref/MonoAndroid10/_._",
505 | "ref/MonoTouch10/_._",
506 | "ref/netcoreapp2.1/_._",
507 | "ref/xamarinios10/_._",
508 | "ref/xamarinmac20/_._",
509 | "ref/xamarintvos10/_._",
510 | "ref/xamarinwatchos10/_._",
511 | "system.threading.tasks.extensions.4.5.2.nupkg.sha512",
512 | "system.threading.tasks.extensions.nuspec",
513 | "useSharedDesignerContext.txt",
514 | "version.txt"
515 | ]
516 | }
517 | },
518 | "projectFileDependencyGroups": {
519 | ".NETCoreApp,Version=v3.1": [
520 | "Azure.DigitalTwins.Core >= 1.2.1",
521 | "Azure.Identity >= 1.3.0"
522 | ]
523 | },
524 | "packageFolders": {
525 | "C:\\Users\\dtbadmin\\.nuget\\packages\\": {}
526 | },
527 | "project": {
528 | "version": "1.0.0",
529 | "restore": {
530 | "projectUniqueName": "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp.csproj",
531 | "projectName": "SmartBuildingConsoleApp",
532 | "projectPath": "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp.csproj",
533 | "packagesPath": "C:\\Users\\dtbadmin\\.nuget\\packages\\",
534 | "outputPath": "C:\\Github\\SmartBuildingConsoleApp\\SmartBuildingConsoleApp\\obj\\",
535 | "projectStyle": "PackageReference",
536 | "configFilePaths": [
537 | "C:\\Users\\dtbadmin\\AppData\\Roaming\\NuGet\\NuGet.Config",
538 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
539 | ],
540 | "originalTargetFrameworks": [
541 | "netcoreapp3.1"
542 | ],
543 | "sources": {
544 | "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
545 | "https://api.nuget.org/v3/index.json": {}
546 | },
547 | "frameworks": {
548 | "netcoreapp3.1": {
549 | "targetAlias": "netcoreapp3.1",
550 | "projectReferences": {}
551 | }
552 | },
553 | "warningProperties": {
554 | "warnAsError": [
555 | "NU1605"
556 | ]
557 | }
558 | },
559 | "frameworks": {
560 | "netcoreapp3.1": {
561 | "targetAlias": "netcoreapp3.1",
562 | "dependencies": {
563 | "Azure.DigitalTwins.Core": {
564 | "target": "Package",
565 | "version": "[1.2.1, )"
566 | },
567 | "Azure.Identity": {
568 | "target": "Package",
569 | "version": "[1.3.0, )"
570 | }
571 | },
572 | "imports": [
573 | "net461",
574 | "net462",
575 | "net47",
576 | "net471",
577 | "net472",
578 | "net48"
579 | ],
580 | "assetTargetFallback": true,
581 | "warn": true,
582 | "frameworkReferences": {
583 | "Microsoft.NETCore.App": {
584 | "privateAssets": "all"
585 | }
586 | },
587 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.103\\RuntimeIdentifierGraph.json"
588 | }
589 | }
590 | }
591 | }
--------------------------------------------------------------------------------