Skip to content

Commit 2a099b6

Browse files
committed
Minor corrections
1 parent af4a551 commit 2a099b6

File tree

3 files changed

+108
-106
lines changed

3 files changed

+108
-106
lines changed

articles/azure-sql-edge/deploy-azure-resources.md

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ In this three-part tutorial, you'll create a machine learning model to predict i
2121
3. Install [Python 3.6.8](https://www.python.org/downloads/release/python-368/).
2222
* Use the Windows x86-x64 executable installer
2323
* Add `python.exe` to the PATH environment variable
24-
4. Install [Microsoft Visual C++ 14.0 and build tools for Visual Studio](https://visualstudio.microsoft.com/downloads/) - You can find the download under "Tools For Visual Studio 2019".
24+
4. Install [Microsoft Visual C++ 14.0 and build tools for Visual Studio](https://visualstudio.microsoft.com/downloads/). You can find the download under "Tools For Visual Studio 2019".
2525
5. Install [Microsoft ODBC Driver 17 for SQL Server](https://www.microsoft.com/download/details.aspx?id=56567).
2626
6. Install [Azure Data Studio](/sql/azure-data-studio/download-azure-data-studio/)
2727
7. Open Azure Data Studio and configure Python for notebooks. For details, see [Configure Python for Notebooks](/sql/azure-data-studio/sql-notebooks#configure-python-for-notebooks).This step can take several minutes.
2828
8. Install the latest version of [Azure CLI](https://github.com/Azure/azure-powershell/releases/tag/v3.5.0-February2020).
2929

3030
## Deploy Azure resources using PowerShell Script
3131

32-
Deploy the Azure resources required by this Azure SQL Edge tutorial. These can be deployed either by using a PowerShell script below or through the Azure portal. This tutorial uses a PowerShell script.
32+
Deploy the Azure resources required by this Azure SQL Edge tutorial. These can be deployed either by using a PowerShell script or through the Azure portal. This tutorial uses a PowerShell script.
3333

3434
1. Import the modules needed to run the PowerShell script in this tutorial.
3535

@@ -148,127 +148,127 @@ Deploy the Azure resources required by this Azure SQL Edge tutorial. These can b
148148

149149
10. Push the ARM/AMD docker images to the container registry.
150150

151-
```powershell
152-
$containerRegistryCredentials = Get-AzContainerRegistryCredential -ResourceGroupName $ResourceGroup -Name $containerRegistryName
153-
154-
$amddockerimageFile = Read-Host "Please Enter the location to the amd docker tar file:"
155-
$armdockerimageFile = Read-Host "Please Enter the location to the arm docker tar file:"
156-
$amddockertag = $containerRegistry.LoginServer + "/silicaprediction" + ":amd64"
157-
$armdockertag = $containerRegistry.LoginServer + "/silicaprediction" + ":arm64"
158-
159-
docker login $containerRegistry.LoginServer --username $containerRegistryCredentials.Username --password $containerRegistryCredentials.Password
160-
161-
docker import $amddockerimageFile $amddockertag
162-
docker push $amddockertag
163-
164-
docker import $armdockerimageFile $armdockertag
165-
docker push $armdockertag
166-
```
151+
```powershell
152+
$containerRegistryCredentials = Get-AzContainerRegistryCredential -ResourceGroupName $ResourceGroup -Name $containerRegistryName
153+
154+
$amddockerimageFile = Read-Host "Please Enter the location to the amd docker tar file:"
155+
$armdockerimageFile = Read-Host "Please Enter the location to the arm docker tar file:"
156+
$amddockertag = $containerRegistry.LoginServer + "/silicaprediction" + ":amd64"
157+
$armdockertag = $containerRegistry.LoginServer + "/silicaprediction" + ":arm64"
158+
159+
docker login $containerRegistry.LoginServer --username $containerRegistryCredentials.Username --password $containerRegistryCredentials.Password
160+
161+
docker import $amddockerimageFile $amddockertag
162+
docker push $amddockertag
163+
164+
docker import $armdockerimageFile $armdockertag
165+
docker push $armdockertag
166+
```
167167
168168
11. Create the network security group within the resource group.
169169
170-
```powershell
171-
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName $ResourceGroup -Name $NetworkSecGroup
172-
if($nsg -eq $null)
173-
{
174-
Write-Output("Network Security Group $NetworkSecGroup does not exist in the resource group $ResourceGroup")
175-
176-
$rule1 = New-AzNetworkSecurityRuleConfig -Name "SSH" -Description "Allow SSH" -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 22
177-
$rule2 = New-AzNetworkSecurityRuleConfig -Name "SQL" -Description "Allow SQL" -Access Allow -Protocol Tcp -Direction Inbound -Priority 101 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 1600
178-
New-AzNetworkSecurityGroup -Name $NetworkSecGroup -ResourceGroupName $ResourceGroup -Location $location -SecurityRules $rule1, $rule2
179-
180-
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName $ResourceGroup -Name $NetworkSecGroup
181-
}
182-
else
183-
{
184-
Write-Output ("Network Security Group $NetworkSecGroup exists in the resource group $ResourceGroup")
185-
}
186-
```
170+
```powershell
171+
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName $ResourceGroup -Name $NetworkSecGroup
172+
if($nsg -eq $null)
173+
{
174+
Write-Output("Network Security Group $NetworkSecGroup does not exist in the resource group $ResourceGroup")
175+
176+
$rule1 = New-AzNetworkSecurityRuleConfig -Name "SSH" -Description "Allow SSH" -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 22
177+
$rule2 = New-AzNetworkSecurityRuleConfig -Name "SQL" -Description "Allow SQL" -Access Allow -Protocol Tcp -Direction Inbound -Priority 101 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 1600
178+
New-AzNetworkSecurityGroup -Name $NetworkSecGroup -ResourceGroupName $ResourceGroup -Location $location -SecurityRules $rule1, $rule2
179+
180+
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName $ResourceGroup -Name $NetworkSecGroup
181+
}
182+
else
183+
{
184+
Write-Output ("Network Security Group $NetworkSecGroup exists in the resource group $ResourceGroup")
185+
}
186+
```
187187
188188
12. Create an Azure virtual machine enabled with SQL Edge. This VM will act as an Edge device.
189189
190-
```powershell
191-
$AzVM = Get-AzVM -ResourceGroupName $ResourceGroup -Name $EdgeDeviceId
192-
If($AzVM -eq $null)
193-
{
194-
Write-Output("The Azure VM with Name- $EdgeVMName is not present in the Resource Group- $ResourceGroup ")
195-
196-
$SingleSubnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix
197-
$Vnet = New-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroup -Location $location -AddressPrefix $VnetAddressPrefix -Subnet $SingleSubnet
198-
$publicIp = New-AzPublicIpAddress -Name $publicIpName -ResourceGroupName $ResourceGroup -AllocationMethod Static -Location $location
199-
$NIC = New-AzNetworkInterface -Name $NICName -ResourceGroupName $ResourceGroup -Location $location -SubnetId $Vnet.Subnets[0].Id -NetworkSecurityGroupId $nsg.Id -PublicIpAddressId $publicIp.Id
200-
201-
##Set-AzNetworkInterfaceIpConfig -Name "ipconfig1" -NetworkInterface $NIC -PublicIpAddress $publicIp
202-
203-
$Credential = New-Object System.Management.Automation.PSCredential ($AdminAcc, $AdminPassword);
204-
205-
$VirtualMachine = New-AzVMConfig -VMName $EdgeDeviceId -VMSize $VMSize
206-
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Linux -ComputerName $EdgeDeviceId -Credential $Credential
207-
$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $NIC.Id
208-
$VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName $imagePublisher -Offer $imageOffer -Skus $imageSku -Version latest
209-
$VirtualMachine = Set-AzVMPlan -VM $VirtualMachine -Name $imageSku -Publisher $imagePublisher -Product $imageOffer
210-
211-
$AzVM = New-AzVM -ResourceGroupName $ResourceGroup -Location $location -VM $VirtualMachine -Verbose
212-
$AzVM = Get-AzVM -ResourceGroupName $ResourceGroup -Name $EdgeDeviceId
190+
```powershell
191+
$AzVM = Get-AzVM -ResourceGroupName $ResourceGroup -Name $EdgeDeviceId
192+
If($AzVM -eq $null)
193+
{
194+
Write-Output("The Azure VM with Name- $EdgeVMName is not present in the Resource Group- $ResourceGroup ")
195+
196+
$SingleSubnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix
197+
$Vnet = New-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroup -Location $location -AddressPrefix $VnetAddressPrefix -Subnet $SingleSubnet
198+
$publicIp = New-AzPublicIpAddress -Name $publicIpName -ResourceGroupName $ResourceGroup -AllocationMethod Static -Location $location
199+
$NIC = New-AzNetworkInterface -Name $NICName -ResourceGroupName $ResourceGroup -Location $location -SubnetId $Vnet.Subnets[0].Id -NetworkSecurityGroupId $nsg.Id -PublicIpAddressId $publicIp.Id
200+
201+
##Set-AzNetworkInterfaceIpConfig -Name "ipconfig1" -NetworkInterface $NIC -PublicIpAddress $publicIp
202+
203+
$Credential = New-Object System.Management.Automation.PSCredential ($AdminAcc, $AdminPassword);
204+
205+
$VirtualMachine = New-AzVMConfig -VMName $EdgeDeviceId -VMSize $VMSize
206+
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Linux -ComputerName $EdgeDeviceId -Credential $Credential
207+
$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $NIC.Id
208+
$VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName $imagePublisher -Offer $imageOffer -Skus $imageSku -Version latest
209+
$VirtualMachine = Set-AzVMPlan -VM $VirtualMachine -Name $imageSku -Publisher $imagePublisher -Product $imageOffer
210+
211+
$AzVM = New-AzVM -ResourceGroupName $ResourceGroup -Location $location -VM $VirtualMachine -Verbose
212+
$AzVM = Get-AzVM -ResourceGroupName $ResourceGroup -Name $EdgeDeviceId
213213
214-
}
215-
else
216-
{
217-
Write-Output ("The Azure VM with Name- $EdgeDeviceId is present in the Resource Group- $ResourceGroup ")
218-
}
219-
```
214+
}
215+
else
216+
{
217+
Write-Output ("The Azure VM with Name- $EdgeDeviceId is present in the Resource Group- $ResourceGroup ")
218+
}
219+
```
220220
221221
13. Create an IoT hub within the resource group.
222222
223-
```powershell
224-
$iotHub = Get-AzIotHub -ResourceGroupName $ResourceGroup -Name $IoTHubName
225-
If($iotHub -eq $null)
226-
{
227-
Write-Output("IoTHub $IoTHubName does not exists, creating The IoTHub in the resource group $ResourceGroup")
228-
New-AzIotHub -ResourceGroupName $ResourceGroup -Name $IoTHubName -SkuName $IoTHubSkuName -Units $IoTHubUnits -Location $location -Verbose
229-
}
230-
else
231-
{
232-
Write-Output ("IoTHub $IoTHubName present in the resource group $ResourceGroup")
233-
}
234-
```
223+
```powershell
224+
$iotHub = Get-AzIotHub -ResourceGroupName $ResourceGroup -Name $IoTHubName
225+
If($iotHub -eq $null)
226+
{
227+
Write-Output("IoTHub $IoTHubName does not exists, creating The IoTHub in the resource group $ResourceGroup")
228+
New-AzIotHub -ResourceGroupName $ResourceGroup -Name $IoTHubName -SkuName $IoTHubSkuName -Units $IoTHubUnits -Location $location -Verbose
229+
}
230+
else
231+
{
232+
Write-Output ("IoTHub $IoTHubName present in the resource group $ResourceGroup")
233+
}
234+
```
235235
236236
14. Add an Edge device to the IoT hub. This step only creates the device digital identity.
237237
238-
```powershell
239-
$deviceIdentity = Get-AzIotHubDevice -ResourceGroupName $ResourceGroup -IotHubName $IoTHubName -DeviceId $EdgeDeviceId
240-
If($deviceIdentity -eq $null)
241-
{
242-
Write-Output("The Edge Device with DeviceId- $EdgeDeviceId is not registered to the IoTHub- $IoTHubName ")
243-
Add-AzIotHubDevice -ResourceGroupName $ResourceGroup -IotHubName $IoTHubName -DeviceId $EdgeDeviceId -EdgeEnabled
244-
}
245-
else
246-
{
247-
Write-Output ("The Edge Device with DeviceId- $EdgeDeviceId is registered to the IoTHub- $IoTHubName")
248-
}
249-
$deviceIdentity = Get-AzIotHubDevice -ResourceGroupName $ResourceGroup -IotHubName $IoTHubName -DeviceId $EdgeDeviceId
250-
```
238+
```powershell
239+
$deviceIdentity = Get-AzIotHubDevice -ResourceGroupName $ResourceGroup -IotHubName $IoTHubName -DeviceId $EdgeDeviceId
240+
If($deviceIdentity -eq $null)
241+
{
242+
Write-Output("The Edge Device with DeviceId- $EdgeDeviceId is not registered to the IoTHub- $IoTHubName ")
243+
Add-AzIotHubDevice -ResourceGroupName $ResourceGroup -IotHubName $IoTHubName -DeviceId $EdgeDeviceId -EdgeEnabled
244+
}
245+
else
246+
{
247+
Write-Output ("The Edge Device with DeviceId- $EdgeDeviceId is registered to the IoTHub- $IoTHubName")
248+
}
249+
$deviceIdentity = Get-AzIotHubDevice -ResourceGroupName $ResourceGroup -IotHubName $IoTHubName -DeviceId $EdgeDeviceId
250+
```
251251
252252
15. Get the device primary connection string. This will be needed later for the VM. The following command uses Azure CLI for deployments.
253253
254-
```powershell
255-
$deviceConnectionString = az iot hub device-identity show-connection-string --device-id $EdgeDeviceId --hub-name $IoTHubName --resource-group $ResourceGroup --subscription $SubscriptionName
256-
$connString = $deviceConnectionString[1].Substring(23,$deviceConnectionString[1].Length-24)
257-
$connString
258-
```
254+
```powershell
255+
$deviceConnectionString = az iot hub device-identity show-connection-string --device-id $EdgeDeviceId --hub-name $IoTHubName --resource-group $ResourceGroup --subscription $SubscriptionName
256+
$connString = $deviceConnectionString[1].Substring(23,$deviceConnectionString[1].Length-24)
257+
$connString
258+
```
259259
260260
16. Update the connection string in the IoT Edge configuration file on the Edge device. The following commands use Azure CLI for deployments.
261261
262-
```powershell
263-
$script = "/etc/iotedge/configedge.sh '" + $connString + "'"
264-
az vm run-command invoke -g $ResourceGroup -n $EdgeDeviceId --command-id RunShellScript --script $script
265-
```
262+
```powershell
263+
$script = "/etc/iotedge/configedge.sh '" + $connString + "'"
264+
az vm run-command invoke -g $ResourceGroup -n $EdgeDeviceId --command-id RunShellScript --script $script
265+
```
266266
267267
17. Create an Azure Machine Learning workspace within the resource group.
268268
269-
```powershell
270-
az ml workspace create -w $MyWorkSpace -g $ResourceGroup
271-
```
269+
```powershell
270+
az ml workspace create -w $MyWorkSpace -g $ResourceGroup
271+
```
272272
273273
## Next Steps
274274

articles/azure-sql-edge/run-ml-model-on-sql-edge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.date: 05/19/2020
1313

1414
# Deploy ML model on Azure SQL Edge using ONNX
1515

16-
In part two of this three-part tutorial for predicting iron ore impurities in Azure SQL Edge, you'll:
16+
In part three of this three-part tutorial for predicting iron ore impurities in Azure SQL Edge, you'll:
1717

1818
1. Use Azure Data Studio to connect to SQL Database in the Azure SQL Edge instance.
1919
2. Predict iron ore impurities with ONNX in Azure SQL Edge.
@@ -173,7 +173,7 @@ Enter the following Python code in the Azure Data Studio notebook and run it.
173173
conn.close()
174174
```
175175

176-
1. Finally, use the Azure SQL Edge model to perform prediction using the trained model.
176+
1. Finally, use the Azure SQL Edge model to perform predictions using the trained model.
177177

178178
```python
179179
## Define the Connection string parameters. These connection strings will be used later also in the demo.

articles/azure-sql-edge/set-up-iot-edge-modules.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ In part two of this three-part tutorial for predicting iron ore impurities in Az
1818
- Azure SQL Edge
1919
- A data generator module
2020

21-
Before proceeding, create an Azure Stream Analytics module that will be used in the tutorial. To learn more about using streaming jobs with SQL Edge, see [Using streaming jobs with SQL Database Edge](https://docs.microsoft.com/azure/sql-database-edge/stream-analytics#using-streaming-jobs-with-sql-database-edge).
21+
## Create Azure Stream Analytics module
22+
23+
Create an Azure Stream Analytics module that will be used in this tutorial. To learn more about using streaming jobs with SQL Edge, see [Using streaming jobs with SQL Database Edge](https://docs.microsoft.com/azure/sql-database-edge/stream-analytics#using-streaming-jobs-with-sql-database-edge).
2224

2325
Once the Azure Stream Analytics job is created with the hosting environment set as Edge, set up the inputs and outputs for the tutorial.
2426

@@ -42,7 +44,7 @@ Once the Azure Stream Analytics job is created with the hosting environment set
4244

4345
3. Navigate to the **Query** section and set up the query as follows:
4446

45-
`SELECT * INTO `*name_of_your_output_stream*` FROM `*name_of_your_input_stream*
47+
`SELECT * INTO <name_of_your_output_stream> FROM <name_of_your_input_stream>`
4648

4749
4. Under **Configure**, select **Publish**, and then select the **Publish** button. Save the SAS URI for use with the SQL Database Edge module.
4850

@@ -100,7 +102,7 @@ Now, specify the container credentials in the IoT Edge module.
100102
BrokeredEndpoint("/modules/<your_azure_sql_edge_module>/inputs/<your_input_stream_name>")
101103
```
102104

103-
For example:
105+
For example:
104106

105107
```
106108
FROM /messages/modules/ASEDataGenerator/outputs/IronOreMeasures INTO BrokeredEndpoint("/modules/AzureSQLEdge/inputs/Input1")

0 commit comments

Comments
 (0)