Azure / Azure/bicep-types-az

Required property 'accessTier' not filled in for storage accounts

Open
#2,115 2 comments 0 reactions 0 assignees View on GitHub
Service Attention Storage
Dominant language
TypeScript
Stars
108
Forks
44
Avg merge
18h 53m
Merged PRs (30d)
29

Description

In a bicep file, type:

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

and press space-equals => required-properties

It gives you:

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

Fill these in, e.g.

```bicep
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:

```json
{
"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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported Bicep reproduction for Microsoft.Storage/storageAccounts@2023-01-01 and inspect how this resource's generated type metadata drives required-properties completion. Reproduce the deployment validation error, then determine the expected handling of accessTier; done should be defined by the issue's intended type or completion behavior and covered by a regression test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
cloud, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.