# AzureSubnetResource.DenyOutbound

- Module: [Aspire.Hosting.Azure.Network](/reference/api/go/aspire.hosting.azure.network.md)
- Defined on: [AzureSubnetResource](/reference/api/go/aspire.hosting.azure.network/azuresubnetresource.md)
- Version: `17.0.0`
- Kind: `method`

Adds an outbound deny rule to the subnet's Network Security Group.

## Remarks

If no Network Security Group has been associated with the subnet, one is automatically created.

## Definition

```go
type AzureSubnetResource interface {
    // ... omitted for brevity
    DenyOutbound(options ...*DenyOutboundOptions) AzureSubnetResource
}
```

## Signature

```go
DenyOutbound(options ...*DenyOutboundOptions) AzureSubnetResource
```

## Parameters

- `options` (`...*DenyOutboundOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*DenyOutboundOptions` argument.

- `Port` (`*string`) -- The destination port range (e.g., "443", "80-443"). Defaults to "*" (any).
- `From` (`*string`) -- The source address prefix. Defaults to "*" (any).
- `To` (`*string`) -- The destination address prefix (e.g., "Internet", "VirtualNetwork"). Defaults to "*" (any).
- `Protocol` (`*SecurityRuleProtocol`) -- The network protocol. Defaults to `Asterisk` (any).
- `Priority` (`*float64`) -- The rule priority (100-4096). If not specified, auto-increments from 100 by 100.
- `Name` (`*string`) -- The rule name. If not specified, auto-generated from parameters.

## Returns

[`AzureSubnetResource`](/reference/api/go/aspire.hosting.azure.network/azuresubnetresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [AzureSubnetResource](/reference/api/go/aspire.hosting.azure.network/azuresubnetresource.md) -- `handle`
