# AzureNetworkSecurityGroupResource Constructors

- Package: [Aspire.Hosting.Azure.Network](/reference/api/csharp/aspire.hosting.azure.network.md)
- Type: [AzureNetworkSecurityGroupResource](/reference/api/csharp/aspire.hosting.azure.network/azurenetworksecuritygroupresource.md)
- Kind: `Constructors`
- Members: `1`

Represents an Azure Network Security Group resource.

## AzureNetworkSecurityGroupResource(string, Action<AzureResourceInfrastructure>)

- Name: `Constructor(string, Action<AzureResourceInfrastructure>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Network/AzureNetworkSecurityGroupResource.cs#L20-L34)

Represents an Azure Network Security Group resource.

```csharp
public class AzureNetworkSecurityGroupResource
{
    public AzureNetworkSecurityGroupResource(
        string name,
        Action<AzureResourceInfrastructure> configureInfrastructure)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `configureInfrastructure` (`Action<AzureResourceInfrastructure>`)
  Callback to configure the Azure Network Security Group resource.

## Remarks

A Network Security Group contains security rules that control inbound and outbound network traffic. Use `AzureProvisioningResourceExtensions.ConfigureInfrastructure` to configure specific `Azure.Provisioning` properties.
