Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
param parVnetObject object
param parNsgObject object
param parNicObject object
resource resVirtualNetwork 'Microsoft.Network/virtualNetworks@2021-08-01' existing = {
name: parVnetObject.name
}
resource resNetworkSecurityGroup 'Microsoft.Network/networkSecurityGroups@2021-08-01' = {
name: parNsgObject.Name
properties: {
securityRules: parNsgObject.securityRules
}
}
resource resNic 'Microsoft.Network/networkInterfaces@2021-08-01' = {
name: parNicObject.name
properties:{
ipConfigurations: [
{
name: 'ipconfig1'
properties: {
subnet: resVirtualNetwork.properties.subnets[0]
}
}
]
networkSecurityGroup: {
id: resNetworkSecurityGroup.id
}
}
}
output outNicId string = resNic.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment