Skip to content

Commit 207e3c6

Browse files
authored
Update cli-upload-file-asset.md
1 parent 55bac07 commit 207e3c6

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

articles/media-services/latest/cli-upload-file-asset.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,32 @@ The Azure CLI script in this article shows how to upload a local file to a stora
2929

3030
## Example script
3131

32-
[!code-azurecli-interactive[main](../../../cli_scripts/media-services/upload-file-asset/UploadFile-Asset.sh "Upload a file")]
32+
```Azure CLI
33+
#!/bin/bash
34+
# Update the following variables for your own settings:
35+
storageAccountName=build2018storage
36+
assetContainer="asset-4c834446-7e55-4760-9a25-f2d4fb1f4657"
37+
localFile="..\Media\ignite-short.mp4"
38+
blobName="ignite-short.mp4"
39+
sasToken="?sv=2015-07-08&sr=c&sig=u1uy9OIeXnZUEN62hE0bDgg%2FPXYgRDNGnQxE%2BSi51dM%3D&se=2018-04-29T18:42:02Z&sp=rwl"
40+
# Use the az storage modules to upload a local file to the container using the SAS URL from previous step.
41+
# If you are logged in already to the subscription with access to the storage account, you do not need to use the --sas-token at all. Just eliminate it below.
42+
# The container name is in the SAS URL path, and should be set with the -c option.
43+
# Use the -f option to point to a local file on your machine.
44+
# Use the -n option to name the blob in storage.
45+
# Use the --account-name option to point to the storage account name to use
46+
# Use the --sas-token option to place the SAS token after the query string from previous step.
47+
# NOTE that the SAS Token is only good for up to 24 hours max.
48+
#
49+
az storage blob upload \
50+
-c $assetContainer \
51+
-f $localFile \
52+
-n $blobName \
53+
--account-name $storageAccountName \
54+
--sas-token $sasToken \
55+
echo "press [ENTER] to continue."
56+
read continue
57+
```
3358

3459
## Next steps
3560

0 commit comments

Comments
 (0)