rjmax / build2017 Goto Github PK
View Code? Open in Web Editor NEWDemos for //build 2017 session B8107 - ARM Templates: Life after (first) deployment
Demos for //build 2017 session B8107 - ARM Templates: Life after (first) deployment
Hi,
following https://azure.microsoft.com/en-gb/resources/videos/build-2017-azure-resource-manager-templates-life-after-first-deployment/ i was drawn here and tried the mechanism used in https://github.com/rjmax/Build2017/blob/master/Act1.TemplateEnhancements/Chapter02.PropertyCopies.json using copy to extend the storage-profile datadisks.
This however does not seem to work out for me:
statusCode:BadRequest statusMessage:{"error":{"code":"InvalidTemplate","message":"Unable to process template language expressions for resource 'XXX' at line '1' and column '2360'. 'The template function 'copyIndex' is not expected at this location. The function can only be used in a resource with copy specified. Please see https://aka.ms/arm-copy for usage details.'"}}
"copy": [
{
"name": "dataDisks",
"count": "3",
"input": {
"diskSizeGB": "1000",
"lun": "[copyIndex('dataDisks')]",
"createOption": "Empty"
}
}
]
I set the api versions according to the one in the templates and i am running this in westeurope region.
Is there anything else needed to get this running?
Thanks and cheers
Hi Team,
Seems CopyIndex for property looping is not working again.
Followed below MSDN docs
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-multiple#property-iteration
similar issue was reported back in 2017
Error
Unable to process template language expressions for resource '/subscriptions/746ac5b9-70eb-4c76-bdf4-0664bfdff2ea/resourceGroups/GRP-EU-IFM-SMA-RG12/providers/Microsoft.Web/sites/aziedt1xvu284/config/web' at line '155' and column '9'. 'The template function 'copyIndex' is not expected at this location. The function can only be used in a resource with copy specified.
Parameter
"allowedCallerIpAddresses": {
"type": "array",
"defaultValue": [
{ "addressRange": "52.232.252.175/32" },
{ "addressRange": "52.236.71.198/32" },
{ "addressRange": "23.101.29.245/32" }
]
}
Resource Code
{
"apiVersion": "2018-02-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('functionsHost'))]",
"[resourceId('Microsoft.Web/sites/extensions', variables('functionsHost'), 'MSDeploy')]"
],
"name": "web",
"properties": {
"minTlsVersion": "1.2",
"copy": [
{
"name": "ipSecurityRestrictions",
"count": "[length(parameters('allowedCallerIpAddresses'))]",
"input": {
"ipAddress": "[parameters('allowedCallerIpAddresses')[copyIndex('ipSecurityRestrictions')].addressRange]",
"action": "Allow",
"tag": "Default",
"priority": "100",
"name": "[concat('APIM IPs-', copyIndex('ipSecurityRestrictions'))]",
"description": "Allowed APIM Access only"
}
}
]
},
"type": "config"
}
Note
ipSecurityRestrictions do work with single ip.
{
"type": "config",
"apiVersion": "2018-02-01",
"name": "web",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('functionsHost'))]",
"[resourceId('Microsoft.Web/sites/extensions', variables('functionsHost'), 'MSDeploy')]"
],
"properties": {
"minTlsVersion": "1.2",
"ipSecurityRestrictions": [
{
"ipAddress": "[parameters('allowedCallerIpAddresses')[0].addressRange]",
"action": "Allow",
"tag": "Default",
"priority": "100",
"name": "APIM IPs",
"description": "Allowed APIM Access only"
}
]
}
}
Thanks,
Subhash
Are conditions currently supported in any Azure regions? When i try to run the neworexisting conditional example in EastUS or EastUS2, I receive the following validation error (i noticed you deployed yours to eastus2eaup):
10:21:18 - 10:21:17 AM - Error: Code=InvalidRequestContent; Message=The request content was invalid and could not be deserialized: 'Could not find member 'condition' on object of type 'TemplateResource'. Path 'properties.template.resources[0].condition', line 78, position 23.'.
10:21:18 - The deployment validation failed
Can i Manage Access Control for other resource Groups using the Cross Resource Group Feature? I am try to assign permission to an Azure AD Application to another resource group and it fails with the error
Role Assignment to a different ResourceGroup
{
"code": "BadRequest",
"message": "{\r\n "error": {\r\n "code": "InvalidCreateRoleAssignmentRequest",\r\n "message": "The request to create role assignment '449aad68-15ee-49aa
-6871-ee449aad6871' is not valid. Role assignment scope '/subscriptions/xxxxxxx-xxxx-cxxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/CitrixCustomImage' must match the scope specified on the
URI '/subscriptions/xxxxxxx-xxxx-cxxxx-xxxxx-xxxxxxxxxxxx/resourcegroups/CitrixInfraRG38'."\r\n }\r\n}"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.