> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formae.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Lay down base networking

> An Azure infrastructure pattern, deployed with formae.

The base networking layer that other Azure stacks build on. One forma provisions
the resource group, a virtual network, and a single subnet.

```mermaid theme={"languages":{"custom":["/languages/pkl.json"]}}
flowchart LR
  target["networking-target-azure"]:::tgt

  subgraph stack["azure-networking-eastus"]
    direction LR
    rg["Resource group"]:::res
    vnet["Virtual network"]:::res
    subnet["Subnet"]:::res

    rg --> vnet
    rg --> subnet
    vnet --> subnet
  end

  target --> stack

  classDef tgt fill:#FF8201,stroke:#B25900,color:#ffffff
  classDef res fill:#FFF3E6,stroke:#FF8201,color:#02024B
  style stack fill:#ffffff,stroke:#02024B,stroke-width:2px,stroke-dasharray:6 4,color:#02024B
```

**Deploy.** Apply the example forma. formae orders the resources by their
dependencies automatically, so the resource group comes up before the virtual
network, and the network before the subnet:

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae apply --mode reconcile \
  /opt/pel/formae/examples/formae-plugin-azure/networking/main.pkl
```

**Verify.** Once the command completes, the network is under management:

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae inventory resources --query="type:AZURE::Network::VirtualNetwork"
```

**Tear down.** Remove everything the forma created:

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae destroy \
  /opt/pel/formae/examples/formae-plugin-azure/networking/main.pkl
```

The full forma is in the
[networking example](https://github.com/platform-engineering-labs/formae-plugin-azure/tree/main/examples/networking).
