# AzureNetworkSecurityGroupResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.Network](/reference/api/csharp/aspire.hosting.azure.network.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Network/AzureNetworkSecurityGroupResource.cs)
- Inherits: `AzureProvisioningResource`

Represents an Azure Network Security Group resource.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureNetworkSecurityGroupResource
    : Aspire.Hosting.Azure.AzureProvisioningResource
{
    // ...
}
```

## Remarks

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

## Constructors

- [AzureNetworkSecurityGroupResource(string, Action<AzureResourceInfrastructure>)](/reference/api/csharp/aspire.hosting.azure.network/azurenetworksecuritygroupresource/constructors.md#constructor-string-action-azureresourceinfrastructure) -- Represents an Azure Network Security Group resource.

## Properties

- [Id](/reference/api/csharp/aspire.hosting.azure.network/azurenetworksecuritygroupresource/properties.md#id) : `BicepOutputReference` `get` -- Gets the "id" output reference from the Azure Network Security Group resource.
- [NameOutputReference](/reference/api/csharp/aspire.hosting.azure.network/azurenetworksecuritygroupresource/properties.md#nameoutputreference) : `BicepOutputReference` `get` -- Gets the "name" output reference for the resource.

## Methods

- [AddAsExistingResource(AzureResourceInfrastructure)](/reference/api/csharp/aspire.hosting.azure.network/azurenetworksecuritygroupresource/methods.md#addasexistingresource-azureresourceinfrastructure) : `ProvisionableResource`
