Skip to content

Commit 267e4db

Browse files
author
Guy Fankam
committed
Initial commit
1 parent 9ccaaae commit 267e4db

87 files changed

Lines changed: 11375 additions & 14 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,28 @@
33
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
44
"features": {
55
"ghcr.io/devcontainers/features/dotnet:2": {
6-
"version": "8.0",
6+
"version": "10.0-preview",
77
"additionalVersions": "9.0"
88
},
9-
"ghcr.io/devcontainers/features/azure-cli:1": {
10-
"version": "latest",
11-
"installBicep": true
12-
},
9+
"ghcr.io/devcontainers/features/git:1": {},
1310
"ghcr.io/devcontainers/features/powershell:1": {
14-
"version": "latest"
11+
"version": "latest",
12+
"modules": "Az"
1513
},
16-
"ghcr.io/devcontainers/features/git:1": {},
17-
"ghcr.io/devcontainers/features/github-cli:1": {}
14+
"ghcr.io/devcontainers/features/github-cli:1": {},
15+
"ghcr.io/devcontainers/features/azure-cli:1": {}
1816
},
19-
"postCreateCommand": "sh .devcontainer/install.sh",
17+
"postStartCommand": "dotnet tool install --global dotnet-outdated-tool",
2018
"customizations": {
2119
"vscode": {
2220
"extensions": [
23-
"ms-azuretools.vscode-bicep",
2421
"ms-dotnettools.csdevkit",
25-
"ms-azure-devops.azure-pipelines",
2622
"GitHub.vscode-github-actions",
2723
"GitHub.copilot",
28-
"timonwong.shellcheck",
29-
"foxundermoon.shell-format",
24+
"GitHub.copilot-chat",
3025
"redhat.vscode-yaml"
3126
]
3227
}
3328
}
34-
}
29+
30+
}

CHANGELOG.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Change log
2+
3+
## What's new
4+
5+
### Better ID references
6+
7+
#### The problem
8+
Many APIM resources reference others through IDs. For example, here is a diagnostic that references a logger through the `loggerId` property:
9+
```json
10+
{
11+
"properties": {
12+
...
13+
"loggerId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/azuremonitor"
14+
...
15+
}
16+
}
17+
```
18+
19+
If we publish this diagnostic as-is to another APIM instance, the publisher will fail. The logger reference is specific to APIM instance `apimService1` in resource group `rg1` and subscription `00000000-0000-0000-0000-000000000000`. To work around this, we have to edit the JSON or override the publisher configuration to reference the new APIM instance.
20+
21+
#### The solution
22+
Going forward, the extractor will use relative references where possible. In the above scenario, it will write `loggerId: "/loggers/azuremonitor"`. This relative reference will work when publishing across instances.
23+
24+
> [!NOTE]
25+
> This change was manually implemented across resources. We're not aware of a way to ask the APIM REST API to return relative references. Some resources may have been missed. If you'd like to request that we add a missed resource, please raise an issue.
26+
27+
### Nested configuration
28+
We now support nested levels of configuration for the extractor and publisher. This allows the configuration of child resources (e.g. api operations, workspace api diagnostics, etc).
29+
30+
#### Sample extractor configuration
31+
Only operations 1 and 2 will be extracted in api 1. All operations in api 2 will be extracted.
32+
```yaml
33+
apis:
34+
- api1:
35+
operations:
36+
- operation1
37+
- operation2
38+
- api2
39+
...
40+
```
41+
42+
#### Sample publisher configuration
43+
The display name of diagnostic 3 in api 2 in workspace 1 will be overriden with `my display name`.
44+
```yaml
45+
workspaces:
46+
- workspace1:
47+
apis:
48+
- api2:
49+
diagnostics:
50+
- diagnostic3:
51+
properties:
52+
displayName: my display name
53+
...
54+
```
55+
56+
### Empty configuration in extractor
57+
58+
Previously, if we wanted to skip extracting all resources of a type, we had to put a random placeholder value (e.g. `ignore`). We now support the more intuitive `[]`.
59+
60+
#### Before
61+
```yaml
62+
apis: ignore # Workaround to skip extracting all APIs.
63+
```
64+
65+
#### After
66+
````yaml
67+
apis: [] # All APIs will be skipped.
68+
````
69+
70+
## Breaking changes
71+
### New section names in extractor configuration
72+
We've made the section names in the extractor and publisher identical. This provides a more consistent experience and greatly simplifies code maintenance.
73+
#### Before (extractor configuration)
74+
```yaml
75+
apiNames:
76+
- api1
77+
- api2
78+
productNames:
79+
- product1
80+
- product2
81+
```
82+
#### After (extractor configuration)
83+
```yaml
84+
apis:
85+
- api1
86+
- api2
87+
products:
88+
- product1
89+
- product2
90+
```

code.slnx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path="CHANGELOG.md" />
4+
</Folder>
5+
<Project Path="src/aspire/aspire.csproj" />
6+
<Project Path="src/common/common.csproj" />
7+
<Project Path="src/extractor/extractor.csproj" />
8+
<Project Path="src/integration.tests/integration.tests.csproj" />
9+
<Project Path="src/publisher/publisher.csproj" />
10+
</Solution>

src/aspire/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var builder = DistributedApplication.CreateBuilder(args);
2+
3+
builder.AddProject<Projects.integration_tests>("integration-tests");
4+
5+
builder.Build().Run();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"http": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"applicationUrl": "http://localhost:15102",
9+
"environmentVariables": {
10+
"ASPNETCORE_ENVIRONMENT": "Development",
11+
"ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true",
12+
"DOTNET_ENVIRONMENT": "Development",
13+
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19251",
14+
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20213"
15+
}
16+
}
17+
}
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}

src/aspire/aspire.csproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
4+
5+
<PropertyGroup>
6+
<OutputType>Exe</OutputType>
7+
<TargetFramework>net9.0</TargetFramework>
8+
<ImplicitUsings>enable</ImplicitUsings>
9+
<Nullable>enable</Nullable>
10+
<IsAspireHost>true</IsAspireHost>
11+
<UserSecretsId>005123cc-339c-4ba3-a189-a918d08c6467</UserSecretsId>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.4.2" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<ProjectReference Include="..\extractor\extractor.csproj" />
20+
<ProjectReference Include="..\integration.tests\integration.tests.csproj" />
21+
<ProjectReference Include="..\publisher\publisher.csproj" />
22+
</ItemGroup>
23+
24+
</Project>

0 commit comments

Comments
 (0)