# AzureNspAccessRule

- 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/AzureNspAccessRule.cs)

Represents an access rule configuration for an Azure Network Security Perimeter.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public sealed class AzureNspAccessRule
{
    // ...
}
```

## ATS metadata

### ATS DTO

- Serialized as a plain JSON object without a `$type` discriminator.

## Remarks

Access rules control how traffic flows into and out of the network security perimeter. Inbound rules specify which external sources (IP ranges or subscriptions) can access resources within the perimeter. Outbound rules specify which external destinations (FQDNs) resources within the perimeter can communicate with.

## Constructors

- [AzureNspAccessRule](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/constructors.md#constructor)

## Properties

- [AddressPrefixes](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#addressprefixes) : `List<string>` `get; init` -- Gets or initializes the list of inbound address prefixes (CIDR ranges) allowed by this rule.
- [AddressPrefixReferences](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#addressprefixreferences) : `List<ReferenceExpression>` `get; init` -- Gets or initializes the list of inbound address prefixes (CIDR ranges) `ApplicationModel.ReferenceExpression` values allowed by this rule.
- [Direction](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#direction) : `NetworkSecurityPerimeterAccessRuleDirection` `get; set` -- Gets or sets the direction of the rule.
- [FullyQualifiedDomainNameReferences](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#fullyqualifieddomainnamereferences) : `List<ReferenceExpression>` `get; init` -- Gets or initializes the fully qualified domain name `ApplicationModel.ReferenceExpression` values allowed by this rule.
- [FullyQualifiedDomainNames](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#fullyqualifieddomainnames) : `List<string>` `get; init` -- Gets or initializes the list of fully qualified domain names (FQDNs) allowed by this rule.
- [Name](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#name) : `string` `get; set` -- Gets or sets the name of the access rule. This name must be unique within the perimeter profile.
- [SubscriptionReferences](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#subscriptionreferences) : `List<ReferenceExpression>` `get; init` -- Gets or initializes the subscription resource ID `ApplicationModel.ReferenceExpression` values allowed by this rule.
- [Subscriptions](/reference/api/csharp/aspire.hosting.azure.network/azurenspaccessrule/properties.md#subscriptions) : `List<string>` `get; init` -- Gets or initializes the list of subscription IDs allowed by this rule.
