-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* apim updates * App Config with issue * chore: update container names in publish-images.azcli and create-apim.azcli * cdn
- Loading branch information
1 parent
b6d728e
commit d08db39
Showing
50 changed files
with
801 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
env=dev | ||
grp=az204-$env | ||
grp=az204-m05-containers | ||
loc=westeurope | ||
acr=az204demos$env | ||
imgApi=catalog-service | ||
|
7 changes: 0 additions & 7 deletions
7
demos/07-secure-solutions/03-app-config/demo-01/config-service-api/.azure/config
This file was deleted.
Oops, something went wrong.
10 changes: 6 additions & 4 deletions
10
demos/07-secure-solutions/03-app-config/demo-01/config-service-api/.vscode/launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
demos/07-secure-solutions/03-app-config/demo-01/config-service-api/config-service-api.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>config_service_api</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Azure.Identity" Version="1.8.1" /> | ||
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.4.0" /> | ||
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="5.2.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="5.2.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> | ||
<PackageReference Include="Azure.Identity" Version="1.12.0" /> | ||
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.6.0" /> | ||
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="7.3.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="7.3.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |
25 changes: 25 additions & 0 deletions
25
demos/07-secure-solutions/03-app-config/demo-01/config-service-api/config-service-api.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "config-service-api", "config-service-api.csproj", "{84F9C0BE-1B03-4C0D-A560-10B655B1473E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{84F9C0BE-1B03-4C0D-A560-10B655B1473E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{84F9C0BE-1B03-4C0D-A560-10B655B1473E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{84F9C0BE-1B03-4C0D-A560-10B655B1473E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{84F9C0BE-1B03-4C0D-A560-10B655B1473E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {09D0ED85-1414-4B5B-B8A1-B6D532F38909} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[defaults] | ||
group = az204-m08-apim-dev | ||
sku = FREE | ||
appserviceplan = food-dev | ||
location = westeurope | ||
web = foodcatalogapi-dev | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...apim/demo-01/food-api/.vscode/launch.json → ...mo-01/catalog-service/.vscode/launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
demos/08-apim/demo-01/catalog-service/AppInsights/AILogger.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.ApplicationInsights; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace FoodApp | ||
{ | ||
public class AILogger | ||
{ | ||
private TelemetryClient ai; | ||
private AppConfig config; | ||
|
||
public AILogger(TelemetryClient tc, IConfiguration cfg) | ||
{ | ||
ai = tc; | ||
config = cfg.Get<AppConfig>(); | ||
} | ||
|
||
public void LogEvent(string text, object item, bool logToConsole = false) | ||
{ | ||
string value = Newtonsoft.Json.JsonConvert.SerializeObject(item); | ||
ai.TrackEvent($"Dev - {text}", new Dictionary<string, string> { { text, value } }); | ||
if (logToConsole) Console.WriteLine($"Dev - {text} - {value}"); | ||
} | ||
|
||
public void LogEvent(string text, string param) | ||
{ | ||
var props = new Dictionary<string, string> { { text, param } }; | ||
ai.TrackEvent(text, props); | ||
} | ||
|
||
public void LogEvent(string text, Exception ex) | ||
{ | ||
ai.TrackEvent(text, new Dictionary<string, string> { { "Error", ex.Message } }); | ||
} | ||
|
||
public void LogEvent(string text, Dictionary<string, string> arr) | ||
{ | ||
ai.TrackEvent(text, arr); | ||
} | ||
|
||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
demos/08-apim/demo-01/catalog-service/AppInsights/FoodTelemetryInitializer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.ApplicationInsights.Channel; | ||
using Microsoft.ApplicationInsights.Extensibility; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace FoodApp | ||
{ | ||
public class FoodTelemetryInitializer : ITelemetryInitializer{ | ||
|
||
AppConfig config; | ||
public FoodTelemetryInitializer(IConfiguration iconfig) | ||
{ | ||
config = iconfig.Get<AppConfig>(); | ||
} | ||
|
||
public void Initialize(ITelemetry telemetry) | ||
{ | ||
if (string.IsNullOrEmpty(telemetry.Context.Cloud.RoleName)) | ||
{ | ||
telemetry.Context.Cloud.RoleName = config.Title; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.