You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/extensions/custom-script-linux.md
+46-46Lines changed: 46 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ To download a script externally, such as from GitHub or Azure Storage, you need
41
41
42
42
If your script is on a local server, you might still need to open other firewall or NSG ports.
43
43
44
-
### Tips and tricks
44
+
### Tips
45
45
46
46
- The highest failure rate for this extension is due to syntax errors in the script. Verify that the script runs without errors. Put more logging into the script to make it easier to find failures.
47
47
- Write scripts that are idempotent, so that running them more than once accidentally doesn't cause system changes.
@@ -103,32 +103,32 @@ You can store sensitive data in a protected configuration, which is encrypted an
| managedIdentity |`{ }` or `{ "clientId": "31b403aa-c364-4240-a7ff-d85fb6cd7232" }` or `{ "objectId": "12dd289c-0583-46e5-b9b4-115d5c19ef4b" }`| JSON object |
118
118
119
119
### Property value details
120
120
121
121
| Property | Optional or required | Details |
122
122
| ---- | ---- | ---- |
123
-
|`apiVersion`| Not applicable | You can find the most up-to-date API version by using [Resource Explorer](https://resources.azure.com/) or by using the command `az provider list -o json` in the Azure CLI. |
124
-
|`fileUris`| Optional | URLs for files to be downloaded. |
125
-
|`commandToExecute`| Required if `script` isn't set | The entry point script to run. Use this property instead of `script` if your command contains secrets such as passwords. |
126
-
|`script`| Required if `commandToExecute` isn't set | A Base64-encoded and optionally gzip'ed script run by `/bin/sh`. |
127
-
|`skipDos2Unix`| Optional | Set this value to `false` if you want to skip dos2unix conversion of script-based file URLs or scripts. |
128
-
|`timestamp`| Optional | Change this value only to trigger a rerun of the script. Any integer value is acceptable, as long as it's different from the previous value. |
129
-
|`storageAccountName`| Optional | The name of storage account. If you specify storage credentials, all `fileUris` values must be URLs for Azure blobs. |
130
-
|`storageAccountKey`| Optional | The access key of the storage account. |
131
-
|`managedIdentity`| Optional | The [managed identity](../../active-directory/managed-identities-azure-resources/overview.md) for downloading files. Values are `clientId` (optional, string), which is the client ID of the managed identity, and `objectId` (optional, string), which is the object ID of the managed identity.|
123
+
| apiVersion | Not applicable | You can find the most up-to-date API version by using [Resource Explorer](https://resources.azure.com/) or by using the command `az provider list -o json` in the Azure CLI. |
124
+
| fileUris | Optional | URLs for files to be downloaded. |
125
+
| commandToExecute | Required if `script` isn't set | The entry point script to run. Use this property instead of `script` if your command contains secrets such as passwords. |
126
+
| script | Required if `commandToExecute` isn't set | A Base64-encoded and optionally gzip'ed script run by `/bin/sh`. |
127
+
| skipDos2Unix | Optional | Set this value to `false` if you want to skip dos2unix conversion of script-based file URLs or scripts. |
128
+
| timestamp | Optional | Change this value only to trigger a rerun of the script. Any integer value is acceptable, as long as it's different from the previous value. |
129
+
| storageAccountName | Optional | The name of storage account. If you specify storage credentials, all `fileUris` values must be URLs for Azure blobs. |
130
+
| storageAccountKey | Optional | The access key of the storage account. |
131
+
| managedIdentity | Optional | The [managed identity](../../active-directory/managed-identities-azure-resources/overview.md) for downloading files. Values are `clientId` (optional, string), which is the client ID of the managed identity, and `objectId` (optional, string), which is the object ID of the managed identity.|
132
132
133
133
*Public settings* are sent in clear text to the VM where the script runs. *Protected settings* are encrypted through a key known only to Azure and the VM. The settings are saved to the VM as they were sent. That is, if the settings were encrypted, they're saved encrypted on the VM. The certificate that's used to decrypt the encrypted values is stored on the VM. The certificate is also used to decrypt settings, if necessary, at runtime.
134
134
@@ -375,35 +375,35 @@ Use a protected configuration file to specify the command to be run:
375
375
376
376
1. Create the public configuration file by using the text editor of your choice or by using the following CLI command:
1. Create the protected configuration file by using the text editor of your choice or by using the following CLI command:
387
387
388
-
```azurecli
389
-
cat <<EOF > protected-config.json
390
-
{
391
-
"commandToExecute": "./config-music.sh"
392
-
}
393
-
EOF
394
-
```
388
+
```azurecli
389
+
cat <<EOF > protected-config.json
390
+
{
391
+
"commandToExecute": "./config-music.sh"
392
+
}
393
+
EOF
394
+
```
395
395
396
396
1. Run the following command:
397
397
398
-
```azurecli
399
-
az vm extension set \
400
-
--resource-group myResourceGroup \
401
-
--vm-name myVM \
402
-
--name customScript \
403
-
--publisher Microsoft.Azure.Extensions \
404
-
--settings ./script-config.json \
405
-
--protected-settings ./protected-config.json
406
-
```
398
+
```azurecli
399
+
az vm extension set \
400
+
--resource-group myResourceGroup \
401
+
--vm-name myVM \
402
+
--name customScript \
403
+
--publisher Microsoft.Azure.Extensions \
404
+
--settings ./script-config.json \
405
+
--protected-settings ./protected-config.json
406
+
```
407
407
408
408
## Virtual Machine Scale Sets
409
409
@@ -538,4 +538,4 @@ The output looks like the following text:
538
538
539
539
## Next steps
540
540
541
-
To see the code, current issues, and versions, go to the [custom-script-extension-linux repo on GitHub](https://github.com/Azure/custom-script-extension-linux).
541
+
To see the code, current issues, and versions, see [custom-script-extension-linux](https://github.com/Azure/custom-script-extension-linux).
0 commit comments