Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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;*.json" Pack="true" PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Maybe we should just pack the one file we want, that way we don't accidently start including other .json files we don't intend to put in the nupkg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, fixed it

</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/Aspire.Hosting.AppHost/AspireAppHostConfiguration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "object",
"properties": {
"Parameters": {
"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
6 changes: 5 additions & 1 deletion src/Aspire.Hosting.Azure/Aspire.Hosting.Azure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@
<Compile Include="..\Aspire.Hosting\Dcp\Process\ProcessUtil.cs" Link="Provisioning\Utils\ProcessUtil.cs" />
<Compile Include="..\Shared\Cosmos\CosmosConstants.cs" Link="Shared\CosmosConstants.cs" />
</ItemGroup>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) this can be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry, removed it as well

<ItemGroup>
<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
43 changes: 43 additions & 0 deletions src/Aspire.Hosting.Azure/AspireAzureConfigurationSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"type": "object",
"properties": {
"Azure": {
"type": "object",
"properties": {
"SubscriptionId": {
"description": "Azure Subscription Id that will be used to host aspire app",
"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",
"type": "boolean"
},
"Location": {
"description": "Azure Location that will be used to create resources",
"type": "string"
},
"CredentialSource": {
"description": "Shows where to look for Azure credentials",
"enum": [
"AzureCli",
"AzurePowerShell",
"VisualStudio",
"VisualStudioCode",
"AzureDeveloperCli",
"InteractiveBrowser",
"Default"
],
"default": "Default"
}
}
}
}
}
6 changes: 6 additions & 0 deletions src/Aspire.Hosting.Azure/build/Aspire.Hosting.Azure.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only need a .targets file in buildTransitive. We shouldn't need the other 2 targets files. Just move this logic in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, removed all unnecessary ones

<ItemGroup>
<JsonSchemaSegment Include="$(MSBuildThisFileDirectory)..\AspireAzureConfigurationSchema.json"
FilePathPattern="appsettings\..*json" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of times these properties go into "User Secrets", which is a secrets.json file. This is a Regex, so I think we should also add secrets.json to it. @alexgav - did we ever hook up the FilePathPattern correctly in VS?

Suggested change
FilePathPattern="appsettings\..*json" />
FilePathPattern="appsettings\..*json|secrets.json" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to add it, but it didn't work for me. So I skipped for now

</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="..\build\Aspire.Hosting.Azure.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="..\build\Aspire.Hosting.Azure.targets" />
</Project>