Skip to content

Commit

Permalink
Configuration change test
Browse files Browse the repository at this point in the history
  • Loading branch information
Guy Fankam committed Jun 22, 2022
1 parent 0c826cf commit 28e1a09
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 121 deletions.
35 changes: 3 additions & 32 deletions configuration.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
apimServiceName: [your target environment apim instance name goes here]
namedValues:
- name: [name goes here. e.g. environment or SearchEngineBackendURL. It doesn't have to exist in the target environment]
displayName: [display name goes here]
value: [replacement value in the target environment. e.g. name value can be dev in dev environment and prod in the prod environment]
loggers:
- name: [source environment app insight name goes here. e.g. apim-dev-insights]
loggerType: applicationInsights
description: [app insight description goes here]
resourceId: "/subscriptions/[Azure subscription id for the target environment goes here]/resourceGroups/
[resource group name for the target environment goes here]/providers/microsoft.insights/components/
[target environment app insight name goes here. e.g. apim-prod-insights]"
credentials:
instrumentationKey: "destination environment namevalue key for the application insights goes here. You can use the display name to avoid hard coding the key here e.g. {{Logger-Credentials--62390d98217d201158b4bfb3}}.
The assumption is that the namevalue key is already populated in the target environment. This happens automatically when you associate an application insight to your target apim instance"
isBuffered: true
diagnostics:
- name: applicationinsights
verbosity: Error
loggerId: "/subscriptions/[Azure subscription id for the target environment goes here]/resourceGroups/[resource group name for the target environment goes here]
/providers/Microsoft.ApiManagement/service/[apim instance name for the target environment goes here]/loggers/[target environment app insight name goes here. e.g. apim-prod-insights]"
apis:
- name: "[target api version & revision to apply application insights to e.g. 'my-api', 'my-api-v2', 'my-api-v2;rev=2']"
diagnostics:
- name: applicationinsights
verbosity: Error
loggerId: "/subscriptions/[Azure subscription id for the target environment goes here]/resourceGroups/[resource group name for the target environment goes here]
/providers/Microsoft.ApiManagement/service/[apim instance name for the target environment goes here]/loggers/[target environment app insight name goes here. e.g. apim-prod-insights]"





- name: abc
displayName: bcdee
value: efghi
32 changes: 32 additions & 0 deletions tools/code/common/Enumerable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace common;

public static class IEnumerableModule
{
/// <summary>
/// Applies <paramref name="f"/> to <paramref name="enumerable"/> items and filters out
/// null results.
/// </summary>
public static IEnumerable<T2> Choose<T, T2>(this IEnumerable<T> enumerable, Func<T, T2?> f) where T2 : class
{
return from t in enumerable
let t2 = f(t)
where t2 is not null
select t2;
}

/// <summary>
/// Applies <paramref name="f"/> to <paramref name="enumerable"/> items and filters out
/// null results.
/// </summary>
public static IEnumerable<T2> Choose<T, T2>(this IEnumerable<T> enumerable, Func<T, T2?> f) where T2 : struct
{
return from t in enumerable
let t2 = f(t)
where t2 is not null
select t2.Value;
}
}
Loading

0 comments on commit 28e1a09

Please sign in to comment.