Azure / Azure/apiops

[BUG] APIM diagnostics App insights publish failed first time, when I publish run pipeline again and select publish all artifact publish is getting success, it will happen every time.

Open
#549 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
448
Forks
247
PR merge metrics
No merged PRs in 30d

Description

### Release version

5.1.3

### Describe the bug

APIM diagnostics App insights publish failed first time, when I publish run pipeline again and select publish all artifact publish is getting success, it will happen every time without making any changes in QA config file and getting below error.

System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/rg-test/providers/Microsoft.ApiManagement/service/ag-int-test/diagnostics/applicationinsights?api-version=2022-04-01-preview failed with status code 412. Content is '{"error":{"code":"PreconditionFailed","message":"Exception of type 'Microsoft.WindowsAzure.ApiManagement.Management.Core.Exceptions.PreconditionFailedException' was thrown.","details":null}}'.

### Expected behavior

without make any changes in QA config file, it should be published.

### Actual behavior

when I approve PR, publish pipeline will start trigger to dev env and it will get success. When I approve changes to QA it's getting failed.
when I run manual trigger and select publish all artifact, publish is getting success. I haven't done any changes in QA env config file before approving PR. I was already configured all loggers and diagnostics inside the QA config file.

Without manual pipeline trigger, changes to go to QA env's.

### Reproduction Steps

Rename App insight name and add newly modified App insight in APIM logger and update it into named values and also update modified appinsights name into QA config file.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.