title: ARM template - Bad JSON content found in the request. (Code:BadRequest)
body: <p>I am trying to deploy a KeyVault in Azure via PowerShell's Az Library and ARM template.
  (I found this: <a href="https://stackoverflow.com/questions/58485101/arm-template-error-bad-json-content-found-in-the-request">ARM template error Bad JSON content found in the request</a> but it did not help me)</p>
  <p>My Code looks like this:</p>
  <pre><code>$kvDeployResult = New-AzResourceGroupDeployment -Name &quot;addKeyVault&quot; -ResourceGroupName $resourceGroupeName -TemplateFile &quot;.\deploy_kv.json&quot; -TemplateParameterFile &quot;.\deploy_kv_param.json&quot; -Verbose
  </code></pre>
  <p>Using the command like this:</p>
  <pre><code>$kvDeployResult = New-AzResourceGroupDeployment -Name &quot;addKeyVault&quot; -ResourceGroupName $resourceGroupeName -TemplateObject $deploy_kv_hashtable -TemplateParameterObject $deploy_kv_param_hashtable -Verbose
  </code></pre>
  <p>results in even lesser progress and more errors.</p>
  <p>I get this output:
  <a href="https://i.stack.imgur.com/7L7tK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7L7tK.png" alt="enter image description here" /></a></p>
  <p>My <code>deploy_kv.json</code>looks like this</p>
  <pre><code>{
  &quot;$schema&quot;:  &quot;http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#&quot;,
  &quot;contentVersion&quot;:  &quot;1.0.0.0&quot;,
  &quot;parameters&quot;:  {
                     &quot;name&quot;:  {
                                  &quot;type&quot;:  &quot;string&quot;
                              },
                     &quot;location&quot;:  {
                                      &quot;type&quot;:  &quot;string&quot;
                                  },
                     &quot;sku&quot;:  {
                                 &quot;type&quot;:  &quot;string&quot;
                             },
                     &quot;accessPolicies&quot;:  {
                                            &quot;type&quot;:  &quot;Array&quot;
                                        },
                     &quot;tenant&quot;:  {
                                    &quot;type&quot;:  &quot;string&quot;
                                },
                     &quot;enabledForDeployment&quot;:  {
                                                  &quot;type&quot;:  &quot;bool&quot;
                                              },
                     &quot;enabledForTemplateDeployment&quot;:  {
                                                          &quot;type&quot;:  &quot;bool&quot;
                                                      },
                     &quot;enabledForDiskEncryption&quot;:  {
                                                      &quot;type&quot;:  &quot;bool&quot;
                                                  },
                     &quot;enableRbacAuthorization&quot;:  {
                                                     &quot;type&quot;:  &quot;bool&quot;
                                                 },
                     &quot;enableSoftDelete&quot;:  {
                                              &quot;type&quot;:  &quot;bool&quot;
                                          },
                     &quot;softDeleteRetentionInDays&quot;:  {
                                                       &quot;type&quot;:  &quot;int&quot;
                                                   },
                     &quot;networkAcls&quot;:  {
                                         &quot;type&quot;:  &quot;Object&quot;
                                     }
                 },
  &quot;variables&quot;:  {
  
                },
  &quot;resources&quot;:  [
                    {
                        &quot;apiVersion&quot;:  &quot;2018-02-14&quot;,
                        &quot;name&quot;:  &quot;[parameters('name')]&quot;,
                        &quot;location&quot;:  &quot;[parameters('location')]&quot;,
                        &quot;type&quot;:  &quot;Microsoft.KeyVault/vaults&quot;,
                        &quot;properties&quot;:  {
                                           &quot;enabledForDeployment&quot;:  &quot;[parameters('enabledForDeployment')]&quot;,
                                           &quot;enabledForTemplateDeployment&quot;:  &quot;[parameters('enabledForTemplateDeployment')]&quot;,
                                           &quot;enabledForDiskEncryption&quot;:  &quot;[parameters('enabledForDiskEncryption')]&quot;,
                                           &quot;enableRbacAuthorization&quot;:  &quot;[parameters('enableRbacAuthorization')]&quot;,
                                           &quot;accessPolicies&quot;:  &quot;[parameters('accessPolicies')]&quot;,
                                           &quot;tenantId&quot;:  &quot;[parameters('tenant')]&quot;,
                                           &quot;sku&quot;:  {
                                                       &quot;name&quot;:  &quot;[parameters('sku')]&quot;,
                                                       &quot;family&quot;:  &quot;A&quot;
                                                   },
                                           &quot;enableSoftDelete&quot;:  &quot;[parameters('enableSoftDelete')]&quot;,
                                           &quot;softDeleteRetentionInDays&quot;:  &quot;[parameters('softDeleteRetentionInDays')]&quot;,
                                           &quot;networkAcls&quot;:  &quot;[parameters('networkAcls')]&quot;
                                       },
                        &quot;tags&quot;:  {
  
                                 },
                        &quot;dependsOn&quot;:  [
  
                                      ]
                    }
                ],
  &quot;outputs&quot;:  {
  
              }
  </code></pre>
  <p>}</p>
  <hr />
  <p>My <code>deploy_kv_param.json</code> looks like this</p>
  <pre><code>{
  &quot;$schema&quot;:  &quot;https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#&quot;,
  &quot;contentVersion&quot;:  &quot;1.0.0.0&quot;,
  &quot;parameters&quot;:  {
                     &quot;name&quot;:  {
                                  &quot;value&quot;:  &quot;vaultName&quot;
                              },
                     &quot;location&quot;:  {
                                      &quot;value&quot;:  &quot;westeurope&quot;
                                  },
                     &quot;sku&quot;:  {
                                 &quot;value&quot;:  &quot;Standard&quot;
                             },
                     &quot;accessPolicies&quot;:  {
                                            &quot;value&quot;:  [
                                                          {
                                                              &quot;objectId&quot;:  &quot;objectID&quot;,
                                                              &quot;tenantId&quot;:  &quot;tenantId&quot;,
                                                              &quot;permissions&quot;:  {
                                                                                  &quot;keys&quot;:  &quot;&quot;,
                                                                                  &quot;secrets&quot;:  &quot;Get List Set Delete Recover Backup Restore&quot;,
                                                                                  &quot;certificates&quot;:  &quot;&quot;
                                                                              },
                                                              &quot;applicationId&quot;:  null
                                                          }
                                                      ]
                                        },
                     &quot;tenant&quot;:  {
                                    &quot;value&quot;:  &quot;tenantId&quot;
                                },
                     &quot;enabledForDeployment&quot;:  {
                                                  &quot;value&quot;:  false
                                              },
                     &quot;enabledForTemplateDeployment&quot;:  {
                                                          &quot;value&quot;:  false
                                                      },
                     &quot;enabledForDiskEncryption&quot;:  {
                                                      &quot;value&quot;:  false
                                                  },
                     &quot;enableRbacAuthorization&quot;:  {
                                                     &quot;value&quot;:  false
                                                 },
                     &quot;enableSoftDelete&quot;:  {
                                              &quot;value&quot;:  true
                                          },
                     &quot;softDeleteRetentionInDays&quot;:  {
                                                       &quot;value&quot;:  90
                                                   },
                     &quot;networkAcls&quot;:  {
                                         &quot;value&quot;:  {
                                                       &quot;defaultAction&quot;:  &quot;allow&quot;,
                                                       &quot;bypass&quot;:  &quot;AzureServices&quot;,
                                                       &quot;ipRules&quot;:  [
  
                                                                   ],
                                                       &quot;virtualNetworkRules&quot;:  [
  
                                                                               ]
                                                   }
                                     }
                 }
  </code></pre>
  <p>}</p>
  <hr />
  <p>Followup:<br></p>
  <p>I tried to minimize the files to only the <code>$deploy_kv.json</code> by using defaultValues for all the properties.</p>
  <p>It looks like this now:</p>
  <pre><code>{
  &quot;$schema&quot;: &quot;https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#&quot;,
  &quot;contentVersion&quot;: &quot;1.0.0.0&quot;,
  &quot;parameters&quot;: {
      &quot;name&quot;: {
          &quot;type&quot;: &quot;string&quot;,
          &quot;defaultValue&quot;: &quot;keyVaultName&quot;
      },
      &quot;location&quot;: {
          &quot;type&quot;: &quot;string&quot;,
          &quot;defaultValue&quot;: &quot;[resourceGroup().location]&quot;
      },
  
      &quot;sku&quot;: {
          &quot;type&quot;: &quot;string&quot;,
          &quot;defaultValue&quot;: &quot;Standard&quot;
      },
      &quot;accessPolicies&quot;: {
          &quot;type&quot;: &quot;array&quot;,
          &quot;defaultvalue&quot;: [
              {
                  &quot;objectId&quot;: &quot;objId&quot;,
                  &quot;tenantId&quot;: &quot;[subscription().tenantId]&quot;,
                  &quot;permissions&quot;: {
                      &quot;keys&quot;: &quot;&quot;,
                      &quot;secrets&quot;: &quot;Get List Set Delete Recover Backup Restore&quot;,
                      &quot;certificates&quot;: &quot;&quot;
                  },
                  &quot;applicationId&quot;: null
              }
          ]
      },
      &quot;tenantId&quot;: {
          &quot;type&quot;: &quot;string&quot;,
          &quot;defaultValue&quot;: &quot;[subscription().tenantId]&quot;,
          &quot;metadata&quot;: {
              &quot;description&quot;: &quot;Specifies the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. Get it by using Get-AzSubscription cmdlet.&quot;
          }
      }
  },
  &quot;variables&quot;: {
  
  },
  &quot;resources&quot;: [
      {
          &quot;type&quot;: &quot;Microsoft.KeyVault/vaults&quot;,
          &quot;name&quot;: &quot;[parameters('name')]&quot;,
          &quot;location&quot;: &quot;[parameters('location')]&quot;,
          &quot;apiVersion&quot;: &quot;2019-04-01&quot;,
          &quot;tags&quot;: {
              &quot;displayName&quot;: &quot;KeyVault&quot;
          },
          &quot;properties&quot;: {
              &quot;enabledForDeployment&quot;: false,
              &quot;enabledForTemplateDeployment&quot;: false,
              &quot;enabledForDiskEncryption&quot;: false,
              &quot;enableSoftDelete&quot;: true,
              &quot;softDeleteRetentionInDays&quot;: 90,
  
              &quot;tenantId&quot;: &quot;[parameters('tenantId')]&quot;,
              &quot;accessPolicies&quot;: &quot;[parameters('accessPolicies')]&quot;,
              &quot;sku&quot;: {
                  &quot;name&quot;: &quot;[parameters('sku')]&quot;,
                  &quot;family&quot;: &quot;A&quot;
              },
              &quot;networkAcls&quot;: {
                  &quot;defaultAction&quot;: &quot;Allow&quot;,
                  &quot;bypass&quot;: &quot;AzureServices&quot;
              }
          }
      }
  ],
  &quot;outputs&quot;: {
  
  }
  </code></pre>
  <p>The error I get is the same. I assume the template(as the command itself states: is valid).</p>