-
Notifications
You must be signed in to change notification settings - Fork 3.4k
az provider register without --subscription does not enable web_search feature as expected #33107
Description
Describe the bug
When enabling the Azure OpenAI web search tool by unregistering the feature flag OpenAI.BlockedTools.web_search, running:
az provider register -n Microsoft.CognitiveServicesdoes not properly apply the change to the intended subscription.
As a result, even after:
- Successfully unregistering the feature flag
- Running the provider registration command
the web search tool remains unavailable and returns the following error:
Tool 'web_search_preview' disabled for this organization.However, when explicitly specifying the subscription:
az provider register -n Microsoft.CognitiveServices --subscription <subscription-id>the issue is resolved and the web search tool starts working correctly.
This indicates that the CLI command without --subscription may not target the expected subscription, or the documentation does not clearly state the requirement.
Related command
az feature unregister \
--name OpenAI.BlockedTools.web_search \
--namespace Microsoft.CognitiveServices
az provider register -n Microsoft.CognitiveServicesWorking command:
az provider register -n Microsoft.CognitiveServices --subscription <subscription-id>Errors
Error code: 400
{
"error": {
"message": "Tool 'web_search_preview' disabled for this organization.",
"type": "invalid_request_error",
"param": "tools"
}
}
Issue script & Debug output
Example request:
from openai import OpenAI
import os
client = OpenAI(
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
base_url="https://<resource>.openai.azure.com/openai/v1/",
)
response = client.responses.create(
model="gpt-5-4-deployment", # deployment name
tools=[{"type": "web_search"}],
input="Give me a positive news story from the web today"
)
print(response.output_text)Observed behavior:
- Even after unregistering the feature flag and running az provider register
- The request is still routed to web_search_preview and fails
After running:
az provider register -n Microsoft.CognitiveServices --subscription <subscription-id>
The same request succeeds.
Expected behavior
- Running:
az provider register -n Microsoft.CognitiveServices
should correctly apply to the active subscription context (as per az account show)
OR
- Documentation should clearly state that
--subscriptionmust be explicitly specified to ensure correct propagation
Environment Summary
azure-cli 2.84.0
core 2.84.0
telemetry 1.1.0
Extensions:
communication 1.14.0
containerapp 1.3.0b4
ml 2.42.0
Dependencies:
msal 1.35.0b1
azure-mgmt-resource 24.0.0
Python location '/opt/homebrew/Cellar/azure-cli/2.84.0/libexec/bin/python'
Config directory '/Users/koheisaito/.azure'
Extensions directory '/Users/koheisaito/.azure/cliextensions'
Python (Darwin) 3.13.12 (main, Feb 3 2026, 17:53:27) [Clang 17.0.0 (clang-1700.6.3.2)]
Additional context
- The issue is likely to occur in environments where:
- Multiple subscriptions exist under the same tenant
- The default subscription context is not clearly aligned with the target Azure OpenAI resource
- Current official documentation and CLI guidance only mention:
az provider register -n Microsoft.CognitiveServices
without clarifying subscription scope
This can lead to silent misconfiguration where:
-
Feature flag appears correctly set
-
But provider registration is not applied to the correct subscription
-
Suggestion:
- Update documentation to explicitly recommend:
az provider register -n Microsoft.CognitiveServices --subscription <subscription-id>- Or clarify how subscription context is resolved