Azure / AzOps

AzOps is a PowerShell module which deploys (Push) ARM Resource Templates & Bicep files at all Azure scope levels and exports (Pull) ARM resource hierarchy.
https://aka.ms/AzOps
MIT License
371 stars 158 forks source link

Azure Recovery Services Vault InvalidRestApiParameter #702

Open buysoft opened 1 year ago

buysoft commented 1 year ago

Describe the bug

When deploying the Microsoft.RecoveryServices/vaults resourceType gives the error "InvalidRestApiParameter - properties parameter is invalid. Please provide a valid properties".

Steps to reproduce

  1. Create an Azure Recovery Services Vault
  2. Do a Pull in AzOps
  3. The Push will trigger and the error appears

I even reproduced it by doing the -WhatIf with the JSON-template coming from the AzOps Pull.

Screenshots

image

StefanIvemo commented 1 year ago

This sounds more like a resource provider issue than AzOps. Can you share your template with us? Although Microsoft.RecoveryServices/vaults have no required properties the RP expects a properties property in the template.

Bicep Example:

resource vault 'Microsoft.RecoveryServices/vaults@2022-09-10' = {
  name: 'myvault'
  location: 'westeurope'
  properties: {}
}

ARM example

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.RecoveryServices/vaults",
      "apiVersion": "2022-09-10",
      "name": "myvault",
      "location": "westeurope",
      "properties": {}
    }
  ]
buysoft commented 1 year ago

This sounds more like a resource provider issue than AzOps. Can you share your template with us? Although Microsoft.RecoveryServices/vaults have no required properties the RP expects a properties property in the template.

Bicep Example:

resource vault 'Microsoft.RecoveryServices/vaults@2022-09-10' = {
  name: 'myvault'
  location: 'westeurope'
  properties: {}
}

ARM example

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.RecoveryServices/vaults",
      "apiVersion": "2022-09-10",
      "name": "myvault",
      "location": "westeurope",
      "properties": {}
    }
  ]

I was not able to share the template at the moment. I will get back to you as soon as possible!

daltondhcp commented 1 year ago

@buys-stash - any updates?

OlafHaalstra commented 9 months ago

In addition to what @buys-stash already mentioned for version @2023-04-01 it is also mandatory to specify the publicNetworkAccess, for example:

resource vault 'Microsoft.RecoveryServices/vaults@2023-04-01' = {
  name: vaultName
  location: location
  tags: tags
  sku: {
    name: 'RS0'
    tier: 'Standard'
  }
  properties: {
    publicNetworkAccess: 'Disabled' 
  }
}