-
Notifications
You must be signed in to change notification settings - Fork 5k
Private endpoint support for container apps #2322
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
Merged
Merged
Changes from 27 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
6fac970
Configure Azure Developer Pipeline
pamelafox adf0353
Merge branch 'main' of https://github.com/pamelafox/azure-search-open…
pamelafox 402e818
Merge branch 'main' of https://github.com/pamelafox/azure-search-open…
pamelafox f33af14
Merge branch 'main' of https://github.com/pamelafox/azure-search-open…
pamelafox b16fd31
Private endpoints draft
pamelafox 7ad962a
Conditional for SPL
pamelafox 7a82bde
private endpoint for ACA
pamelafox ee758e5
Merge branch 'main' into acaprivate
pamelafox 0f18906
Add P2S VPN gateway and other improvements
pamelafox b754767
Merge branch 'main' into acaprivate
pamelafox ced5983
Private endpoint almost working
pamelafox abb00aa
Usving avm for the subnets
pamelafox 4b3eb2a
Connected app to vnet
pamelafox ba69870
Feedback from Matt
pamelafox eac9f9d
Move resources into modules
pamelafox 4b3cd8c
Bring back unneeded changes
pamelafox 7c0147a
Update prepdocs with ping and update docs
pamelafox bbd145a
Merge branch 'main' into acaprivate
pamelafox d1f1de8
Fix VPN client link
pamelafox ebecb05
Merge branch 'acaprivate' of https://github.com/pamelafox/azure-searc…
pamelafox 5a92db1
Add App Service private endpoint for deployment
pamelafox d7f070b
Revert unneeded bicep changes
pamelafox 0d0abb0
Revert unneeded changes
pamelafox 8aaf0c0
Remove unneeded NSG rules
pamelafox fc628e4
Address feedback from Copilot
pamelafox a426a3a
Address feedback from Copilot
pamelafox a46875b
Address Copilot feedback
pamelafox 287aa0e
Update NSG, container registry
pamelafox c2509d0
Update NSG, container registry
pamelafox ee8a447
Address feedback
pamelafox 6ec8a2f
Bring back workload profile name
pamelafox 4dc3570
Merge branch 'main' into acaprivate
pamelafox c429d92
Merge branch 'main' into acaprivate
pamelafox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,59 @@ | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
|
||
param daprEnabled bool = false | ||
param logAnalyticsWorkspaceName string = '' | ||
param applicationInsightsName string = '' | ||
|
||
param subnetResourceId string | ||
|
||
param usePrivateIngress bool = true | ||
|
||
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2025-02-02-preview' = { | ||
name: name | ||
location: location | ||
tags: tags | ||
properties: { | ||
// We can't use a conditional here due to an issue with the Container Apps ARM parsing | ||
appLogsConfiguration: { | ||
destination: 'log-analytics' | ||
logAnalyticsConfiguration: { | ||
customerId: logAnalyticsWorkspace.properties.customerId | ||
sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey | ||
} | ||
} | ||
daprAIInstrumentationKey: daprEnabled && !empty(applicationInsightsName) ? applicationInsights.properties.InstrumentationKey : '' | ||
publicNetworkAccess: usePrivateIngress ? 'Disabled' : 'Enabled' | ||
vnetConfiguration: usePrivateIngress ? { | ||
infrastructureSubnetId: subnetResourceId | ||
internal: true | ||
} : null | ||
workloadProfiles: usePrivateIngress | ||
? [ | ||
{ | ||
name: 'Consumption' | ||
workloadProfileType: 'Consumption' | ||
} | ||
{ | ||
name: 'Warm' | ||
workloadProfileType: 'D4' | ||
minimumCount: 1 | ||
maximumCount: 3 | ||
} | ||
] | ||
: [] | ||
} | ||
} | ||
|
||
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = if (!empty(logAnalyticsWorkspaceName)) { | ||
name: logAnalyticsWorkspaceName | ||
} | ||
|
||
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = if (daprEnabled && !empty(applicationInsightsName)){ | ||
name: applicationInsightsName | ||
} | ||
|
||
output defaultDomain string = containerAppsEnvironment.properties.defaultDomain | ||
output name string = containerAppsEnvironment.name | ||
output resourceId string = containerAppsEnvironment.id |
This file contains hidden or 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,78 +1,46 @@ | ||
metadata description = 'Creates an Azure Container Registry and an Azure Container Apps environment.' | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
|
||
param containerAppsEnvironmentName string | ||
param containerRegistryName string | ||
param containerRegistryResourceGroupName string = '' | ||
param containerRegistryAdminUserEnabled bool = false | ||
param logAnalyticsWorkspaceResourceId string | ||
param applicationInsightsName string = '' // Not used here, was used for DAPR | ||
param virtualNetworkSubnetId string = '' | ||
@allowed(['Consumption', 'D4', 'D8', 'D16', 'D32', 'E4', 'E8', 'E16', 'E32', 'NC24-A100', 'NC48-A100', 'NC96-A100']) | ||
param workloadProfile string | ||
param logAnalyticsWorkspaceName string = '' | ||
param applicationInsightsName string = '' | ||
|
||
var workloadProfiles = workloadProfile == 'Consumption' | ||
? [ | ||
{ | ||
name: 'Consumption' | ||
workloadProfileType: 'Consumption' | ||
} | ||
] | ||
: [ | ||
{ | ||
name: 'Consumption' | ||
workloadProfileType: 'Consumption' | ||
} | ||
{ | ||
minimumCount: 0 | ||
maximumCount: 2 | ||
name: workloadProfile | ||
workloadProfileType: workloadProfile | ||
} | ||
] | ||
@description('Virtual network name for container apps environment.') | ||
param vnetName string = '' | ||
@description('Subnet name for container apps environment integration.') | ||
param subnetName string = '' | ||
|
||
@description('Optional user assigned identity IDs to assign to the resource') | ||
param userAssignedIdentityResourceIds array = [] | ||
param subnetResourceId string = '' | ||
|
||
module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.8.0' = { | ||
param usePrivateIngress bool = true | ||
|
||
module containerAppsEnvironment 'container-apps-environment.bicep' = { | ||
name: '${name}-container-apps-environment' | ||
params: { | ||
// Required parameters | ||
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspaceResourceId | ||
|
||
managedIdentities: empty(userAssignedIdentityResourceIds) ? { | ||
systemAssigned: true | ||
} : { | ||
userAssignedResourceIds: userAssignedIdentityResourceIds | ||
} | ||
|
||
name: containerAppsEnvironmentName | ||
// Non-required parameters | ||
infrastructureResourceGroupName: containerRegistryResourceGroupName | ||
infrastructureSubnetId: virtualNetworkSubnetId | ||
location: location | ||
tags: tags | ||
zoneRedundant: false | ||
workloadProfiles: workloadProfiles | ||
logAnalyticsWorkspaceName: logAnalyticsWorkspaceName | ||
applicationInsightsName: applicationInsightsName | ||
usePrivateIngress: usePrivateIngress | ||
subnetResourceId: subnetResourceId | ||
} | ||
} | ||
|
||
module containerRegistry 'br/public:avm/res/container-registry/registry:0.5.1' = { | ||
module containerRegistry 'container-registry.bicep' = { | ||
name: '${name}-container-registry' | ||
scope: resourceGroup(!empty(containerRegistryResourceGroupName) ? containerRegistryResourceGroupName : resourceGroup().name) | ||
params: { | ||
name: containerRegistryName | ||
location: location | ||
acrAdminUserEnabled: containerRegistryAdminUserEnabled | ||
tags: tags | ||
useVnet: !empty(vnetName) | ||
} | ||
} | ||
|
||
output defaultDomain string = containerAppsEnvironment.outputs.defaultDomain | ||
output environmentName string = containerAppsEnvironment.outputs.name | ||
output environmentId string = containerAppsEnvironment.outputs.resourceId | ||
|
||
output registryLoginServer string = containerRegistry.outputs.loginServer | ||
output registryName string = containerRegistry.outputs.name |
This file contains hidden or 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,38 @@ | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
|
||
param adminUserEnabled bool = true | ||
param anonymousPullEnabled bool = false | ||
param dataEndpointEnabled bool = false | ||
param encryption object = { | ||
status: 'disabled' | ||
} | ||
param networkRuleBypassOptions string = 'AzureServices' | ||
param publicNetworkAccess string = useVnet ? 'Disabled' : 'Enabled' // Public network access is disabled if VNet integration is enabled | ||
param useVnet bool = false // Determines if VNet integration is enabled | ||
param sku object = { | ||
name: useVnet ? 'Premium' : 'Standard' // Use Premium if VNet is required, otherwise Standard | ||
} | ||
param zoneRedundancy string = 'Disabled' | ||
|
||
// 2022-02-01-preview needed for anonymousPullEnabled | ||
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' = { | ||
name: name | ||
location: location | ||
tags: tags | ||
sku: sku | ||
properties: { | ||
adminUserEnabled: adminUserEnabled | ||
anonymousPullEnabled: anonymousPullEnabled | ||
dataEndpointEnabled: dataEndpointEnabled | ||
encryption: encryption | ||
networkRuleBypassOptions: networkRuleBypassOptions | ||
publicNetworkAccess: publicNetworkAccess | ||
zoneRedundancy: zoneRedundancy | ||
} | ||
} | ||
|
||
output loginServer string = containerRegistry.properties.loginServer | ||
output name string = containerRegistry.name | ||
output resourceId string = containerRegistry.id |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.