-
Notifications
You must be signed in to change notification settings - Fork 418
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
Generate ACA app infrastructure #2965
base: main
Are you sure you want to change the base?
Conversation
var resourceToken = uniqueString(resourceGroup().id) | ||
|
||
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = { | ||
name: 'law-${resourceToken}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these "global" resources I wonder if we need some concept of the app name which we can then use when generating these resource names.
src/Aspire.Hosting.Azure/Provisioning/Provisioners/AzureContainerAppsInfastructure.cs
Show resolved
Hide resolved
...ground/AzureStorageEndToEnd/AzureStorageEndToEnd.AppHost/aspire-dashboard-containerapp.bicep
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure/Provisioning/Provisioners/AzureContainerAppsInfastructure.cs
Outdated
Show resolved
Hide resolved
7dddef8
to
0f0cd91
Compare
// REVIEW: Is this correct? | ||
var anyHttp2 = http.Any(e => e.Transport == "http2") || https.Any(e => e.Transport == "http2"); | ||
var external = http.Any(e => e.IsExternal) || https.Any(e => e.IsExternal); | ||
var containerPort = resource is ProjectResource ? 8080 : 80; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on how we'd support <ContainerPort>
? https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container?pivots=dotnet-8-0#containerport
Is that something AZD will need to check for when it runs MSBuild or should our targets be injecting that value in to the assembly so we can get at it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this will need some thought. It can either be passed into the app or declared on the endpoint (which is probably cleaner but duplicative).
src/Aspire.Hosting.Azure/Provisioning/Provisioners/AzureContainerAppsInfastructure.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure/Provisioning/Provisioners/AzureContainerAppsInfastructure.cs
Outdated
Show resolved
Hide resolved
82c7311
to
14a2647
Compare
// ACA can't handle > 5 additional ports so throw if that's the case here | ||
if (endpointsByContainerPort.Count > 5) | ||
{ | ||
throw new NotSupportedException("More than 5 additional ports are not supported. See https://learn.microsoft.com/en-us/azure/container-apps/ingress-overview#tcp for more details."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new NotSupportedException("More than 5 additional ports are not supported. See https://learn.microsoft.com/en-us/azure/container-apps/ingress-overview#tcp for more details."); | |
throw new NotSupportedException("More than 5 additional ports are not supported. See https://learn.microsoft.com/azure/container-apps/ingress-overview#tcp for more details."); |
} | ||
|
||
// Add additional ports | ||
// https://learn.microsoft.com/en-us/azure/container-apps/ingress-how-to?pivots=azure-cli#use-additional-tcp-ports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// https://learn.microsoft.com/en-us/azure/container-apps/ingress-how-to?pivots=azure-cli#use-additional-tcp-ports | |
// https://learn.microsoft.com/azure/container-apps/ingress-how-to?pivots=azure-cli#use-additional-tcp-ports |
src/Aspire.Hosting.Azure/Provisioning/Provisioners/AzureContainerAppsInfastructure.cs
Outdated
Show resolved
Hide resolved
1f2a174
to
bcd43f6
Compare
if (executionContext.IsPublishMode) | ||
{ | ||
// TODO: Let the user pick what this is, for now just hard code azure container apps | ||
await new AzureContainerAppsInfastructure(executionContext).GenerateAdditionalInfrastructureAsync(appModel, cancellationToken).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that we'll want a model where we can choose per app/resource. This is fine for a x.1 release though. Just pointing to the horizon from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to enable that for functions, for sure, but that can't be the default mode.
@@ -9,6 +9,9 @@ param keyVaultName string | |||
@description('') | |||
param principalId string | |||
|
|||
@description('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to regen your manifests after my merge of #3135
e54bb3b
to
54b2c7c
Compare
6c8ebbd
to
cdae1db
Compare
64849de
to
9298ebb
Compare
Regen manifest Prep for multiple tcp ports PR feedback Rules? Fixes Moar fixes Made the endpoint mapping more robust - Added container app context that has a reference to all of the processing contexts. It will handle caching processing contexts. - Resovle host and port based on endpoint mappings Fix bug with additional mapping Move everything to the contexts - Rename ProcessingContext to ContainerAppContext. Make everything private Fixed the formatting More gen Better formatting Full bicep gen Better parameter names More gen Updates Fix formatting Pick the first one Don't throw if there are more than 5 additional endpoints Do port allocation in the bicep generation Fixes Order by group index. Fix and skip a test Fixed test Added target port resolution Fix AI resource Fixed AppInsights issues, deleted old files
9298ebb
to
39c458c
Compare
- Bring to parity with azd logic
Making progress on Azure/azure-dev#3292
Microsoft Reviewers: Open in CodeFlow