Skip to content

Commit e1508d2

Browse files
committed
Reconstruction of PowerShell template article
1 parent 8aca00e commit e1508d2

File tree

2 files changed

+21
-30
lines changed

2 files changed

+21
-30
lines changed

articles/iot-hub/iot-hub-rm-template.md

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ You can use Azure Resource Manager to create and manage Azure IoT hubs programma
2626
To complete this tutorial, you need the following:
2727

2828
* Visual Studio
29-
* An [Azure Storage account][lnk-storage-account] where you can store your Azure Resource Manager template files
30-
* [Azure PowerShell module][lnk-powershell-install]
29+
* An [Azure Storage account][lnk-storage-account] for your Azure Resource Manager template files
30+
* [Azure PowerShell module][lnk-powershell-install] or [Azure Cloud Shell](/azure/cloud-shell/overview)
3131

3232
[!INCLUDE [iot-hub-prepare-resource-manager](../../includes/iot-hub-prepare-resource-manager.md)]
3333

3434
## Prepare your Visual Studio project
3535

36-
1. In Visual Studio, create a Visual C# Windows Classic Desktop project using the **Console App (.NET Framework)** project template. Name the project **CreateIoTHub**.
36+
1. In Visual Studio, create a C# Windows Desktop project using the **Console App (.NET Framework)** project template. Name the project **CreateIoTHub**.
3737

3838
2. In Solution Explorer, right-click on your project and then click **Manage NuGet Packages**.
3939

@@ -71,41 +71,32 @@ To complete this tutorial, you need the following:
7171

7272
Use a JSON template and parameter file to create an IoT hub in your resource group. You can also use an Azure Resource Manager template to make changes to an existing IoT hub.
7373

74-
1. In Solution Explorer, right-click on your project, click **Add**, and then click **New Item**. Add a JSON file called **template.json** to your project.
74+
1. In Solution Explorer, right-click on your project, click **Add**, and then click **New Item**. Add a text file to your project and rename it **template.json**.
7575

76-
2. To add a standard IoT hub to the **East US** region, replace the contents of **template.json** with the following resource definition. For the current list of regions that support IoT Hub see [Azure Status][lnk-status]:
76+
2. To add a standard IoT hub to the **East US** region, replace the contents of **template.json** with the following resource definition. For the current list of regions that support IoT Hub see [Azure Status][lnk-status]. Replace the `<myHubName>` value with a unique name for your new IoT hub.
7777

7878
```json
7979
{
80-
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
80+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
8181
"contentVersion": "1.0.0.0",
8282
"parameters": {
8383
"hubName": {
8484
"type": "string"
8585
}
8686
},
8787
"resources": [
88-
{
89-
"apiVersion": "2016-02-03",
90-
"type": "Microsoft.Devices/IotHubs",
91-
"name": "[parameters('hubName')]",
92-
"location": "East US",
93-
"sku": {
94-
"name": "S1",
95-
"tier": "Standard",
96-
"capacity": 1
97-
},
98-
"properties": {
99-
"location": "East US"
100-
}
101-
}
102-
],
103-
"outputs": {
104-
"hubKeys": {
105-
"value": "[listKeys(resourceId('Microsoft.Devices/IotHubs', parameters('hubName')), '2016-02-03')]",
106-
"type": "object"
107-
}
108-
}
88+
{
89+
"type": "Microsoft.Devices/IotHubs",
90+
"apiVersion": "2022-04-30-preview",
91+
"name": "[parameters('<myHubName>')]",
92+
"location": "eastus",
93+
"sku": {
94+
"name": "S1",
95+
"tier": "Standard",
96+
"capacity": 1
97+
},
98+
}
99+
]
109100
}
110101
```
111102

includes/iot-hub-prepare-resource-manager.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install the [Azure PowerShell cmdlets][lnk-powershell-install] before you contin
1212

1313
The following steps show how to set up password authentication for an AD application using PowerShell. You can run these commands in a standard PowerShell session.
1414

15-
1. Sign in to your Azure subscription using the following command:
15+
1. Sign in to your Azure subscription using the following command. If you're using PowerShell in Azure Cloud Shell you're already signed in, so you can skip this step.
1616

1717
```powershell
1818
Connect-AzAccount
@@ -26,10 +26,10 @@ The following steps show how to set up password authentication for an AD applica
2626
Get-AzSubscription
2727
```
2828

29-
Select the subscription you want to use. You can use either the subscription name or ID from the output of the previous command.
29+
Select the subscription you want to use. You can use either the `Name` or `Id` from the output of the previous command.
3030

3131
```powershell
32-
Select-AzSubscription -SubscriptionName "{your subscription name}"
32+
Select-AzSubscription -SubscriptionName "{your subscription Name or Id}"
3333
```
3434

3535
1. Save your **Id** and **TenantId** for later.

0 commit comments

Comments
 (0)