You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/templates/deployment-tutorial-linked-template.md
+28-20Lines changed: 28 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ In the [previous tutorials](./deployment-tutorial-local-template.md), you learne
12
12
13
13
## Prerequisites
14
14
15
-
We recommend that you complete the first tutorial, but it's not required.
15
+
We recommend that you complete the previous tutorial, but it's not required.
16
16
17
17
## Review template
18
18
@@ -34,7 +34,7 @@ Save a copy of the main template to your local computer.
34
34
35
35
## Store the linked template
36
36
37
-
The following PowerShell script creates a storage account, creates a container, copies the linked template from a github repository to the container. At the end of the execution, the script returns the URI of the linked template. You will pass the value as a parameter when you deploy the main template.
37
+
The following PowerShell script creates a storage account, creates a container, copies the linked template from a github repository to the container. \
38
38
39
39
Select **Try-it** to open the Cloud shell, select **Copy** to copy the PowerShell script, and right-click the shell pane to paste the script:
40
40
@@ -74,35 +74,26 @@ Set-AzStorageBlobContent `
74
74
-Blob $fileName `
75
75
-Context $context
76
76
77
-
# Generate a SAS token
78
-
$templateURI = New-AzStorageBlobSASToken `
79
-
-Context $context `
77
+
# List the template
78
+
Get-AzStorageBlob `
80
79
-Container $containerName `
81
-
-Blob $fileName `
82
-
-Permission r `
83
-
-ExpiryTime (Get-Date).AddHours(8.0) `
84
-
-FullUri
80
+
-Blob $fileName
85
81
86
-
Write-Host "You need the following values later in the tutorial:"
87
-
Write-Host "Resource Group Name: $resourceGroupName"
88
-
Write-Host "Linked template URI with SAS token: $templateURI"
89
82
Write-Host "Press [ENTER] to continue ..."
90
83
```
91
84
92
-
Make a note of the linked template URI. The SAS token is embedded in the URL.
93
-
94
85
## Deploy template
95
86
96
-
Use either Azure CLI or Azure PowerShell to deploy the template.
87
+
To deploy a private template in a storage account, generate a SAS token and include it in the URI for the template. Set the expiry time to allow enough time to complete the deployment. The blob containing the template is accessible to only the account owner. However, when you create a SAS token for the blob, the blob is accessible to anyone with that URI. If another user intercepts the URI, that user is able to access the template. A SAS token is a good way of limiting access to your templates, but you should not include sensitive data like passwords directly in the template.
97
88
98
-
If you haven't created the resource group, see [Create resource group](template-tutorial-create-first-template.md#create-resource-group). The example assumes you've set the **templateFile** variable to the path to the template file, as shown in the [first tutorial](./deployment-tutorial-local-template.md#deploy-template).
89
+
If you haven't created the resource group, see [Create resource group](deployment-tutorial-linked-template.md#create-resource-group).
99
90
100
91
# [PowerShell](#tab/azure-powershell)
101
92
102
93
```azurepowershell
103
94
104
95
$projectName = Read-Host -Prompt "Enter a project name:" # This name is used to generate names for Azure resources, such as storage account name.
105
-
$templateFile = Read-Host -Prompt "Enter the main template file"
96
+
$templateFile = Read-Host -Prompt "Enter the main template file and path"
0 commit comments