Hi @n cloud
Welcome to Microsoft Q&A! Thanks for posting the question.
Unfortunately, you cannot create Named Value from Key Vault for the APIM using Azure CLI.
As per the latest CLI version for APIM the commands don't support it. Most of the features in Azure CLI are available once the APIs are GA. If you find any functionality missing in CLI then you can always create an Azure CLI issue/feature request.
If you want to automate it programmatically then you can do it by calling the Azure Management REST API. I have looked into network traces of my browser and can see the preview version of APIM that is called to create the Named Value from Key Vault for the APIM. Once the API's are GA then only the documents are updated. But if you still want to automate it you can use the 2020-06-01-preview version API. You can take network traces as there can be other API calls to enable the permission on Key Vault.
Named Value - Create or Update API: https://learn.microsoft.com/en-us/rest/api/apimanagement/2019-12-01/namedvalue/createorupdate
PUT
https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourcegroupname}/providers/Microsoft.ApiManagement/service/{APIM Instance Name}/namedValues/{YourNamed Key}?api-version=2020-06-01-preview
Request Body:
{"properties":{"displayName":"{YourNamed Key}","secret":true,"tags":[],"keyVault":{"identityClientId":null,"secretIdentifier":"https://{keyvalutname}.vault.azure.net/secrets/{secretname}"}}}
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.