Git Product home page Git Product logo

Comments (9)

KacperMucha avatar KacperMucha commented on September 18, 2024 2

I've found another strange issue. ListKeys function also seems to not work in nested template. For example, Azure Function default template contains this code:

{
    "name": "AzureWebJobsDashboard",
    "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageName')), '2015-05-01-preview').key1)]"
},

And it perfectly works in root a template, but in nested template I get an error:
The Resource 'Microsoft.Storage/storageAccounts/somestorageaccount' under resource group 'RG' was not found.
It looks like dependsOn defined on Function resource is ignored and listKeys tries to execute before storage account is created.

from armexamples.

abhi1509 avatar abhi1509 commented on September 18, 2024

did you find an answer/workaround to this ?

from armexamples.

KacperMucha avatar KacperMucha commented on September 18, 2024

Yeah, I stopped using nested inline templates.

from armexamples.

wahidsaleemi avatar wahidsaleemi commented on September 18, 2024

Having the same problem myself.

from armexamples.

rkuehfus avatar rkuehfus commented on September 18, 2024

This still seems to be an issue using even the latest API - 2018-05-01

from armexamples.

tyconsulting avatar tyconsulting commented on September 18, 2024

I worked around the issue by looping outside of the nested template

from armexamples.

tapasudenia avatar tapasudenia commented on September 18, 2024

Did you find any workaround to this? I have this piece of resource which I want to iterate couple of times
The code below is part of the master template, I use the template link (citrix-connector-vm.json) which, actually creates a VM
{
"name": "[concat('CreateConnector',copyIndex(),uniqueString(resourceGroup().id))]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2017-05-10",
"dependsOn": [
"[resourceId('Microsoft.Compute/availabilitySets', variables('connAvailailitySetName'))]"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(uri(deployment().properties.templateLink.uri,'citrix-connector-vm.json'),parameters('SasToken'))]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"virtualNetworkName": {
"value": "[parameters('virtualNetworkName')]"
},
"adSubnetName": {
"value": "[parameters('adSubnetName')]"
},
"connAvailabilitySetName": {
"value": "[variables('connAvailailitySetName')]"
},
"connVmName": {
"value": "[concat(variables('connVMName'), copyIndex())]"
},
"connVmIp": {
"value": "10.3.0.7"
},
"connAdminUsername": {
"value": "[parameters('connAdminUsername')]"
},
"connAdminPassword": {
"value": "[parameters('connAdminPassword')]"
},
"connVmSize": {
"value": "[parameters('connVmSize')]"
},
"connDiskType": {
"value": "[parameters('connDiskType')]"
},
"connImageSKU": {
"value": "[parameters('connImageSKU')]"
}
}
},
"copy": {
"name": "CopyConnectorVM",
"count": "[parameters('numberOfConnectors')]",
"mode": "Serial",
"batchSize":1
}
}

from armexamples.

JackStromberg avatar JackStromberg commented on September 18, 2024

Sorry to bump up an older topic, but I can repro this issue with the copy function and nested templates as well.

from armexamples.

hsubramaniam avatar hsubramaniam commented on September 18, 2024

Anything on this yet?

from armexamples.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.