We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
Manages an Azure Storage Account Management Policy.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("exampleAccount", new Azure.Storage.AccountArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
AccountKind = "BlobStorage",
});
var exampleManagementPolicy = new Azure.Storage.ManagementPolicy("exampleManagementPolicy", new Azure.Storage.ManagementPolicyArgs
{
StorageAccountId = exampleAccount.Id,
Rules =
{
new Azure.Storage.Inputs.ManagementPolicyRuleArgs
{
Name = "rule1",
Enabled = true,
Filters = new Azure.Storage.Inputs.ManagementPolicyRuleFiltersArgs
{
PrefixMatches =
{
"container1/prefix1",
},
BlobTypes =
{
"blockBlob",
},
MatchBlobIndexTags =
{
new Azure.Storage.Inputs.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs
{
Name = "tag1",
Operation = "==",
Value = "val1",
},
},
},
Actions = new Azure.Storage.Inputs.ManagementPolicyRuleActionsArgs
{
BaseBlob = new Azure.Storage.Inputs.ManagementPolicyRuleActionsBaseBlobArgs
{
TierToCoolAfterDaysSinceModificationGreaterThan = 10,
TierToArchiveAfterDaysSinceModificationGreaterThan = 50,
DeleteAfterDaysSinceModificationGreaterThan = 100,
},
Snapshot = new Azure.Storage.Inputs.ManagementPolicyRuleActionsSnapshotArgs
{
DeleteAfterDaysSinceCreationGreaterThan = 30,
},
},
},
new Azure.Storage.Inputs.ManagementPolicyRuleArgs
{
Name = "rule2",
Enabled = false,
Filters = new Azure.Storage.Inputs.ManagementPolicyRuleFiltersArgs
{
PrefixMatches =
{
"container2/prefix1",
"container2/prefix2",
},
BlobTypes =
{
"blockBlob",
},
},
Actions = new Azure.Storage.Inputs.ManagementPolicyRuleActionsArgs
{
BaseBlob = new Azure.Storage.Inputs.ManagementPolicyRuleActionsBaseBlobArgs
{
TierToCoolAfterDaysSinceModificationGreaterThan = 11,
TierToArchiveAfterDaysSinceModificationGreaterThan = 51,
DeleteAfterDaysSinceModificationGreaterThan = 101,
},
Snapshot = new Azure.Storage.Inputs.ManagementPolicyRuleActionsSnapshotArgs
{
ChangeTierToArchiveAfterDaysSinceCreation = 90,
ChangeTierToCoolAfterDaysSinceCreation = 23,
DeleteAfterDaysSinceCreationGreaterThan = 31,
},
Version = new Azure.Storage.Inputs.ManagementPolicyRuleActionsVersionArgs
{
ChangeTierToArchiveAfterDaysSinceCreation = 9,
ChangeTierToCoolAfterDaysSinceCreation = 90,
DeleteAfterDaysSinceCreation = 3,
},
},
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
AccountKind: pulumi.String("BlobStorage"),
})
if err != nil {
return err
}
_, err = storage.NewManagementPolicy(ctx, "exampleManagementPolicy", &storage.ManagementPolicyArgs{
StorageAccountId: exampleAccount.ID(),
Rules: storage.ManagementPolicyRuleArray{
&storage.ManagementPolicyRuleArgs{
Name: pulumi.String("rule1"),
Enabled: pulumi.Bool(true),
Filters: &storage.ManagementPolicyRuleFiltersArgs{
PrefixMatches: pulumi.StringArray{
pulumi.String("container1/prefix1"),
},
BlobTypes: pulumi.StringArray{
pulumi.String("blockBlob"),
},
MatchBlobIndexTags: storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArray{
&storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs{
Name: pulumi.String("tag1"),
Operation: pulumi.String("=="),
Value: pulumi.String("val1"),
},
},
},
Actions: &storage.ManagementPolicyRuleActionsArgs{
BaseBlob: &storage.ManagementPolicyRuleActionsBaseBlobArgs{
TierToCoolAfterDaysSinceModificationGreaterThan: pulumi.Int(10),
TierToArchiveAfterDaysSinceModificationGreaterThan: pulumi.Int(50),
DeleteAfterDaysSinceModificationGreaterThan: pulumi.Int(100),
},
Snapshot: &storage.ManagementPolicyRuleActionsSnapshotArgs{
DeleteAfterDaysSinceCreationGreaterThan: pulumi.Int(30),
},
},
},
&storage.ManagementPolicyRuleArgs{
Name: pulumi.String("rule2"),
Enabled: pulumi.Bool(false),
Filters: &storage.ManagementPolicyRuleFiltersArgs{
PrefixMatches: pulumi.StringArray{
pulumi.String("container2/prefix1"),
pulumi.String("container2/prefix2"),
},
BlobTypes: pulumi.StringArray{
pulumi.String("blockBlob"),
},
},
Actions: &storage.ManagementPolicyRuleActionsArgs{
BaseBlob: &storage.ManagementPolicyRuleActionsBaseBlobArgs{
TierToCoolAfterDaysSinceModificationGreaterThan: pulumi.Int(11),
TierToArchiveAfterDaysSinceModificationGreaterThan: pulumi.Int(51),
DeleteAfterDaysSinceModificationGreaterThan: pulumi.Int(101),
},
Snapshot: &storage.ManagementPolicyRuleActionsSnapshotArgs{
ChangeTierToArchiveAfterDaysSinceCreation: pulumi.Int(90),
ChangeTierToCoolAfterDaysSinceCreation: pulumi.Int(23),
DeleteAfterDaysSinceCreationGreaterThan: pulumi.Int(31),
},
Version: &storage.ManagementPolicyRuleActionsVersionArgs{
ChangeTierToArchiveAfterDaysSinceCreation: pulumi.Int(9),
ChangeTierToCoolAfterDaysSinceCreation: pulumi.Int(90),
DeleteAfterDaysSinceCreation: pulumi.Int(3),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleAccount = new azure.storage.Account("exampleAccount", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
accountTier: "Standard",
accountReplicationType: "LRS",
accountKind: "BlobStorage",
});
const exampleManagementPolicy = new azure.storage.ManagementPolicy("exampleManagementPolicy", {
storageAccountId: exampleAccount.id,
rules: [
{
name: "rule1",
enabled: true,
filters: {
prefixMatches: ["container1/prefix1"],
blobTypes: ["blockBlob"],
matchBlobIndexTags: [{
name: "tag1",
operation: "==",
value: "val1",
}],
},
actions: {
baseBlob: {
tierToCoolAfterDaysSinceModificationGreaterThan: 10,
tierToArchiveAfterDaysSinceModificationGreaterThan: 50,
deleteAfterDaysSinceModificationGreaterThan: 100,
},
snapshot: {
deleteAfterDaysSinceCreationGreaterThan: 30,
},
},
},
{
name: "rule2",
enabled: false,
filters: {
prefixMatches: [
"container2/prefix1",
"container2/prefix2",
],
blobTypes: ["blockBlob"],
},
actions: {
baseBlob: {
tierToCoolAfterDaysSinceModificationGreaterThan: 11,
tierToArchiveAfterDaysSinceModificationGreaterThan: 51,
deleteAfterDaysSinceModificationGreaterThan: 101,
},
snapshot: {
changeTierToArchiveAfterDaysSinceCreation: 90,
changeTierToCoolAfterDaysSinceCreation: 23,
deleteAfterDaysSinceCreationGreaterThan: 31,
},
version: {
changeTierToArchiveAfterDaysSinceCreation: 9,
changeTierToCoolAfterDaysSinceCreation: 90,
deleteAfterDaysSinceCreation: 3,
},
},
},
],
});
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_account = azure.storage.Account("exampleAccount",
resource_group_name=example_resource_group.name,
location=example_resource_group.location,
account_tier="Standard",
account_replication_type="LRS",
account_kind="BlobStorage")
example_management_policy = azure.storage.ManagementPolicy("exampleManagementPolicy",
storage_account_id=example_account.id,
rules=[
azure.storage.ManagementPolicyRuleArgs(
name="rule1",
enabled=True,
filters=azure.storage.ManagementPolicyRuleFiltersArgs(
prefix_matches=["container1/prefix1"],
blob_types=["blockBlob"],
match_blob_index_tags=[azure.storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs(
name="tag1",
operation="==",
value="val1",
)],
),
actions=azure.storage.ManagementPolicyRuleActionsArgs(
base_blob=azure.storage.ManagementPolicyRuleActionsBaseBlobArgs(
tier_to_cool_after_days_since_modification_greater_than=10,
tier_to_archive_after_days_since_modification_greater_than=50,
delete_after_days_since_modification_greater_than=100,
),
snapshot=azure.storage.ManagementPolicyRuleActionsSnapshotArgs(
delete_after_days_since_creation_greater_than=30,
),
),
),
azure.storage.ManagementPolicyRuleArgs(
name="rule2",
enabled=False,
filters=azure.storage.ManagementPolicyRuleFiltersArgs(
prefix_matches=[
"container2/prefix1",
"container2/prefix2",
],
blob_types=["blockBlob"],
),
actions=azure.storage.ManagementPolicyRuleActionsArgs(
base_blob=azure.storage.ManagementPolicyRuleActionsBaseBlobArgs(
tier_to_cool_after_days_since_modification_greater_than=11,
tier_to_archive_after_days_since_modification_greater_than=51,
delete_after_days_since_modification_greater_than=101,
),
snapshot=azure.storage.ManagementPolicyRuleActionsSnapshotArgs(
change_tier_to_archive_after_days_since_creation=90,
change_tier_to_cool_after_days_since_creation=23,
delete_after_days_since_creation_greater_than=31,
),
version=azure.storage.ManagementPolicyRuleActionsVersionArgs(
change_tier_to_archive_after_days_since_creation=9,
change_tier_to_cool_after_days_since_creation=90,
delete_after_days_since_creation=3,
),
),
),
])
Example coming soon!
Create ManagementPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagementPolicy(name: string, args: ManagementPolicyArgs, opts?: CustomResourceOptions);@overload
def ManagementPolicy(resource_name: str,
args: ManagementPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ManagementPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
storage_account_id: Optional[str] = None,
rules: Optional[Sequence[ManagementPolicyRuleArgs]] = None)func NewManagementPolicy(ctx *Context, name string, args ManagementPolicyArgs, opts ...ResourceOption) (*ManagementPolicy, error)public ManagementPolicy(string name, ManagementPolicyArgs args, CustomResourceOptions? opts = null)
public ManagementPolicy(String name, ManagementPolicyArgs args)
public ManagementPolicy(String name, ManagementPolicyArgs args, CustomResourceOptions options)
type: azure:storage:ManagementPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ManagementPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ManagementPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ManagementPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagementPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagementPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var managementPolicyResource = new Azure.Storage.ManagementPolicy("managementPolicyResource", new()
{
StorageAccountId = "string",
Rules = new[]
{
new Azure.Storage.Inputs.ManagementPolicyRuleArgs
{
Actions = new Azure.Storage.Inputs.ManagementPolicyRuleActionsArgs
{
BaseBlob = new Azure.Storage.Inputs.ManagementPolicyRuleActionsBaseBlobArgs
{
DeleteAfterDaysSinceLastAccessTimeGreaterThan = 0,
DeleteAfterDaysSinceModificationGreaterThan = 0,
TierToArchiveAfterDaysSinceLastAccessTimeGreaterThan = 0,
TierToArchiveAfterDaysSinceModificationGreaterThan = 0,
TierToCoolAfterDaysSinceLastAccessTimeGreaterThan = 0,
TierToCoolAfterDaysSinceModificationGreaterThan = 0,
},
Snapshot = new Azure.Storage.Inputs.ManagementPolicyRuleActionsSnapshotArgs
{
ChangeTierToArchiveAfterDaysSinceCreation = 0,
ChangeTierToCoolAfterDaysSinceCreation = 0,
DeleteAfterDaysSinceCreationGreaterThan = 0,
},
Version = new Azure.Storage.Inputs.ManagementPolicyRuleActionsVersionArgs
{
ChangeTierToArchiveAfterDaysSinceCreation = 0,
ChangeTierToCoolAfterDaysSinceCreation = 0,
DeleteAfterDaysSinceCreation = 0,
},
},
Enabled = false,
Name = "string",
Filters = new Azure.Storage.Inputs.ManagementPolicyRuleFiltersArgs
{
BlobTypes = new[]
{
"string",
},
MatchBlobIndexTags = new[]
{
new Azure.Storage.Inputs.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs
{
Name = "string",
Value = "string",
Operation = "string",
},
},
PrefixMatches = new[]
{
"string",
},
},
},
},
});
example, err := storage.NewManagementPolicy(ctx, "managementPolicyResource", &storage.ManagementPolicyArgs{
StorageAccountId: pulumi.String("string"),
Rules: storage.ManagementPolicyRuleArray{
&storage.ManagementPolicyRuleArgs{
Actions: &storage.ManagementPolicyRuleActionsArgs{
BaseBlob: &storage.ManagementPolicyRuleActionsBaseBlobArgs{
DeleteAfterDaysSinceLastAccessTimeGreaterThan: pulumi.Int(0),
DeleteAfterDaysSinceModificationGreaterThan: pulumi.Int(0),
TierToArchiveAfterDaysSinceLastAccessTimeGreaterThan: pulumi.Int(0),
TierToArchiveAfterDaysSinceModificationGreaterThan: pulumi.Int(0),
TierToCoolAfterDaysSinceLastAccessTimeGreaterThan: pulumi.Int(0),
TierToCoolAfterDaysSinceModificationGreaterThan: pulumi.Int(0),
},
Snapshot: &storage.ManagementPolicyRuleActionsSnapshotArgs{
ChangeTierToArchiveAfterDaysSinceCreation: pulumi.Int(0),
ChangeTierToCoolAfterDaysSinceCreation: pulumi.Int(0),
DeleteAfterDaysSinceCreationGreaterThan: pulumi.Int(0),
},
Version: &storage.ManagementPolicyRuleActionsVersionArgs{
ChangeTierToArchiveAfterDaysSinceCreation: pulumi.Int(0),
ChangeTierToCoolAfterDaysSinceCreation: pulumi.Int(0),
DeleteAfterDaysSinceCreation: pulumi.Int(0),
},
},
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
Filters: &storage.ManagementPolicyRuleFiltersArgs{
BlobTypes: pulumi.StringArray{
pulumi.String("string"),
},
MatchBlobIndexTags: storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArray{
&storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs{
Name: pulumi.String("string"),
Value: pulumi.String("string"),
Operation: pulumi.String("string"),
},
},
PrefixMatches: pulumi.StringArray{
pulumi.String("string"),
},
},
},
},
})
var managementPolicyResource = new ManagementPolicy("managementPolicyResource", ManagementPolicyArgs.builder()
.storageAccountId("string")
.rules(ManagementPolicyRuleArgs.builder()
.actions(ManagementPolicyRuleActionsArgs.builder()
.baseBlob(ManagementPolicyRuleActionsBaseBlobArgs.builder()
.deleteAfterDaysSinceLastAccessTimeGreaterThan(0)
.deleteAfterDaysSinceModificationGreaterThan(0)
.tierToArchiveAfterDaysSinceLastAccessTimeGreaterThan(0)
.tierToArchiveAfterDaysSinceModificationGreaterThan(0)
.tierToCoolAfterDaysSinceLastAccessTimeGreaterThan(0)
.tierToCoolAfterDaysSinceModificationGreaterThan(0)
.build())
.snapshot(ManagementPolicyRuleActionsSnapshotArgs.builder()
.changeTierToArchiveAfterDaysSinceCreation(0)
.changeTierToCoolAfterDaysSinceCreation(0)
.deleteAfterDaysSinceCreationGreaterThan(0)
.build())
.version(ManagementPolicyRuleActionsVersionArgs.builder()
.changeTierToArchiveAfterDaysSinceCreation(0)
.changeTierToCoolAfterDaysSinceCreation(0)
.deleteAfterDaysSinceCreation(0)
.build())
.build())
.enabled(false)
.name("string")
.filters(ManagementPolicyRuleFiltersArgs.builder()
.blobTypes("string")
.matchBlobIndexTags(ManagementPolicyRuleFiltersMatchBlobIndexTagArgs.builder()
.name("string")
.value("string")
.operation("string")
.build())
.prefixMatches("string")
.build())
.build())
.build());
management_policy_resource = azure.storage.ManagementPolicy("managementPolicyResource",
storage_account_id="string",
rules=[{
"actions": {
"base_blob": {
"delete_after_days_since_last_access_time_greater_than": 0,
"delete_after_days_since_modification_greater_than": 0,
"tier_to_archive_after_days_since_last_access_time_greater_than": 0,
"tier_to_archive_after_days_since_modification_greater_than": 0,
"tier_to_cool_after_days_since_last_access_time_greater_than": 0,
"tier_to_cool_after_days_since_modification_greater_than": 0,
},
"snapshot": {
"change_tier_to_archive_after_days_since_creation": 0,
"change_tier_to_cool_after_days_since_creation": 0,
"delete_after_days_since_creation_greater_than": 0,
},
"version": {
"change_tier_to_archive_after_days_since_creation": 0,
"change_tier_to_cool_after_days_since_creation": 0,
"delete_after_days_since_creation": 0,
},
},
"enabled": False,
"name": "string",
"filters": {
"blob_types": ["string"],
"match_blob_index_tags": [{
"name": "string",
"value": "string",
"operation": "string",
}],
"prefix_matches": ["string"],
},
}])
const managementPolicyResource = new azure.storage.ManagementPolicy("managementPolicyResource", {
storageAccountId: "string",
rules: [{
actions: {
baseBlob: {
deleteAfterDaysSinceLastAccessTimeGreaterThan: 0,
deleteAfterDaysSinceModificationGreaterThan: 0,
tierToArchiveAfterDaysSinceLastAccessTimeGreaterThan: 0,
tierToArchiveAfterDaysSinceModificationGreaterThan: 0,
tierToCoolAfterDaysSinceLastAccessTimeGreaterThan: 0,
tierToCoolAfterDaysSinceModificationGreaterThan: 0,
},
snapshot: {
changeTierToArchiveAfterDaysSinceCreation: 0,
changeTierToCoolAfterDaysSinceCreation: 0,
deleteAfterDaysSinceCreationGreaterThan: 0,
},
version: {
changeTierToArchiveAfterDaysSinceCreation: 0,
changeTierToCoolAfterDaysSinceCreation: 0,
deleteAfterDaysSinceCreation: 0,
},
},
enabled: false,
name: "string",
filters: {
blobTypes: ["string"],
matchBlobIndexTags: [{
name: "string",
value: "string",
operation: "string",
}],
prefixMatches: ["string"],
},
}],
});
type: azure:storage:ManagementPolicy
properties:
rules:
- actions:
baseBlob:
deleteAfterDaysSinceLastAccessTimeGreaterThan: 0
deleteAfterDaysSinceModificationGreaterThan: 0
tierToArchiveAfterDaysSinceLastAccessTimeGreaterThan: 0
tierToArchiveAfterDaysSinceModificationGreaterThan: 0
tierToCoolAfterDaysSinceLastAccessTimeGreaterThan: 0
tierToCoolAfterDaysSinceModificationGreaterThan: 0
snapshot:
changeTierToArchiveAfterDaysSinceCreation: 0
changeTierToCoolAfterDaysSinceCreation: 0
deleteAfterDaysSinceCreationGreaterThan: 0
version:
changeTierToArchiveAfterDaysSinceCreation: 0
changeTierToCoolAfterDaysSinceCreation: 0
deleteAfterDaysSinceCreation: 0
enabled: false
filters:
blobTypes:
- string
matchBlobIndexTags:
- name: string
operation: string
value: string
prefixMatches:
- string
name: string
storageAccountId: string
ManagementPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ManagementPolicy resource accepts the following input properties:
- Storage
Account stringId - Specifies the id of the storage account to apply the management policy to.
- Rules
List<Management
Policy Rule> - A
ruleblock as documented below.
- Storage
Account stringId - Specifies the id of the storage account to apply the management policy to.
- Rules
[]Management
Policy Rule Args - A
ruleblock as documented below.
- storage
Account StringId - Specifies the id of the storage account to apply the management policy to.
- rules
List<Management
Policy Rule> - A
ruleblock as documented below.
- storage
Account stringId - Specifies the id of the storage account to apply the management policy to.
- rules
Management
Policy Rule[] - A
ruleblock as documented below.
- storage_
account_ strid - Specifies the id of the storage account to apply the management policy to.
- rules
Sequence[Management
Policy Rule Args] - A
ruleblock as documented below.
- storage
Account StringId - Specifies the id of the storage account to apply the management policy to.
- rules List<Property Map>
- A
ruleblock as documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the ManagementPolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ManagementPolicy Resource
Get an existing ManagementPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ManagementPolicyState, opts?: CustomResourceOptions): ManagementPolicy@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
rules: Optional[Sequence[ManagementPolicyRuleArgs]] = None,
storage_account_id: Optional[str] = None) -> ManagementPolicyfunc GetManagementPolicy(ctx *Context, name string, id IDInput, state *ManagementPolicyState, opts ...ResourceOption) (*ManagementPolicy, error)public static ManagementPolicy Get(string name, Input<string> id, ManagementPolicyState? state, CustomResourceOptions? opts = null)public static ManagementPolicy get(String name, Output<String> id, ManagementPolicyState state, CustomResourceOptions options)resources: _: type: azure:storage:ManagementPolicy get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Rules
List<Management
Policy Rule> - A
ruleblock as documented below. - Storage
Account stringId - Specifies the id of the storage account to apply the management policy to.
- Rules
[]Management
Policy Rule Args - A
ruleblock as documented below. - Storage
Account stringId - Specifies the id of the storage account to apply the management policy to.
- rules
List<Management
Policy Rule> - A
ruleblock as documented below. - storage
Account StringId - Specifies the id of the storage account to apply the management policy to.
- rules
Management
Policy Rule[] - A
ruleblock as documented below. - storage
Account stringId - Specifies the id of the storage account to apply the management policy to.
- rules
Sequence[Management
Policy Rule Args] - A
ruleblock as documented below. - storage_
account_ strid - Specifies the id of the storage account to apply the management policy to.
- rules List<Property Map>
- A
ruleblock as documented below. - storage
Account StringId - Specifies the id of the storage account to apply the management policy to.
Supporting Types
ManagementPolicyRule, ManagementPolicyRuleArgs
- Actions
Management
Policy Rule Actions - An
actionsblock as documented below. - Enabled bool
- Boolean to specify whether the rule is enabled.
- Name string
- A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- Filters
Management
Policy Rule Filters - A
filterblock as documented below.
- Actions
Management
Policy Rule Actions - An
actionsblock as documented below. - Enabled bool
- Boolean to specify whether the rule is enabled.
- Name string
- A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- Filters
Management
Policy Rule Filters - A
filterblock as documented below.
- actions
Management
Policy Rule Actions - An
actionsblock as documented below. - enabled Boolean
- Boolean to specify whether the rule is enabled.
- name String
- A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- filters
Management
Policy Rule Filters - A
filterblock as documented below.
- actions
Management
Policy Rule Actions - An
actionsblock as documented below. - enabled boolean
- Boolean to specify whether the rule is enabled.
- name string
- A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- filters
Management
Policy Rule Filters - A
filterblock as documented below.
- actions
Management
Policy Rule Actions - An
actionsblock as documented below. - enabled bool
- Boolean to specify whether the rule is enabled.
- name str
- A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- filters
Management
Policy Rule Filters - A
filterblock as documented below.
- actions Property Map
- An
actionsblock as documented below. - enabled Boolean
- Boolean to specify whether the rule is enabled.
- name String
- A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
- filters Property Map
- A
filterblock as documented below.
ManagementPolicyRuleActions, ManagementPolicyRuleActionsArgs
- Base
Blob ManagementPolicy Rule Actions Base Blob - A
base_blobblock as documented below. - Snapshot
Management
Policy Rule Actions Snapshot - A
snapshotblock as documented below. - Version
Management
Policy Rule Actions Version - A
versionblock as documented below.
- Base
Blob ManagementPolicy Rule Actions Base Blob - A
base_blobblock as documented below. - Snapshot
Management
Policy Rule Actions Snapshot - A
snapshotblock as documented below. - Version
Management
Policy Rule Actions Version - A
versionblock as documented below.
- base
Blob ManagementPolicy Rule Actions Base Blob - A
base_blobblock as documented below. - snapshot
Management
Policy Rule Actions Snapshot - A
snapshotblock as documented below. - version
Management
Policy Rule Actions Version - A
versionblock as documented below.
- base
Blob ManagementPolicy Rule Actions Base Blob - A
base_blobblock as documented below. - snapshot
Management
Policy Rule Actions Snapshot - A
snapshotblock as documented below. - version
Management
Policy Rule Actions Version - A
versionblock as documented below.
- base_
blob ManagementPolicy Rule Actions Base Blob - A
base_blobblock as documented below. - snapshot
Management
Policy Rule Actions Snapshot - A
snapshotblock as documented below. - version
Management
Policy Rule Actions Version - A
versionblock as documented below.
- base
Blob Property Map - A
base_blobblock as documented below. - snapshot Property Map
- A
snapshotblock as documented below. - version Property Map
- A
versionblock as documented below.
ManagementPolicyRuleActionsBaseBlob, ManagementPolicyRuleActionsBaseBlobArgs
- Delete
After intDays Since Last Access Time Greater Than - The age in days after last access time to delete the blob. Must be between
0and99999. - Delete
After intDays Since Modification Greater Than - The age in days after last modification to delete the blob. Must be between 0 and 99999.
- Tier
To intArchive After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between
0 and99999`. - Tier
To intArchive After Days Since Modification Greater Than - The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between 0 and 99999.
- Tier
To intCool After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between
0and99999. - Tier
To intCool After Days Since Modification Greater Than - The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between 0 and 99999.
- Delete
After intDays Since Last Access Time Greater Than - The age in days after last access time to delete the blob. Must be between
0and99999. - Delete
After intDays Since Modification Greater Than - The age in days after last modification to delete the blob. Must be between 0 and 99999.
- Tier
To intArchive After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between
0 and99999`. - Tier
To intArchive After Days Since Modification Greater Than - The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between 0 and 99999.
- Tier
To intCool After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between
0and99999. - Tier
To intCool After Days Since Modification Greater Than - The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between 0 and 99999.
- delete
After IntegerDays Since Last Access Time Greater Than - The age in days after last access time to delete the blob. Must be between
0and99999. - delete
After IntegerDays Since Modification Greater Than - The age in days after last modification to delete the blob. Must be between 0 and 99999.
- tier
To IntegerArchive After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between
0 and99999`. - tier
To IntegerArchive After Days Since Modification Greater Than - The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between 0 and 99999.
- tier
To IntegerCool After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between
0and99999. - tier
To IntegerCool After Days Since Modification Greater Than - The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between 0 and 99999.
- delete
After numberDays Since Last Access Time Greater Than - The age in days after last access time to delete the blob. Must be between
0and99999. - delete
After numberDays Since Modification Greater Than - The age in days after last modification to delete the blob. Must be between 0 and 99999.
- tier
To numberArchive After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between
0 and99999`. - tier
To numberArchive After Days Since Modification Greater Than - The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between 0 and 99999.
- tier
To numberCool After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between
0and99999. - tier
To numberCool After Days Since Modification Greater Than - The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between 0 and 99999.
- delete_
after_ intdays_ since_ last_ access_ time_ greater_ than - The age in days after last access time to delete the blob. Must be between
0and99999. - delete_
after_ intdays_ since_ modification_ greater_ than - The age in days after last modification to delete the blob. Must be between 0 and 99999.
- tier_
to_ intarchive_ after_ days_ since_ last_ access_ time_ greater_ than - The age in days after last access time to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between
0 and99999`. - tier_
to_ intarchive_ after_ days_ since_ modification_ greater_ than - The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between 0 and 99999.
- tier_
to_ intcool_ after_ days_ since_ last_ access_ time_ greater_ than - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between
0and99999. - tier_
to_ intcool_ after_ days_ since_ modification_ greater_ than - The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between 0 and 99999.
- delete
After NumberDays Since Last Access Time Greater Than - The age in days after last access time to delete the blob. Must be between
0and99999. - delete
After NumberDays Since Modification Greater Than - The age in days after last modification to delete the blob. Must be between 0 and 99999.
- tier
To NumberArchive After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between
0 and99999`. - tier
To NumberArchive After Days Since Modification Greater Than - The age in days after last modification to tier blobs to archive storage. Supports blob currently at Hot or Cool tier. Must be between 0 and 99999.
- tier
To NumberCool After Days Since Last Access Time Greater Than - The age in days after last access time to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between
0and99999. - tier
To NumberCool After Days Since Modification Greater Than - The age in days after last modification to tier blobs to cool storage. Supports blob currently at Hot tier. Must be between 0 and 99999.
ManagementPolicyRuleActionsSnapshot, ManagementPolicyRuleActionsSnapshotArgs
- Change
Tier intTo Archive After Days Since Creation - The age in days after creation to tier blob snapshot to archive storage. Must be between 0 and 99999.
- Change
Tier intTo Cool After Days Since Creation - The age in days after creation to tier blob snapshot to cool storage. Must be between 0 and 99999.
- Delete
After intDays Since Creation Greater Than - The age in days after creation to delete the blob snapshot. Must be between 0 and 99999.
- Change
Tier intTo Archive After Days Since Creation - The age in days after creation to tier blob snapshot to archive storage. Must be between 0 and 99999.
- Change
Tier intTo Cool After Days Since Creation - The age in days after creation to tier blob snapshot to cool storage. Must be between 0 and 99999.
- Delete
After intDays Since Creation Greater Than - The age in days after creation to delete the blob snapshot. Must be between 0 and 99999.
- change
Tier IntegerTo Archive After Days Since Creation - The age in days after creation to tier blob snapshot to archive storage. Must be between 0 and 99999.
- change
Tier IntegerTo Cool After Days Since Creation - The age in days after creation to tier blob snapshot to cool storage. Must be between 0 and 99999.
- delete
After IntegerDays Since Creation Greater Than - The age in days after creation to delete the blob snapshot. Must be between 0 and 99999.
- change
Tier numberTo Archive After Days Since Creation - The age in days after creation to tier blob snapshot to archive storage. Must be between 0 and 99999.
- change
Tier numberTo Cool After Days Since Creation - The age in days after creation to tier blob snapshot to cool storage. Must be between 0 and 99999.
- delete
After numberDays Since Creation Greater Than - The age in days after creation to delete the blob snapshot. Must be between 0 and 99999.
- change_
tier_ intto_ archive_ after_ days_ since_ creation - The age in days after creation to tier blob snapshot to archive storage. Must be between 0 and 99999.
- change_
tier_ intto_ cool_ after_ days_ since_ creation - The age in days after creation to tier blob snapshot to cool storage. Must be between 0 and 99999.
- delete_
after_ intdays_ since_ creation_ greater_ than - The age in days after creation to delete the blob snapshot. Must be between 0 and 99999.
- change
Tier NumberTo Archive After Days Since Creation - The age in days after creation to tier blob snapshot to archive storage. Must be between 0 and 99999.
- change
Tier NumberTo Cool After Days Since Creation - The age in days after creation to tier blob snapshot to cool storage. Must be between 0 and 99999.
- delete
After NumberDays Since Creation Greater Than - The age in days after creation to delete the blob snapshot. Must be between 0 and 99999.
ManagementPolicyRuleActionsVersion, ManagementPolicyRuleActionsVersionArgs
- Change
Tier intTo Archive After Days Since Creation - The age in days after creation to tier blob version to archive storage. Must be between 0 and 99999.
- Change
Tier intTo Cool After Days Since Creation - The age in days creation create to tier blob version to cool storage. Must be between 0 and 99999.
- Delete
After intDays Since Creation - The age in days after creation to delete the blob version. Must be between 0 and 99999.
- Change
Tier intTo Archive After Days Since Creation - The age in days after creation to tier blob version to archive storage. Must be between 0 and 99999.
- Change
Tier intTo Cool After Days Since Creation - The age in days creation create to tier blob version to cool storage. Must be between 0 and 99999.
- Delete
After intDays Since Creation - The age in days after creation to delete the blob version. Must be between 0 and 99999.
- change
Tier IntegerTo Archive After Days Since Creation - The age in days after creation to tier blob version to archive storage. Must be between 0 and 99999.
- change
Tier IntegerTo Cool After Days Since Creation - The age in days creation create to tier blob version to cool storage. Must be between 0 and 99999.
- delete
After IntegerDays Since Creation - The age in days after creation to delete the blob version. Must be between 0 and 99999.
- change
Tier numberTo Archive After Days Since Creation - The age in days after creation to tier blob version to archive storage. Must be between 0 and 99999.
- change
Tier numberTo Cool After Days Since Creation - The age in days creation create to tier blob version to cool storage. Must be between 0 and 99999.
- delete
After numberDays Since Creation - The age in days after creation to delete the blob version. Must be between 0 and 99999.
- change_
tier_ intto_ archive_ after_ days_ since_ creation - The age in days after creation to tier blob version to archive storage. Must be between 0 and 99999.
- change_
tier_ intto_ cool_ after_ days_ since_ creation - The age in days creation create to tier blob version to cool storage. Must be between 0 and 99999.
- delete_
after_ intdays_ since_ creation - The age in days after creation to delete the blob version. Must be between 0 and 99999.
- change
Tier NumberTo Archive After Days Since Creation - The age in days after creation to tier blob version to archive storage. Must be between 0 and 99999.
- change
Tier NumberTo Cool After Days Since Creation - The age in days creation create to tier blob version to cool storage. Must be between 0 and 99999.
- delete
After NumberDays Since Creation - The age in days after creation to delete the blob version. Must be between 0 and 99999.
ManagementPolicyRuleFilters, ManagementPolicyRuleFiltersArgs
- Blob
Types List<string> - An array of predefined values. Valid options are
blockBlobandappendBlob. -
List<Management
Policy Rule Filters Match Blob Index Tag> - A
match_blob_index_tagblock as defined below. The block defines the blob index tag based filtering for blob objects. - Prefix
Matches List<string> - An array of strings for prefixes to be matched.
- Blob
Types []string - An array of predefined values. Valid options are
blockBlobandappendBlob. -
[]Management
Policy Rule Filters Match Blob Index Tag - A
match_blob_index_tagblock as defined below. The block defines the blob index tag based filtering for blob objects. - Prefix
Matches []string - An array of strings for prefixes to be matched.
- blob
Types List<String> - An array of predefined values. Valid options are
blockBlobandappendBlob. -
List<Management
Policy Rule Filters Match Blob Index Tag> - A
match_blob_index_tagblock as defined below. The block defines the blob index tag based filtering for blob objects. - prefix
Matches List<String> - An array of strings for prefixes to be matched.
- blob
Types string[] - An array of predefined values. Valid options are
blockBlobandappendBlob. -
Management
Policy Rule Filters Match Blob Index Tag[] - A
match_blob_index_tagblock as defined below. The block defines the blob index tag based filtering for blob objects. - prefix
Matches string[] - An array of strings for prefixes to be matched.
- blob_
types Sequence[str] - An array of predefined values. Valid options are
blockBlobandappendBlob. -
Sequence[Management
Policy Rule Filters Match Blob Index Tag] - A
match_blob_index_tagblock as defined below. The block defines the blob index tag based filtering for blob objects. - prefix_
matches Sequence[str] - An array of strings for prefixes to be matched.
- blob
Types List<String> - An array of predefined values. Valid options are
blockBlobandappendBlob. - List<Property Map>
- A
match_blob_index_tagblock as defined below. The block defines the blob index tag based filtering for blob objects. - prefix
Matches List<String> - An array of strings for prefixes to be matched.
ManagementPolicyRuleFiltersMatchBlobIndexTag, ManagementPolicyRuleFiltersMatchBlobIndexTagArgs
Import
Storage Account Management Policies can be imported using the resource id, e.g.
$ pulumi import azure:storage/managementPolicy:ManagementPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Storage/storageAccounts/myaccountname/managementPolicies/default
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi