Skip to content

Commit 47205a4

Browse files
author
Cameron Battagler
committed
aligning AutoExportBlobRetention documentation and script to AutoExport script
1 parent b687860 commit 47205a4

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

samples/manage/azure-automation-automated-export/AutoExportBlobRetention.ps1

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
# The storage key for the storage account you are using.
2-
$storageKey = Get-AutomationVariable -Name "STORAGEKEYVARIABLENAME";
3-
# The name of the storage container you are using.
4-
$storageContainer = "STORAGECONTAINERNAME";
5-
# Set up the storage context for the storage account.
6-
$context = New-AzureStorageContext -StorageAccountName "STORAGEACCOUNTNAME" -StorageAccountKey $storageKey
7-
# Get all of the blobs in the storage account.
8-
$blobs = Get-AzureStorageBlob -Container $storageContainer -Context $context
1+
#Azure Automation String Variable name for your Storage Account Key
2+
$storageKeyVariableName = "STORAGEKEYVARIABLENAME";
3+
#Name of your Storage Account
4+
$storageAccountName = "STORAGEACCOUNTNAME";
5+
#Name of your Storage Container
6+
$storageContainerName = "STORAGECONTAINERNAME";
97
# Set the number of days that you want the blob to be stored for.
108
$retentionInDays = 30
119

10+
11+
# Get the storage key
12+
$storageKey = Get-AutomationVariable -Name $storageKeyVariableName;
13+
# Set up the storage context for the storage account.
14+
$context = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageKey
15+
# Get all of the blobs in the storage account.
16+
$blobs = Get-AzureStorageBlob -Container $storageContainerName -Context $context
17+
18+
1219
foreach($blob in $blobs)
1320
{
1421
# Get the current time to compare to the time that the blob was created.

0 commit comments

Comments
 (0)