Configuration
Update the HVAC configuration file
- With your favorite text editor, open the DotnetClient/hvac.env file.
- Update the ID_SCOPE key with the Azure DPS ID Scope value from the deployment output.
- Leave the configuration file open, you will need to update it again in the next step.
Create a Azure DPS enrolment group
- From your browser, navigate to the Azure Portal.
- Select the Azure DPS resource created for the Predictive Maintenance solution.
- Select Manage enrollments.
- Select Add enrollment group.
- Name the group
HVAC_Simulator
. - Select Symmetric key for the Authentication type.
- Select Save.
- Don't close the browser window, you will need the enrollment group Primary key in the next step.
Create an Azure DPS derived device key
Select the newly created HVAC_Simulator enrollment group.
Copy the Primary key to the clipboard.
Select the Cloud Shell button in the Azure Portal to open a command-line window in the browser.
Run the following command in the cloud shell to create a derived device key:
az iot dps enrollment-group compute-device-key --rid hvac_simulator --key <your-primary-key>
Update the DotnetClient/hvac.env file with the derived device key.
Create an Open Weather Map API key
Open Weather Map is a weather data provider. The HVAC simulator app uses Open Weather Map to get the current weather conditions. You must create a free Open Weather Map API key to use the app.
Follow these steps to create a free Open Weather Map API key:
- From your web browser navigate to https://openweathermap.org/api
- Sign in to Open Weather Map
- Select API from the Open Weather Map main menu.
- Subscribe to the Current Weather Data. Select the Free option, and select Get API key.
- Repeat and subscribe to the Air Pollution API. Select the Free option, and select Get API key.
- Select API Keys from the Open Weather Map site.
- Update the DotnetClient/hvac.env file with the API key value.
- Save the DotnetClient/hvac.env file.