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

dateTimeAdd() in certain scenarios gives a template validation error #1056

Closed
StephenWeatherford opened this issue Oct 16, 2020 · 3 comments · Fixed by #1097
Closed

dateTimeAdd() in certain scenarios gives a template validation error #1056

StephenWeatherford opened this issue Oct 16, 2020 · 3 comments · Fixed by #1097

Comments

@StephenWeatherford
Copy link
Contributor

StephenWeatherford commented Oct 16, 2020

This is straight out of the docs (https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-date#datetimeadd):

Template: https://raw.githubusercontent.com/StephenWeatherford/template-examples/master/1056-dateTimeAdd.json
Parameters: https://raw.githubusercontent.com/StephenWeatherford/template-examples/master/1056-dateTimeAdd.parameters.json (only needed to turn on full validation)

Error: Template validation failed: The template variable 'add3Years' is not valid: The template function 'dateTimeAdd' is not valid. Please see https://aka.ms/arm-template-expressions for usage details.. Please see https://aka.ms/arm-template-expressions for usage details.

EXPECTED: no errors
Deployment works fine:

stephenweatherford@Stephens-MacBook-Pro template-examples % ./deploy-rg.sh 1056-dateTimeAdd.json 1056-dateTimeAdd.parameters.json
{- Finished ..
"id": "/subscriptions/e5ef2b13-6478-4887-ad57-1aa6b9475040/resourceGroups/deleteme/providers/Microsoft.Resources/deployments/1056-dateTimeAdd",
"location": null,
"name": "1056-dateTimeAdd",
"properties": {
"correlationId": "1628fa0c-e2d3-45d8-a7bb-c00258655f05",
"debugSetting": null,
"dependencies": [],
"duration": "PT1.6347238S",
"mode": "Incremental",
"onErrorDeployment": null,
"outputResources": [],
"outputs": {
"add3Years": {
"type": "String",
"value": "2023-10-16T18:29:01Z"
}
},
"parameters": {
"baseTime": {
"type": "String",
"value": "2020-10-16 18:29:01Z"
}
},
"parametersLink": null,
"providers": [],
"provisioningState": "Succeeded",
"template": null,
"templateHash": "14462041680041500311",
"templateLink": null,
"timestamp": "2020-10-16T18:29:03.395443+00:00"
},
"resourceGroup": "deleteme",
"type": "Microsoft.Resources/deployments"
}

@StephenWeatherford
Copy link
Contributor Author

Fixed in validation assembly

@jorgecotillo
Copy link
Collaborator

We have a fix in place in the upcoming template engine package.

@StephenWeatherford
Copy link
Contributor Author

Fixed by validation v14

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

Successfully merging a pull request may close this issue.

2 participants