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

Required property 'accessTier' not filled in for storage accounts #2115

Open
StephenWeatherford opened this issue Apr 4, 2024 · 2 comments

Comments

@StephenWeatherford
Copy link
Contributor

StephenWeatherford commented Apr 4, 2024

In a bicep file, type:

resource storage 'Microsoft.Storage/storageAccounts@2023-01-01'

and press space-equals => required-properties

It gives you:

resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = {
  name: 
  location: 
  sku: {
    name: 
  }
  kind: 
}

Fill these in, e.g.

resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = {
  name: uniqueString(resourceGroup().id, 'afsdhlga')
  location: location
  sku: {
    name: 'Premium_LRS'
  }
  kind: 'BlobStorage'
}

and try to deploy

You get this error:

{
  "code": "InvalidTemplateDeployment",
  "message": "The template deployment 'bicep-deploy' is not valid according to the validation procedure. The tracking id is 'b79122c9-055c-4492-80bd-c1a80c0f792d'. See inner errors for details.",
  "details": [
    {
      "code": "PreflightValidationCheckFailed",
      "message": "Preflight validation failed. Please refer to the details for the specific errors.",
      "details": [
        {
          "code": "MissingRequiredAccountProperty",
          "message": "Account property accessTier is required for the request.",
          "target": "d44py5vkmw72a"
        }
      ]
    }
  ]
}

EXPECTED: Why is there no error in the bicep file if a required property is missing, and why is it not automatically added to the resource?

@alex-frankel
Copy link
Collaborator

It's because the swagger spec is not accurate. Transferring to bicep-types-az.

@alex-frankel alex-frankel transferred this issue from Azure/bicep Apr 5, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage. Please see https://aka.ms/biceptypesinfo for troubleshooting help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants