Microsoft.Storage storageAccounts/blobServices 2021-01-01

Template format

To create a Microsoft.Storage/storageAccounts/blobServices resource, add the following JSON to the resources section of your template.

{
  "name": "default",
  "type": "Microsoft.Storage/storageAccounts/blobServices",
  "apiVersion": "2021-01-01",
  "properties": {
    "cors": {
      "corsRules": [
        {
          "allowedOrigins": [
            "string"
          ],
          "allowedMethods": [
            "string"
          ],
          "maxAgeInSeconds": "integer",
          "exposedHeaders": [
            "string"
          ],
          "allowedHeaders": [
            "string"
          ]
        }
      ]
    },
    "defaultServiceVersion": "string",
    "deleteRetentionPolicy": {
      "enabled": "boolean",
      "days": "integer"
    },
    "isVersioningEnabled": "boolean",
    "automaticSnapshotPolicyEnabled": "boolean",
    "changeFeed": {
      "enabled": "boolean",
      "retentionInDays": "integer"
    },
    "restorePolicy": {
      "enabled": "boolean",
      "days": "integer"
    },
    "containerDeleteRetentionPolicy": {
      "enabled": "boolean",
      "days": "integer"
    },
    "lastAccessTimeTrackingPolicy": {
      "enable": "boolean",
      "name": "AccessTimeTracking",
      "trackingGranularityInDays": "integer",
      "blobType": [
        "string"
      ]
    }
  },
  "resources": []
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Storage/storageAccounts/blobServices object

Note

In Bicep, type and apiVersion are specified in the first line of the resource declaration. Use the format <type>@<apiVersion>. Don't set those properties in the resource body.

Name Type Required Value
name enum Yes The name of the blob Service within the specified storage account. Blob Service Name must be 'default' - default
type enum Yes For JSON -blobServices
-or-
Microsoft.Storage/storageAccounts/blobServices

See Set name and type for child resources.
apiVersion enum Yes For JSON - 2021-01-01
properties object Yes The properties of a storage account’s Blob service. - BlobServicePropertiesProperties object
resources array No containers

BlobServicePropertiesProperties object

Name Type Required Value
cors object No Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. - CorsRules object
defaultServiceVersion string No DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions.
deleteRetentionPolicy object No The blob service properties for blob soft delete. - DeleteRetentionPolicy object
isVersioningEnabled boolean No Versioning is enabled if set to true.
automaticSnapshotPolicyEnabled boolean No Deprecated in favor of isVersioningEnabled property.
changeFeed object No The blob service properties for change feed events. - ChangeFeed object
restorePolicy object No The blob service properties for blob restore policy. - RestorePolicyProperties object
containerDeleteRetentionPolicy object No The blob service properties for container soft delete. - DeleteRetentionPolicy object
lastAccessTimeTrackingPolicy object No The blob service property to configure last access time based tracking policy. - LastAccessTimeTrackingPolicy object

CorsRules object

Name Type Required Value
corsRules array No The List of CORS rules. You can include up to five CorsRule elements in the request. - CorsRule object

DeleteRetentionPolicy object

Name Type Required Value
enabled boolean No Indicates whether DeleteRetentionPolicy is enabled.
days integer No Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.

ChangeFeed object

Name Type Required Value
enabled boolean No Indicates whether change feed event logging is enabled for the Blob service.
retentionInDays integer No Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). A null value indicates an infinite retention of the change feed.

RestorePolicyProperties object

Name Type Required Value
enabled boolean Yes Blob restore is enabled if set to true.
days integer No how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days.

LastAccessTimeTrackingPolicy object

Name Type Required Value
enable boolean Yes When set to true last access time based tracking is enabled.
name enum No Name of the policy. The valid value is AccessTimeTracking. This field is currently read only. - AccessTimeTracking
trackingGranularityInDays integer No The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This field is currently read only with value as 1
blobType array No An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only - string

CorsRule object

Name Type Required Value
allowedOrigins array Yes Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains - string
allowedMethods array Yes Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. - DELETE, GET, HEAD, MERGE, POST, OPTIONS, PUT
maxAgeInSeconds integer Yes Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response.
exposedHeaders array Yes Required if CorsRule element is present. A list of response headers to expose to CORS clients. - string
allowedHeaders array Yes Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. - string

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Azure Cloud Shell - VNet storage

Deploy to Azure
This template deploys Azure Cloud Shell storage into an Azure virtual network.