Skip to content

Commit fb53a27

Browse files
committed
cleanup
1 parent 411bff2 commit fb53a27

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

articles/iot-dps/how-to-use-custom-allocation-policies.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ You perform the following steps in this article:
3838

3939
## Prerequisites
4040

41-
* Completion of the [Set up IoT Hub Device Provisioning Service with the Azure portal](./quick-setup-auto-provision.md) quickstart.
4241
* [Visual Studio](https://visualstudio.microsoft.com/vs/) 2015 or later with the ['Desktop development with C++'](https://www.visualstudio.com/vs/support/selecting-workloads-visual-studio-2017/) workload enabled.
4342
* Latest version of [Git](https://git-scm.com/download/) installed.
4443

@@ -92,15 +91,15 @@ In this section, you use the Azure Cloud Shell to create a provisioning service
9291
9392
## Create the custom allocation function
9493
95-
In this section, you create an Azure function that implements your custom allocation policy. This function decides which IoT hub a device should be registered to based on whether its registration ID contains the string `-toasters-` or `-heatpumps-`. It also sets the initial state of the device twin based on whether the device is a toaster or a heat pump.
94+
In this section, you create an Azure function that implements your custom allocation policy. This function decides which divisional IoT hub a device should be registered to based on whether its registration ID contains the string **-contoso-tstrsd-007** or **-contoso-hpsd-088**. It also sets the initial state of the device twin based on whether the device is a toaster or a heat pump.
9695
9796
1. Sign in to the [Azure portal](https://portal.azure.com). From your home page, select **+ Create a resource**.
9897
9998
2. In the *Search the Marketplace* search box, type "Function App". From the drop-down list select **Function App**, and then select **Create**.
10099
101100
3. On **Function App** create page, under the **Basics** tab, enter the following settings for your new function app and click **Review + create**:
102101
103-
**Resource Group**: Select **Use existing** and select the **contoso-us-resource-group** to keep all resources created in this article together.
102+
**Resource Group**: Select the **contoso-us-resource-group** to keep all resources created in this article together.
104103
105104
**Function App name**: Enter a unique function app name. This example uses **contoso-function-app-1098**.
106105
@@ -111,23 +110,23 @@ In this section, you create an Azure function that implements your custom alloca
111110
**Region**: Select the same region as your resource group. This example uses **West US**.
112111
113112
> [!NOTE]
114-
> By default, **Application Insights** is enabled. If you want to, you can disable it by selecting the **Monitoring** tab and selecting **No** for **Enable Application Insights**.
113+
> By default, **Application Insights** is enabled. Application Insights is not necessary for this article, but it might help you understand If you want to, you can disable it by selecting the **Monitoring** tab and selecting **No** for **Enable Application Insights**.
115114
116115
![Create an Azure Function App to host the custom allocation function](./media/how-to-use-custom-allocation-policies/create-function-app.png)
117116
118117
4. On the **Summary** page, select **Create** to create the function app. Deployment may take several minutes. When it completes, select **Go to resource**.
119118
120-
5. On the left-hand pane of the **Overview** page, select **+** next to **Functions** to add a new function.
119+
5. On the left pane of the function app **Overview** page, select **+** next to **Functions** to add a new function.
121120
122121
![Add a function to the Function App](./media/how-to-use-custom-allocation-policies/create-function.png)
123122
124-
6. On **Azure Functions for .NET - getting started**, for the **CHOOSE A DEPLOYMENT ENVIRONMENT** step, select the **In-portal** tile, then select **Continue**.
123+
6. On the **Azure Functions for .NET - getting started** page, for the **CHOOSE A DEPLOYMENT ENVIRONMENT** step, select the **In-portal** tile, then select **Continue**.
125124
126125
![Select the portal development environment](./media/how-to-use-custom-allocation-policies/function-choose-environment.png)
127126
128127
7. On the next page, for the **CREATE A FUNCTION** step, select the **Webhook + API** tile, then select **Create**. A function named **HttpTrigger1** is created, and the portal displays the contents of the **run.csx** code file.
129128
130-
8. Reference required Nuget packages. To create the initial device twin, the custom allocation function uses classes that are defined in two Nuget packages that must be loaded into the hosting environment. With Azure Functions, Nuget packages are referenced using a function.host file. In this step, you save and upload a function.host file.
129+
8. Reference required Nuget packages. To create the initial device twin, the custom allocation function uses classes that are defined in two Nuget packages that must be loaded into the hosting environment. With Azure Functions, Nuget packages are referenced using a *function.host* file. In this step, you save and upload a *function.host* file.
131130
132131
1. Copy the following lines into your favorite editor and save the file on your computer as *function.host*.
133132
@@ -147,11 +146,11 @@ In this section, you create an Azure function that implements your custom alloca
147146
148147
![Open view files](./media/how-to-use-custom-allocation-policies/function-open-view-files.png)
149148
150-
3. Select **Upload** and browse to the **function.proj** file you saved previously and select **Open** to upload the file.
149+
3. Select **Upload**, browse to the **function.proj** file, and select **Open** to upload the file.
151150
152151
![Select upload file](./media/how-to-use-custom-allocation-policies/function-choose-upload-file.png)
153152
154-
9. Replace the code for the **HttpTrigger1** function with the following code and click **Save**:
153+
9. Replace the code for the **HttpTrigger1** function with the following code and select **Save**:
155154
156155
```csharp
157156
#r "Newtonsoft.Json"
@@ -294,7 +293,7 @@ In this section, you create an Azure function that implements your custom alloca
294293
295294
In this section, you'll create a new enrollment group that uses the custom allocation policy. For simplicity, this article uses [Symmetric key attestation](concepts-symmetric-key-attestation.md) with the enrollment. For a more secure solution, consider using [X.509 certificate attestation](concepts-security.md#x509-certificates) with a chain of trust.
296295
297-
1. Still on the [Azure portal](https://portal.azure.com), open your Device Provisioning Service instance.
296+
1. Still on the [Azure portal](https://portal.azure.com), open your provisioning service.
298297
299298
2. Select **Manage enrollments** on the left pane, and then click the **Add enrollment group** button at the top of the page.
300299
@@ -504,7 +503,7 @@ This sample code simulates a device boot sequence that sends the provisioning re
504503
The following output is an example of the simulated toaster device successfully booting up and connecting to the provisioning service instance to be assigned to the toasters IoT hub by the custom allocation policy:
505504
506505
```cmd
507-
Provisioning API Version: 1.2.9
506+
Provisioning API Version: 1.3.6
508507
509508
Registering Device
510509
@@ -533,7 +532,7 @@ This sample code simulates a device boot sequence that sends the provisioning re
533532
The following output is an example of the simulated heat pump device successfully booting up and connecting to the provisioning service instance to be assigned to the Contoso heat pumps IoT hub by the custom allocation policy:
534533
535534
```cmd
536-
Provisioning API Version: 1.2.9
535+
Provisioning API Version: 1.3.6
537536
538537
Registering Device
539538

0 commit comments

Comments
 (0)