Skip to content

Commit 5b906bd

Browse files
committed
Remove non-existent extension call
1 parent c9ea2fb commit 5b906bd

2 files changed

Lines changed: 2 additions & 33 deletions

File tree

azure-functions-durable/azure/durable_functions/client.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66
from datetime import timedelta
77
import azure.functions as func
8-
from urllib.parse import urlparse, urljoin, quote
8+
from urllib.parse import urlparse, quote
99

1010
from durabletask.client import TaskHubGrpcClient
1111
from .internal.azurefunctions_grpc_interceptor import AzureFunctionsDefaultClientInterceptorImpl
1212
from .http import HttpManagementPayload
13-
import requests
1413

1514

1615
# Client class used for Durable Functions
@@ -44,10 +43,6 @@ def __init__(self, client_as_string: str):
4443
json.JSONDecodeError: If the provided string is not valid JSON.
4544
"""
4645
self._parse_client_configuration(client_as_string)
47-
if not self.httpBaseUrl:
48-
# This happens when the extension has not been configured for gRPC yet. For some reason, instead of
49-
# the client returning with null rpcBaseUrl and httpBaseUrl, it returns rpcBaseUrl with the http url.
50-
self.configure_extension_for_grpc()
5146

5247
interceptors = [AzureFunctionsDefaultClientInterceptorImpl(self.taskHubName, self.requiredQueryStringParameters)]
5348

@@ -82,31 +77,6 @@ def _parse_client_configuration(self, client_as_string: str) -> None:
8277
# TODO: convert the string value back to timedelta - annoying regex?
8378
self.grpcHttpClientTimeout = client.get("grpcHttpClientTimeout", timedelta(seconds=30))
8479

85-
def configure_extension_for_grpc(self) -> None:
86-
"""Configures the Durable Functions extension for gRPC communication.
87-
88-
Makes an HTTP request to the extension's management endpoint to enable gRPC.
89-
"""
90-
91-
# Make an HTTP request to the extension to configure gRPC
92-
configure_base_url = self.httpBaseUrl
93-
if not configure_base_url:
94-
# For some reason, in the "bad" case when rpc has not been configured, the httpBaseUrl is empty and sent in rpcBaseUrl
95-
configure_base_url = self.rpcBaseUrl
96-
# configure_base_url = urlparse(configure_base_url)
97-
# url = f"{configure_base_url.scheme}://{configure_base_url.netloc}/management/configureGrpc"
98-
url = urljoin(configure_base_url, "management/configureGrpc")
99-
params = {
100-
"taskHubName": self.taskHubName,
101-
"connectionName": self.connectionName
102-
}
103-
response = requests.get(url, params=params)
104-
if response.status_code != 200:
105-
raise Exception(f"Failed to configure gRPC for Durable Functions extension. Status code: {response.status_code}, Response: {response.text}")
106-
107-
# Parse the response to update client configuration - it's double-encoded so we need to load it twice
108-
self._parse_client_configuration(json.loads(response.text))
109-
11080
def create_check_status_response(self, request: func.HttpRequest, instance_id: str) -> func.HttpResponse:
11181
"""Creates an HTTP response for checking the status of a Durable Function instance.
11282

azure-functions-durable/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ readme = "README.md"
2929
dependencies = [
3030
"durabletask>=1.2.0dev0",
3131
"azure-identity>=1.19.0",
32-
"azure-functions>=1.25.0b3.dev1",
33-
"requests>=2.31.0"
32+
"azure-functions>=1.25.0b3.dev1"
3433
]
3534

3635
[project.urls]

0 commit comments

Comments
 (0)