File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
samples/manage/azure-automation-automated-export Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 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" ;
9
7
# Set the number of days that you want the blob to be stored for.
10
8
$retentionInDays = 30
11
9
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
+
12
19
foreach ($blob in $blobs )
13
20
{
14
21
# Get the current time to compare to the time that the blob was created.
You can’t perform that action at this time.
0 commit comments