Hi @王艳芳
Thank you for reaching out to Microsoft Q&A.
Microsoft-hosted Ubuntu agents in Azure Pipelines do not support Azure Service Tags for network access control. This is because Microsoft-hosted agents are ephemeral, dynamically created for each pipeline run, and their outbound IP addresses can change frequently. As a result, Azure cannot reliably associate these agents with a fixed service tag such as AzureCloud or AzureDevOps. Although service tags like AzureDevOps and AzureCloud do exist, they are intended for Azure DevOps service endpoints or broad Azure platform services and explicitly do not represent Microsoft-hosted build agents. Additionally, regional service tag variants (for example, AzureCloud.southeastasia) are not applicable to Azure Pipelines hosted agents. This limitation is by design and applies across all Azure DevOps regions.
Refer below points to resolve this issue or as a workaround
Use IP allow-listing for Microsoft-hosted agents
Microsoft-hosted agents must be allowed through firewalls or NSGs by using the Azure IP Ranges and Service Tags (Public Cloud) JSON file published by Microsoft. This file is updated weekly and contains the IP ranges required for Azure DevOps hosted agents. Service tags cannot be used for this purpose.
Do not use AzureDevOps or AzureCloud service tags for hosted agents
While the AzureDevOps and AzureCloud service tags are valid Azure service tags, they do not apply to Microsoft-hosted Azure Pipelines agents. Using these tags will not allow traffic from hosted Ubuntu agents.
Use self-hosted or VM Scale Set agents for stricter network control
If allowing a broad set of Microsoft IP ranges is not acceptable for your security requirements, Microsoft recommends using self-hosted agents or Azure Virtual Machine Scale Set agents. With these options, you control the network, IP addresses, and NSG rules, and you can apply more granular firewall restrictions.