[BUG] Policy fragment referenced in an API Policy from Lower Environment is not synced to Upper Environment
See original GitHub issueRelease version
APIOps Toolkit for Azure APIM Release 3.0.1
Describe the bug
When using an existing Policy Fragment in an API Policy, that association is not being synced by the time I run the Publisher Pipeline.
When running the Extractor pipeline, I am getting what is shown below:
When running the Publisher pipeline, I am getting the error below:
crit: Publisher[0] System.ArgumentException: An element with the same key but a different value already exists. Key: 'Put' at System.Collections.Immutable.ImmutableDictionary
2.HashBucket.Add(TKey key, TValue value, IEqualityComparer1 keyOnlyComparer, IEqualityComparer
1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result)
at System.Collections.Immutable.ImmutableDictionary2.AddRange(IEnumerable
1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
at System.Collections.Immutable.ImmutableDictionary2.AddRange(IEnumerable
1 pairs, Boolean avoidToHashMap)
at System.Collections.Immutable.ImmutableDictionary2.AddRange(IEnumerable
1 pairs)
at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable1 source, Func
2 keySelector, Func2 elementSelector, IEqualityComparer
1 keyComparer, IEqualityComparer1 valueComparer) at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector)
at publisher.Publisher.GetCommitIdFiles(CommitId commitId)
at publisher.Publisher.RunWithCommitId(CommitId commitId, CancellationToken cancellationToken)
at publisher.Publisher.Run(CancellationToken cancellationToken)
at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken)
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down…
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
`
Expected behavior
Extractor pipeline should extract the updated configuration and detect the existing Policy Fragment is being used in API Policy. Publisher pipeline should detect that change and sync to Upper Environment.
Actual behavior
The Extractor detects the change as shown in the image from the description. The Publisher pipelines fails in the stage “Run publisher for Dev environment”.
Reproduction Steps
-
Take an existing policy fragment name (E.G. “ForwardContext”), and associate it to a API Policy with the proper command
<include-fragment fragment-id="ForwardContext" />
-
Run the Extractor and Publisher pipelines and you will receive that error.
Issue Analytics
- State:
- Created 9 months ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Hi @waelkdouh! Tested today with 4.1.0. It seems to be solved, thanks!!
Any update on this?