Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Moore authored and Brian Moore committed May 13, 2020
2 parents f4a554e + c771439 commit 401a243
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 31 deletions.
44 changes: 32 additions & 12 deletions 101-app-function/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,48 @@
"description": "The name of you Web Site."
}
},
"storageAccountName": {
"type": "String",
"defaultValue": "[concat('store', uniqueString(resourceGroup().id))]"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {
"hostingPlanName": "[concat('hpn-', resourceGroup().name)]"
"variables": {
"hostingPlanName": "[concat('hpn-', resourceGroup().name)]",
"storageAccountid": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-02-01",
"apiVersion": "2019-08-01",
"name": "[parameters('siteName')]",
"kind": "functionapp,linux",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
],
"properties": {
"name": "[parameters('siteName')]",
"siteConfig": {
"appSettings": [
"appSettings": [
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "python"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2019-06-01').keys[0].value)]"
}
]
},
Expand All @@ -50,17 +60,27 @@
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"apiVersion": "2019-08-01",
"name": "[variables('hostingPlanName')]",
"location": "[parameters('location')]",
"kind": "linux",
"properties":{
"reserved": false
"properties": {
"reserved": true
},
"sku": {
"Tier": "Dynamic",
"Name": "Y1"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[parameters('storageAccountName')]",
"apiVersion": "2019-06-01",
"location": "[parameters('location')]",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS"
}
}
]
}
}
7 changes: 5 additions & 2 deletions 101-app-function/azuredeploy.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"parameters": {
"siteName": {
"value": "GEN-UNIQUE"
}
},
"storageAccountName": {
"value": "GEN-UNIQUE"
}
}
}
}
7 changes: 5 additions & 2 deletions 101-app-function/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
"description": "This template deploy an empty Function App and a hosting plan.",
"summary": "This template deploys an empty Function App and a hosting plan.",
"githubUsername": "leestott",
"dateUpdated": "2019-11-06",
"dateUpdated": "2020-05-11",
"type": "QuickStart",
"tags": {
"subscriptiontype": "Azure4Student",
"resource":"appServices, Function",
"os": "serverless",
"level": "Begginer",
"cost": "$0"
}
},
"environments": [
"AzureCloud"
]
}
16 changes: 8 additions & 8 deletions 101-batchaccount-with-storage/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,36 @@
},
"resources": [
{
"comments": "This storage account is used to associate to a batch account",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('storageAccountname')]",
"apiVersion": "2016-01-01",
"location": "[parameters('location')]",
"comments": "This storage account is used to associate to a batch account",
"sku": {
"name": "[parameters('storageAccountsku')]"
},
"kind": "Storage",
"kind": "StorageV2",
"tags": {
"ObjectName": "[variables('storageAccountName')]"
},
"properties": {}
},
{
"type": "Microsoft.Batch/batchAccounts",
"apiVersion": "2019-08-01",
"name": "[parameters('batchAccountName')]",
"apiVersion": "2015-12-01",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"tags": {
"ObjectName": "[parameters('batchAccountName')]"
},
"properties": {
"autoStorage": {
"storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
}
}
],
"outputs": {
Expand Down
2 changes: 1 addition & 1 deletion 101-batchaccount-with-storage/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "This template creates a Batch Account and a storage account.",
"summary": "Create a Batch Account using a template and s storage account associated with the batch account.",
"githubUsername": "zechariahks",
"dateUpdated": "2017-08-28"
"dateUpdated": "2020-05-11"
}


10 changes: 8 additions & 2 deletions application-gateway-demo-setup/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@
"adminUsername": {
"value": "[parameters('adminUsername')]"
},
"adminPassword": {
"authenticationType": {
"value": "password"
},
"adminPasswordOrKey": {
"value": "[parameters('adminPassword')]"
},
"dnsNameForPublicIP": {
Expand Down Expand Up @@ -126,7 +129,10 @@
"adminUsername": {
"value": "[parameters('adminUsername')]"
},
"adminPassword": {
"authenticationType": {
"value": "password"
},
"adminPasswordOrKey": {
"value": "[parameters('adminPassword')]"
},
"dnsNameForPublicIP": {
Expand Down
2 changes: 1 addition & 1 deletion application-gateway-demo-setup/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "This template allows you to quickly deploy Azure Application Gateway demo to test load-balancing with or without cookie-based affinity.",
"summary": "Once your demo setup is deployed use DNS name of your Azure Application Gateway that was generated for you automatically to test the load balancing.",
"githubUsername": "AlekseiPolkovnikov",
"dateUpdated": "2016-09-13"
"dateUpdated": "2020-05-12"
}


6 changes: 3 additions & 3 deletions test/ci-scripts/Gen-TemplateParameters.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ While($txt.Contains("`"GEN-UNIQUE-")){
$numStart = $txt.IndexOf("`"GEN-UNIQUE-") + 12
$numEnd = $txt.IndexOf("`"", $numStart)
$l = $txt.Substring($numStart, $numEnd-$numStart)
$i = [int]::parse($l)
if($i -gt 24){ $i = 24 }
Write-Host "l > $i"
$i = [int]::parse($l) - 2 # subtract 2 since 'ci' is prepended
if($i -gt 24){ $i = 24 } elseif($i -lt 1){ $i = 1}
Write-Output "length = $i"
$v = "ci" + (New-Guid).ToString().Replace("-", "").ToString().Substring(0, $i)
[regex]$r = "GEN-UNIQUE-$l"
$txt = $r.Replace($txt, $v, 1)
Expand Down

0 comments on commit 401a243

Please sign in to comment.