delay another import

This commit is contained in:
Steven Silvester 2024-03-13 07:33:43 -05:00
parent 944bea3892
commit 1db5cfa2f5
No known key found for this signature in database
GPG Key ID: B1BF5EC3A8B32F91

View File

@ -17,12 +17,14 @@ from __future__ import annotations
import json
from typing import Any, Optional
from urllib.request import Request, urlopen
def _get_azure_response(
resource: str, object_id: Optional[str] = None, timeout: float = 5
) -> dict[str, Any]:
# Deferred import to save overall import time.
from urllib.request import Request, urlopen
url = "http://169.254.169.254/metadata/identity/oauth2/token"
url += "?api-version=2018-02-01"
url += f"&resource={resource}"