azure-sdk-for-ruby icon indicating copy to clipboard operation
azure-sdk-for-ruby copied to clipboard

Possible incorrect constant error in KeyVaultClient

Open scarfacedeb opened this issue 6 years ago • 2 comments

I'm trying to create new key in my Azure KeyVault and I keep getting the same NameError:

> client = Azure::KeyVault::Profiles::Latest::Client.new(options)
> client.create_key("https://secret.vault.azure.net/", "Testkey", "RSA-HSM")
NameError: uninitialized constant Azure::KeyVault::V7_0::KeyVaultClient::KeyCreateParameters

It's coming from KeyVaultClient#create_key_async.

I think that there're a couple of errors in that code: incorrect constant and camelCased method used, instead of snake_case.

Here's a quick fix that I applied to make it work again:

parameters = Azure::KeyVault::V7_0::Models::KeyCreateParameters.new
...
parameters.key_attributes = key_attributes

Furthermore, there're the same issues with import_key_async and update_key_async.

scarfacedeb avatar Dec 05 '19 14:12 scarfacedeb

I tested KeyVaultClient#encrypt and it didn't work either.

First of all, it has the same constant error as the methods mentioned earlier.

Next, its KeyOperationsParameters.mapper uses Base64Url type for the value parameter that isn't supported by MsRest::Serialization#serialize.

Am I doing something wrong? Is Key Vault SDK not finished yet?

scarfacedeb avatar Dec 05 '19 15:12 scarfacedeb

@scarfacedeb Thanks for your feedback, I'll look into this next weekday.

bim-msft avatar Dec 06 '19 13:12 bim-msft

Thank you for your interest in Azure SDKs. As detailed in this retirement announcement, this repo is no longer supported as of December 31st 2021. Please find the up-to-date list of languages and services supported with Azure SDKs here: https://aka.ms/azsdk

kurtzeborn avatar Jan 11 '23 03:01 kurtzeborn