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

App Service/Function App - returning a helpful error when the name is in use #1037

Merged
merged 2 commits into from
Mar 28, 2018

Conversation

tombuildsstuff
Copy link
Contributor

The names used for Function Apps and App Services need to be globally unique. Currently when attempting to create either of these when the name is in use will return the (unclear/unhelpful) error:

Error: Error applying plan:

1 error(s) occurred:

* azurerm_function_app.test: 1 error(s) occurred:

* azurerm_function_app.test: web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=409 -- Original Error: failed request: autorest/azure: Service returned an error.Status=<nil> <nil>

This PR changes these to returning a friendlier error message if the Name specified is in use:

Error: Error applying plan:

1 error(s) occurred:

* azurerm_function_app.test: 1 error(s) occurred:

* azurerm_function_app.test: The name "test" used for the Function App needs to be globally unique and isn't available: Hostname 'test' already exists. Please select a different name.

and for an App Service:

Error: Error applying plan:

1 error(s) occurred:

* azurerm_app_service.test: 1 error(s) occurred:

* azurerm_app_service.test: The name "test" used for the App Service needs to be globally unique and isn't available: Hostname 'test' already exists. Please select a different name.

Fixes #994

@tombuildsstuff tombuildsstuff added this to the 1.3.1 milestone Mar 28, 2018
@tombuildsstuff tombuildsstuff requested a review from a team March 28, 2018 18:37
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.

LGTM

@tombuildsstuff tombuildsstuff merged commit 3fe766b into master Mar 28, 2018
@tombuildsstuff tombuildsstuff deleted the app-function-app-check-name branch March 28, 2018 19:00
tombuildsstuff added a commit that referenced this pull request Mar 28, 2018
@ghost
Copy link

ghost commented Mar 31, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 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.

Failed to Create Resource: azurerm_function_app
2 participants