Modifies the service properties for the Azure Storage Blob service.
Syntax AccountName (Default)Update-AzStorageBlobServiceProperty
[-ResourceGroupName] <String>
[-StorageAccountName] <String>
[-DefaultServiceVersion <String>]
[-EnableChangeFeed <Boolean>]
[-ChangeFeedRetentionInDays <Int32>]
[-IsVersioningEnabled <Boolean>]
[-CorsRule <PSCorsRule[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
AccountObject
Update-AzStorageBlobServiceProperty
-StorageAccount <PSStorageAccount>
[-DefaultServiceVersion <String>]
[-EnableChangeFeed <Boolean>]
[-ChangeFeedRetentionInDays <Int32>]
[-IsVersioningEnabled <Boolean>]
[-CorsRule <PSCorsRule[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
BlobServicePropertiesResourceId
Update-AzStorageBlobServiceProperty
[-ResourceId] <String>
[-DefaultServiceVersion <String>]
[-EnableChangeFeed <Boolean>]
[-ChangeFeedRetentionInDays <Int32>]
[-IsVersioningEnabled <Boolean>]
[-CorsRule <PSCorsRule[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-AzStorageBlobServiceProperty cmdlet modifies the service properties for the Azure Storage Blob service.
Examples Example 1: Set Blob service DefaultServiceVersion to 2018-03-28Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -DefaultServiceVersion 2018-03-28
StorageAccountName : mystorageaccount
ResourceGroupName : myresourcegroup
DefaultServiceVersion : 2018-03-28
DeleteRetentionPolicy.Enabled : False
DeleteRetentionPolicy.Days :
RestorePolicy.Enabled :
RestorePolicy.Days :
ChangeFeed.Enabled :
ChangeFeed.RetentionInDays :
IsVersioningEnabled :
This command sets the DefaultServiceVersion of Blob Service to 2018-03-28.
Example 2: Enable Changefeed on Blob service of a Storage account with ChangeFeedRetentionInDays as 5 daysUpdate-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableChangeFeed $true -ChangeFeedRetentionInDays 5
StorageAccountName : mystorageaccount
ResourceGroupName : myresourcegroup
DefaultServiceVersion :
DeleteRetentionPolicy.Enabled : False
DeleteRetentionPolicy.Days :
RestorePolicy.Enabled :
RestorePolicy.Days :
ChangeFeed.Enabled : True
ChangeFeed.RetentionInDays : 5
IsVersioningEnabled :
This command enables Changefeed on Blob service of a Storage account with ChangeFeedRetentionInDays as 5 days. Change feed support in Azure Blob Storage works by listening to a GPv2 or Blob storage account for any blob level creation, modification, or deletion events. It then outputs an ordered log of events for the blobs stored in the $blobchangefeed container within the storage account. The serialized changes are persisted as an Apache Avro file and can be processed asynchronously and incrementally. If not specify ChangeFeedRetentionInDays, will get null value in service properties, indicates an infinite retention of the change feed.
Example 3: Enable Versioning on Blob service of a Storage accountUpdate-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -IsVersioningEnabled $true
StorageAccountName : mystorageaccount
ResourceGroupName : myresourcegroup
DefaultServiceVersion :
DeleteRetentionPolicy.Enabled : False
DeleteRetentionPolicy.Days :
RestorePolicy.Enabled :
RestorePolicy.Days :
ChangeFeed :
ChangeFeed.RetentionInDays :
IsVersioningEnabled : True
This command enables Versioning on Blob service of a Storage account
Example 4: Update CORS rules$CorsRules = (@{
AllowedHeaders=@("x-ms-blob-content-type","x-ms-blob-content-disposition");
ExposedHeaders=@();
AllowedOrigins=@("*");
AllowedMethods=@("TRACE","CONNECT")},
@{
AllowedOrigins=@("http://www.fabrikam.com","http://www.contoso.com");
ExposedHeaders=@("x-ms-meta-data*","x-ms-meta-customheader");
AllowedHeaders=@("x-ms-meta-target*","x-ms-meta-customheader");
MaxAgeInSeconds=30;
AllowedMethods=@("PUT")})
$property = Update-AzStorageBlobServiceProperty -ResourceGroupName myresourcegroup -StorageAccountName mystorageaccount -CorsRule $CorsRules
$property.Cors.CorsRulesProperty
AllowedOrigins : {*}
AllowedMethods : {TRACE, CONNECT}
MaxAgeInSeconds : 0
ExposedHeaders : {}
AllowedHeaders : {x-ms-blob-content-type, x-ms-blob-content-disposition}
AllowedOrigins : {http://www.fabrikam.com, http://www.contoso.com}
AllowedMethods : {PUT}
MaxAgeInSeconds : 30
ExposedHeaders : {x-ms-meta-customheader, x-ms-meta-data*}
AllowedHeaders : {x-ms-meta-customheader, x-ms-meta-target*}
The first command assigns an array of rules to the $CorsRules variable. This command uses standard extends over several lines in this code block. The second command sets the rules in $CorsRules to the Blob service of a Storage account.
Example 5: Clean up CORS rulesUpdate-AzStorageBlobServiceProperty -ResourceGroupName myresourcegroup -StorageAccountName mystorageaccount -CorsRule @()
This command cleans up the CORS rules of a Storage account by inputting @() to parameter CorsRule
Parameters -ChangeFeedRetentionInDaysIndicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). Never specify it when enabled changeFeed will get null value in service properties, indicates an infinite retention of the change feed.
Parameter properties Type: Int32 Default value: None Supports wildcards: False DontShow: False Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -ConfirmPrompts you for confirmation before running the cmdlet.
Parameter properties Type: SwitchParameter Default value: None Supports wildcards: False DontShow: False Aliases: cf Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -CorsRuleSpecifies CORS rules for the Blob service.
Parameter properties Type: Default value: None Supports wildcards: False DontShow: False Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -DefaultProfileThe credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties Type: IAzureContextContainer Default value: None Supports wildcards: False DontShow: False Aliases: AzContext, AzureRmContext, AzureCredential Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -DefaultServiceVersionDefault Service Version to Set
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -EnableChangeFeedEnable Change Feed logging for the storage account by set to $true, disable Change Feed logging by set to $false.
Parameter properties Type: Boolean Default value: None Supports wildcards: False DontShow: False Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -IsVersioningEnabledGets or sets versioning is enabled if set to true.
Parameter properties Type: Boolean Default value: None Supports wildcards: False DontShow: False Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -ResourceGroupNameResource Group Name.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets AccountName Position: 0 Mandatory: True Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -ResourceIdInput a Storage account Resource Id, or a Blob service properties Resource Id.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Parameter sets BlobServicePropertiesResourceId Position: 0 Mandatory: True Value from pipeline: False Value from pipeline by property name: True Value from remaining arguments: False -StorageAccountStorage account object
Parameter properties Type: PSStorageAccount Default value: None Supports wildcards: False DontShow: False Parameter sets AccountObject Position: Named Mandatory: True Value from pipeline: True Value from pipeline by property name: False Value from remaining arguments: False -StorageAccountNameStorage Account Name.
Parameter properties Type: String Default value: None Supports wildcards: False DontShow: False Aliases: AccountName, Name Parameter sets AccountName Position: 1 Mandatory: True Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False -WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties Type: SwitchParameter Default value: None Supports wildcards: False DontShow: False Aliases: wi Parameter sets (All) Position: Named Mandatory: False Value from pipeline: False Value from pipeline by property name: False Value from remaining arguments: False CommonParametersThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs PSStorageAccount String Outputs PSBlobServicePropertiesRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4