Azure / bicep-registry-modules

Bicep registry modules
MIT License
520 stars 367 forks source link

SkuName for TextAnalytics not working #1701

Closed MaxBe1985 closed 7 months ago

MaxBe1985 commented 7 months ago

https://github.com/Azure/bicep-registry-modules/blob/c4d951f3f392dcd1b8cc1c7d1896abeceec133a3/modules/ai/cognitiveservices/main.bicep#L36

I get the error The subscription does not have QuotaId/Feature required by SKU 'S0' from kind 'TextAnalytics' or contains blocked QuotaId/Feature. when deploying TextAnalytics.

I did find the solution to change it to S but this is not in the allowed list. Can this be added to the allowed list.

ilhaan commented 7 months ago

@MaxBe1985 thanks for submitting an issue. I don't see S listed as a valid option: https://learn.microsoft.com/en-us/rest/api/aiservices/accountmanagement/resource-skus/list?view=rest-aiservices-accountmanagement-2023-05-01&tabs=HTTP.

Here is another doc stating that this value should be a "letter+number code": https://learn.microsoft.com/en-us/azure/templates/microsoft.cognitiveservices/accounts?pivots=deployment-language-bicep#sku

Does setting to S pick any of the S tier options that are available to your subscription?

I will need to look into this. @jceval are you familiar with how the sku selection without a number works?

jceval commented 7 months ago

@MaxBe1985 I see that your issue is pointing to an older commit and is using our legacy module 'bicep-registry-modules/modules/ai/cognitiveservices/main.bicep'

Could you try using the module on the main branch 'avm/res/cognitive-services/account/main.bicep'

@description('Optional. The location to deploy resources to.')
param resourceLocation string = resourceGroup().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = '<serviceshortname>'

@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.')
param namePrefix string = '<nameprefix>'

module testDeployment './bicep-registry-modules/avm/res/cognitive-services/account/main.bicep' = {
  // scope: resourceGroup
  name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}'
  params: {
    name: '${namePrefix}${serviceShort}001'
    kind: 'TextAnalytics'
    location: resourceLocation

    sku: 'S'
  }
}
microsoft-github-policy-service[bot] commented 7 months ago

[!NOTE] The "Type: AVM :a: :v: :m:" label was added as per ITA08BCP.

MaxBe1985 commented 7 months ago

@MaxBe1985 I see that your issue is pointing to an older commit and is using our legacy module 'bicep-registry-modules/modules/ai/cognitiveservices/main.bicep'

Could you try using the module on the main branch 'avm/res/cognitive-services/account/main.bicep'

@description('Optional. The location to deploy resources to.')
param resourceLocation string = resourceGroup().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = '<serviceshortname>'

@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.')
param namePrefix string = '<nameprefix>'

module testDeployment './bicep-registry-modules/avm/res/cognitive-services/account/main.bicep' = {
  // scope: resourceGroup
  name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}'
  params: {
    name: '${namePrefix}${serviceShort}001'
    kind: 'TextAnalytics'
    location: resourceLocation

    sku: 'S'
  }
}

Thanks @jceval this solved the problem.