Azure Resource Manager failing with a "409 Conflict" when creating storage account

2,779 views
Skip to first unread message

Brad Pinter

unread,
Mar 22, 2016, 3:50:13 PM3/22/16
to Terraform
I've been scratching my head long enough on this one that I figure I would reach out to the community.  I'm getting a 409 error when attempting to create an Azure storage account using the resource manager provider.  My suspicion is that I have misconfigured my Azure account somehow.  Any help from the community would be greatly appreciated.  

btw - the example below was pulled directly from the Terraform website (https://www.terraform.io/docs/providers/azurerm/r/storage_account.html).



azurerm_resource_group.testrg: Refreshing state... (ID: /subscriptions/vvvvvvvv-wwww-xxxx-yyyy-zzzzzzzzzzzz/resourceGroups/resourceGroupName)
azurerm_storage_account.testsa: Creating...
  account_type:             "" => "Standard_GRS"
  location:                 "" => "westus"
  name:                     "" => "storageaccountname"
  primary_blob_endpoint:    "" => "<computed>"
  primary_file_endpoint:    "" => "<computed>"
  primary_location:         "" => "<computed>"
  primary_queue_endpoint:   "" => "<computed>"
  primary_table_endpoint:   "" => "<computed>"
  resource_group_name:      "" => "resourceGroupName"
  secondary_blob_endpoint:  "" => "<computed>"
  secondary_location:       "" => "<computed>"
  secondary_queue_endpoint: "" => "<computed>"
  secondary_table_endpoint: "" => "<computed>"
  tags.#:                   "" => "1"
  tags.environment:         "" => "staging"
Error applying plan:

1 error(s) occurred:

* azurerm_storage_account.testsa: Error creating Azure Storage Account 'storageaccountname': autorest:DoErrorUnlessStatusCode 409 PUT https://management.azure.com/subscriptions/vvvvvvvv-wwww-xxxx-yyyy-zzzzzzzzzzzz/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname?api-version=2015-06-15 failed with 409 Conflict

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with any resources that successfully completed. Please address the error above and apply again to incrementally change your infrastructure.

Brad Pinter

unread,
Mar 23, 2016, 10:37:14 AM3/23/16
to Terraform
I solved my own issue.  Apparently, storage account names must be unique...across all of Azure?!?!  To be clear, my assumption was that in a multi-tenant environment uniqueness constraints would be at the subscription level.  Add this to the list of reasons why Azure is so damn painful to use.

Raghav Boorgapally

unread,
Mar 26, 2016, 4:20:24 PM3/26/16
to Terraform
Well you get a domain name with the storage account and therefore the name has to be unique. Storage accounts can contain files that can be made public. So they need a way to have a URI for files in the storage account.
Reply all
Reply to author
Forward
0 new messages