我正在尝试连接到使用以下Bicep部署脚本部署的Azure Container App(不是Azure容器示例!):
vnet
resource vnet 'Microsoft.Network/virtualNetworks@2021-08-01' = {
name: vnetName
location: location
properties: {
addressSpace: {
addressPrefixes: [
vnetAddressPrefix
]
}
subnets: [
{
name: subnetName
properties: {
privateEndpointNetworkPolicies: 'Enabled'
addressPrefix: vnetAddressPrefix
}
}
]
}
}
appEnv
resource appEnv 'Microsoft.App/managedEnvironments@2022-10-01' = {
name: containerAppEnvName
location: location
properties: {
vnetConfiguration: {
infrastructureSubnetId: vnet.properties.subnets[0].id
internal: false
}
zoneRedundant: false
}
}
容器应用
resource containerApp 'Microsoft.App/containerApps@2022-10-01' = {
name: containerAppName
location: location
properties: {
environmentId: appEnv.id
configuration: {
secrets: [
{
name: 'password'
value: '...'
}
]
registries: [
{
server: '...'
username: '...'
passwordSecretRef: 'password'
}
]
ingress: {
external: true
targetPort: 7687
exposedPort: 7687
transport: 'tcp'
}
}
template: {
containers: [
{
image: '...'
name: 'neo4j'
env: []
resources: {
cpu: 2
memory: '4Gi'
}
}
]
scale: {
minReplicas: 1
maxReplicas: 1
}
}
}
dependsOn: [
vnet
]
}
这一切都成功了:在Azure Portal中成功创建了所有资源。但是,如果我尝试连接到Azure容器应用程序,则会收到一般的ServiceUnavailable错误:
[error] session error - ServiceUnavailable: Neo4jError: WebSocket connection failure. ...
当我在Azure Portal中查找容器应用程序并选择Ingress
刀片时,我看到了以下内容:
我想尝试选择选项Accept traffic from anywhere
1(屏幕截图中的红色箭头),但无法选择。在Bicep文档中,我找不到容器应用程序环境的参数internalOnly
(在vnetConfiguration
中更改internal: ...
不起作用)。
问题:如何更改Bicep展开脚本以选择Accept traffic from anywhere
?
1我们正处于类似POC的阶段,因此安全性目前不是首要任务。
1条答案
按热度按时间vhmi4jdf1#
我成功地设置了一个具有公共TCP入口的容器应用程序。负责
Accept traffic from anywhere
的设置在容器环境中(vnetConfiguration.internal
必须是false
)。然而,我需要在将此更改为false后删除并重新创建环境,以实际获得所需的更改。这是我的bicep模板: