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

Feature request: azurerm_api_management_diagnostic #4760

Closed
molinch opened this issue Oct 30, 2019 · 6 comments · Fixed by #7873
Closed

Feature request: azurerm_api_management_diagnostic #4760

molinch opened this issue Oct 30, 2019 · 6 comments · Fixed by #7873

Comments

@molinch
Copy link

molinch commented Oct 30, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently it does not seem to be possible to specify the diagnostic settings for API management
This part was mentioned in #1177 but it seems like it got forgotten

image

New or Affected Resource(s)

  • azurerm_api_management_diagnostic
  • azurerm_api_management_api_diagnostic

Potential Terraform Configuration

Basic settings would be as simple as:

resource "azurerm_api_management_diagnostic" "api_management_diagnostic" {
  logger = "${azurerm_api_management_logger.api_management_logger.name}"
  sampling = 20
  always_log_errors = true
}

But there are optional additional settings as well:
image

References

See the yaml that references diagnostics:
https://github.com/Azure/azure-api-management-devops-resource-kit/blob/master/example/diagnostics/application-insights.template.json

@molinch molinch changed the title api-management-api-diagnostic Feature request: azurerm_api_management_diagnostic Oct 30, 2019
@aqche
Copy link
Contributor

aqche commented Nov 6, 2019

Hi,

I took a crack at adding the azurerm_api_management_diagnostic resource and managed to get it working but since the provider is currently using 2018-01-01 version of the apimanagement service the new resource only really supports enabling and disabling Application Insights.

For Reference:
2018-01-01 Diagnostic Options
2019-01-01 Diagnostic Options

Would it be valuable for me to open a PR with the azurerm_api_management_diagnostic resource using the 2018-01-01 apimanagement service?

Edit: Opened a PR in case it does provide value.

@jeanpaulsmit
Copy link
Contributor

Great feature request, looking for this myself. However, I don't think this should be enabled on APIM level, rather on API level?
Although you can enable it on all API's using the Azure portal, in my view it's a property of an API.
As the logging/diagnostics are going to App Insights, the resource should be called something like api-management-api-appinsights or api-management-api-logger-appinsights to be prepared for additional loggers.

@evertonmc
Copy link
Contributor

Potential Terraform Configuration
Basic settings would be as simple as:

resource "azurerm_api_management_diagnostic" "api_management_diagnostic" {
logger = "${azurerm_api_management_logger.api_management_logger.name}"

What happened to this suggested config?
There is no link between both in the current implementation #6104

@hctv19
Copy link

hctv19 commented Jun 15, 2020

@aqche Hey! I think the the API version in use by the provider has been updated to one of the 2019 versions in a previous PR, so it should be possible to build on the support for the diagnostics resources now. Any chance you'd be able to take another look at some point?

@ghost
Copy link

ghost commented Sep 10, 2020

This has been released in version 2.27.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.27.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Oct 9, 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 as resolved and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants