-
Notifications
You must be signed in to change notification settings - Fork 3k
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
az apim nv
doesn't provide parameters for configuring Key Vault secrets
#27822
Comments
Hi @jamesmcroft, 2.53.0 is not the latest Azure CLI(2.53.1). If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli. |
Thank you for opening this issue, we will look into it. |
More than happy to help contribute to fixing this if needed. |
I wanted to also add here, I'm finding myself needing to use |
same here! |
You can use The endpoint is as follows replacing any $ prefix parts with your specific deployment: The request body is simply a JSON object representing: {
"properties": {
"displayName": "$namedValue",
"secret": true,
"keyVault": {
"identityClientId": "$managedIdentityClientId",
"secretIdentifier": "$keyVaultSecretUri"
}
}
} The CLI to call is: Not the most elegant, but does allow you to stay in the flow using the Azure CLI. |
@jamesmcroft I have a problem when implementing the suggested work-around: https://stackoverflow.com/questions/78298862/az-cli-to-create-an-apim-named-value-that-references-a-key-vault-secret. Would be grateful for any pointers. |
Hi @yonzhan |
Describe the bug
When using the Azure CLI, it is not currently possible to configure a named variable within API Management that uses Azure Key Vault secret values.
This functionality exists at the REST API documented here but appears to be missing as a parameter in the CLI specifically.
Related command
az apim nv
Errors
ERROR: unrecognized arguments: --keyvault {
Examples from AI knowledge base:
az apim nv create --service-name MyApim --resource-group MyResourceGroup --named-value-id MyNamedValue --display-name 'My Named Value' --value 'foo'
Create a Named Value.
az apim nv create --display-name 'My Named Value' --named-value-id MyNamedValue --resource-group MyResourceGroup --secret true --service-name MyApim --value 'foo'
Create an API Management Named Value. (autogenerated)
https://docs.microsoft.com/en-US/cli/azure/apim/nv#az_apim_nv_create
Read more about the command in reference docs
Issue script & Debug output
ERROR: unrecognized arguments: --keyvault {
Examples from AI knowledge base:
az apim nv create --service-name MyApim --resource-group MyResourceGroup --named-value-id MyNamedValue --display-name 'My Named Value' --value 'foo'
Create a Named Value.
az apim nv create --display-name 'My Named Value' --named-value-id MyNamedValue --resource-group MyResourceGroup --secret true --service-name MyApim --value 'foo'
Create an API Management Named Value. (autogenerated)
https://docs.microsoft.com/en-US/cli/azure/apim/nv#az_apim_nv_create
Read more about the command in reference docs
Expected behavior
When providing a Key Vault contract object as described in the REST API documentation for API Management named variables, the CLI should accept this value and configure the named variable in Azure.
Environment Summary
azure-cli 2.53.0 *
core 2.53.0 *
telemetry 1.1.0
Extensions:
resource-graph 2.1.0
Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\jamescroft.azure\cliextensions'
Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Additional context
No response
The text was updated successfully, but these errors were encountered: