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
Save a copy of the main template to your local computer.
33
+
Save a copy of the main template to your local computer with the .json extension, for example, azuredeploy.json. You don't need to save a copy of the linked template. The linked template will be copied from a GitHub repository to a storage account.
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. \
37
+
The following PowerShell script creates a storage account, creates a container, and copies the linked template from a github repository to the container. A copy of the linked template is stored in [GitHub](https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/get-started-deployment/linked-template/linkedStorageAccount.json).
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,19 +74,14 @@ Set-AzStorageBlobContent `
74
74
-Blob $fileName `
75
75
-Context $context
76
76
77
-
# List the template
78
-
Get-AzStorageBlob `
79
-
-Container $containerName `
80
-
-Blob $fileName
81
-
82
77
Write-Host "Press [ENTER] to continue ..."
83
78
```
84
79
85
80
## Deploy template
86
81
87
82
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.
88
83
89
-
If you haven't created the resource group, see [Create resource group](deployment-tutorial-linked-template.md#create-resource-group).
84
+
If you haven't created the resource group, see [Create resource group](./deployment-tutorial-local-template.md#create-resource-group).
90
85
91
86
# [PowerShell](#tab/azure-powershell)
92
87
@@ -95,8 +90,8 @@ If you haven't created the resource group, see [Create resource group](deploymen
95
90
$projectName = Read-Host -Prompt "Enter a project name:" # This name is used to generate names for Azure resources, such as storage account name.
96
91
$templateFile = Read-Host -Prompt "Enter the main template file and path"
97
92
98
-
$resourceGroupName = $projectName + "rg"
99
-
$storageAccountName = $projectName + "store"
93
+
$resourceGroupName="${projectName}rg"
94
+
$storageAccountName="${projectName}store"
100
95
$containerName = "templates"
101
96
$fileName = "linkedStorageAccount.json" # A file name used for downloading and uploading the linked template.
Save a copy of the template to your local computer. You deploy this template later in the tutorial.
41
+
> [!IMPORTANT]
42
+
> Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. The name must be unique. In the template, the storage account name is the project name with "store" appended, and the project name must be between 3 and 11 characters. So the project name must meet the storage account name requirements and has less than 11 characters.
43
+
44
+
Save a copy of the template to your local computer with the .json extension, for example, azuredeploy.json. You deploy this template later in the tutorial.
42
45
43
46
## Sign in to Azure
44
47
@@ -56,6 +59,20 @@ Connect-AzAccount
56
59
az login
57
60
```
58
61
62
+
If you have multiple Azure subscriptions, select the subscription you want to use:
0 commit comments