From ae20346cc3bbb5baf4130703aa450fe65210380a Mon Sep 17 00:00:00 2001 From: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:14:11 +0800 Subject: [PATCH] [Tool] Add sample link to Readme (#25800) * add sample_link * Update tools/azure-sdk-tools/packaging_tools/templates/README.md Co-authored-by: Yuchao Yan * Update README.md Co-authored-by: Yuchao Yan --- tools/azure-sdk-tools/packaging_tools/conf.py | 1 + tools/azure-sdk-tools/packaging_tools/templates/README.md | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/azure-sdk-tools/packaging_tools/conf.py b/tools/azure-sdk-tools/packaging_tools/conf.py index 16a50ff5ff66..cbf0b9ed8f78 100644 --- a/tools/azure-sdk-tools/packaging_tools/conf.py +++ b/tools/azure-sdk-tools/packaging_tools/conf.py @@ -19,6 +19,7 @@ "is_arm": True, "need_msrestazure": False, # track2 does not need it anymore in setup.py "need_azuremgmtcore": True, + "sample_link": "", } diff --git a/tools/azure-sdk-tools/packaging_tools/templates/README.md b/tools/azure-sdk-tools/packaging_tools/templates/README.md index 646fcfb95e31..f367b58f458a 100644 --- a/tools/azure-sdk-tools/packaging_tools/templates/README.md +++ b/tools/azure-sdk-tools/packaging_tools/templates/README.md @@ -14,10 +14,16 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) {% endif %} +{%- if not sample_link -%} +{%- set sample_link="https://aka.ms/azsdk/python/mgmt/samples" -%} +{%- else -%} +{%- set sample_link="https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/" + sample_link -%} +{%- endif -%} + {% if is_arm %} For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/{{package_doc_id}}) Code samples for this package can be found at [{{package_pprint_name}}](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. -Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) +Additional code samples for different Azure services are available at [Samples Repo]({{ sample_link }}) {% else %} For code examples, see [{{package_pprint_name}}](https://docs.microsoft.com/python/api/overview/azure/{{package_doc_id}}) on docs.microsoft.com. {% endif %}