Skip to content

Commit

Permalink
Replace docs.microsoft.com in docs links
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-c-martin committed Oct 24, 2024
1 parent a796d78 commit dd1f194
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion scripts/GetQuickstartLinks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ foreach ($metadataPath in $metadataPaths) {
$hasBicep = (Test-Path $bicepPath -PathType Leaf)

$metadataContent = Get-Content $metadataPath.FullName | ConvertFrom-Json
$description = $metadataContent.description.Replace("/en-us/", "/").Replace("http://", "https://").Replace("https://docs.microsoft.com/", "/")
$description = $metadataContent.description
$displayName = $metadataContent.itemDisplayName

$templateContent = Get-Content $templatePath | ConvertFrom-Json
Expand Down
38 changes: 19 additions & 19 deletions src/TemplateRefGenerator/Files/samples/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@
},
{
"Title": "NetApp ONTAP Cloud with SQL",
"Description": "NetApp ONTAP Cloud, the leading enterprise storage operating system, is deployed using OnCommand Cloud Manager to deliver secure, proven NFS, CIFS and iSCSI data management for Azure cloud storage. A software-only storage service running the ONTAP storage operating system, ONTAP Cloud combines data control with enterprise-class storage features—such as data deduplication and compression—to minimize your Azure storage footprint. OnCommand Cloud Manager handles deployment and management of ONTAP Cloud, giving you a simple point-and-click environment to manage your storage and ease control of your data. This Quickstart deploys a production ready and secure environment which includes NetApp ONTAP Cloud, OnCommand Manager, backend SQL Server and Jump Server for accessing systems via remote Desktop.It follows standard recommended architecture & security best practices. See quickstart guide at https://bit.ly/otcguide before deploying the template.",
"Description": "NetApp ONTAP Cloud, the leading enterprise storage operating system, is deployed using OnCommand Cloud Manager to deliver secure, proven NFS, CIFS and iSCSI data management for Azure cloud storage. A software-only storage service running the ONTAP storage operating system, ONTAP Cloud combines data control with enterprise-class storage features—such as data deduplication and compression—to minimize your Azure storage footprint. OnCommand Cloud Manager handles deployment and management of ONTAP Cloud, giving you a simple point-and-click environment to manage your storage and ease control of your data. This Quickstart deploys a production ready and secure environment which includes NetApp ONTAP Cloud, OnCommand Manager, backend SQL Server and Jump Server for accessing systems via remote Desktop.It follows standard recommended architecture & security best practices. See quickstart guide at http://bit.ly/otcguide before deploying the template.",
"Path": "application-workloads/netapp/netapp-ontap-sql",
"ResourceTypes": [],
"HasBicep": false
Expand Down Expand Up @@ -2084,7 +2084,7 @@
},
{
"Title": "SAP LaMa template for SAP NetWeaver application server",
"Description": "This template deploys a virtual machine and installs the required applications to use this virtual machine for SAP LaMa. The template also creates the required disk layout. For more information about managing Azure virtual machines with SAP LaMa, see /azure/virtual-machines/workloads/sap/lama-installation.",
"Description": "This template deploys a virtual machine and installs the required applications to use this virtual machine for SAP LaMa. The template also creates the required disk layout. For more information about managing Azure virtual machines with SAP LaMa, see https://docs.microsoft.com/azure/virtual-machines/workloads/sap/lama-installation.",
"Path": "application-workloads/sap/sap-lama-apps",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand All @@ -2097,7 +2097,7 @@
},
{
"Title": "SAP LaMa template for SAP NetWeaver ASCS",
"Description": "This template deploys a virtual machine and installs the required applications to use this virtual machine for SAP LaMa. The template also creates the required disk layout. For more information about managing Azure virtual machines with SAP LaMa, see /azure/virtual-machines/workloads/sap/lama-installation.",
"Description": "This template deploys a virtual machine and installs the required applications to use this virtual machine for SAP LaMa. The template also creates the required disk layout. For more information about managing Azure virtual machines with SAP LaMa, see https://docs.microsoft.com/azure/virtual-machines/workloads/sap/lama-installation.",
"Path": "application-workloads/sap/sap-lama-ascs",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand All @@ -2110,7 +2110,7 @@
},
{
"Title": "SAP LaMa template for SAP NetWeaver database server",
"Description": "This template deploys a virtual machine and installs the required applications to use this virtual machine for SAP LaMa. The template also creates the required disk layout. For more information about managing Azure virtual machines with SAP LaMa, see /azure/virtual-machines/workloads/sap/lama-installation.",
"Description": "This template deploys a virtual machine and installs the required applications to use this virtual machine for SAP LaMa. The template also creates the required disk layout. For more information about managing Azure virtual machines with SAP LaMa, see https://docs.microsoft.com/azure/virtual-machines/workloads/sap/lama-installation.",
"Path": "application-workloads/sap/sap-lama-database",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand Down Expand Up @@ -2807,7 +2807,7 @@
},
{
"Title": "Deploy a single-VM WordPress to Azure",
"Description": "This template deploys a complete LAMP stack, then installs and initializes WordPress. Once the deployment is finished, you need to go to https://fqdn.of.your.vm/wordpress/ to finish the configuration, create an account, and get started with WordPress.",
"Description": "This template deploys a complete LAMP stack, then installs and initializes WordPress. Once the deployment is finished, you need to go to http://fqdn.of.your.vm/wordpress/ to finish the configuration, create an account, and get started with WordPress.",
"Path": "application-workloads/wordpress/wordpress-single-vm-ubuntu",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand Down Expand Up @@ -4471,7 +4471,7 @@
},
{
"Title": "WinRM on a Windows VM",
"Description": "This template installs a certificate from Azure Key Vault on a Virtual Machine and opens up WinRM HTTP and HTTPS listeners. Prerequisite: A certificate uploaded to Azure Key Vault. Create the Key Vault using the template at https://azure.microsoft.com/documentation/templates/101-create-key-vault",
"Description": "This template installs a certificate from Azure Key Vault on a Virtual Machine and opens up WinRM HTTP and HTTPS listeners. Prerequisite: A certificate uploaded to Azure Key Vault. Create the Key Vault using the template at http://azure.microsoft.com/en-us/documentation/templates/101-create-key-vault",
"Path": "demos/vm-winrm-keyvault-windows",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand Down Expand Up @@ -6838,7 +6838,7 @@
},
{
"Title": "Push a certificate onto a Windows VM",
"Description": "Push a certificate onto a Windows VM. Create the Key Vault using the template at https://azure.microsoft.com/documentation/templates/101-create-key-vault",
"Description": "Push a certificate onto a Windows VM. Create the Key Vault using the template at http://azure.microsoft.com/en-us/documentation/templates/101-create-key-vault",
"Path": "quickstarts/microsoft.compute/vm-push-certificate-windows",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand Down Expand Up @@ -7103,7 +7103,7 @@
},
{
"Title": "Deploy a trusted launch capable Linux virtual machine",
"Description": "This template allows you to deploy a trusted launch capable Linux virtual machine using a few different options for the Linux version, using the latest patched version. If you enable Secureboot and vTPM, the Guest Attestation extension will be installed on your VM. This extension will perform remote [attestation](/windows/security/information-protection/tpm/tpm-fundamentals#measured-boot-with-support-for-attestation) by the cloud. By default, this will deploy an Standard_D2_v3 size virtual machine in the resource group location and return the FQDN of the virtual machine.",
"Description": "This template allows you to deploy a trusted launch capable Linux virtual machine using a few different options for the Linux version, using the latest patched version. If you enable Secureboot and vTPM, the Guest Attestation extension will be installed on your VM. This extension will perform remote [attestation](https://docs.microsoft.com/en-us/windows/security/information-protection/tpm/tpm-fundamentals#measured-boot-with-support-for-attestation) by the cloud. By default, this will deploy an Standard_D2_v3 size virtual machine in the resource group location and return the FQDN of the virtual machine.",
"Path": "quickstarts/microsoft.compute/vm-trustedlaunch-linux",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand All @@ -7117,7 +7117,7 @@
},
{
"Title": "Deploy a trusted launch capable Windows virtual machine",
"Description": "This template allows you to deploy a trusted launch capable Windows virtual machine using a few different options for the Windows version, using the latest patched version. If you enable Secureboot and vTPM, the Guest Attestation extension will be installed on your VM. This extension will perform remote [attestation](/windows/security/information-protection/tpm/tpm-fundamentals#measured-boot-with-support-for-attestation) by the cloud. By default, this will deploy an Standard_D2_v3 size virtual machine in the resource group location and return the FQDN of the virtual machine.",
"Description": "This template allows you to deploy a trusted launch capable Windows virtual machine using a few different options for the Windows version, using the latest patched version. If you enable Secureboot and vTPM, the Guest Attestation extension will be installed on your VM. This extension will perform remote [attestation](https://docs.microsoft.com/en-us/windows/security/information-protection/tpm/tpm-fundamentals#measured-boot-with-support-for-attestation) by the cloud. By default, this will deploy an Standard_D2_v3 size virtual machine in the resource group location and return the FQDN of the virtual machine.",
"Path": "quickstarts/microsoft.compute/vm-trustedlaunch-windows",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand Down Expand Up @@ -7447,7 +7447,7 @@
},
{
"Title": "Deploy a trusted launch capable Windows VM Scale Set",
"Description": "This template allows you to deploy a trusted launch capable VM Scale Set of Windows VMs using the latest patched version of Windows Server 2016, Windows Server 2019 or Windows Server 2022 Azure Edition. These VMs are behind a load balancer with NAT rules for RDP connections. If you enable Secureboot and vTPM, the Guest Attestation extension will be installed on your VMSS. This extension will perform remote [attestation](/windows/security/information-protection/tpm/tpm-fundamentals#measured-boot-with-support-for-attestation) by the cloud.",
"Description": "This template allows you to deploy a trusted launch capable VM Scale Set of Windows VMs using the latest patched version of Windows Server 2016, Windows Server 2019 or Windows Server 2022 Azure Edition. These VMs are behind a load balancer with NAT rules for RDP connections. If you enable Secureboot and vTPM, the Guest Attestation extension will be installed on your VMSS. This extension will perform remote [attestation](https://docs.microsoft.com/en-us/windows/security/information-protection/tpm/tpm-fundamentals#measured-boot-with-support-for-attestation) by the cloud.",
"Path": "quickstarts/microsoft.compute/vmss-trustedlaunch-windows",
"ResourceTypes": [
"Microsoft.Compute/virtualMachineScaleSets",
Expand Down Expand Up @@ -8595,7 +8595,7 @@
},
{
"Title": "Configure Dev Box service",
"Description": "This template would create all Dev Box admin resources as per Dev Box quick start guide (https://learn.microsoft.com/azure/dev-box/quickstart-create-dev-box). You can view all resources created, or directly go to DevPortal.microsoft.com to create your first Dev Box.",
"Description": "This template would create all Dev Box admin resources as per Dev Box quick start guide (https://learn.microsoft.com/en-us/azure/dev-box/quickstart-create-dev-box). You can view all resources created, or directly go to DevPortal.microsoft.com to create your first Dev Box.",
"Path": "quickstarts/microsoft.devcenter/devbox-with-customized-image",
"ResourceTypes": [
"Microsoft.Authorization/roleAssignments",
Expand Down Expand Up @@ -9331,7 +9331,7 @@
},
{
"Title": "Deploy HDInsight cluster + Confluent Schema Registry node",
"Description": "This template allows you to create an HDInsight cluster running Linux with a schema registry edge node. For more information, see /azure/hdinsight/hdinsight-apps-use-edge-node",
"Description": "This template allows you to create an HDInsight cluster running Linux with a schema registry edge node. For more information, see https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-apps-use-edge-node",
"Path": "quickstarts/microsoft.hdinsight/hdinsight-kafka-with-edge-schema-registry",
"ResourceTypes": [
"Microsoft.HDInsight/clusters",
Expand All @@ -9352,7 +9352,7 @@
},
{
"Title": "Deploy an edge node to an existing HDInsight cluster",
"Description": "This template allows you to create an empty edge node and add it to an existing HDInsight cluster. For more information, see /azure/hdinsight/hdinsight-apps-use-edge-node",
"Description": "This template allows you to create an empty edge node and add it to an existing HDInsight cluster. For more information, see https://docs.microsoft.com/azure/hdinsight/hdinsight-apps-use-edge-node",
"Path": "quickstarts/microsoft.hdinsight/hdinsight-linux-add-edge-node",
"ResourceTypes": [
"Microsoft.HDInsight/clusters/applications"
Expand Down Expand Up @@ -9390,7 +9390,7 @@
},
{
"Title": "Deploy a HDInsight cluster with an edge node",
"Description": "This template allows you to create an HDInsight cluster running Linux with an empty edge node. For more information, see /azure/hdinsight/hdinsight-apps-use-edge-node",
"Description": "This template allows you to create an HDInsight cluster running Linux with an empty edge node. For more information, see https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-apps-use-edge-node",
"Path": "quickstarts/microsoft.hdinsight/hdinsight-linux-with-edge-node",
"ResourceTypes": [
"Microsoft.HDInsight/clusters",
Expand Down Expand Up @@ -11643,7 +11643,7 @@
},
{
"Title": "Standard Load Balancer with Backend Pool by IP Addresses",
"Description": "This template is used to demonstrate how ARM Templates can be used to configure the Backend Pool of a Load Balancer by IP Address as outlined in the [Backend Pool management](/azure/load-balancer/backend-pool-management) document.",
"Description": "This template is used to demonstrate how ARM Templates can be used to configure the Backend Pool of a Load Balancer by IP Address as outlined in the [Backend Pool management](https://docs.microsoft.com/azure/load-balancer/backend-pool-management) document.",
"Path": "quickstarts/microsoft.network/load-balancer-ip-configured-backend-pool",
"ResourceTypes": [
"Microsoft.Compute/virtualMachines",
Expand Down Expand Up @@ -13377,7 +13377,7 @@
},
{
"Title": "App Service Quickstart - Linux App",
"Description": "This template is to be used with /azure/app-service/quickstart-arm-template",
"Description": "This template is to be used with http://docs.microsoft.com/azure/app-service/quickstart-arm-template",
"Path": "quickstarts/microsoft.web/app-service-docs-linux",
"ResourceTypes": [
"Microsoft.Web/serverfarms",
Expand All @@ -13388,7 +13388,7 @@
},
{
"Title": "App Service Quickstart - Windows container app",
"Description": "This template is to be used with /azure/app-service/quickstart-arm-template",
"Description": "This template is to be used with http://docs.microsoft.com/azure/app-service/quickstart-arm-template",
"Path": "quickstarts/microsoft.web/app-service-docs-windows-container",
"ResourceTypes": [
"Microsoft.Web/serverfarms",
Expand All @@ -13398,7 +13398,7 @@
},
{
"Title": "App Service Quickstart - Windows app",
"Description": "This template is to be used with /azure/app-service/quickstart-arm-template",
"Description": "This template is to be used with http://docs.microsoft.com/azure/app-service/quickstart-arm-template",
"Path": "quickstarts/microsoft.web/app-service-docs-windows",
"ResourceTypes": [
"Microsoft.Web/serverfarms",
Expand Down Expand Up @@ -14116,7 +14116,7 @@
},
{
"Title": "App Service Quickstart - Windows app",
"Description": "This template is to be used with /azure/app-service/quickstart-arm-template",
"Description": "This template is to be used with http://docs.microsoft.com/azure/app-service/quickstart-arm-template",
"Path": "quickstarts/microsoft.web/webapp-basic-windows",
"ResourceTypes": [
"Microsoft.Web/serverfarms",
Expand Down
6 changes: 4 additions & 2 deletions src/TemplateRefGenerator/Generators/MarkdownGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,10 @@ The following quickstart samples deploy this resource type.
foreach (var link in matchingLinks)
{
var bicepUrl = $"https://github.com/Azure/azure-quickstart-templates/tree/master/{link.Path}/main.bicep";
var description = MarkdownUtils.ConvertDocsLinks(link.Description);

sb.Append($"""
> | [{link.Title}]({bicepUrl}) | {link.Description} |
> | [{link.Title}]({bicepUrl}) | {MarkdownUtils.Escape(description)} |
""");
}
Expand Down Expand Up @@ -408,9 +409,10 @@ The following quickstart templates deploy this resource type.
var templateUrl = $"https://github.com/Azure/azure-quickstart-templates/tree/master/{link.Path}";
var rawTemplateUrl = $"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/{link.Path}/azuredeploy.json";
var deployUrl = $"https://portal.azure.com/#create/Microsoft.Template/uri/{Uri.EscapeDataString(rawTemplateUrl)}";
var description = MarkdownUtils.ConvertDocsLinks(link.Description);

sb.Append($"""
> | [{link.Title}]({templateUrl})<br><br>[![Deploy to Azure](~/media/deploy-to-azure.svg)]({deployUrl}) | {link.Description} |
> | [{link.Title}]({templateUrl})<br><br>[![Deploy to Azure](~/media/deploy-to-azure.svg)]({deployUrl}) | {MarkdownUtils.Escape(description)} |
""");
}
Expand Down
6 changes: 5 additions & 1 deletion src/TemplateRefGenerator/Utils/MarkdownUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public static string Escape(string input) => input
.Replace("\n", "<br />");

public static string ConvertDocsLinks(string input) => input
// Remove hostname so that links under the same domain are relative
// Remove hostname and /en-us/ prefix so that links under the same domain are relative
.Replace("http://docs.microsoft.com/", "https://docs.microsoft.com/")
.Replace("http://learn.microsoft.com/", "https://learn.microsoft.com/")
.Replace("https://docs.microsoft.com/en-us/", "https://docs.microsoft.com/")
.Replace("https://learn.microsoft.com/en-us/", "https://learn.microsoft.com/")
.Replace("https://docs.microsoft.com/", "/")
.Replace("https://learn.microsoft.com/", "/");
}

0 comments on commit dd1f194

Please sign in to comment.