Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/storage_account: parsing the account name from either casing #99

Merged
merged 1 commit into from
Jul 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions azurestack/resource_arm_storage_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e
return err
}
storageAccountName := id.Path["storageaccounts"]
// https://github.com/terraform-providers/terraform-provider-azurestack/issues/98
// it appears the casing of the Resource ID's changed in Azure Stack version 1905
// as such we need to confirm both casings
if storageAccountName == "" {
storageAccountName = id.Path["storageAccounts"]
}
resourceGroupName := id.ResourceGroup

accountTier := d.Get("account_tier").(string)
Expand Down Expand Up @@ -441,6 +447,12 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err
}

name := id.Path["storageaccounts"]
// https://github.com/terraform-providers/terraform-provider-azurestack/issues/98
// it appears the casing of the Resource ID's changed in Azure Stack version 1905
// as such we need to confirm both casings
if name == "" {
name = id.Path["storageAccounts"]
}
resGroup := id.ResourceGroup

resp, err := client.GetProperties(ctx, resGroup, name)
Expand Down Expand Up @@ -555,6 +567,12 @@ func resourceArmStorageAccountDelete(d *schema.ResourceData, meta interface{}) e
return err
}
name := id.Path["storageaccounts"]
// https://github.com/terraform-providers/terraform-provider-azurestack/issues/98
// it appears the casing of the Resource ID's changed in Azure Stack version 1905
// as such we need to confirm both casings
if name == "" {
name = id.Path["storageAccounts"]
}
resGroup := id.ResourceGroup

_, err = client.Delete(ctx, resGroup, name)
Expand Down