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

RecoveryVault cannot deploy #2336

Closed
Agazoth opened this issue Apr 20, 2021 · 5 comments · Fixed by #2353
Closed

RecoveryVault cannot deploy #2336

Agazoth opened this issue Apr 20, 2021 · 5 comments · Fixed by #2353

Comments

@Agazoth
Copy link

Agazoth commented Apr 20, 2021

Bicep 0.3.228

https://github.com/Azure/bicep/blob/81fa2c2c5044e3c3a8a973379f7d776a6ca4a92a/src/Bicep.LangServer/Snippets/Templates/res-recovery-service-vault.bicep

cannot deploy.

New-AzResourceGroupDeployment: 08.30.31 - The deployment 'testdeployrecvault' failed with error(s). Showing 1 out of 1 error(s).
Status Message: properties parameter is invalid.
Please provide a valid properties (Code:InvalidRestApiParameter)
CorrelationId: 41a17ddf-43d4-4b0a-b991-744b936bcc4e
@ghost ghost added the Needs: Triage 🔍 label Apr 20, 2021
@anthony-c-martin
Copy link
Member

@Agazoth - would you mind providing an example of the full Bicep file + parameters used to deploy this resource generated from the snippet you linked?

@Agazoth
Copy link
Author

Agazoth commented Apr 20, 2021

@anthony-c-martin actually just hard coding strings in the main.bicep file like this::

resource recoveryServiceVault 'Microsoft.RecoveryServices/vaults@2021-01-01' = {
  name: 'axtestrecvault'
  location: resourceGroup().location
  sku: {
    name: 'RS0'
    tier: 'Standard'
  }
}

And running:

New-AzResourceGroupDeployment -ResourceGroupName  rg-smo-axtest -Name testdeployrecvault -TemplateFile .\main.bicep

@StefanIvemo
Copy link
Collaborator

@Agazoth - this is not a Bicep specific error . Although there is no required property for a Recovery Services Vault, you need to add an empty properties object to your template for the API to accept it.

This will work:

resource recoveryServiceVault 'Microsoft.RecoveryServices/vaults@2021-01-01' = {
  name: 'axtestrecvault'
  location: resourceGroup().location
  sku: {
    name: 'RS0'
    tier: 'Standard'
  }
  properties: {}
}

@anthony-c-martin - I will create a PR fixing this snippet.

@Agazoth
Copy link
Author

Agazoth commented Apr 21, 2021

Thanks, adding an empty properties object fixed it.

@say2merohit
Copy link

It worked for me as well all we need to do is add empty property and it will work

@ghost ghost locked as resolved and limited conversation to collaborators May 27, 2023
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.

4 participants