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

azurerm_function_app - storage_connection_string can now rotate keys but still a require recreate when changing the account #5645

Conversation

kraihn
Copy link
Contributor

@kraihn kraihn commented Feb 7, 2020

Fixes #5435

@kraihn kraihn force-pushed the bugfix/function-app-storage-credentials branch from fcbcbb6 to 9bb3ce6 Compare February 7, 2020 20:40
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @kraihn

Thanks for this PR :)

I've taken a look through and left a couple of comments inline about the design of this resource - ultimately I'm wondering if it'd be worth splitting the storage_connection_string field into two to be able to apply different rules to each of the segments - WDYT?

Thanks!

@@ -78,7 +78,6 @@ func resourceArmFunctionApp() *schema.Resource {
"storage_connection_string": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Sensitive: true,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whilst this'd work it'd cause a bunch of runtime errors should someone opt to change the account being used - as such I'm wondering if we'd be better to split this field into two:

  1. "storage_account_id" for the ID of the Storage Account in question - which is ForceNew
  2. the "storage account access key" which is either the primary/secondary key and allows updating

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that idea! It makes more sense to me. Should I make this change with 2.0 in mind and remove the old property?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that we are post 2.0 what we will have to do is deprecate the old one and make them conflict.

@@ -869,3 +878,14 @@ func flattenFunctionAppSiteCredential(input *web.UserProperties) []interface{} {

return append(results, result)
}

func getAccountName(storageConnectionString string) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in Golang functions are shared across the entire package - as such this method would probably be better named as:

Suggested change
func getAccountName(storageConnectionString string) string {
func getAccountNameFromStorageConnectionString(storageConnectionString string) string {

@@ -78,7 +78,6 @@ func resourceArmFunctionApp() *schema.Resource {
"storage_connection_string": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Sensitive: true,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that we are post 2.0 what we will have to do is deprecate the old one and make them conflict.

@katbyte
Copy link
Collaborator

katbyte commented Apr 6, 2020

@kraihnm, going to close this in favour of #6304. thanks for opening the PR!

@katbyte katbyte closed this Apr 6, 2020
@ghost
Copy link

ghost commented May 7, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing the azurerm_function_app storage_connection_string causes a recreate when it shouldn't
3 participants