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

BCP036 reported as error rather than warning (preventing suppression) #13534

Closed
anthony-c-martin opened this issue Mar 5, 2024 · 0 comments · Fixed by #13535
Closed

BCP036 reported as error rather than warning (preventing suppression) #13534

anthony-c-martin opened this issue Mar 5, 2024 · 0 comments · Fixed by #13535
Assignees
Labels
bug Something isn't working type system

Comments

@anthony-c-martin
Copy link
Member

Reported under Azure/bicep-types-az#2057 - here's a modified sample which just contains dummy values to repro the problem:

var username = ''
var password = ''
var fileshareConnection = {
  name: ''
  authType: ''
  rootfolder: ''
  odgw: {
    name: ''
    resourceGroup: ''
  }
}

var general = {
  location: ''
}

resource resFileshareConnection 'Microsoft.Web/connections@2016-06-01' = {
  name: fileshareConnection.name
  location: general.location
  kind: 'V2'
  properties: {
    displayName: fileshareConnection.name
    customParameterValues: {}
    parameterValues: {
      rootfolder: fileshareConnection.rootfolder
      authType: fileshareConnection.authType
      gateway: {
        name: fileshareConnection.odgw.name
        id: resourceId(fileshareConnection.odgw.resourceGroup, 'Microsoft.Web/connectionGateways', fileshareConnection.odgw.name)
        type: 'Microsoft.Web/connectionGateways'
      }
      username: username
      password: password
    }
    api: {
      id: subscriptionResourceId('Microsoft.Web/locations/managedApis', general.location, 'filesystem')
    }
  }
}

There is a genuine RP type authoring error, however we should be raising this as a warning, so that it can be suppressed.

@jeskew jeskew self-assigned this Mar 5, 2024
@jeskew jeskew added bug Something isn't working type system and removed Needs: Triage 🔍 labels Mar 5, 2024
jeskew added a commit that referenced this issue Mar 5, 2024
…ags (#13535)

Resolves #13534 

The cache within `AzResourceTypeFactory` was using the serialized type
as a key, but since the AZ resource types reuse types pretty
aggressively, this was leading to values being cached with the wrong
flag assignments (which are dependent on *where* in a resource a
particular type is used). This PR updates the cache to use a compound
key instead to keep these usages separate.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/13535)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working type system
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants