From d860250f948f2ae5df12e808f06c4eb1b5e515a9 Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Mon, 27 Apr 2026 12:23:43 +1000 Subject: [PATCH 01/12] raw githubusercontent urls are updated to refer azcli blob to restrict external system access --- azure-pipelines.yml | 23 +++ scripts/ci/external_url_exclusions.json | 64 +++++++ scripts/ci/validate_external_source_urls.py | 161 ++++++++++++++++++ .../recordings/test_ExtensionUpgrade.yaml | 4 +- .../recordings/test_NewExtensionDiskAdd.yaml | 4 +- .../test_NewExtensionUltraDisk.yaml | 4 +- .../test_OldExtensionReinstall.yaml | 4 +- .../test_WithUserAssignedIdentity.yaml | 4 +- src/alias/setup.py | 3 +- .../test_hardwaresecuritymodules.yaml | 2 +- .../test_community_gallery_operations.yaml | 2 +- ...reate_vm_with_community_gallery_image.yaml | 2 +- .../recordings/test_main_account_vm.yaml | 2 +- .../recordings/test_sub_account_vm.yaml | 2 +- ..._data_collection_endpoint_association.yaml | 4 +- ...test_monitor_control_service_commands.yaml | 4 +- ...st_scheduled_query_condition_operator.yaml | 4 +- ...t_scheduled_query_update_action_group.yaml | 4 +- .../recordings/test_check_resource_VM.yaml | 4 +- .../recordings/test_check_resource_VMSS.yaml | 4 +- ...iterecovery_A2A_selfcreated_scenarios.yaml | 4 +- .../test_siterecovery_scenarios.yaml | 4 +- ...test_storage_mover_endpoint_scenarios.yaml | 8 +- ...torage_mover_job_definition_scenarios.yaml | 4 +- .../latest/recordings/test_vme_live.yaml | 4 +- .../recordings/test_vme_upgrade_live.yaml | 2 +- 26 files changed, 290 insertions(+), 41 deletions(-) create mode 100644 scripts/ci/external_url_exclusions.json create mode 100644 scripts/ci/validate_external_source_urls.py diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7b9a213cfd2..3ab5a3e4ea0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -150,6 +150,29 @@ jobs: ADO_PULL_REQUEST_LATEST_COMMIT: HEAD ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch) +- job: CheckExternalUrls + displayName: "Check External Source URLs" + pool: + name: ${{ variables.ubuntu_pool }} + steps: + - task: UsePythonVersion@0 + displayName: 'Use Python 3.13' + inputs: + versionSpec: 3.13 + - bash: | + #!/usr/bin/env bash + set -ev + if [[ "$(System.PullRequest.TargetBranch)" != "" ]]; then + # If CI is set to shallow fetch, target branch should be explicitly fetched. + # External URL exclusions are maintained in scripts/ci/external_url_exclusions.json. + git fetch origin --depth=1 $(System.PullRequest.TargetBranch) + python scripts/ci/validate_external_source_urls.py --src=HEAD --tgt=origin/$(System.PullRequest.TargetBranch) + else + # Non-PR builds + echo "Skipping external URL checks for Non-PR builds" + fi + displayName: 'Validate External Source URLs' + - job: AzdevLinterModifiedExtensions displayName: "azdev linter on Modified Extensions" condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) diff --git a/scripts/ci/external_url_exclusions.json b/scripts/ci/external_url_exclusions.json new file mode 100644 index 00000000000..ab97c930581 --- /dev/null +++ b/scripts/ci/external_url_exclusions.json @@ -0,0 +1,64 @@ +{ + "tool": "External URL Validation", + "exclusions": [ + { + "file": [ + "*.md", + "*.rst", + "docs/*", + "*/doc/*", + "*/docs/*" + ], + "_justification": "Documentation content may intentionally reference external URLs and is excluded from this source-code-focused validation." + }, + { + "file": [ + "scripts/*" + ], + "_justification": "CI and tooling scripts are maintained separately from extension source content and are excluded to avoid self-flagging the validator configuration." + }, + { + "file": [ + "*/tests/recordings/*", + "*/tests/*.py", + "*/tests/*.json", + "*/tests/*.yaml", + "*/tests/*.yml", + "*/tests/*/recordings/*", + "*/tests/*/test_*.py", + "*/tests/*/*.json", + "*/tests/*/*.yaml", + "*/tests/*/*.yml" + ], + "_justification": "Test sources, recordings, and test data can contain external sample URLs that are not shipped as runtime source dependencies." + }, + { + "file": [ + "src/automation/azext_automation/generated/_help.py" + ], + "_justification": "Generated help content contains a preserved sample raw GitHub URL and is excluded as generated documentation output." + }, + { + "file": [ + "src/custom-providers/azext_custom_providers/_help.py" + ], + "_justification": "Custom Providers help text documents the service contract for validation specifications and intentionally references raw GitHub as an example input." + }, + { + "file": [ + "src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py", + "src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py" + ], + "_justification": "Vendored SDK model validation regexes intentionally describe the accepted raw GitHub URL format and are not outbound source references." + }, + { + "file": [ + "src/machinelearningservices/azext_mlv2/manual/_help/_data_help.py" + ], + "_justification": "Manual help content includes a public sample dataset URL for documentation purposes and is excluded from runtime source validation." + } + ] +} + + + diff --git a/scripts/ci/validate_external_source_urls.py b/scripts/ci/validate_external_source_urls.py new file mode 100644 index 00000000000..8d66a9c2a46 --- /dev/null +++ b/scripts/ci/validate_external_source_urls.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +"""Fail CI if forbidden raw GitHub URL is introduced in new diff lines.""" + +import argparse +import fnmatch +import json +import re +import subprocess +import sys +from pathlib import Path + + +FORBIDDEN_EXTERNAL_URL_PATTERN = re.compile( + r"https://raw\.githubusercontent\.com" +) +RECOMMENDED_INTERNAL_URL = "https://azcliprod.blob.core.windows.net/cli" +EXCLUSION_CONFIG_PATH = Path(__file__).with_name("external_url_exclusions.json") + +# Paths matching these glob patterns are excluded from the check. +# Exclusions are loaded from external_url_exclusions.json. +EXCLUDED_PATH_PATTERNS = None + + +def _load_excluded_path_patterns(): + """Load excluded path glob patterns from the JSON configuration file.""" + try: + with EXCLUSION_CONFIG_PATH.open(encoding="utf-8") as input_file: + config = json.load(input_file) + except (OSError, ValueError) as ex: + raise RuntimeError(f"Unable to load exclusion patterns from '{EXCLUSION_CONFIG_PATH}': {ex}") from ex + + if not isinstance(config, dict): + raise RuntimeError( + f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': expected a JSON object" + ) + + exclusions = config.get("exclusions") + if not isinstance(exclusions, list): + raise RuntimeError( + f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': expected 'exclusions' to be a JSON array" + ) + + patterns = [] + for exclusion in exclusions: + if not isinstance(exclusion, dict): + raise RuntimeError( + f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': each exclusion must be a JSON object" + ) + + files = exclusion.get("file") + if isinstance(files, str): + files = [files] + + if not isinstance(files, list) or not all(isinstance(pattern, str) for pattern in files): + raise RuntimeError( + f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': each exclusion 'file' must be a string or JSON array of strings" + ) + + patterns.extend(pattern.replace("\\", "/") for pattern in files) + + return patterns + + +def _get_excluded_path_patterns(): + """Return cached excluded path glob patterns.""" + global EXCLUDED_PATH_PATTERNS # pylint: disable=global-statement + + if EXCLUDED_PATH_PATTERNS is None: + EXCLUDED_PATH_PATTERNS = _load_excluded_path_patterns() + + return EXCLUDED_PATH_PATTERNS + + +def _is_excluded(file_path: str) -> bool: + """Return True if *file_path* matches one of the exclusion glob patterns.""" + for pattern in _get_excluded_path_patterns(): + if fnmatch.fnmatch(file_path, pattern): + return True + return False + + +def _run_diff(src: str, tgt: str, cached: bool = False) -> str: + cmd = ["git", "diff", "--unified=0", "--no-color"] + if cached: + cmd.append("--cached") + else: + cmd.append(f"{tgt}...{src}") + + proc = subprocess.run( + cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + check=False, + ) + if proc.returncode != 0: + raise RuntimeError(proc.stderr.strip() or "git diff failed") + return proc.stdout + + +def _find_violations(diff_text: str): + violations = [] + current_file = "" + + for line in diff_text.splitlines(): + if line.startswith("+++ b/"): + current_file = line[6:] + continue + + if not line.startswith("+") or line.startswith("+++"): + continue + + added_line = line[1:] + if FORBIDDEN_EXTERNAL_URL_PATTERN.search(added_line) and not _is_excluded(current_file): + violations.append((current_file or "", added_line.strip())) + + return violations + + +def main() -> int: + parser = argparse.ArgumentParser(description="Check diff for forbidden raw github URL usage.") + parser.add_argument("--src", default="HEAD", help="Source ref/commit for git diff.") + parser.add_argument("--tgt", default="HEAD~1", help="Target ref/commit for git diff.") + parser.add_argument("--cached", action="store_true", help="Check staged changes in git index.") + args = parser.parse_args() + + try: + _get_excluded_path_patterns() + diff_text = _run_diff(src=args.src, tgt=args.tgt, cached=args.cached) + except Exception as ex: # pylint: disable=broad-except + if args.cached: + print(f"Unable to evaluate staged diff: {ex}", file=sys.stderr) + else: + print(f"Unable to evaluate diff between '{args.tgt}' and '{args.src}': {ex}", file=sys.stderr) + return 1 + + violations = _find_violations(diff_text) + if not violations: + print("No forbidden external github URL found in added lines.") + return 0 + + print("Found forbidden external github URL in this change:", file=sys.stderr) + for file_path, content in violations: + print(f" - {file_path}: {content}", file=sys.stderr) + + print( + f"Use '{RECOMMENDED_INTERNAL_URL}' instead of raw GitHub URLs to limit external system access.", + file=sys.stderr, + ) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) + diff --git a/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml b/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml index 32e5d1c53cd..b7d3afb29ea 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml index 0e3e1395009..0f1314a9fc6 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml index bf64bbb9260..6c0008f7afa 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1834,7 +1834,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml b/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml index 20da1bb43a2..9e0cfd05487 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml b/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml index b164a5a5f1f..c4ba5a06ed1 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/alias/setup.py b/src/alias/setup.py index 2561a889312..c9442f33d73 100644 --- a/src/alias/setup.py +++ b/src/alias/setup.py @@ -41,5 +41,6 @@ classifiers=CLASSIFIERS, package_data={'azext_alias': ['azext_metadata.json']}, packages=find_packages(exclude=["azext_alias.tests"]), - install_requires=DEPENDENCIES + install_requires=DEPENDENCIES, + urls='https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json', ) diff --git a/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml b/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml index 96631da05c4..152290fcbb0 100644 --- a/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml +++ b/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml @@ -379,7 +379,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml index 97388e7b7c2..d6b9786440f 100644 --- a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml +++ b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml @@ -626,7 +626,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml index fc567405a7c..fe4ba4fbd0a 100644 --- a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml +++ b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml @@ -638,7 +638,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml b/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml index 678506205fd..955caf348f0 100644 --- a/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml +++ b/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml @@ -329,7 +329,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json response: body: string: '{"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", diff --git a/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml b/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml index 865f79d3929..043985f584b 100644 --- a/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml +++ b/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml @@ -553,7 +553,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json response: body: string: '{"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", diff --git a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml index 912937add20..6673eca42fc 100644 --- a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml +++ b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml @@ -212,7 +212,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -491,7 +491,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml index e9cbf6cdcfb..d1496c4406b 100644 --- a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml +++ b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml @@ -402,7 +402,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -681,7 +681,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml index 664a6e69c37..065bd105a61 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml @@ -55,7 +55,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -328,7 +328,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml index b45b5125d79..4e6b9028699 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml @@ -55,7 +55,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -328,7 +328,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml index 48f951fbd77..3ac20707660 100644 --- a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml +++ b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml @@ -150,7 +150,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -429,7 +429,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml index 73889de8b77..1053c29ae66 100644 --- a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml +++ b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml @@ -150,7 +150,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -429,7 +429,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml index 38732b93793..e3495d636a0 100644 --- a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml +++ b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml @@ -148,7 +148,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -437,7 +437,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml index b15c6e60cc9..43f48d96225 100644 --- a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml +++ b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -2368,7 +2368,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml index d82f92663f3..ca5dc086020 100644 --- a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml +++ b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml @@ -1264,7 +1264,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -4364,7 +4364,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -5502,7 +5502,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -8606,7 +8606,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml index a0242eb854f..d3935b9bb3f 100644 --- a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml +++ b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml @@ -484,7 +484,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -2937,7 +2937,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml b/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml index 49313f3fca8..48c15ce71bb 100644 --- a/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml +++ b/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml @@ -1032,7 +1032,7 @@ interactions: uri: https://management.azure.com/metadata/endpoints?api-version=2022-09-01 response: body: - string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' + string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' headers: cache-control: - no-cache @@ -2459,7 +2459,7 @@ interactions: uri: https://management.azure.com/metadata/endpoints?api-version=2022-09-01 response: body: - string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' + string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' headers: cache-control: - no-cache diff --git a/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml b/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml index b4d79adff94..af30c24f001 100644 --- a/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml +++ b/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml @@ -1032,7 +1032,7 @@ interactions: uri: https://management.azure.com/metadata/endpoints?api-version=2022-09-01 response: body: - string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' + string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' headers: cache-control: - no-cache From cbdf256b6ea982d965041f620f4f1796054565eb Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Mon, 27 Apr 2026 13:50:29 +1000 Subject: [PATCH 02/12] reverted the change --- src/alias/setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/alias/setup.py b/src/alias/setup.py index c9442f33d73..2561a889312 100644 --- a/src/alias/setup.py +++ b/src/alias/setup.py @@ -41,6 +41,5 @@ classifiers=CLASSIFIERS, package_data={'azext_alias': ['azext_metadata.json']}, packages=find_packages(exclude=["azext_alias.tests"]), - install_requires=DEPENDENCIES, - urls='https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json', + install_requires=DEPENDENCIES ) From 0b30efe334814fa489c84465f6245a4b1baeefeb Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Wed, 29 Apr 2026 11:44:45 +1000 Subject: [PATCH 03/12] revert for Integration Test --- src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml | 4 ++-- .../tests/latest/recordings/test_vme_upgrade_live.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml b/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml index 48c15ce71bb..49313f3fca8 100644 --- a/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml +++ b/src/vme/azext_vme/tests/latest/recordings/test_vme_live.yaml @@ -1032,7 +1032,7 @@ interactions: uri: https://management.azure.com/metadata/endpoints?api-version=2022-09-01 response: body: - string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' + string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' headers: cache-control: - no-cache @@ -2459,7 +2459,7 @@ interactions: uri: https://management.azure.com/metadata/endpoints?api-version=2022-09-01 response: body: - string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' + string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' headers: cache-control: - no-cache diff --git a/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml b/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml index af30c24f001..b4d79adff94 100644 --- a/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml +++ b/src/vme/azext_vme/tests/latest/recordings/test_vme_upgrade_live.yaml @@ -1032,7 +1032,7 @@ interactions: uri: https://management.azure.com/metadata/endpoints?api-version=2022-09-01 response: body: - string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' + string: '{"portal":"https://portal.azure.com","authentication":{"loginEndpoint":"https://login.microsoftonline.com","audiences":["https://management.core.windows.net/","https://management.azure.com/"],"tenant":"common","identityProvider":"AAD"},"media":"https://rest.media.azure.net","graphAudience":"https://graph.windows.net/","graph":"https://graph.windows.net/","name":"AzureCloud","suffixes":{"azureDataLakeStoreFileSystem":"azuredatalakestore.net","acrLoginServer":"azurecr.io","sqlServerHostname":"database.windows.net","azureDataLakeAnalyticsCatalogAndJob":"azuredatalakeanalytics.net","keyVaultDns":"vault.azure.net","storage":"core.windows.net","azureFrontDoorEndpointSuffix":"azurefd.net","storageSyncEndpointSuffix":"afs.azure.net","mhsmDns":"managedhsm.azure.net","mysqlServerEndpoint":"mysql.database.azure.com","postgresqlServerEndpoint":"postgres.database.azure.com","mariadbServerEndpoint":"mariadb.database.azure.com","synapseAnalytics":"dev.azuresynapse.net","attestationEndpoint":"attest.azure.net"},"batch":"https://batch.core.windows.net/","resourceManager":"https://management.azure.com/","vmImageAliasDoc":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json","activeDirectoryDataLake":"https://datalake.azure.net/","sqlManagement":"https://management.core.windows.net:8443/","microsoftGraphResourceId":"https://graph.microsoft.com/","appInsightsResourceId":"https://api.applicationinsights.io","appInsightsTelemetryChannelResourceId":"https://dc.applicationinsights.azure.com/v2/track","attestationResourceId":"https://attest.azure.net","synapseAnalyticsResourceId":"https://dev.azuresynapse.net","logAnalyticsResourceId":"https://api.loganalytics.io","ossrDbmsResourceId":"https://ossrdbms-aad.database.windows.net"}' headers: cache-control: - no-cache From 8628e879b56f1dba8c7f0edd9beed62f561dec47 Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Fri, 1 May 2026 10:15:07 +1000 Subject: [PATCH 04/12] reverted github url from recording files --- .../tests/latest/recordings/test_ExtensionUpgrade.yaml | 4 ++-- .../tests/latest/recordings/test_NewExtensionDiskAdd.yaml | 4 ++-- .../latest/recordings/test_NewExtensionUltraDisk.yaml | 4 ++-- .../latest/recordings/test_OldExtensionReinstall.yaml | 4 ++-- .../latest/recordings/test_WithUserAssignedIdentity.yaml | 4 ++-- .../latest/recordings/test_hardwaresecuritymodules.yaml | 2 +- .../recordings/test_community_gallery_operations.yaml | 2 +- .../test_create_vm_with_community_gallery_image.yaml | 2 +- .../tests/latest/recordings/test_main_account_vm.yaml | 2 +- .../tests/latest/recordings/test_sub_account_vm.yaml | 2 +- .../test_amcs_data_collection_endpoint_association.yaml | 4 ++-- .../recordings/test_monitor_control_service_commands.yaml | 4 ++-- .../test_scheduled_query_condition_operator.yaml | 4 ++-- .../test_scheduled_query_update_action_group.yaml | 4 ++-- .../tests/latest/recordings/test_check_resource_VM.yaml | 4 ++-- .../tests/latest/recordings/test_check_resource_VMSS.yaml | 4 ++-- .../test_siterecovery_A2A_selfcreated_scenarios.yaml | 4 ++-- .../latest/recordings/test_siterecovery_scenarios.yaml | 4 ++-- .../recordings/test_storage_mover_endpoint_scenarios.yaml | 8 ++++---- .../test_storage_mover_job_definition_scenarios.yaml | 4 ++-- 20 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml b/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml index b7d3afb29ea..32e5d1c53cd 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml index 0f1314a9fc6..0e3e1395009 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml index 6c0008f7afa..bf64bbb9260 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1834,7 +1834,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml b/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml index 9e0cfd05487..20da1bb43a2 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml b/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml index c4ba5a06ed1..b164a5a5f1f 100644 --- a/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml +++ b/src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -1836,7 +1836,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml b/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml index 152290fcbb0..96631da05c4 100644 --- a/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml +++ b/src/hardware-security-modules/azext_hardware_security_modules/tests/latest/recordings/test_hardwaresecuritymodules.yaml @@ -379,7 +379,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml index d6b9786440f..97388e7b7c2 100644 --- a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml +++ b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_community_gallery_operations.yaml @@ -626,7 +626,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml index fe4ba4fbd0a..fc567405a7c 100644 --- a/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml +++ b/src/image-gallery/azext_image_gallery/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml @@ -638,7 +638,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml b/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml index 955caf348f0..678506205fd 100644 --- a/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml +++ b/src/logz/azext_logz/tests/latest/recordings/test_main_account_vm.yaml @@ -329,7 +329,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json response: body: string: '{"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", diff --git a/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml b/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml index 043985f584b..865f79d3929 100644 --- a/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml +++ b/src/logz/azext_logz/tests/latest/recordings/test_sub_account_vm.yaml @@ -553,7 +553,7 @@ interactions: User-Agent: - python-requests/2.25.1 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json response: body: string: '{"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", diff --git a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml index 6673eca42fc..912937add20 100644 --- a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml +++ b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_amcs_data_collection_endpoint_association.yaml @@ -212,7 +212,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -491,7 +491,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml index d1496c4406b..e9cbf6cdcfb 100644 --- a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml +++ b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_commands.yaml @@ -402,7 +402,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -681,7 +681,7 @@ interactions: User-Agent: - python-requests/2.32.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml index 065bd105a61..664a6e69c37 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml @@ -55,7 +55,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -328,7 +328,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml index 4e6b9028699..b45b5125d79 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_update_action_group.yaml @@ -55,7 +55,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ @@ -328,7 +328,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ diff --git a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml index 3ac20707660..48f951fbd77 100644 --- a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml +++ b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml @@ -150,7 +150,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -429,7 +429,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml index 1053c29ae66..73889de8b77 100644 --- a/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml +++ b/src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml @@ -150,7 +150,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -429,7 +429,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml index e3495d636a0..38732b93793 100644 --- a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml +++ b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_A2A_selfcreated_scenarios.yaml @@ -148,7 +148,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -437,7 +437,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml index 43f48d96225..b15c6e60cc9 100644 --- a/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml +++ b/src/site-recovery/azext_site_recovery/tests/latest/recordings/test_siterecovery_scenarios.yaml @@ -54,7 +54,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -2368,7 +2368,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml index ca5dc086020..d82f92663f3 100644 --- a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml +++ b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_endpoint_scenarios.yaml @@ -1264,7 +1264,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -4364,7 +4364,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -5502,7 +5502,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -8606,7 +8606,7 @@ interactions: User-Agent: - python-requests/2.32.4 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n diff --git a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml index d3935b9bb3f..a0242eb854f 100644 --- a/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml +++ b/src/storage-mover/azext_storage_mover/tests/latest/recordings/test_storage_mover_job_definition_scenarios.yaml @@ -484,7 +484,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n @@ -2937,7 +2937,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: GET - uri: https://azcliprod.blob.core.windows.net/cli/vm/aliases.json + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json response: body: string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n From 307bdc0058abe04e6d925c359eb2b94006489637 Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Fri, 1 May 2026 16:00:33 +1000 Subject: [PATCH 05/12] use inclusion and exclusion rules to flag particular files --- scripts/ci/external_url_exclusions.json | 66 ++------------- scripts/ci/validate_external_source_urls.py | 94 ++++++++++++--------- 2 files changed, 61 insertions(+), 99 deletions(-) diff --git a/scripts/ci/external_url_exclusions.json b/scripts/ci/external_url_exclusions.json index ab97c930581..745a85f1bc6 100644 --- a/scripts/ci/external_url_exclusions.json +++ b/scripts/ci/external_url_exclusions.json @@ -1,63 +1,13 @@ { "tool": "External URL Validation", - "exclusions": [ - { - "file": [ - "*.md", - "*.rst", - "docs/*", - "*/doc/*", - "*/docs/*" - ], - "_justification": "Documentation content may intentionally reference external URLs and is excluded from this source-code-focused validation." - }, - { - "file": [ - "scripts/*" - ], - "_justification": "CI and tooling scripts are maintained separately from extension source content and are excluded to avoid self-flagging the validator configuration." - }, - { - "file": [ - "*/tests/recordings/*", - "*/tests/*.py", - "*/tests/*.json", - "*/tests/*.yaml", - "*/tests/*.yml", - "*/tests/*/recordings/*", - "*/tests/*/test_*.py", - "*/tests/*/*.json", - "*/tests/*/*.yaml", - "*/tests/*/*.yml" - ], - "_justification": "Test sources, recordings, and test data can contain external sample URLs that are not shipped as runtime source dependencies." - }, - { - "file": [ - "src/automation/azext_automation/generated/_help.py" - ], - "_justification": "Generated help content contains a preserved sample raw GitHub URL and is excluded as generated documentation output." - }, - { - "file": [ - "src/custom-providers/azext_custom_providers/_help.py" - ], - "_justification": "Custom Providers help text documents the service contract for validation specifications and intentionally references raw GitHub as an example input." - }, - { - "file": [ - "src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py", - "src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py" - ], - "_justification": "Vendored SDK model validation regexes intentionally describe the accepted raw GitHub URL format and are not outbound source references." - }, - { - "file": [ - "src/machinelearningservices/azext_mlv2/manual/_help/_data_help.py" - ], - "_justification": "Manual help content includes a public sample dataset URL for documentation purposes and is excluded from runtime source validation." - } - ] + "scope": { + "include": ["src/**/*.py"], + "exclude": [ + "**/tests/**", + "**/vendored_sdks/**", + "**/*help.py" + ] + } } diff --git a/scripts/ci/validate_external_source_urls.py b/scripts/ci/validate_external_source_urls.py index 8d66a9c2a46..e4973a28922 100644 --- a/scripts/ci/validate_external_source_urls.py +++ b/scripts/ci/validate_external_source_urls.py @@ -20,69 +20,81 @@ r"https://raw\.githubusercontent\.com" ) RECOMMENDED_INTERNAL_URL = "https://azcliprod.blob.core.windows.net/cli" -EXCLUSION_CONFIG_PATH = Path(__file__).with_name("external_url_exclusions.json") +SCOPE_CONFIG_PATH = Path(__file__).with_name("external_url_exclusions.json") -# Paths matching these glob patterns are excluded from the check. -# Exclusions are loaded from external_url_exclusions.json. -EXCLUDED_PATH_PATTERNS = None +# Scope configuration loaded from external_url_exclusions.json. +# Contains optional "include" and "exclude" glob-pattern lists. +_SCOPE_CONFIG = None -def _load_excluded_path_patterns(): - """Load excluded path glob patterns from the JSON configuration file.""" +def _load_scope_config(): + """Load scope configuration (include/exclude patterns) from the JSON file.""" try: - with EXCLUSION_CONFIG_PATH.open(encoding="utf-8") as input_file: + with SCOPE_CONFIG_PATH.open(encoding="utf-8") as input_file: config = json.load(input_file) except (OSError, ValueError) as ex: - raise RuntimeError(f"Unable to load exclusion patterns from '{EXCLUSION_CONFIG_PATH}': {ex}") from ex + raise RuntimeError(f"Unable to load scope config from '{SCOPE_CONFIG_PATH}': {ex}") from ex if not isinstance(config, dict): raise RuntimeError( - f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': expected a JSON object" + f"Invalid scope configuration in '{SCOPE_CONFIG_PATH}': expected a JSON object" ) - exclusions = config.get("exclusions") - if not isinstance(exclusions, list): + scope = config.get("scope", {}) + if not isinstance(scope, dict): raise RuntimeError( - f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': expected 'exclusions' to be a JSON array" + f"Invalid scope configuration in '{SCOPE_CONFIG_PATH}': 'scope' must be a JSON object" ) - patterns = [] - for exclusion in exclusions: - if not isinstance(exclusion, dict): - raise RuntimeError( - f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': each exclusion must be a JSON object" - ) + include = scope.get("include", []) + exclude = scope.get("exclude", []) - files = exclusion.get("file") - if isinstance(files, str): - files = [files] + if isinstance(include, str): + include = [include] + if isinstance(exclude, str): + exclude = [exclude] - if not isinstance(files, list) or not all(isinstance(pattern, str) for pattern in files): - raise RuntimeError( - f"Invalid exclusion pattern configuration in '{EXCLUSION_CONFIG_PATH}': each exclusion 'file' must be a string or JSON array of strings" - ) + if not isinstance(include, list) or not all(isinstance(p, str) for p in include): + raise RuntimeError( + f"Invalid scope configuration in '{SCOPE_CONFIG_PATH}': 'include' must be a string or array of strings" + ) + if not isinstance(exclude, list) or not all(isinstance(p, str) for p in exclude): + raise RuntimeError( + f"Invalid scope configuration in '{SCOPE_CONFIG_PATH}': 'exclude' must be a string or array of strings" + ) + + return ( + [p.replace("\\", "/") for p in include], + [p.replace("\\", "/") for p in exclude], + ) + + +def _get_scope_config(): + """Return cached (include_patterns, exclude_patterns) tuple.""" + global _SCOPE_CONFIG # pylint: disable=global-statement - patterns.extend(pattern.replace("\\", "/") for pattern in files) + if _SCOPE_CONFIG is None: + _SCOPE_CONFIG = _load_scope_config() - return patterns + return _SCOPE_CONFIG -def _get_excluded_path_patterns(): - """Return cached excluded path glob patterns.""" - global EXCLUDED_PATH_PATTERNS # pylint: disable=global-statement +def _matches_any(file_path: str, patterns: list) -> bool: + """Return True if *file_path* matches any of the given glob patterns.""" + return any(fnmatch.fnmatch(file_path, p) for p in patterns) - if EXCLUDED_PATH_PATTERNS is None: - EXCLUDED_PATH_PATTERNS = _load_excluded_path_patterns() - return EXCLUDED_PATH_PATTERNS +def _should_flag(file_path: str) -> bool: + """Decide whether *file_path* should be checked for forbidden URLs. + An entry is included when there is no include list (empty means + "entire codebase") or when it matches at least one include pattern. + A included entry is then flagged unless it also matches an exclude pattern. + """ + include_patterns, exclude_patterns = _get_scope_config() -def _is_excluded(file_path: str) -> bool: - """Return True if *file_path* matches one of the exclusion glob patterns.""" - for pattern in _get_excluded_path_patterns(): - if fnmatch.fnmatch(file_path, pattern): - return True - return False + included = (not include_patterns) or _matches_any(file_path, include_patterns) + return included and not _matches_any(file_path, exclude_patterns) def _run_diff(src: str, tgt: str, cached: bool = False) -> str: @@ -117,7 +129,7 @@ def _find_violations(diff_text: str): continue added_line = line[1:] - if FORBIDDEN_EXTERNAL_URL_PATTERN.search(added_line) and not _is_excluded(current_file): + if FORBIDDEN_EXTERNAL_URL_PATTERN.search(added_line) and _should_flag(current_file): violations.append((current_file or "", added_line.strip())) return violations @@ -131,7 +143,7 @@ def main() -> int: args = parser.parse_args() try: - _get_excluded_path_patterns() + _get_scope_config() diff_text = _run_diff(src=args.src, tgt=args.tgt, cached=args.cached) except Exception as ex: # pylint: disable=broad-except if args.cached: From d31f705755ba319aadccb58d3cafa36b71f7a39b Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Fri, 1 May 2026 17:28:22 +1000 Subject: [PATCH 06/12] use inline comments to exempt external urls --- scripts/ci/validate_external_source_urls.py | 65 ++++++++++++++++--- .../partner_extensions/OpenServiceMesh.py | 1 + src/vm-repair/azext_vm_repair/repair_utils.py | 3 +- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/scripts/ci/validate_external_source_urls.py b/scripts/ci/validate_external_source_urls.py index e4973a28922..9c1b502c970 100644 --- a/scripts/ci/validate_external_source_urls.py +++ b/scripts/ci/validate_external_source_urls.py @@ -17,7 +17,13 @@ FORBIDDEN_EXTERNAL_URL_PATTERN = re.compile( - r"https://raw\.githubusercontent\.com" + r"raw\.githubusercontent\.com" +) +GITHUB_URL_PATTERN = re.compile( + r"https?://raw\.githubusercontent\.com/[^\s\"'`,)}\]]*" +) +INLINE_SUPPRESSION_PATTERN = re.compile( + r"#\s*external-url-exempt:\s*\S" ) RECOMMENDED_INTERNAL_URL = "https://azcliprod.blob.core.windows.net/cli" SCOPE_CONFIG_PATH = Path(__file__).with_name("external_url_exclusions.json") @@ -84,6 +90,21 @@ def _matches_any(file_path: str, patterns: list) -> bool: return any(fnmatch.fnmatch(file_path, p) for p in patterns) +def _extract_filename_from_url(line: str) -> str: + """Extract the file name from the first GitHub URL found in *line*. + + Returns the basename (e.g. ``map.json``) or ``"xxx.xxx"`` when no + recognisable file name is present. + """ + match = GITHUB_URL_PATTERN.search(line) + if match: + url_path = match.group(0).rstrip("/") + basename = url_path.rsplit("/", 1)[-1] if "/" in url_path else "" + if "." in basename: + return basename + return "xxx.xxx" + + def _should_flag(file_path: str) -> bool: """Decide whether *file_path* should be checked for forbidden URLs. @@ -119,18 +140,26 @@ def _run_diff(src: str, tgt: str, cached: bool = False) -> str: def _find_violations(diff_text: str): violations = [] current_file = "" + prev_added_line = "" for line in diff_text.splitlines(): if line.startswith("+++ b/"): current_file = line[6:] + prev_added_line = "" continue if not line.startswith("+") or line.startswith("+++"): + prev_added_line = "" continue added_line = line[1:] if FORBIDDEN_EXTERNAL_URL_PATTERN.search(added_line) and _should_flag(current_file): - violations.append((current_file or "", added_line.strip())) + # Skip if the current line or the previous added line has a suppression comment + if not (INLINE_SUPPRESSION_PATTERN.search(added_line) + or INLINE_SUPPRESSION_PATTERN.search(prev_added_line)): + violations.append((current_file or "", added_line.strip())) + + prev_added_line = added_line return violations @@ -157,14 +186,32 @@ def main() -> int: print("No forbidden external github URL found in added lines.") return 0 - print("Found forbidden external github URL in this change:", file=sys.stderr) + print("ERROR: Found forbidden external GitHub URL(s) in this change:\n", file=sys.stderr) for file_path, content in violations: - print(f" - {file_path}: {content}", file=sys.stderr) - - print( - f"Use '{RECOMMENDED_INTERNAL_URL}' instead of raw GitHub URLs to limit external system access.", - file=sys.stderr, - ) + filename = _extract_filename_from_url(content) + print( + f" {file_path}: {content}\n" + "\n" + " To fix, follow one of the options below (in priority order):\n" + "\n" + " Option 1 (Preferred) — Host the file in the AME storage account\n" + " ---------------------------------------------------------------\n" + " Reach out to the Platform squad to upload the file to the shared\n" + " Azure CLI storage account. Once uploaded, replace the raw GitHub\n" + " URL with the internal blob URL. The resulting URL should look like:\n" + "\n" + f" {RECOMMENDED_INTERNAL_URL}//{filename}\n" + "\n" + " Option 2 (Fallback) — Suppress with an inline comment\n" + " -----------------------------------------------------\n" + " Only if the GitHub URL is required by design (e.g. the upstream\n" + " repo IS the authoritative source), add an inline suppression\n" + " comment on the line before or on the same line like:\n" + "\n" + " # external-url-exempt: \n" + f" {content} \n", + file=sys.stderr, + ) return 1 diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py index 3ff0d6d16a1..4401df47ba6 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py @@ -129,6 +129,7 @@ def _validate_tested_distro(cmd, cluster_resource_group_name, cluster_name, exte def _get_tested_distros(chart_version): + # external-url-exempt: OSM chart values must be fetched from the upstream Azure/osm-azure repo chart_url = 'https://raw.githubusercontent.com/Azure/osm-azure/' \ 'v{0}/charts/osm-arc/values.yaml'.format(chart_version) chart_request = requests.get(url=chart_url) diff --git a/src/vm-repair/azext_vm_repair/repair_utils.py b/src/vm-repair/azext_vm_repair/repair_utils.py index b307c11f624..caa2a5f27e8 100644 --- a/src/vm-repair/azext_vm_repair/repair_utils.py +++ b/src/vm-repair/azext_vm_repair/repair_utils.py @@ -20,6 +20,7 @@ from azure.cli.core.azclierror import CLIError +# external-url-exempt: repair script map is maintained in the Azure/repair-script-library repo REPAIR_MAP_URL = 'https://raw.githubusercontent.com/Azure/repair-script-library/master/map.json' logger = get_logger(__name__) @@ -39,7 +40,7 @@ def _get_cloud_init_script(): def _set_repair_map_url(url): raw_url = str(url) if "github.com" in raw_url: - raw_url = raw_url.replace("github.com", "raw.githubusercontent.com") + raw_url = raw_url.replace("github.com", "raw.githubusercontent.com") # external-url-exempt: URL transform for user-provided repo links raw_url = raw_url.replace("/blob/", "/") global REPAIR_MAP_URL REPAIR_MAP_URL = raw_url From 591375ffb76d449ef40cace606c12b2c70786ded Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Fri, 1 May 2026 17:40:45 +1000 Subject: [PATCH 07/12] fixed external filename pattern --- scripts/ci/validate_external_source_urls.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ci/validate_external_source_urls.py b/scripts/ci/validate_external_source_urls.py index 9c1b502c970..3c817ac2bf9 100644 --- a/scripts/ci/validate_external_source_urls.py +++ b/scripts/ci/validate_external_source_urls.py @@ -25,6 +25,7 @@ INLINE_SUPPRESSION_PATTERN = re.compile( r"#\s*external-url-exempt:\s*\S" ) +_FILENAME_PATTERN = re.compile(r"^[A-Za-z0-9_\-]+\.[A-Za-z0-9]{1,10}$") RECOMMENDED_INTERNAL_URL = "https://azcliprod.blob.core.windows.net/cli" SCOPE_CONFIG_PATH = Path(__file__).with_name("external_url_exclusions.json") @@ -90,6 +91,7 @@ def _matches_any(file_path: str, patterns: list) -> bool: return any(fnmatch.fnmatch(file_path, p) for p in patterns) + def _extract_filename_from_url(line: str) -> str: """Extract the file name from the first GitHub URL found in *line*. @@ -100,7 +102,7 @@ def _extract_filename_from_url(line: str) -> str: if match: url_path = match.group(0).rstrip("/") basename = url_path.rsplit("/", 1)[-1] if "/" in url_path else "" - if "." in basename: + if _FILENAME_PATTERN.match(basename): return basename return "xxx.xxx" From 4f284fb06e1c7f2def293cb732889ba9e7b678ec Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Fri, 1 May 2026 17:41:41 +1000 Subject: [PATCH 08/12] added dummy url to test the pipeline functionality --- src/alias/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/alias/setup.py b/src/alias/setup.py index 2561a889312..c9442f33d73 100644 --- a/src/alias/setup.py +++ b/src/alias/setup.py @@ -41,5 +41,6 @@ classifiers=CLASSIFIERS, package_data={'azext_alias': ['azext_metadata.json']}, packages=find_packages(exclude=["azext_alias.tests"]), - install_requires=DEPENDENCIES + install_requires=DEPENDENCIES, + urls='https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json', ) From af9cb23c8ce77b9dd798943369d98ca7167bbe64 Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Fri, 1 May 2026 18:38:57 +1000 Subject: [PATCH 09/12] Revert "added dummy url to test the pipeline functionality" This reverts commit 4f284fb06e1c7f2def293cb732889ba9e7b678ec. --- src/alias/setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/alias/setup.py b/src/alias/setup.py index c9442f33d73..2561a889312 100644 --- a/src/alias/setup.py +++ b/src/alias/setup.py @@ -41,6 +41,5 @@ classifiers=CLASSIFIERS, package_data={'azext_alias': ['azext_metadata.json']}, packages=find_packages(exclude=["azext_alias.tests"]), - install_requires=DEPENDENCIES, - urls='https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json', + install_requires=DEPENDENCIES ) From 38f1088edc1ab05d4f2b1375d2397b87b4ad5b6e Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Fri, 1 May 2026 18:52:08 +1000 Subject: [PATCH 10/12] reverted inline comments for external-url-exempt --- .../azext_k8s_extension/partner_extensions/OpenServiceMesh.py | 1 - src/vm-repair/azext_vm_repair/repair_utils.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py index 4401df47ba6..3ff0d6d16a1 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py @@ -129,7 +129,6 @@ def _validate_tested_distro(cmd, cluster_resource_group_name, cluster_name, exte def _get_tested_distros(chart_version): - # external-url-exempt: OSM chart values must be fetched from the upstream Azure/osm-azure repo chart_url = 'https://raw.githubusercontent.com/Azure/osm-azure/' \ 'v{0}/charts/osm-arc/values.yaml'.format(chart_version) chart_request = requests.get(url=chart_url) diff --git a/src/vm-repair/azext_vm_repair/repair_utils.py b/src/vm-repair/azext_vm_repair/repair_utils.py index caa2a5f27e8..b307c11f624 100644 --- a/src/vm-repair/azext_vm_repair/repair_utils.py +++ b/src/vm-repair/azext_vm_repair/repair_utils.py @@ -20,7 +20,6 @@ from azure.cli.core.azclierror import CLIError -# external-url-exempt: repair script map is maintained in the Azure/repair-script-library repo REPAIR_MAP_URL = 'https://raw.githubusercontent.com/Azure/repair-script-library/master/map.json' logger = get_logger(__name__) @@ -40,7 +39,7 @@ def _get_cloud_init_script(): def _set_repair_map_url(url): raw_url = str(url) if "github.com" in raw_url: - raw_url = raw_url.replace("github.com", "raw.githubusercontent.com") # external-url-exempt: URL transform for user-provided repo links + raw_url = raw_url.replace("github.com", "raw.githubusercontent.com") raw_url = raw_url.replace("/blob/", "/") global REPAIR_MAP_URL REPAIR_MAP_URL = raw_url From 0c6a3ea0c51eab924b09c82ea82ad97f39c78394 Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Mon, 4 May 2026 09:53:34 +1000 Subject: [PATCH 11/12] simplified pipeline changes --- azure-pipelines.yml | 13 ++++--------- scripts/ci/validate_external_source_urls.py | 5 +---- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ab5a3e4ea0..500833a20e5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -152,6 +152,7 @@ jobs: - job: CheckExternalUrls displayName: "Check External Source URLs" + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) pool: name: ${{ variables.ubuntu_pool }} steps: @@ -162,15 +163,9 @@ jobs: - bash: | #!/usr/bin/env bash set -ev - if [[ "$(System.PullRequest.TargetBranch)" != "" ]]; then - # If CI is set to shallow fetch, target branch should be explicitly fetched. - # External URL exclusions are maintained in scripts/ci/external_url_exclusions.json. - git fetch origin --depth=1 $(System.PullRequest.TargetBranch) - python scripts/ci/validate_external_source_urls.py --src=HEAD --tgt=origin/$(System.PullRequest.TargetBranch) - else - # Non-PR builds - echo "Skipping external URL checks for Non-PR builds" - fi + # External URL exclusions are maintained in scripts/ci/external_url_exclusions.json. + git fetch origin --depth=1 $(System.PullRequest.TargetBranch) + python scripts/ci/validate_external_source_urls.py --src=HEAD --tgt=origin/$(System.PullRequest.TargetBranch) displayName: 'Validate External Source URLs' - job: AzdevLinterModifiedExtensions diff --git a/scripts/ci/validate_external_source_urls.py b/scripts/ci/validate_external_source_urls.py index 3c817ac2bf9..c494e489139 100644 --- a/scripts/ci/validate_external_source_urls.py +++ b/scripts/ci/validate_external_source_urls.py @@ -16,9 +16,6 @@ from pathlib import Path -FORBIDDEN_EXTERNAL_URL_PATTERN = re.compile( - r"raw\.githubusercontent\.com" -) GITHUB_URL_PATTERN = re.compile( r"https?://raw\.githubusercontent\.com/[^\s\"'`,)}\]]*" ) @@ -155,7 +152,7 @@ def _find_violations(diff_text: str): continue added_line = line[1:] - if FORBIDDEN_EXTERNAL_URL_PATTERN.search(added_line) and _should_flag(current_file): + if GITHUB_URL_PATTERN.search(added_line) and _should_flag(current_file): # Skip if the current line or the previous added line has a suppression comment if not (INLINE_SUPPRESSION_PATTERN.search(added_line) or INLINE_SUPPRESSION_PATTERN.search(prev_added_line)): From ccdb079631dc821e0190a3cc226aaed03a748c10 Mon Sep 17 00:00:00 2001 From: Mansoor Sarfraz Date: Mon, 4 May 2026 10:16:15 +1000 Subject: [PATCH 12/12] updated comment --- scripts/ci/validate_external_source_urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ci/validate_external_source_urls.py b/scripts/ci/validate_external_source_urls.py index c494e489139..b1456a1521b 100644 --- a/scripts/ci/validate_external_source_urls.py +++ b/scripts/ci/validate_external_source_urls.py @@ -164,7 +164,7 @@ def _find_violations(diff_text: str): def main() -> int: - parser = argparse.ArgumentParser(description="Check diff for forbidden raw github URL usage.") + parser = argparse.ArgumentParser(description="Check diff for forbidden raw GitHub URL usage.") parser.add_argument("--src", default="HEAD", help="Source ref/commit for git diff.") parser.add_argument("--tgt", default="HEAD~1", help="Target ref/commit for git diff.") parser.add_argument("--cached", action="store_true", help="Check staged changes in git index.") @@ -182,7 +182,7 @@ def main() -> int: violations = _find_violations(diff_text) if not violations: - print("No forbidden external github URL found in added lines.") + print("No forbidden external GitHub URL found in added lines.") return 0 print("ERROR: Found forbidden external GitHub URL(s) in this change:\n", file=sys.stderr)