Skip to content

Commit d04d8ea

Browse files
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into WI-148955-release-note-def-for-storage-new-recommendation
2 parents fe05b05 + ffad28f commit d04d8ea

18 files changed

+252
-116
lines changed

articles/automation/python-packages.md

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Manage Python 2 packages in Azure Automation
33
description: This article tells how to manage Python 2 packages in Azure Automation.
44
services: automation
55
ms.subservice: process-automation
6-
ms.date: 10/29/2021
6+
ms.date: 08/21/2023
77
ms.topic: conceptual
88
ms.custom: devx-track-python
99
---
@@ -16,7 +16,7 @@ For information on managing Python 3 packages, see [Manage Python 3 packages](./
1616

1717
## Import packages
1818

19-
1. In your Automation account, select **Python packages** under **Shared Resources**. Click **+ Add a Python package**.
19+
1. In your Automation account, select **Python packages** under **Shared Resources**. Select **+ Add a Python package**.
2020

2121
:::image type="content" source="media/python-packages/add-python-package.png" alt-text="Screenshot of the Python packages page shows Python packages in the left menu and Add a Python package highlighted.":::
2222

@@ -26,13 +26,13 @@ For information on managing Python 3 packages, see [Manage Python 3 packages](./
2626

2727
:::image type="content" source="media/python-packages/upload-package.png" alt-text="Screenshot shows the Add Python Package page with an uploaded tar.gz file selected.":::
2828

29-
After a package has been imported, it's listed on the **Python packages** page in your Automation account. To remove a package, select the package and click **Delete**.
29+
After a package has been imported, it's listed on the **Python packages** page in your Automation account. To remove a package, select the package and select **Delete**.
3030

3131
:::image type="content" source="media/python-packages/package-list.png" alt-text="Screenshot shows the Python 2.7.x packages page after a package has been imported.":::
3232

3333
## Import packages with dependencies
3434

35-
Azure automation doesn't resolve dependencies for Python packages during the import process. There are two ways to import a package with all its dependencies. Only one of the following steps needs to be used to import the packages into your Automation account.
35+
Azure Automation doesn't resolve dependencies for Python packages during the import process. There are two ways to import a package with all its dependencies. Only one of the following steps needs to be used to import the packages into your Automation account.
3636

3737
### Manually download
3838

@@ -46,7 +46,7 @@ Once the packages are downloaded, you can import them into your automation accou
4646

4747
### Runbook
4848

49-
To obtain a runbook, [import Python 2 packages from pypi into Azure Automation account](https://github.com/azureautomation/import-python-2-packages-from-pypi-into-azure-automation-account) from the Azure Automation GitHub organization into your Automation account. Make sure the Run Settings are set to **Azure** and start the runbook with the parameters. The runbook requires a Run As account for the Automation account to work. For each parameter make sure you start it with the switch as seen in the following list and image:
49+
To obtain a runbook, [import Python 2 packages from pypi into Azure Automation account](https://github.com/azureautomation/import-python-2-packages-from-pypi-into-azure-automation-account) from the Azure Automation GitHub organization into your Automation account. Make sure the Run Settings are set to **Azure** and start the runbook with the parameters. Ensure that Managed identity is enabled for your Automation account and has Automation Contributor access for successful import of package. For each parameter make sure you start it with the switch as seen in the following list and image:
5050

5151
* -s \<subscriptionId\>
5252
* -g \<resourceGroup\>
@@ -55,41 +55,32 @@ Once the packages are downloaded, you can import them into your automation accou
5555

5656
:::image type="content" source="media/python-packages/import-python-runbook.png" alt-text="Screenshot shows the Overview page for import_py2package_from_pypi with the Start Runbook pane on the right side.":::
5757

58-
The runbook allows you to specify what package to download. For example, use of the `Azure` parameter downloads all Azure modules and all dependencies (about 105).
59-
60-
After the runbook is complete, you can check the **Python packages** under **Shared Resources** in your Automation account to verify that the package has been imported correctly.
58+
The runbook allows you to specify what package to download. For example, use of the `Azure` parameter downloads all Azure modules and all dependencies (about 105). After the runbook is complete, you can check the **Python packages** under **Shared Resources** in your Automation account to verify that the package has been imported correctly.
6159

6260
## Use a package in a runbook
6361

64-
With a package imported, you can use it in a runbook. The following example uses the [Azure Automation utility package](https://github.com/azureautomation/azure_automation_utility). This package makes it easier to use Python with Azure Automation. To use the package, follow the instructions in the GitHub repository and add it to the runbook. For example, you can use `from azure_automation_utility import get_automation_runas_credential` to import the function for retrieving the Run As account.
62+
With a package imported, you can use it in a runbook. Add the following code to list all the resource groups in an Azure subscription:
6563

6664
```python
67-
import azure.mgmt.resource
68-
import automationassets
69-
from azure_automation_utility import get_automation_runas_credential
70-
71-
# Authenticate to Azure using the Azure Automation RunAs service principal
72-
runas_connection = automationassets.get_automation_connection("AzureRunAsConnection")
73-
azure_credential = get_automation_runas_credential()
74-
75-
# Intialize the resource management client with the RunAs credential and subscription
76-
resource_client = azure.mgmt.resource.ResourceManagementClient(
77-
azure_credential,
78-
str(runas_connection["SubscriptionId"]))
79-
80-
# Get list of resource groups and print them out
81-
groups = resource_client.resource_groups.list()
82-
for group in groups:
83-
print group.name
65+
#!/usr/bin/env python
66+
import os
67+
import requests
68+
# printing environment variables
69+
endPoint = os.getenv('IDENTITY_ENDPOINT') + "?resource=https://management.azure.com/"
70+
identityHeader = os.getenv('IDENTITY_HEADER')
71+
payload = {}
72+
headers = {
73+
'X-IDENTITY-HEADER': identityHeader,
74+
'Metadata': 'True'
75+
}
76+
response = requests.request("GET", endPoint, headers=headers, data=payload)
77+
print response.text
8478
```
8579

86-
> [!NOTE]
87-
> The Python `automationassets` package is not available on pypi.org, so it's not available for import onto a Windows machine.
88-
8980
## Develop and test runbooks offline
9081

9182
To develop and test your Python 2 runbooks offline, you can use the [Azure Automation Python emulated assets](https://github.com/azureautomation/python_emulated_assets) module on GitHub. This module allows you to reference your shared resources such as credentials, variables, connections, and certificates.
9283

9384
## Next steps
9485

95-
To prepare a Python runbook, see [Create a Python runbook](./learn/automation-tutorial-runbook-textual-python-3.md).
86+
To prepare a Python runbook, see [Create a Python runbook](./learn/automation-tutorial-runbook-textual-python-3.md).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Working with Farm Activities data in Azure Data Manager for Agriculture
3+
description: Learn how to integrate with Farm Activities data providers and ingest data into ADMA
4+
author: lbpudi
5+
ms.author: lbethapudi
6+
ms.service: data-manager-for-agri
7+
ms.topic: conceptual
8+
ms.date: 08/14/2023
9+
ms.custom: template-concept
10+
---
11+
# Working with Farm Activities data in Azure Data Manager for Agriculture
12+
Farm Activities data is one of the most important ground truth datasets in precision agriculture. It's these machine-generated reports that preserve the record of what exactly happened where and when that is used to both improve in-field practice and the downstream values chain analytics cases
13+
14+
The Data Manager for Agriculture supports both
15+
* summary data - entered as properties in the operation data item directly
16+
* precision data - (for example, a .shp, .dat, .isoxml) uploaded as an attachment file and reference linked to the operation data item.
17+
18+
New operation data can be pushed into the service via the APIs for operation and attachment creation. Or, if the desired source is in the supported list of OEM connectors, data can be synced automatically from providers like Climate FieldView with a farm operation ingestion job.
19+
[!INCLUDE [public-preview-notice.md](includes/public-preview-notice.md)]
20+
* Azure Data Manager for Agriculture supports a range of Farm Activities data that can be found [here](/rest/api/data-manager-for-agri/#farm-activities)
21+
22+
## Integration with farm equipment manufacturers
23+
Azure Data Manager for Agriculture fetches the associated Farm Activities data (planting, application, tillage & harvest) from the data provider (Ex: Climate FieldView) by creating a Farm Activities data ingestion job. Look [here](./how-to-ingest-and-egress-farm-operations-data.md) for more details.
24+
25+
## Next steps
26+
27+
* Test our APIs [here](/rest/api/data-manager-for-agri).

articles/data-manager-for-agri/concepts-hierarchy-model.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ms.custom: template-concept
1515

1616
To generate actionable insights data related to growers, farms, and fields should be organized in a well defined manner. Firms operating in the agriculture industry often perform longitudinal studies and need high quality data to generate insights. Data Manager for Agriculture organizes agronomic data in the below manner.
1717

18-
:::image type="content" source="./media/data-model.png" alt-text="Screenshot showing farm hierarchy model.":::
18+
:::image type="content" source="./media/data-model-v-2.png" alt-text="Screenshot showing farm hierarchy model.":::
19+
:::image type="content" source="./media/management-zones.png" alt-text="Screenshot showing management zones.":::
1920

2021
## Understanding farm hierarchy
2122

@@ -28,25 +29,19 @@ To generate actionable insights data related to growers, farms, and fields shoul
2829
* Farms don't have any geometry associated with them. Farm entity helps you organize your growing operations. For example Contoso Inc is the Party that has farms in Oregon and Idaho.
2930

3031
### Field
31-
* Fields denote a stable boundary that is in general agnostic to seasons and other temporal constructs. For example, field could be the boundary denoted in government records.
32+
* Fields denote a stable geometry that is in general agnostic to seasons and other temporal constructs. For example, field could be the geometry denoted in government records.
3233
* Fields are multi-polygon. For example, a road might divide the farm in two or more parts.
33-
* Fields are multi-boundary.
3434

3535
### Seasonal field
3636
* This is the most important construct in the farming world. A seasonal fields definition includes the following things
37-
* Boundary
37+
* geometry
3838
* Season
3939
* Crop
4040
* A seasonal field is associated with a field or a farm
4141
* In Data Manager for Agriculture, seasonal fields are mono crop entities. In cases where farmers are cultivating different crops simultaneously, they have to create one seasonal field per crop.
4242
* A seasonal field is associated with one season. If a farmer cultivates across multiple seasons, they have to create one seasonal field per season.
4343
* It's multi-polygon. Same crop can be planted in different areas within the farm.
4444

45-
46-
### Boundary
47-
* Boundary represents the geometry of a field or a seasonal field.
48-
* It's represented as a multi-polygon GeoJSON consisting of vertices (lat/long).
49-
5045
### Season
5146
* Season represents the temporal aspect of farming. It is a function of local agronomic practices, procedures and weather.
5247

articles/data-manager-for-agri/concepts-ingest-satellite-imagery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Satellite imagery makes up a foundational pillar of agriculture data. To support
1717
* Read the Sinergise Sentinel Hub terms of service and privacy policy: https://www.sentinel-hub.com/tos/
1818
* Have your providerClientId and providerClientSecret ready
1919

20-
## Ingesting boundary-clipped imagery
20+
## Ingesting geometry-clipped imagery
2121
Using satellite data in Data Manager for Agriculture involves following steps:
2222

2323
:::image type="content" source="./media/satellite-flow.png" alt-text="Diagram showing satellite data ingestion flow.":::

articles/data-manager-for-agri/concepts-ingest-sensor-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In addition to the above approach, IOT devices (sensors/nodes/gateway) can direc
3838

3939
## Sensor topology
4040

41-
The following diagram depicts the topology of a sensor in Azure Data Manager for Agriculture. Each boundary under a party has a set of devices placed within it. A device can be either be a node or a gateway and each device has a set of sensors associated with it. Sensors send the recordings via gateway to the cloud. Sensors are tagged with GPS coordinates helping in creating a geospatial time series for all measured data.
41+
The following diagram depicts the topology of a sensor in Azure Data Manager for Agriculture. Each geometry under a party has a set of devices placed within it. A device can be either be a node or a gateway and each device has a set of sensors associated with it. Sensors send the recordings via gateway to the cloud. Sensors are tagged with GPS coordinates helping in creating a geospatial time series for all measured data.
4242

4343
:::image type="content" source="./media/sensor-topology-new.png" alt-text="Screenshot showing sensor topology.":::
4444

articles/data-manager-for-agri/concepts-isv-solutions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The solution framework is built on top of Data Manager for Agriculture that prov
3333

3434
Following are some of the examples of use cases on how an ISV partner could use the solution framework to build an industry specific solution.
3535

36-
* Yield Prediction Model: An ISV partner can build a yield model using historical data for a specific boundary and track periodic progress. The ISV can then enable forecast of estimated yield for the upcoming season.
36+
* Yield Prediction Model: An ISV partner can build a yield model using historical data for a specific geometry and track periodic progress. The ISV can then enable forecast of estimated yield for the upcoming season.
3737
* Carbon Emission Model: An ISV partner can estimate the amount of carbon emitted from the field based upon the imagery, sensors data for a particular farm.
3838
* Crop Identification: Use imagery data to identify crop growing in an area of interest.
3939

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Working with Farm Activities and in-field activity data in Azure Data Manager for Agriculture
3+
description: Learn how to manage Farm Activities data with manual and auto sync data ingestion jobs
4+
author: lbpudi
5+
ms.author: lbethapudi
6+
ms.service: data-manager-for-agri
7+
ms.topic: how-to
8+
ms.date: 08/14/2023
9+
ms.custom: template-how-to
10+
---
11+
# Working with Farm Activities and activity data in Azure Data Manager for Agriculture
12+
13+
Users can create a farm operation data ingestion job to **pull associated Farm Activities activity data** from a specified data provider into your Azure Data Manager for Agriculture instance, associated with a specific party. The job handles any required auth refresh, and by default detects and syncs any changes daily. In some cases, the job will also **pull farm and field** information associated with the given account into the party.
14+
15+
> [!NOTE]
16+
>
17+
>Before creating Farm Activities job, it is mandatory to successfully [**integrate with Farm Activities data provider oAuth flow**](./how-to-integrate-with-farm-ops-data-provider.md)
18+
>
19+
20+
## Create FarmOperations Job
21+
22+
Create a farm-operations job to ingest Farm Activity data with an ID of your choice. This job ID is used to monitor the status of the job using GET Farm Operations job.
23+
24+
API documentation:[FarmOperations_CreateDataIngestionJob](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/farm-operations/create-data-ingestion-job)
25+
26+
> [!NOTE]
27+
>`shapeType` and `shapeResolution` are provider specific attributes. If they aren't applicable to your provider, set the value to "None".
28+
29+
Based on the `startYear` and `operations` list provided, Azure Data Manager for Agriculture fetches the data from the start year to the current date.
30+
31+
Along with specific data (geometry), Farm Activities data provider also gives us the DAT file for the activity performed on your farm or field. The DAT file, Shape File etc. contain a geometry that reflects where the activity was performed.
32+
33+
Job status and details can be retrieved with: [FarmOperations_GetDataIngestionJobDetails](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/farm-operations/get-data-ingestion-job-details)
34+
35+
36+
## Finding and retrieving Farm Activities data
37+
38+
Now that the data is ingested into Azure Data Manager for Agriculture, it can be queried or listed with the following methods:
39+
40+
### Method 1: List data by type
41+
42+
Retrieved data is sorted by type under the party. These can be listed, with standard filters applied
43+
44+
[PlantingData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/planting-data/search)
45+
46+
[HarvestData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/harvest-data/search)
47+
48+
[ApplicationData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/application-data/search)
49+
50+
Individual data items may be retrieved to view the properties and metadata, including the `sourceActivityId`, `providerFieldId` and `Geometry`.
51+
52+
53+
[PlantingData_Get](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/planting-data/get)
54+
55+
[HarvestData_Get](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/harvest-data/get)
56+
57+
[ApplicationData_Get](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/application-data/get)
58+
59+
60+
### Method 2: search Farm Activities data using geometry intersect
61+
To account for the high degree of change found in field definitions, Azure Data Manager for Agriculture supports a search by intersect feature that allows you to organize data by space and time, without needing to first know the farm/field hierarchy or association.
62+
63+
64+
65+
[PlantingData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/planting-data/search)
66+
67+
68+
[HarvestData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/harvest-data/search)
69+
70+
[ApplicationData_Search](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/application-data/search)
71+
72+
You can also use the ID like `plantingId` to fetch the above data in the same API. if you remove the ID, you're able to see any other data that intersects with the same geometry across party. So it shows data for the same geometry across different parties.
73+
74+
## List and Download Attachments
75+
76+
The message attribute in the response of `FarmOperations_GetDataIngestionJobDetails` API shows how much data was processed and how many attachments were created. To check the attachments associated to the partyId, go to attachment API. The response gives you all the attachments created under the partyId.
77+
78+
API documentation: [Attachments](/rest/api/data-manager-for-agri/dataplane-version2023-07-01-preview/attachments)
79+
80+
## Next steps
81+
82+
* Understand our APIs [here](/rest/api/data-manager-for-agri).

0 commit comments

Comments
 (0)