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

azurerm_cognitive_account services specified in Kind validation function need updated #2294

Closed
neilbailie opened this issue Nov 12, 2018 · 8 comments
Labels
enhancement hashibot/ignore service/cognitive-services upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR
Milestone

Comments

@neilbailie
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.11.8

  • provider.azurerm v1.18.0

Affected Resource(s)

  • azurerm_cognitive_account

I think Microsoft has combined a number of Speech services under a new Kind which can't be consumed in Terraform as the function to validate Kind doesn't include the new type.

At the same time if I try to consume one of the older Kind services Azure complains that the service isn't available.

I can consume a Kind of LUIS without issue as this is still available in Azure.

Terraform Configuration Files

resource "azurerm_cognitive_account" "cognitive_speech_service" {
  name                = "speech001"
  location            = "eastus2"
  resource_group_name = "test2"
  kind                = "SpeechServices"

  sku {
    name = "S0"
    tier = "Standard"
  }
}

Or

resource "azurerm_cognitive_account" "cognitive_speech_service" {
  name                = "speech001"
  location            = "eastus2"
  resource_group_name = "test2"
  kind                = "Bing.Speech"

  sku {
    name = "S0"
    tier = "Standard"
  }
}

Debug Output

Panic Output

Expected Behavior

SpeechServices API service created

Actual Behavior

  • Error: module.cognitive_services_speech_service.azurerm_cognitive_account.cognitive_speech_service: expected kind to be one of [Academic Bing.Autosuggest Bing.Autosuggest.v7 Bing.CustomSearc
    h Bing.Search Bing.Search.v7 Bing.Speech Bing.SpellCheck Bing.SpellCheck.v7 ComputerVision ContentModerator CustomSpeech Emotion Face LUIS Recommendations SpeakerRecognition Speech SpeechTranslation TextAnalytics TextTranslation WebLM], got SpeechServices

OR

  • azurerm_cognitive_account.cognitive_speech_service: Error creating Cognitive Services Account "test" (Resource Group "test"): cognitiv
    eservices.AccountsClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidApiSetId" Message="The ac
    count type 'Bing.Speech' is either invalid or unavailable in given region."

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@neilbailie
Copy link
Author

I'd be interested in working on this issue.

@tombuildsstuff
Copy link
Contributor

hey @neilbailie

Thanks for opening this issue :)

Taking a quick look into this it appears this value is missing from the possible values for the 'kind' field.

Whilst we can look to add this value to the validation function - I have a feeling it might be worth opening an issue/PR on the Rest API Specs Repository to get these added to the Swagger file which the SDK is generated from.

Whilst we could add this to the validation function outlined above, it'd be parsed incorrectly since it's not part of the Enum/Constant outlined above - as such I believe adding this to the Swagger (and thus the Go SDK) would be the best place to start here.

Hope that helps :)

Thanks!

@TechyMatt
Copy link
Contributor

@neilbailie we were having the same issue with Bing.Search.v7 and the same error about location. Upon reverse engineering the ARM Templates we actually found for location we needed to specify "global" and not "eastus2" as it's considered a global service from MS. It applied in TF and appeared in the portal so maybe worth a go?

@tomrijntjes
Copy link

@mb290 changing to "global" doesn't help. Opening a cognitive service in the portal clearly lists "West Europe", not "Global". I'm not sure how you found that MS considers it a global service but it's definitely not reflected in the UI.

Status=400 Code="InvalidApiSetId" Message="The account type 'Speech' is either invalid or unavailable in given region.

Other suggestions for workarounds?

@neilbailie
Copy link
Author

neilbailie commented Dec 28, 2018

Hi @tombuildsstuff

I requested Microsoft make the changes suggested by you and I believe the Swagger and Go SDK (version 24.0.0) have now been updated to use a string instead of a enum for the kind and SKU.

@katbyte
Copy link
Collaborator

katbyte commented Dec 31, 2018

@neilbailie,

Thank you for the update, I can confirm that v24 of the SDK has changed to a string. I have a open PR for the upgrade but it is blocked on another bug in the SDK so this is currently blocked.

We will still need to find a list of all possible values (probably from the portal) so we can continue doing validation on plan.

@katbyte katbyte added this to the Blocked milestone Dec 31, 2018
@katbyte katbyte added the upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR label Dec 31, 2018
@neilbailie
Copy link
Author

Now works as expected under the v24 SDK.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement hashibot/ignore service/cognitive-services upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR
Projects
None yet
Development

No branches or pull requests

5 participants