# AzureNetworkSecurityGroupResource

- Module: [Aspire.Hosting.Azure.Network](/reference/api/typescript/aspire.hosting.azure.network.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface AzureNetworkSecurityGroupResource
  extends IAzureResource,
    IResource,
    IResourceWithParameters {
  withSecurityRule(rule: AzureSecurityRule): AzureNetworkSecurityGroupResource;
}
```

## Methods

- [withSecurityRule](/reference/api/typescript/aspire.hosting.azure.network/azurenetworksecuritygroupresource/withsecurityrule.md) -- `method` -- Adds a security rule to the Network Security Group.
    ```typescript
  withSecurityRule(rule: AzureSecurityRule): AzureNetworkSecurityGroupResource
  ```
