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_api_management_diagnostic - the operation_name_format property is only available for applicationinsights diagnostic #23736

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

sinbai
Copy link
Contributor

@sinbai sinbai commented Oct 31, 2023

Although PR #22545 was submitted to fix #19970, no response was received from the submitter for a long time. Since we received request from users to fix this issue, submitting this PR to fix it.

Copy link
Member

@stephybun stephybun 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 this PR @sinbai. Some of the changes still need to be wrapped in the 4.0 flag. Once that's done I can take another look over.

Comment on lines 160 to 166
if d.Get("identifier") == "applicationinsights" {
if operationNameFormat, ok := d.GetOk("operation_name_format"); ok {
parameters.Properties.OperationNameFormat = pointer.To(diagnostic.OperationNameFormat(operationNameFormat.(string)))
} else {
parameters.Properties.OperationNameFormat = pointer.To(diagnostic.OperationNameFormatName)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This should also be wrapped in the 4.0 flag since after 4.0 we don't want to be sending diagnostic.OperationNameFormatName is operation_name_format is omitted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -259,7 +272,7 @@ func resourceApiManagementDiagnosticRead(d *pluginsdk.ResourceData, meta interfa
d.Set("backend_request", nil)
d.Set("backend_response", nil)
}
format := string(diagnostic.OperationNameFormatName)
format := ""
Copy link
Member

Choose a reason for hiding this comment

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

Same here, pre 4.0 we should still be defaulting this in the read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@sinbai
Copy link
Contributor Author

sinbai commented Nov 1, 2023

Thanks for this PR @sinbai. Some of the changes still need to be wrapped in the 4.0 flag. Once that's done I can take another look over.

Hi @stephybun thanks for your time. The code has been updated. Could you please take another look?

@github-actions github-actions bot added size/XS and removed size/S labels Nov 1, 2023
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @sinbai. There was some misunderstanding around my comment about the wrapping so I pushed a simplification. I'll be more specific with my suggestions next time. LGTM 🥟

@stephybun stephybun merged commit 1a075a9 into hashicorp:main Nov 1, 2023
21 checks passed
@github-actions github-actions bot added this to the v3.79.0 milestone Nov 1, 2023
stephybun added a commit that referenced this pull request Nov 2, 2023
dduportal pushed a commit to jenkins-infra/azure that referenced this pull request Nov 6, 2023
<Actions>
<action
id="f410411e63aff4bb73a81c2aec1d373cf8a903e63b30dee2006b0030d8a94cc8">
        <h3>Bump Terraform `azurerm` provider version</h3>
<details
id="1d9343c012f5434ac9fe8a98135bae3667b399259be16d9b14302ea3bd424a24">
            <summary>Update Terraform lock file</summary>
<p>&#34;hashicorp/azurerm&#34; updated from &#34;3.77.0&#34; to
&#34;3.79.0&#34; in file &#34;.terraform.lock.hcl&#34;</p>
            <details>
                <summary>3.79.0</summary>
<pre>Changelog retrieved
from:&#xA;&#x9;https://github.com/hashicorp/terraform-provider-azurerm/releases/tag/v3.79.0&#xA;ENHANCEMENTS:&#xA;&#xA;*
provider: log instead of error when RPs are unavailable when validating
RP registrations
([#23380](hashicorp/terraform-provider-azurerm#23380
`azurerm_arc_kuberenetes_cluster_extension_resource` - the `version` and
`release_train` properties can now be set simultaneously
([#23692](hashicorp/terraform-provider-azurerm#23692
`azurerm_container_apps` - support for the `ingress.exposed_port`
property
([#23752](hashicorp/terraform-provider-azurerm#23752
`azurerm_cosmosdb_postgresql_cluster` - read replica clusters can be
created without specifying `administrator_login_password` property
([#23750](hashicorp/terraform-provider-azurerm#23750
`azurerm_managed_application` - arrays can be supplied in the
`parameter_values` property
([#23754](hashicorp/terraform-provider-azurerm#23754
`azurerm_storage_management_policy` - support for properties
`rule.*.actions.*.base_blob.0.tier_to_cold_after_days_since_{modification|last_access_time|creation}_greater_than
and
rule.*.actions.*.{snapshot|version}.0.tier_to_cold_after_days_since_creation_greater_than`
([#23574](https://github.com/hashicorp/terraform-provider-azurerm/issues/23574))&#xA;&#xA;BUG
FIXES:&#xA;&#xA;* `azurerm_api_management_diagnostic` - the
`operation_name_format` attribute will only be sent if `identifier` is
set to `applicationinsights`
([#23736](hashicorp/terraform-provider-azurerm#23736
`azurerm_backup_policy_vm` - fix payload by using current datetime
([#23586](hashicorp/terraform-provider-azurerm#23586
`azurerm_kubernetes_cluster` - the `custom_ca_trust_certificates_base64`
property can not be removed, only updated
([#23737](https://github.com/hashicorp/terraform-provider-azurerm/issues/23737))&#xA;&#xA;&#xA;</pre>
            </details>
        </details>
    </action>
</Actions>

---

<table>
  <tr>
    <td width="77">
<img src="https://www.updatecli.io/images/updatecli.png" alt="Updatecli
logo" width="50" height="50">
    </td>
    <td>
      <p>
Created automatically by <a
href="https://www.updatecli.io/">Updatecli</a>
      </p>
      <details><summary>Options:</summary>
        <br />
<p>Most of Updatecli configuration is done via <a
href="https://www.updatecli.io/docs/prologue/quick-start/">its
manifest(s)</a>.</p>
        <ul>
<li>If you close this pull request, Updatecli will automatically reopen
it, the next time it runs.</li>
<li>If you close this pull request and delete the base branch, Updatecli
will automatically recreate it, erasing all previous commits made.</li>
        </ul>
        <p>
Feel free to report any issues at <a
href="https://github.com/updatecli/updatecli/issues">github.com/updatecli/updatecli</a>.<br
/>
If you find this tool useful, do not hesitate to star <a
href="https://github.com/updatecli/updatecli/stargazers">our GitHub
repository</a> as a sign of appreciation, and/or to tell us directly on
our <a
href="https://matrix.to/#/#Updatecli_community:gitter.im">chat</a>!
        </p>
      </details>
    </td>
  </tr>
</table>

Co-authored-by: Jenkins Infra Bot (updatecli) <[email protected]>
@sinbai sinbai deleted the apim/fix_issue_19970 branch March 28, 2024 02:44
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2024
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.

For azurerm_api_management_diagnostic, Event Hub Configuration not working
2 participants