Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close #2636: added json schemas for Aspire.Hosting.AppHost and Aspire.Hosting.Azure #4912

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Aspire.Hosting.AppHost/Aspire.Hosting.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<None Include="**/*.props;**/*.targets" Pack="true" PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="**/*.props;**/*.targets;AspireAppHostConfiguration.json" Pack="true" PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions src/Aspire.Hosting.AppHost/AspireAppHostConfiguration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "object",
"properties": {
"Parameters": {
"description": ".NET Aspire parameter configuration. A parameter's value will be retrieved from the property with the same name.",
"type": "object"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<ProjectCapability Include="Aspire" Condition=" '$(IsAspireHost)' == 'true' " />
</ItemGroup>

<ItemGroup>
<JsonSchemaSegment Include="$(MSBuildThisFileDirectory)..\AspireAppHostConfiguration.json"
FilePathPattern="appsettings\..*json" />
</ItemGroup>

<Target Name="_CreateAspireProjectResources">

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/Aspire.Hosting.Azure/Aspire.Hosting.Azure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<EmbeddedResource Include="Bicep\*.bicep" />
</ItemGroup>

<ItemGroup>
<None Include="**/*.targets;AspireAzureConfigurationSchema.json" Pack="true" PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Aspire.Hosting\Aspire.Hosting.csproj" />
<PackageReference Include="System.IO.Hashing" />
Expand Down
44 changes: 44 additions & 0 deletions src/Aspire.Hosting.Azure/AspireAzureConfigurationSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"type": "object",
"properties": {
"Azure": {
"description": "Azure provisioning information. This section is used to create Azure resources for the app.",
"type": "object",
"properties": {
"SubscriptionId": {
"description": "Azure Subscription Id that will be used to host the resources.",
"type": "string"
},
"ResourceGroup": {
"description": "Azure Resource Group name where to create resources.",
"type": "string"
},
"ResourceGroupPrefix": {
"description": "Azure Resource Group prefix used in resource groups names created.",
"type": "string"
},
"AllowResourceGroupCreation": {
"description": "Flag that shows if it is allowed to create a resource group if not exists. Defaults to false if ResourceGroup is provided.",
"type": "boolean"
},
"Location": {
"description": "Azure Location that will be used to create resources.",
"type": "string"
},
"CredentialSource": {
"description": "Configures which Azure credential to use for provisioning.",
"enum": [
"AzureCli",
"AzurePowerShell",
"VisualStudio",
"VisualStudioCode",
"AzureDeveloperCli",
"InteractiveBrowser",
"Default"
],
"default": "Default"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<ItemGroup>
<JsonSchemaSegment Include="$(MSBuildThisFileDirectory)..\AspireAzureConfigurationSchema.json"
FilePathPattern="appsettings\..*json" />
</ItemGroup>
</Project>