Sample code to provision and read resources in a Digital Twins topology via management APIs. It also creates an example function that runs within the Digital Twins instance that computes motion from a sensor in a room in order to determine the occupancy.
Below are some details on how to get up and running. For a more detailed walkthrough or more details on how to get the values described below, please see this quickstart doc.
appSettings.json
is used to specify info on which Digital Twins instance to connect to. The three fields you will need to fill in are:
ClientId
: The application ID of a native Azure Active Directory app that has permissions to call the Azure Digital Twins service.Tenant
: The directory ID of a your Azure Active Directory.BaseUrl
: The management api url to your Digital Twins instance (seeappSetting.json
for what this should look like).
-
Run the app:
cd src dotnet restore dotnet run
This will show usage. For a walkthrough of what you can do see quickstart doc.
-
Run tests:
dotnet test ../tests
- Open the 'occupancy-quickstart' folder in Visual Studio Code.
- Run the app by using the
F5
key. You can change the command-line parameters inlaunch.json
. - To build and run tests use the 'Run Task' command in Visual Studio Code and choose
test
.
To learn more about configuration, security, and API authentication:
- See the role-based access control doc.
- See the Management API doc.
If you run into problems or have questions checkout our FAQ. If that doesn't help search open and closed issues and open a new one if you can't find an answer.
Azure Digital Twins Samples are MIT Licensed.