Dela via


Bicep-diagnostikkod – BCP135

I Bicep bestämmer omfång den hierarkiska nivå där resurser distribueras i Azure. ARM innehåller fyra distributionsomfång – resursgrupp, hanteringsgrupp, prenumeration och klientorganisation. Resurser måste distribueras inom de tillåtna omfången. Mer information finns i Distributionsomfång.

beskrivning

Omfångsnamnet <> är inte giltigt för den här resurstypen. Tillåtna omfång: <scope-name>.

Nivå

Fel

Lösningar

Distribuera resurser till de tillåtna omfången.

Exempel

I följande exempel genereras diagnostiken eftersom storageAccounts det inte går att distribuera i hanteringsgruppens omfång.

targetScope = 'managementGroup'

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
  name: 'demostorage0220'
  location: 'eastus'
  sku: {
    name:  'Standard_LRS'
  }
  kind:  'StorageV2'
}

Du kan åtgärda diagnostiken genom att ange targetScope till resourceGroup.

targetScope = 'resourceGroup'

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
  name: 'demostorage0220'
  location: 'eastus'
  sku: {
    name:  'Standard_LRS'
  }
  kind:  'StorageV2'
}

Nästa steg

Mer information om Bicep-diagnostik finns i Bicep Core Diagnostics.