Skip to content

Commit 9ec639c

Browse files
authored
Merge pull request #107583 from uhabiba04/master
updating to meet the microsoft doc standards
2 parents 84cf1c5 + fc782b7 commit 9ec639c

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

articles/industry/agriculture/ingest-historical-telemetry-data-in-azure-farmbeats.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,35 @@ Ingesting historical data from Internet of Things (IoT) resources such as device
1515

1616
## Before you begin
1717

18-
Before you proceed with this article, make sure that you've installed FarmBeats and collected historical data from your IoT devices.
19-
You also need to enable partner access as mentioned in the following steps.
18+
Before you proceed with this article, make sure that you've installed FarmBeats and collected historical data from your IoT devices. You also need to enable partner access as mentioned in the following steps.
2019

2120
## Enable partner access
2221

2322
You need to enable partner integration to your Azure FarmBeats instance. This step creates a client that has access to your Azure FarmBeats instance as your device partner and provides you with the following values that are required in the subsequent steps:
2423

25-
- API endpoint: This is the Datahub URL, for example, https://\<datahub>.azurewebsites.net.
24+
- API endpoint: This is the Datahub URL, for example, https://\<datahub>.azurewebsites.net
2625
- Tenant ID
2726
- Client ID
2827
- Client secret
2928
- EventHub connection string
3029

31-
Follow these steps.
30+
Follow these steps:
3231

3332
>[!NOTE]
3433
> You must be an administrator to do the following steps.
3534
3635
1. Download the [zip file](https://aka.ms/farmbeatspartnerscriptv2), and extract it to your local drive. There will be one file inside the zip file.
37-
2. Sign in to https://portal.azure.com/ and go to Azure Active Directory -> App Registrations
36+
2. Sign in to https://portal.azure.com/ and go to **Azure Active Directory** > **App Registrations**.
3837

39-
3. Click on the App Registration that was created as part of your FarmBeats deployment. It will have the same name as your FarmBeats Datahub.
38+
3. Select the **App Registration** that was created as part of your FarmBeats deployment. It will have the same name as your FarmBeats Datahub.
4039

41-
4. Click on “Expose an API” -> Click “Add a client application and enter **04b07795-8ddb-461a-bbee-02f9e1bf7b46** and check "Authorize Scope". This will give access to the Azure CLI (Cloud Shell) to perform the below steps.
40+
4. Select **Expose an API** > Select **Add a client application** and enter **04b07795-8ddb-461a-bbee-02f9e1bf7b46** and check **Authorize Scope**. This will give access to the Azure CLI (Cloud Shell) to perform the following steps:
4241

4342
5. Open Cloud Shell. This option is available on the toolbar in the upper-right corner of the Azure portal.
4443

4544
![Azure portal toolbar](./media/get-drone-imagery-from-drone-partner/navigation-bar-1.png)
4645

47-
6. Make sure the environment is set to **PowerShell**. By default, it's set to Bash.
46+
6. Ensure the environment is set to **PowerShell**. By default, it's set to Bash.
4847

4948
![PowerShell toolbar setting](./media/get-sensor-data-from-sensor-partner/power-shell-new-1.png)
5049

@@ -54,9 +53,9 @@ Follow these steps.
5453

5554
8. Go to the directory where the file was uploaded. By default, files get uploaded to the home directory under the username.
5655

57-
9. Run the following script. The script asks for the Tenant ID which can be obtained from Azure Active Directory -> Overview page.
56+
9. Run the following script. The script asks for the Tenant ID, which can be obtained from **Azure Active Directory** > **Overview page**.
5857

59-
```azurepowershell-interactive
58+
```azurepowershell-interactive
6059
6160
./generatePartnerCredentials.ps1
6261
@@ -65,9 +64,12 @@ Follow these steps.
6564
10. Follow the onscreen instructions to capture the values for **API Endpoint**, **Tenant ID**, **Client ID**, **Client Secret**, and **EventHub Connection String**.
6665
## Create device or sensor metadata
6766
68-
Now that you have the required credentials, you can define the device and sensors. To do this, create the metadata by calling FarmBeats APIs. Please note you will need to call the APIs as the client app that you created in the above section
67+
Now that you have the required credentials, you can define the device and sensors. To do this, create the metadata by calling FarmBeats APIs. Make sure to call the APIs as the client app that you created in the above section.
6968
70-
FarmBeats Datahub has the following APIs that enable creation and management of device or sensor metadata. Please note that as a partner you have access to only read, create and update the metadata; **Delete is not allowed by a partner.**
69+
FarmBeats Datahub has the following APIs that enable creation and management of device or sensor metadata.
70+
71+
> [!NOTE]
72+
> As a partner you have access only to read, create and update the metadata; **delete option is restricted to the partner.**
7173
7274
- /**DeviceModel**: DeviceModel corresponds to the metadata of the device, such as the manufacturer and the type of device, which is either a gateway or a node.
7375
- /**Device**: Device corresponds to a physical device present on the farm.
@@ -279,7 +281,7 @@ curl -X POST "https://<datahub>.azurewebsites.net/Device" -H
279281
\"description\": \"Test Device 123\"}" *
280282
```
281283

282-
Below is a sample code in Python. Please note that the access token used in this sample is the same that we received during authentication
284+
Below is a sample code in Python. The access token used in this sample is the same that is received during the authentication.
283285

284286
```python
285287
import requests
@@ -342,11 +344,11 @@ Convert the historical sensor data format to a canonical format that Azure FarmB
342344
"sensordata": [
343345
{
344346
"timestamp": "< timestamp in ISO 8601 format >",
345-
"<sensor measure name (as defined in the Sensor Model)>": <value>
347+
"<sensor measure name (as defined in the Sensor Model)>": "<value>"
346348
},
347349
{
348350
"timestamp": "<timestamp in ISO 8601 format>",
349-
"<sensor measure name (as defined in the Sensor Model)>": <value>
351+
"<sensor measure name (as defined in the Sensor Model)>": "<values>"
350352
}
351353
]
352354
}
@@ -403,8 +405,10 @@ Here's an example of a telemetry message:
403405

404406
**Corrective action**:
405407

406-
1. Ensure you have done the partner registration correctly - you can check this by going to your datahub swagger, navigate to /Partner API, Do a Get and check if the partner is registered. If not, please follow the [steps here](get-sensor-data-from-sensor-partner.md#enable-device-integration-with-farmbeats) to add partner.
408+
1. Ensure you have done the appropriate partner registration - you can check this by going to your datahub swagger, navigate to /Partner API, Do a Get and check if the partner is registered. If not, follow the [steps here](get-sensor-data-from-sensor-partner.md#enable-device-integration-with-farmbeats) to add partner.
409+
407410
2. Ensure that you have created the metadata (DeviceModel, Device, SensorModel, Sensor) using the partner client credentials.
411+
408412
3. Ensure that you have used the correct Telemetry message format (as specified below):
409413

410414
```json
@@ -418,11 +422,11 @@ Here's an example of a telemetry message:
418422
"sensordata": [
419423
{
420424
"timestamp": "< timestamp in ISO 8601 format >",
421-
"<sensor measure name (as defined in the Sensor Model)>": <value>
425+
"<sensor measure name (as defined in the Sensor Model)>": "<value>"
422426
},
423427
{
424428
"timestamp": "<timestamp in ISO 8601 format>",
425-
"<sensor measure name (as defined in the Sensor Model)>": <value>
429+
"<sensor measure name (as defined in the Sensor Model)>": "<value>"
426430
}
427431
]
428432
}

0 commit comments

Comments
 (0)