Skip to content

Commit ab28ad3

Browse files
authored
Merge pull request #107926 from lanicolas/patch-16
Aligning with Bash style guide
2 parents 2a0fafa + 22d22df commit ab28ad3

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

articles/hdinsight/hdinsight-sales-insights-etl.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
7676
1. Set variable for resource group. Replace `RESOURCE_GROUP_NAME` with the name of an existing or new resource group, then enter the command:
7777

7878
```bash
79-
resourceGroup="RESOURCE_GROUP_NAME"
79+
RESOURCE_GROUP="RESOURCE_GROUP_NAME"
8080
```
8181

8282
1. Execute the script. Replace `LOCATION` with a desired value, then enter the command:
8383

8484
```bash
85-
./scripts/resources.sh $resourceGroup LOCATION
85+
./scripts/resources.sh $RESOURCE_GROUP LOCATION
8686
```
8787

8888
If you're not sure which region to specify, you can retrieve a list of supported regions for your subscription with the [az account list-locations](/cli/azure/account#az-account-list-locations) command.
@@ -107,39 +107,39 @@ The default password for SSH access to the clusters is `Thisisapassword1`. If yo
107107
1. To view the names of the clusters, enter the following command:
108108
109109
```bash
110-
sparkClusterName=$(cat resourcesoutputs_remainder.json | jq -r '.properties.outputs.sparkClusterName.value')
111-
llapClusterName=$(cat resourcesoutputs_remainder.json | jq -r '.properties.outputs.llapClusterName.value')
110+
SPARK_CLUSTER_NAME=$(cat resourcesoutputs_remainder.json | jq -r '.properties.outputs.sparkClusterName.value')
111+
LLAP_CLUSTER_NAME=$(cat resourcesoutputs_remainder.json | jq -r '.properties.outputs.llapClusterName.value')
112112
113-
echo "Spark Cluster" $sparkClusterName
114-
echo "LLAP cluster" $llapClusterName
113+
echo "Spark Cluster" $SPARK_CLUSTER_NAME
114+
echo "LLAP cluster" $LLAP_CLUSTER_NAME
115115
```
116116
117117
1. To view the Azure storage account and access key, enter the following command:
118118
119119
```azurecli
120-
blobStorageName=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.blobStorageName.value')
120+
BLOB_STORAGE_NAME=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.blobStorageName.value')
121121
122122
blobKey=$(az storage account keys list \
123-
--account-name $blobStorageName \
124-
--resource-group $resourceGroup \
123+
--account-name $BLOB_STORAGE_NAME \
124+
--resource-group $RESOURCE_GROUP \
125125
--query [0].value -o tsv)
126126
127-
echo $blobStorageName
128-
echo $blobKey
127+
echo $BLOB_STORAGE_NAME
128+
echo $BLOB_KEY
129129
```
130130
131131
1. To view the Data Lake Storage Gen2 account and access key, enter the following command:
132132
133133
```azurecli
134-
ADLSGen2StorageName=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.adlsGen2StorageName.value')
134+
ADLSGEN2STORAGENAME=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.adlsGen2StorageName.value')
135135
136-
adlsKey=$(az storage account keys list \
137-
--account-name $ADLSGen2StorageName \
138-
--resource-group $resourceGroup \
136+
ADLSKEY=$(az storage account keys list \
137+
--account-name $ADLSGEN2STORAGENAME \
138+
--resource-group $RESOURCE_GROUP \
139139
--query [0].value -o tsv)
140140
141-
echo $ADLSGen2StorageName
142-
echo $adlsKey
141+
echo $ADLSGEN2STORAGENAME
142+
echo $ADLSKEY
143143
```
144144
145145
### Create a data factory
@@ -154,10 +154,10 @@ This data factory will have one pipeline with two activities:
154154
To set up your Azure Data Factory pipeline, execute the command below. You should still be at the `hdinsight-sales-insights-etl` directory.
155155
156156
```bash
157-
blobStorageName=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.blobStorageName.value')
158-
ADLSGen2StorageName=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.adlsGen2StorageName.value')
157+
BLOB_STORAGE_NAME=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.blobStorageName.value')
158+
ADLSGEN2STORAGENAME=$(cat resourcesoutputs_storage.json | jq -r '.properties.outputs.adlsGen2StorageName.value')
159159
160-
./scripts/adf.sh $resourceGroup $ADLSGen2StorageName $blobStorageName
160+
./scripts/adf.sh $RESOURCE_GROUP $ADLSGEN2STORAGENAME $BLOB_STORAGE_NAME
161161
```
162162
163163
This script does the following things:
@@ -220,16 +220,16 @@ For other ways to transform data by using HDInsight, see [this article on using
220220
1. Copy the `query.hql` file to the LLAP cluster by using SCP. Enter the command:
221221

222222
```bash
223-
llapClusterName=$(cat resourcesoutputs_remainder.json | jq -r '.properties.outputs.llapClusterName.value')
224-
scp scripts/query.hql sshuser@$llapClusterName-ssh.azurehdinsight.net:/home/sshuser/
223+
LLAP_CLUSTER_NAME=$(cat resourcesoutputs_remainder.json | jq -r '.properties.outputs.llapClusterName.value')
224+
scp scripts/query.hql sshuser@$LLAP_CLUSTER_NAME-ssh.azurehdinsight.net:/home/sshuser/
225225
```
226226

227227
Reminder: The default password is `Thisisapassword1`.
228228

229229
1. Use SSH to access the LLAP cluster. Enter the command:
230230

231231
```bash
232-
ssh sshuser@$llapClusterName-ssh.azurehdinsight.net
232+
ssh sshuser@$LLAP_CLUSTER_NAME-ssh.azurehdinsight.net
233233
```
234234

235235
1. Use the following command to run the script:
@@ -270,14 +270,14 @@ If you're not going to continue to use this application, delete all resources by
270270
1. To remove the resource group, enter the command:
271271

272272
```azurecli
273-
az group delete -n $resourceGroup
273+
az group delete -n $RESOURCE_GROUP
274274
```
275275

276276
1. To remove the service principal, enter the commands:
277277

278278
```azurecli
279-
servicePrincipal=$(cat serviceprincipal.json | jq -r '.name')
280-
az ad sp delete --id $servicePrincipal
279+
SERVICE_PRINCIPAL=$(cat serviceprincipal.json | jq -r '.name')
280+
az ad sp delete --id $SERVICE_PRINCIPAL
281281
```
282282

283283
## Next steps

0 commit comments

Comments
 (0)