mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
aligning AutoExportBlobRetention documentation and script to AutoExport script
This commit is contained in:
@@ -1,14 +1,21 @@
|
|||||||
# The storage key for the storage account you are using.
|
#Azure Automation String Variable name for your Storage Account Key
|
||||||
$storageKey = Get-AutomationVariable -Name "STORAGEKEYVARIABLENAME";
|
$storageKeyVariableName = "STORAGEKEYVARIABLENAME";
|
||||||
# The name of the storage container you are using.
|
#Name of your Storage Account
|
||||||
$storageContainer = "STORAGECONTAINERNAME";
|
$storageAccountName = "STORAGEACCOUNTNAME";
|
||||||
# Set up the storage context for the storage account.
|
#Name of your Storage Container
|
||||||
$context = New-AzureStorageContext -StorageAccountName "STORAGEACCOUNTNAME" -StorageAccountKey $storageKey
|
$storageContainerName = "STORAGECONTAINERNAME";
|
||||||
# Get all of the blobs in the storage account.
|
|
||||||
$blobs = Get-AzureStorageBlob -Container $storageContainer -Context $context
|
|
||||||
# Set the number of days that you want the blob to be stored for.
|
# Set the number of days that you want the blob to be stored for.
|
||||||
$retentionInDays = 30
|
$retentionInDays = 30
|
||||||
|
|
||||||
|
|
||||||
|
# Get the storage key
|
||||||
|
$storageKey = Get-AutomationVariable -Name $storageKeyVariableName;
|
||||||
|
# Set up the storage context for the storage account.
|
||||||
|
$context = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageKey
|
||||||
|
# Get all of the blobs in the storage account.
|
||||||
|
$blobs = Get-AzureStorageBlob -Container $storageContainerName -Context $context
|
||||||
|
|
||||||
|
|
||||||
foreach($blob in $blobs)
|
foreach($blob in $blobs)
|
||||||
{
|
{
|
||||||
# Get the current time to compare to the time that the blob was created.
|
# Get the current time to compare to the time that the blob was created.
|
||||||
|
|||||||
Reference in New Issue
Block a user