> For the complete documentation index, see [llms.txt](https://docs.mechcloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mechcloud.io/cloud-computing/stateless-iac/azure/examples-free-resources/network-interface.md).

# Network Interface

{% hint style="info" %}
**Updated**: February 13, 2026
{% endhint %}

{% hint style="info" %}
These examples assume that linked resources (VNet, Subnet, NSG) already exist in the same resource group.
{% endhint %}

## Creating a NIC with NSG

```yaml
defaults:
  resource_group: rg1

resources:
  - type: "Microsoft.Network/networkInterfaces"
    api_version: "2025-05-01"
    name: nic1
    props:
      network_security_group:
        id: "/providers/Microsoft.Network/networkSecurityGroups/nsg1"
      ip_configurations:
        - name: ipconfig1
          props:
            subnet:
              id: "/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"
```
