Skip to content

Commit 234a410

Browse files
authored
Merge pull request #1 from Azure/master
merging latest commits
2 parents e2f2eab + 6cedb2c commit 234a410

File tree

3,462 files changed

+254931
-46523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,462 files changed

+254931
-46523
lines changed

.beautifyrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"js": {
3-
"indentChar": " ",
4-
"indentLevel": 0,
5-
"indentSize": 2,
6-
"indentWithTabs": false,
3+
"end_with_newline": true,
4+
"indent_char": " ",
5+
"indent_level": 0,
6+
"indent_size": 2,
7+
"indent_with_tabs": false,
78
"space_after_anon_function": "true"
89
}
910
}

.github/CONTRIBUTING.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,23 @@ To make sure your template is added to Azure.com index, please follow these guid
4343
9. Name **variables** using this scheme **templateScenarioResourceName** (e.g. simpleLinuxVMVNET, userRoutesNSG, elasticsearchPublicIP etc.) that describe the scenario rather. This ensures when a user browses all the resources in the Portal there aren't a bunch of resources with the same name (e.g. myVNET, myPublicIP, myNSG)
4444
10. **Storage account names** need to be lower case and can't contain hyphens (-) in addition to other domain name restrictions. These also need to be globally unique.
4545
11. **Passwords** must be passed into parameters of type `securestring`.
46-
* Passwords must also be passed to customScriptExtension using the `commandToExecute` property in `protectedSettings`. This will look like below
46+
* Passwords must also be passed to Custom Script Extension using the `commandToExecute` property in `protectedSettings`. This will look like below:
4747

4848
```
49-
"properties": {
50-
"publisher": "Microsoft.OSTCExtensions",
51-
"type": "CustomScriptForLinux",
52-
"typeHandlerVersion": "1.4",
53-
"settings": {
54-
"fileUris": [
55-
"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/lamp-app/install_lamp.sh"
56-
]
57-
},
58-
"protectedSettings": {
59-
"commandToExecute": "[concat('sh install_lamp.sh ', parameters('mySqlPassword'))]"
60-
}
61-
}
49+
"properties": {
50+
"publisher": "Microsoft.Azure.Extensions",
51+
"type": "CustomScript",
52+
"typeHandlerVersion": "2.0",
53+
"autoUpgradeMinorVersion": true,
54+
"settings": {
55+
"fileUris": [
56+
"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/lamp-app/install_lamp.sh"
57+
]
58+
},
59+
"protectedSettings": {
60+
"commandToExecute": "[concat('sh install_lamp.sh ', parameters('mySqlPassword'))]"
61+
}
62+
}
6263
```
6364
6465
12. Every parameter in the template must have the **lower-case description** tag specified using the metadata property. This looks like below
@@ -269,4 +270,4 @@ Server Error:{
269270
}
270271
}
271272
}
272-
```
273+
```

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
### Contributing guide
2-
https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/README.md
1+
### Best Practice Checklist
2+
Check these items before submitting a PR... See the Contribution Guide for the full detail: https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/README.md
3+
4+
1. uri's compatible with all clouds (Stack, China, Government)
5+
1. Staged artifacts use _artifactsLocation & _artifactsLocationSasToken
6+
1. Use resourceGroup().location for resource locations
7+
1. Folder names for artifacts (nestedtemplates, scripts, DSC)
8+
1. Use literal values for apiVersion (no variables)
9+
1. Parameter files (GEN-UNIQUE for value generation and no "changemeplease" values
10+
1. $schema and other uris use https
11+
1. Use uniqueString() whenever possible to generate names for resources. While this is not required, it's one of the most common failure points in a deployment.
12+
1. Update the metadata.json with the current date
13+
14+
For details: https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/bp-checklist.md
15+
16+
- [ ] - Please check this box once you've submitted the PR if you've read through the Contribution Guide and best practices checklist.
317

418
### Changelog
5-
*
6-
*
19+
720
*
821
*
922
*
1023

11-
### Description of the change

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ org-mode-config.el
2121
.DS_Store
2222
org-clock-save.el
2323
emacs-config.el
24-
.vscode/settings.json
25-
24+
.vscode
25+
node_modules
26+
Nese_OMS_NEstedforOMSWS.json

1-CONTRIBUTION-GUIDE/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ The following information is relevant to get started with contributing to this r
66
+ [**Contribution guide**](/1-CONTRIBUTION-GUIDE/README.md#contribution-guide). Describes the minimal guidelines for contributing.
77
+ [**Best practices**](/1-CONTRIBUTION-GUIDE/best-practices.md#best-practices). Best practices for improving the quality of your template design.
88
+ [**Git tutorial**](/1-CONTRIBUTION-GUIDE/git-tutorial.md#git-tutorial). Step by step to get you started with Git.
9+
+ [**Useful Tools**](/1-CONTRIBUTION-GUIDE/useful-tools.md#useful-tools). Useful resources and tools for Azure development.
910

1011
## Deploying Samples
1112

1213
You can deploy these samples directly through the Azure Portal or by using the scripts supplied in the root of the repo.
1314

14-
To deploy a sammple using the Azure Portal, click the **Deploy to Azure** button found in the README.md of each sample.
15+
To deploy a sample using the Azure Portal, click the **Deploy to Azure** button found in the README.md of each sample.
1516

1617
To deploy the sample via the command line (using [Azure PowerShell or the Azure CLI](https://azure.microsoft.com/en-us/downloads/)) you can use the scripts.
1718

@@ -21,7 +22,7 @@ Simple execute the script and pass in the folder name of the sample you want to
2122
.\Deploy-AzureResourceGroup.ps1 -ResourceGroupLocation 'eastus' -ArtifactsStagingDirectory '[foldername]'
2223
```
2324
```bash
24-
azure-group-deploy.sh -a [foldername] -l eastus -u
25+
azure-group-deploy.sh -a [foldername] -l eastus
2526
```
2627
If the sample has artifacts that need to be "staged" for deployment (Configuration Scripts, Nested Templates, DSC Packages) then set the upload switch on the command.
2728
You can optionally specify a storage account to use, if so the storage account must already exist within the subscription. If you don't want to specify a storage account
@@ -65,7 +66,7 @@ The README.md describes your deployment. A good description helps other communit
6566
+ Deploy to Azure button
6667
+ Visualize button
6768
+ Description of what the template will deploy
68-
+ Tags, that can be used for seach. Specify the tags comma seperated and enclosed between two back-ticks (e.g Tags: `cluster, ha, sql`)
69+
+ Tags, that can be used for search. Specify the tags comma separated and enclosed between two back-ticks (e.g Tags: `cluster, ha, sql`)
6970
+ *Optional: Prerequisites
7071
+ *Optional: Description on how to use the application
7172
+ *Optional: Notes
@@ -258,3 +259,7 @@ Server Error:{
258259
}
259260
}
260261
```
262+
263+
```
264+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
265+
```

1-CONTRIBUTION-GUIDE/best-practices.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ You are currently reading the best practices.
1313

1414
+ It is a good practice to pass your template through a JSON linter to remove extraneous commas, parenthesis, brackets that may break the "Deploy to Azure" experience. Try http://jsonlint.com/ or a linter package for your favorite editing environment (Visual Studio Code, Atom, Sublime Text, Visual Studio etc.)
1515
+ It's also a good idea to format your JSON for better readability. You can use a JSON formatter package for your local editor or [format online using this link](https://www.bing.com/search?q=json+formatter).
16-
+ A starter template is provided [here](/100-STARTER-TEMPLATE-with-VALIDATION) for you to follow.
1716

1817
The following guidelines are relevant to the main deployment template and nested templates (if used).
1918

@@ -129,8 +128,10 @@ The following guidelines are relevant to the main deployment template and nested
129128

130129
```
131130
"properties": {
132-
"publisher": "Microsoft.OSTCExtensions",
133-
"type": "CustomScriptForLinux",
131+
"publisher": "Microsoft.Azure.Extensions",
132+
"type": "CustomScript",
133+
"version": "2.0",
134+
"autoUpgradeMinorVersion": true,
134135
"settings": {
135136
"fileUris": [
136137
"[concat(variables('template').assets, '/lamp-app/install_lamp.sh')]"
@@ -172,7 +173,7 @@ The following guidelines are relevant to the main deployment template and nested
172173

173174
Note: A complex object cannot contain an expression that references a value from a complex object. Define a separate variable for this purpose.
174175

175-
13. The **domainNameLabel** property for publicIPAddresses must be **unique**. domainNameLabel is required to be betweeen 3 and 63 characters long and to follow the rules specified by this regular expression ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. As the uniqueString function will generate a string that is 13 characters long in the example below it is presumed that the dnsPrefixString prefix string has been checked to be no more than 50 characters long and to conform to those rules.
176+
13. The **domainNameLabel** property for publicIPAddresses must be **unique**. domainNameLabel is required to be between 3 and 63 characters long and to follow the rules specified by this regular expression ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. As the uniqueString function will generate a string that is 13 characters long in the example below it is presumed that the dnsPrefixString prefix string has been checked to be no more than 50 characters long and to conform to those rules.
176177

177178
```
178179
"parameters": {
@@ -194,11 +195,11 @@ The following guidelines are relevant to the main deployment template and nested
194195
```
195196
"outputs": {
196197
"fqdn": {
197-
"value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName')),providers('Microsoft.Network', 'publicIPAddresses').apiVersions[0]).dnsSettings.fqdn]",
198+
"value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName')),'2016-10-01').dnsSettings.fqdn]",
198199
"type": "string"
199200
},
200201
"ipaddress": {
201-
"value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName')),providers('Microsoft.Network', 'publicIPAddresses').apiVersions[0]).ipAddress]",
202+
"value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',parameters('publicIPAddressName')),'2016-10-01').dnsSettings.fqdn]",
202203
"type": "string"
203204
}
204205
}
@@ -211,7 +212,7 @@ The following guidelines are relevant to the main deployment template and nested
211212
It is obvious to create a single deployment template for deploying a single resource. Nested templates are common for more advanced scenarios. The following section is by no means a hard requirement, but more of a guidance to help you decide between a single template or a decomposed nested template design.
212213

213214
* Create a single template for a single tier application
214-
* Create a nested templates deployment for a multitier application
215+
* Create a nested templates deployment for a multi-tier application
215216
* Use nested templates for conditional deployment
216217

217218
### Samples that contain extra artifacts (Custom Scripts, nested templates, etc)
@@ -221,7 +222,7 @@ When samples contain scripts, templates or other artifacts that need to be made
221222
First, define two standard parameters:
222223

223224
* _artifactsLocation - this is the base URI where all artifacts for the deployment will be staged. The default value should be the samples folder so that the sample can be easily deployed in scenarios where a private location is not required.
224-
* _artifactsocationSasToken - this is the sasToken required to access _artifactsLocation. The default value should be "" for scenarios where the _artifactsLocation is not secured, for example, the raw GitHub URI.
225+
* _artifactsLocationSasToken - this is the sasToken required to access _artifactsLocation. The default value should be "" for scenarios where the _artifactsLocation is not secured, for example, the raw GitHub URI.
225226

226227
```
227228
"parameters": {
@@ -310,15 +311,15 @@ When authoring a template that references another sample, define a complex objec
310311
_**Note:** Using this approach will still require pulling the dependent artifact from the raw GitHub location. The sample scripts do not privately stage artifacts from adjacent solutions. In practice, it is expected that this technique would be rarely used because the main template being deployed has a dependency on a shared template that may have a different lifecycle, resulting in unexpected changes in the configuration. In a real-world scenario, all the templates that make up the deployment should be under the same span of control and could be staged together. Simply put share the same parent. This will work for a shared environment of the repository, but a best practice would be to refactor these samples to ensure a proper configuration is maintained._
311312

312313

313-
It is possible to deploy a nested template based on parameter input. The parameter input is used to concatenate the relative path to a nested template. Based on the user input a different template is deployed. This enables a conditional nested template deployment. The paramater is used to define the name of the template. Ensure the allowedValues of the input parameter match the names of the nested templates.
314+
It is possible to deploy a nested template based on parameter input. The parameter input is used to concatenate the relative path to a nested template. Based on the user input a different template is deployed. This enables a conditional nested template deployment. The parameter is used to define the name of the template. Ensure the allowedValues of the input parameter match the names of the nested templates.
314315

315316
### Nested templates design for more advanced scenarios
316317

317318
When you decide to decompose your template design into multiple nested templates, the following guidelines will help to standardize the design. These guidelines are based on the [best practices for designing Azure Resource Manager templates](https://azure.microsoft.com/en-us/documentation/articles/best-practices-resource-manager-design-templates/) documentation.
318319
For this guidance a deployment of a SharePoint farm is used as an example. The SharePoint farm consists of multiple tiers. Each tier can be created with high availability. The recommended design consists of the following templates.
319320

320321
+ **Main template** (azuredeploy.json). Used for the input parameters.
321-
+ **Shared resouces template**. Deploys the shared resources that all other resources use (e.g. virtual network, availability sets). The expression dependsOn enforces that this template is deployed before the other templates.
322+
+ **Shared resources template**. Deploys the shared resources that all other resources use (e.g. virtual network, availability sets). The expression dependsOn enforces that this template is deployed before the other templates.
322323
+ **Optional resources template**. Conditionally deploys resources based on a parameter (e.g. a jumpbox)
323324
+ **Member resources templates**. Each within an application tier within has its own configuration. Within a tier different instance types can be defined. (e.g. first instance creates a new cluster, additional instances are added to the existing cluster). Each instance type will have its own deployment template.
324325
+ **Scripts**. Widely reusable scripts are applicable for each instance type (e.g. initialize and format additional disks). Custom scripts are created for specific customization purpose are different per instance type.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Azure Resource Manager Templates - Best Practice Checklist
2+
3+
Use this as a quick checklist to ensure your sample meets the minimum set of guidelines for samples in this repository. For the full set and a detailed explanation see the [**Best Practices Guide**](/1-CONTRIBUTION-GUIDE/best-practices.md#best-practices).
4+
5+
These practices ensure your sample provides a consistent, reliable experience across all Azure Clouds.
6+
7+
## Checklist
8+
9+
1. All uri's should be compatible with all clouds (Stack, China, Government)
10+
+ See #9 in [**Best practices**](/1-CONTRIBUTION-GUIDE/best-practices.md#best-practices)
11+
12+
2. For staging artifacts (scripts, templates, etc) use paramters named _artifactsLocation & _artifactsLocationSasToken - see:
13+
+ [**Samples that contain artifacts**](https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/best-practices.md#samples-that-contain-extra-artifacts-custom-scripts-nested-templates-etc)
14+
15+
3. Use resourceGroup().location for resource locations to be compatible with all clouds
16+
+ Exceptions for resources that are available on only a few locations (which is not the same as !global)
17+
+ If a location param is needed do not use parameters named "location", instead resourceLocation or storageLocation, etc.
18+
19+
4. Folder names for artifacts:
20+
+ nestedtemplates
21+
+ scripts
22+
+ DSC
23+
24+
5. Use literal values for apiVersion (do not variables so schema validation can be done)
25+
26+
6. Parameter files must not contain values like "changemeplease" - use default values when appropriate in the template file and leave them out of param files
27+
28+
7. Check whether $schema entries in templates and parameter files are the latest (2015-01-01) and using https
29+
30+
8. Update the metadata.json with the current date
31+
32+
9. Use uniqueString() whenever possible to generate names for resources. While this is not required, it's one of the most common failure points in a deployment.
33+
34+
---
35+
36+
### Final Note
37+
If you're submitting a developer sample (101/201/301 level template), use the full best practice guide to ensure the full list of practices have been followed.

0 commit comments

Comments
 (0)