Storage Account

Overview

The Storage Account builder creates storage accounts and their associated containers.

  • Storage Accounts (Microsoft.Storage/storageAccounts)
  • Storage Containers (blobServices/containers)
  • File Shares (fileServices/shares)
  • Queues (Microsoft.Storage/storageAccounts/queueServices/queues)

Builder Keywords

KeywordPurpose
nameSpecifies the name of the storage account
skuSets the SKU of the storage account
add_public_containerAdds a general-purpose public storage container
add_private_containerAdds a general-purpose private storage container
add_blob_containerAdds a general-purpose private blob container
add_file_shareAdds a file share to storage account
add_file_share_with_quotaAdds a file share to storage account with a share quota in Gb
add_queueAdds a queue to the storage account
add_queuesAdds a list of queues to the storage account
use_static_websiteActivates static website host, and uploads the provided local content as a post-deployment task to the storage with the specified index page
static_website_error_pageSpecifies the 404 page to display for static website hosting
enable_data_lakeEnables Azure Data Lake Gen2 support on the storage account
add_lifecycle_policyGiven a rule name, a list of PolicyActions and a list of string filters, creates a lifecycle policy for the storage account

Configuration Members

MemberPurpose
KeyReturns an ARM expression to retrieve the storage account’s primary connection string. Useful for e.g. supplying the connection string to another resource e.g. KeyVault or an app setting in the App Service.
WebsitePrimaryEndpointReturns the Primary endpoint for static website (if enabled).

Helpers

The StorageAccount type contains helper methods to quickly create ARM expressions for Storage Account connection strings.

Example

open Farmer
open Farmer.Builders

let storage = storageAccount {
    name "isaacssuperstorage"
    sku Storage.Premium_LRS
    add_public_container "myPublicContainer"
    add_private_container "myPrivateContainer"
    add_blob_container "myBlobContainer"
    add_file_share "share1"
    add_file_share_with_quota "share2" 1024
    use_static_website "local/path/to/folder/content" "index.html"
    static_website_error_page "error.html"
    enable_data_lake
    add_lifecycle_rule "moveToCool" [ Storage.CoolAfter 30<Days>; Storage.ArchiveAfter 90<Days> ] Storage.NoRuleFilters
    add_lifecycle_rule "cleanup" [ Storage.DeleteAfter 7<Days> ] [ "data/recyclebin" ]
}