Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM template validation cannot handle "copy" in outputs section #600

Closed
dohughes-msft opened this issue Apr 15, 2020 · 4 comments
Closed

Comments

@dohughes-msft
Copy link

Issue Type: Bug

Edit any ARM template with a "copy" in the outputs section as per:

https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/copy-outputs

Validation fails even though the syntax is correct.

Template validation failed: Could not find member 'copy' on object of type 'TemplateOutputParameter'. Path 'outputs.fileShares.copy', line 85, position 19.arm-template (validation)

Extension version: 0.9.0
VS Code version: Code 1.44.1 (a9f8623ec050e5f0b44cc8ce8204a1455884749f, 2020-04-11T01:48:12.622Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.88GB (19.74GB free)
Process Argv
Screen Reader no
VM 0%
@neilpeterson
Copy link
Contributor

Thanks @dohughes-msft we will look into this.

@StephenWeatherford
Copy link
Contributor

@KenKilty
Copy link

Repro of the issue with sub-level template and params. This generates one additional warning not present in the original issue post: Missing required property "value"

{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "rgNamePrefix" : { "value": "LOB1-WORKLOAD1" }, "rgEnvList" : { "value": ["DEV", "PROD"] }, "rgLocation" : { "value": "centralus" }, "instanceCount" : { "value": 2 } } }

{ "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "rgNamePrefix": { "type": "string" }, "rgEnvList": { "type": "array", "allowedValues": [ "DEV", "TEST", "PROD" ] }, "rgLocation": { "type": "string" }, "instanceCount": { "type": "int" } }, "variables": { }, "resources": [ { "type": "Microsoft.Resources/resourceGroups", "apiVersion": "2018-05-01", "location": "[parameters('rgLocation')]", "name": "[concat(parameters('rgNamePrefix'),'-',parameters('rgEnvList')[copyIndex()])]", "copy": { "name": "rgCopy", "count": "[parameters('instanceCount')]" }, "properties": { } } ], "outputs": { "resourceGroups": { "type": "array", "copy": { "count": "[parameters('instanceCount')]", "input": "[resourceId('Microsoft.Resources/resourceGroups', concat(parameters('rgNamePrefix'),'-',parameters('rgEnvList')[copyIndex()]))]" } } } }

@StephenWeatherford
Copy link
Contributor

@dohughes-msft I've verified your scenario is fixed in 0.10.0 (coming out on Monday).
@KenKilty I've moved your example to #695 - for some reason this works for resource group deployment but not the other schemas.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants