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

Fixes #1722 - function app's setting read #2111

Merged
merged 3 commits into from Oct 20, 2018
Merged

Fixes #1722 - function app's setting read #2111

merged 3 commits into from Oct 20, 2018

Conversation

DexterPOSH
Copy link
Contributor

@DexterPOSH DexterPOSH commented Oct 18, 2018

PR to fix the read of Function App's settings #1722
It is based on the suggestion in the same email thread. Catching if the response is not found and returning a nil (should it be nil?) or it should be an if-else block like below:

appSettingsResp, err := client.ListApplicationSettings(ctx, resGroup, name)
	if err != nil {
		if utils.ResponseWasNotFound(appSettingsResp.Response) {
			log.Printf("[DEBUG] Application Settings of Function App %q (resource group %q) were not found", name, resGroup)
		} else {
			return fmt.Errorf("Error making Read request on AzureRM Function App AppSettings %q: %+v", name, err)
		}
	}

(Fixes #1722)

@ghost ghost added the size/XS label Oct 18, 2018
@DexterPOSH DexterPOSH changed the title Fixes function app's setting read [WIP] Fixes function app's setting read Oct 18, 2018
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Hi @DexterPOSH,

Thanks for the fix! It's almost there, along with not returning an error when the resource is not found we need to set the ID to nil marking it as missing in terraform. I've left a comment inline with the suggested code.

Once that is added this'll be good to merge 🙂

azurerm/resource_arm_function_app.go Show resolved Hide resolved
@katbyte katbyte added this to the 1.17.1 milestone Oct 19, 2018
@katbyte
Copy link
Collaborator

katbyte commented Oct 19, 2018

(also just a FYI, putting fixes #1722 in the description will cause that issue to be closed when this is merged)

@katbyte katbyte self-assigned this Oct 19, 2018
@DexterPOSH DexterPOSH changed the title [WIP] Fixes function app's setting read Fixes #1722 - function app's setting read Oct 20, 2018
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks for the update @DexterPOSH! LGTM now 👍

@katbyte katbyte merged commit f03182e into hashicorp:master Oct 20, 2018
katbyte added a commit that referenced this pull request Oct 20, 2018
@DexterPOSH DexterPOSH deleted the fix-func-appsetting-read branch October 21, 2018 05:04
@tombuildsstuff
Copy link
Member

hi @DexterPOSH

Just to let you know that this has been released as a part of v1.18 of the AzureRM Provider (the full changelog is available here). You can upgrade to this by specifying the version in the provider block (as shown below) and then running terraform init -upgrade

provider "azurerm" {
  version = "=1.18.0"
}

Thanks!

@ghost
Copy link

ghost commented Mar 6, 2019

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 Mar 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants