Skip to content

Deployment error in Bicep when referencing an existing virtual network in another resource group #78

@v-aswinse

Description

@v-aswinse

bicepparam config used for existing vnet:

param existingVNetSubnetsDefinition = {
existingVNetName: '/subscriptions/9ad6f7f4-b0d6-4d88-a6d1-3fc2257d5583/resourceGroups/rg-exworks-v-aswinse-demo01/providers/Microsoft.Network/virtualNetworks/aivnet01exworks'
useDefaultSubnets: true
}

modified the subnet address prefix in bicep\infra\helpers\setup-subnets-for-vnet\main.bicep.
eg:
var defaultExistingVnetSubnets = [
{
name: 'agent-subnet'
addressPrefix: '192.168.248.0/25'
delegation: 'Microsoft.App/environments'
serviceEndpoints: ['Microsoft.CognitiveServices']
networkSecurityGroupResourceId: !empty(nsgResourceIds.agentNsgResourceId) ? nsgResourceIds.agentNsgResourceId : null
}

Attached the error when we run azd provision.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions