Skip to content

Instantly share code, notes, and snippets.

@johnlokerse
Created June 12, 2022 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnlokerse/f7f2a3a78c0f48b463ede9c0b367a060 to your computer and use it in GitHub Desktop.
Save johnlokerse/f7f2a3a78c0f48b463ede9c0b367a060 to your computer and use it in GitHub Desktop.
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