AzureServiceTags
Class static net8.0
Provides well-known Azure service tags that can be used as source or destination address prefixes in network security group rules.
namespace Aspire.Hosting.Azure;
public static class AzureServiceTags{ // ...} 15 members
Remarks
Section titled RemarksService tags represent a group of IP address prefixes from a given Azure service. Microsoft manages the address prefixes encompassed by each tag and automatically updates them as addresses change.
These tags can be used with the from and to parameters of methods such as AzureVirtualNetworkExtensions.AllowInbound, AzureVirtualNetworkExtensions.DenyInbound, AzureVirtualNetworkExtensions.AllowOutbound, AzureVirtualNetworkExtensions.DenyOutbound, or with the AzureSecurityRule.SourceAddressPrefix and AzureSecurityRule.DestinationAddressPrefix properties.
Fields15
Section titled FieldsAppServicestaticstring Represents Azure App Service and Azure Functions service addresses.
AzureActiveDirectorystaticstring Represents Microsoft Entra ID (formerly Azure Active Directory) service addresses.
AzureContainerRegistrystaticstring Represents Azure Container Registry service addresses.
AzureCosmosDBstaticstring Represents Azure Cosmos DB service addresses.
AzureKeyVaultstaticstring Represents Azure Key Vault service addresses.
AzureLoadBalancerstaticstring Represents the Azure infrastructure load balancer. This tag is commonly used to allow health probe traffic from Azure.
AzureMonitorstaticstring Represents Azure Monitor service addresses, including Log Analytics, Application Insights, and Azure Monitor metrics.
AzureTrafficManagerstaticstring Represents Azure Traffic Manager probe IP addresses.
EventHubstaticstring Represents Azure Event Hubs service addresses.
GatewayManagerstaticstring Represents the Gateway Manager service, used for VPN Gateway and Application Gateway management traffic.
Internetstaticstring Represents the Internet address space, including all publicly routable IP addresses.
ServiceBusstaticstring Represents Azure Service Bus service addresses.
Sqlstaticstring Represents Azure SQL Database, Azure Database for MySQL, Azure Database for PostgreSQL, Azure Database for MariaDB, and Azure Synapse Analytics.
Storagestaticstring Represents the Azure Storage service. This tag does not include specific Storage accounts; it covers all Azure Storage IP addresses.
VirtualNetworkstaticstring Represents the address space for the virtual network, including all connected address spaces, all connected on-premises address spaces, and peered virtual networks.
Examples
Section titled ExamplesUse service tags when configuring network security rules:
var subnet = vnet.AddSubnet("web", "10.0.1.0/24") .AllowInbound(port: "443", from: AzureServiceTags.AzureLoadBalancer, protocol: SecurityRuleProtocol.Tcp) .DenyInbound(from: AzureServiceTags.Internet);