Skip to content

Latest commit

 

History

History
57 lines (35 loc) · 2.51 KB

File metadata and controls

57 lines (35 loc) · 2.51 KB

Occupancy Sample

License: MIT Contribute

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.

Build and Run the Sample

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.

Update appSettings.json

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 (see appSetting.json for what this should look like).

Use a shell

  1. Run the app:

    cd src
    dotnet restore
    dotnet run

    This will show usage. For a walkthrough of what you can do see quickstart doc.

  2. Run tests:

    dotnet test ../tests

Use Visual Studio Code

  1. Open the 'occupancy-quickstart' folder in Visual Studio Code.
  2. Run the app by using the F5 key. You can change the command-line parameters in launch.json.
  3. To build and run tests use the 'Run Task' command in Visual Studio Code and choose test.

Notes

Authentication

To learn more about configuration, security, and API authentication:

  1. See the role-based access control doc.
  2. See the Management API doc.

Problems

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.

Licensing and Use

Azure Digital Twins Samples are MIT Licensed.