Open akrone-hach opened 5 years ago
@yugangw-msft Awesome! I'll give it a try. Just so I'm clear, the latest edge build should fix this and not the latest MSI installer version (2.0.50), correct?
Not the 2.0.50, rather the 2.0.51 to be released tomorrow. Stay tuned.
@yugangw-msft Saw that the MSI for 2.0.51 was released and gave it a try. The Create Cert still isn't working for me and the error message from the CLI didn't change and isn't helpful. Here's the dump of the output from the az keyvault certificate create
command:
3480 : 2018-11-20 15:48:19,985 : DEBUG : cli.knack.log : File logging enabled - writing logs to 'C:\Users\akrone\.azure\logs'.
3480 : 2018-11-20 15:48:19,985 : DEBUG : cli.knack.cli : Command arguments: ['keyvault', 'certificate', 'create', '--vault-name', 'aaronkrone5-SF-Keyvault', '--name', 'aaronkrone5', '--policy', '@defaultpolicy.json', '--debug']
3480 : 2018-11-20 15:48:19,986 : DEBUG : cli.knack.cli : Event: Cli.PreExecute []
3480 : 2018-11-20 15:48:19,986 : DEBUG : cli.knack.cli : Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x05BAAE40>, <function OutputProducer.on_global_arguments at 0x05BDCA98>, <function CLIQuery.on_global_arguments at 0x05AC96F0>]
3480 : 2018-11-20 15:48:19,987 : DEBUG : cli.azure.cli.core.util : attempting to read file defaultpolicy.json as utf-8-sig
3480 : 2018-11-20 15:48:19,987 : DEBUG : cli.knack.cli : Event: CommandInvoker.OnPreCommandTableCreate []
3480 : 2018-11-20 15:48:19,996 : DEBUG : cli.azure.cli.core : Installed command modules ['acr', 'acs', 'advisor', 'ams', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'lab', 'maps', 'monitor', 'network', 'policyinsights', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'servicebus', 'servicefabric', 'signalr', 'sql', 'storage', 'vm']
3480 : 2018-11-20 15:48:20,001 : DEBUG : cli.azure.cli.core : Loaded module 'acr' in 0.004 seconds.
3480 : 2018-11-20 15:48:20,005 : DEBUG : cli.azure.cli.core : Loaded module 'acs' in 0.004 seconds.
3480 : 2018-11-20 15:48:20,007 : DEBUG : cli.azure.cli.core : Loaded module 'advisor' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,008 : DEBUG : cli.knack.cli : Event: CommandLoader.OnLoadCommandTable []
3480 : 2018-11-20 15:48:20,013 : DEBUG : cli.azure.cli.core : Loaded module 'ams' in 0.006 seconds.
3480 : 2018-11-20 15:48:20,018 : DEBUG : cli.azure.cli.core : Loaded module 'appservice' in 0.005 seconds.
3480 : 2018-11-20 15:48:20,021 : DEBUG : cli.azure.cli.core : Loaded module 'backup' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,025 : DEBUG : cli.knack.cli : Event: CommandLoader.OnLoadCommandTable []
3480 : 2018-11-20 15:48:20,029 : DEBUG : cli.azure.cli.core : Loaded module 'batch' in 0.008 seconds.
3480 : 2018-11-20 15:48:20,033 : DEBUG : cli.azure.cli.core : Loaded module 'batchai' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,035 : DEBUG : cli.azure.cli.core : Loaded module 'billing' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,040 : DEBUG : cli.azure.cli.core : Loaded module 'botservice' in 0.004 seconds.
3480 : 2018-11-20 15:48:20,041 : DEBUG : cli.knack.cli : Event: CommandLoader.OnLoadCommandTable []
3480 : 2018-11-20 15:48:20,043 : DEBUG : cli.azure.cli.core : Loaded module 'cdn' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,045 : DEBUG : cli.azure.cli.core : Loaded module 'cloud' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,047 : DEBUG : cli.azure.cli.core : Loaded module 'cognitiveservices' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,048 : DEBUG : cli.azure.cli.core : Loaded module 'configure' in 0.001 seconds.
3480 : 2018-11-20 15:48:20,051 : DEBUG : cli.azure.cli.core : Loaded module 'consumption' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,053 : DEBUG : cli.azure.cli.core : Loaded module 'container' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,057 : DEBUG : cli.azure.cli.core : Loaded module 'cosmosdb' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,061 : DEBUG : cli.azure.cli.core : Loaded module 'dla' in 0.004 seconds.
3480 : 2018-11-20 15:48:20,065 : DEBUG : cli.azure.cli.core : Loaded module 'dls' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,067 : DEBUG : cli.azure.cli.core : Loaded module 'dms' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,069 : DEBUG : cli.azure.cli.core : Loaded module 'eventgrid' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,072 : DEBUG : cli.azure.cli.core : Loaded module 'eventhubs' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,074 : DEBUG : cli.azure.cli.core : Loaded module 'extension' in 0.001 seconds.
3480 : 2018-11-20 15:48:20,075 : DEBUG : cli.azure.cli.core : Loaded module 'feedback' in 0.001 seconds.
3480 : 2018-11-20 15:48:20,076 : DEBUG : cli.azure.cli.core : Loaded module 'find' in 0.001 seconds.
3480 : 2018-11-20 15:48:20,078 : DEBUG : cli.azure.cli.core : Loaded module 'hdinsight' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,079 : DEBUG : cli.azure.cli.core : Loaded module 'interactive' in 0.001 seconds.
3480 : 2018-11-20 15:48:20,084 : DEBUG : cli.azure.cli.core : Loaded module 'iot' in 0.005 seconds.
3480 : 2018-11-20 15:48:20,087 : DEBUG : cli.azure.cli.core : Loaded module 'iotcentral' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,093 : DEBUG : cli.azure.cli.core : Loaded module 'keyvault' in 0.005 seconds.
3480 : 2018-11-20 15:48:20,096 : DEBUG : cli.azure.cli.core : Loaded module 'lab' in 0.004 seconds.
3480 : 2018-11-20 15:48:20,099 : DEBUG : cli.azure.cli.core : Loaded module 'maps' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,104 : DEBUG : cli.azure.cli.core : Loaded module 'monitor' in 0.005 seconds.
3480 : 2018-11-20 15:48:20,125 : DEBUG : cli.azure.cli.core : Loaded module 'network' in 0.022 seconds.
3480 : 2018-11-20 15:48:20,128 : DEBUG : cli.azure.cli.core : Loaded module 'policyinsights' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,130 : DEBUG : cli.azure.cli.core : Loaded module 'profile' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,135 : DEBUG : cli.azure.cli.core : Loaded module 'rdbms' in 0.005 seconds.
3480 : 2018-11-20 15:48:20,138 : DEBUG : cli.azure.cli.core : Loaded module 'redis' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,141 : DEBUG : cli.azure.cli.core : Loaded module 'relay' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,144 : DEBUG : cli.azure.cli.core : Loaded module 'reservations' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,151 : DEBUG : cli.azure.cli.core : Loaded module 'resource' in 0.008 seconds.
3480 : 2018-11-20 15:48:20,155 : DEBUG : cli.azure.cli.core : Loaded module 'role' in 0.003 seconds.
3480 : 2018-11-20 15:48:20,157 : DEBUG : cli.azure.cli.core : Loaded module 'search' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,161 : DEBUG : cli.azure.cli.core : Loaded module 'servicebus' in 0.004 seconds.
3480 : 2018-11-20 15:48:20,163 : DEBUG : cli.azure.cli.core : Loaded module 'servicefabric' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,165 : DEBUG : cli.azure.cli.core : Loaded module 'signalr' in 0.002 seconds.
3480 : 2018-11-20 15:48:20,173 : DEBUG : cli.azure.cli.core : Loaded module 'sql' in 0.008 seconds.
3480 : 2018-11-20 15:48:20,175 : DEBUG : cli.knack.cli : Event: CommandLoader.OnLoadCommandTable []
3480 : 2018-11-20 15:48:20,199 : DEBUG : cli.azure.cli.core : Loaded module 'storage' in 0.026 seconds.
3480 : 2018-11-20 15:48:20,212 : DEBUG : cli.azure.cli.core : Loaded module 'vm' in 0.013 seconds.
3480 : 2018-11-20 15:48:20,212 : DEBUG : cli.azure.cli.core : Loaded all modules in 0.206 seconds. (note: there's always an overhead with the first module loaded)
3480 : 2018-11-20 15:48:20,213 : DEBUG : cli.azure.cli.core.extension : Extensions directory: 'C:\Users\akrone\.azure\cliextensions'
3480 : 2018-11-20 15:48:20,214 : DEBUG : cli.knack.cli : Event: CommandInvoker.OnPreCommandTableTruncate []
3480 : 2018-11-20 15:48:20,600 : DEBUG : cli.knack.cli : Event: CommandInvoker.OnPostCommandTableCreate [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x05B10348>, <function register_ids_argument.<locals>.add_ids_arguments at 0x05B10D68>]
3480 : 2018-11-20 15:48:20,602 : DEBUG : cli.knack.cli : Event: CommandInvoker.OnCommandTableLoaded []
3480 : 2018-11-20 15:48:20,602 : DEBUG : cli.knack.cli : Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x068FF858>]
3480 : 2018-11-20 15:48:20,603 : DEBUG : cli.knack.cli : Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x05BDCAE0>, <function CLIQuery.handle_query_parameter at 0x05AC9738>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x05B10DB0>, <function handler at 0x0698CC00>]
3480 : 2018-11-20 15:48:20,611 : INFO : cli.azure.cli.command_modules.keyvault.custom : Starting long-running operation 'keyvault certificate create'
3480 : 2018-11-20 15:48:20,618 : DEBUG : msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
3480 : 2018-11-20 15:48:20,620 : DEBUG : msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
3480 : 2018-11-20 15:48:20,622 : DEBUG : msrest.exceptions : Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'
3480 : 2018-11-20 15:48:20,622 : DEBUG : msrest.exceptions : Unable to build a model: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get', DeserializationError: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'
3480 : 2018-11-20 15:48:20,622 : ERROR : cli.azure.cli.core.util : Unable to build a model: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get', DeserializationError: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'
@akrone-hach, I meant to communicate that the silent failure was supposed to be fixed.
For the failure underneath, i am not able to reproduce this problem, but I would suggest skip the following updates and see whether it would work. If yes, then I suspect SomethingToSecure
might be the cause
$policy = Get-Content 'defaultpolicy.json' -raw | ConvertFrom-Json
$policy.x509CertificateProperties.subject = "CN=SomethingToSecure"
$policy | ConvertTo-Json | Set-Content 'defaultpolicy.json'
From the last few lines of the debug trace, it looks very much like there may have been a breaking change in the KeyVault SDK where some property went from accepting a string to a list of strings. @schaabs
@schaabs any update for this issue?
Is this issue addressed?. I am getting the below error when trying to create a cert in keyVault using Azure CLI
Error detail: Expecting property name enclosed in double quotes: line 1 column 5 (char 4)
az keyvault certificate create --vault-name RGTestkeyVault -n cert1 -p "$(az keyvault certificate get-default-policy)" --debug
my power shell version 5.1.2
Describe the bug When trying to create a certificate in an existing Key Vault, the command fails silently and no error is displayed. When running the command with the
--debug
flag the following output is displayed:To Reproduce
Expected behavior A self signed certificate is created and enabled in the Key Vault, or an error message is displayed
Environment summary Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) MSI
CLI version (
az --version
)OS version Windows 10 Pro 64-bit (10.0, Build 16299)
Shell Type (e.g. bash, cmd.exe, Bash on Windows)
PowerShell
Additional context The default policy is written to a file because of how powershell encodes the JSON data. Reference https://github.com/Azure/azure-cli/issues/4626