Skip to content

Commit

Permalink
azurerm_api_management_api_diagnostic fix support for identifier `a…
Browse files Browse the repository at this point in the history
…zuremonitor` (#27456)
  • Loading branch information
smokedlinq authored Oct 11, 2024
1 parent 8da4254 commit 0b79486
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,14 @@ func resourceApiManagementApiDiagnosticCreateUpdate(d *pluginsdk.ResourceData, m

parameters := apidiagnostic.DiagnosticContract{
Properties: &apidiagnostic.DiagnosticContractProperties{
LoggerId: d.Get("api_management_logger_id").(string),
OperationNameFormat: pointer.To(apidiagnostic.OperationNameFormat(d.Get("operation_name_format").(string))),
LoggerId: d.Get("api_management_logger_id").(string),
},
}

if d.Get("identifier") == "applicationinsights" {
parameters.Properties.OperationNameFormat = pointer.To(apidiagnostic.OperationNameFormat(d.Get("operation_name_format").(string)))
}

samplingPercentage := d.GetRawConfig().AsValueMap()["sampling_percentage"]
if !samplingPercentage.IsNull() {
parameters.Properties.Sampling = &apidiagnostic.SamplingSettings{
Expand Down

0 comments on commit 0b79486

Please sign in to comment.