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

Kusto - upgrade API Version from 2022-02-01 to 2022-12-29 #21961

Merged
merged 16 commits into from
Jun 13, 2023

Conversation

liuwuliuyun
Copy link
Contributor

@liuwuliuyun liuwuliuyun commented May 30, 2023

New API Swagger Link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/kusto.json

Content

  • RP Kusto - upgrade API Version from 2022-02-01 to 2022-12-29

Special Change for property language_extensions

Context

Currently, we are using an old API version (2022-02-01) where language_extensions is a read-only property and we have a separate API to manage its CRUD operations. We first create a kusto cluster with a PUT request without specifying language_extensions, and then we use the separate API to add or remove them.

However, in the new API version (2022-12-29) that we want to upgrade to, language_extensions is a read-write property and it has a new required sub property called LanguageExtensionImageName. This means that if we use the same PUT request as before, it will delete all existing language_extensions.

On the other hand, if we specify language_extensions in the PUT request, we must provide the LanguageExtensionImageName for each of them, which may not be available or known by the customers.

This change is challenging because it breaks the existing behavior and expectations of the customers who use the azurerm_kusto_cluster resource. But if we don’t do API upgrading. It will block the adoption of a new resource called azurerm_kusto_cosmosdb_data_connection, which only exists in the new api version.

Solution

Team members had a meeting discussing this. Our solution:

For version 3.x we have three different names.

Use language_extensions = 'PYTHON' to represent

{
  "languageExtensionName": "PYTHON",
  "languageExtensionImageName": "Python3_6_5" (defualt value retrevied by GET)
}

Use language_extensions = 'PYTHON_3.10.8' to represent

{
  "languageExtensionName": "PYTHON",
  "languageExtensionImageName": "Python3_10_8"
}

Use language_extensions = 'R' to represent

{
  "languageExtensionName": "R",
  "languageExtensionImageName": "R" (defualt value retrevied by GET)
}

For 4.0 and later version, we use a new block called language_extension which is optional and has two required properties. And works like following:

resource "azurerm_kusto_cluster" "example" {
  ...
  language_extension {
     name  = "PYTHON"
     image = "Python3_10_8"
  }
  ...
}

Testing Evidence

image

All failed tests also failed on main branch. Will address them seperately.

Welcome any feedback on this PR

@liuwuliuyun liuwuliuyun changed the title RP Kusto - upgrade API Version from 2022-02-01 to 2022-12-29 Kusto - upgrade API Version from 2022-02-01 to 2022-12-29 May 30, 2023
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a test failure here

Error: creating/updating Cluster (Subscription: "*******"
        Resource Group Name: "acctestRG-230601164428475644"
        Cluster Name: "acctestkcntdjg"): performing CreateOrUpdate: clusters.ClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="BadRequest" Message="The sku Standard_D32d_v5 is not supported in westus2"
        

@liuwuliuyun
Copy link
Contributor Author

we have a test failure here

Error: creating/updating Cluster (Subscription: "*******"
        Resource Group Name: "acctestRG-230601164428475644"
        Cluster Name: "acctestkcntdjg"): performing CreateOrUpdate: clusters.ClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="BadRequest" Message="The sku Standard_D32d_v5 is not supported in westus2"
        

This test failed because sku is not supported in the test region. I pick a more common sku and update the test accordingly.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ⛈️

@katbyte katbyte merged commit 938514c into hashicorp:main Jun 13, 2023
@github-actions github-actions bot added this to the v3.61.0 milestone Jun 13, 2023
katbyte added a commit that referenced this pull request Jun 13, 2023
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 26, 2024
@liuwuliuyun liuwuliuyun deleted the kusto_sdk_upgrade branch September 19, 2024 06:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants