Security Compliance
Importing ARM template causes the error "The given key was not present in the dictionary."
Following this article, you will be able to solve template errors in ARM.
First published date
Last published date
Overview
Product section
Cause
- The wrong "DefaultValue" value was entered in the template.
- The default value was not listed as an item per se in the list above its definition.
Resolution
Instead what error points out is to the "DefaultValue" key.
Here is the OU code section again:
"OrganizationalUnit": {
"IsHiddenFromRequester": false,
"Definition": {
"Type": "DropDownList",
"Label": "['en-us:Organizational unit', 'de-de:Organisationseinheit', 'fr-fr:Unité organisationnelle']",
"Items": [
{
"Value": "OU=ARM-Test,DC=arm,DC=local",
"DisplayValue": "Test OU"
},
],
"DefaultValue": "OU=ARM-Tsest,DC=arm,DC=local"
}
},
Notice the "DefaultValue" and how it is different than the actual OU value.
This small typo is causing the issue and all that needs to be done is to change it to the correct value, like so:
"OrganizationalUnit": {
"IsHiddenFromRequester": false,
"Definition": {
"Type": "DropDownList",
"Label": "['en-us:Organizational unit', 'de-de:Organisationseinheit', 'fr-fr:Unité organisationnelle']",
"Items": [
{
"Value": "OU=ARM-Test,DC=arm,DC=local",
"DisplayValue": "Test OU"
},
],
"DefaultValue": "OU=ARM-Test,DC=arm,DC=local"
}
},