Get-AzKeyVaultSecret : Could not load file or assembly ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxx’ or one of its dependencies. The
system cannot find the file specified.
At line:1 char:1
- Get-AzKeyVaultSecret -VaultName $azurerm_key_vault_name -Name $secret …
writeErrorStream : True
PSMessageDetails :
Exception : System.IO.FileNotFoundException: Could not load file or assembly ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx’
or one of its dependencies. The system cannot find the file specified.
File name: ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxxx’
at Microsoft.Azure.Commands.KeyVault.Models.KeyVaultDataServiceClient…ctor(IAuthenticationFactory authFactory, IAzureContext context)
at Microsoft.Azure.Commands.KeyVault.Models.KeyVaultCmdletBase.get_DataServiceClient()
at Microsoft.Azure.Commands.KeyVault.GetAzureKeyVaultSecret.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
TargetObject :
CategoryInfo : CloseError: (
[Get-AzKeyVaultSecret], FileNotFoundException
FullyQualifiedErrorId : Microsoft.Azure.Commands.KeyVault.GetAzureKeyVaultSecret
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}
"Newtonsoft.Json/10.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-MoAGREATBIGLONGNUMBERHEREJUSTFORFUNQ==",
"path": "newtonsoft.json/10.0.3",
"hashPath": "newtonsoft.json.10.0.3.nupkg.sha512"
},
I found this, here:
C:\Program Files\WindowsPowerShell\Modules\Az.KeyVault\1.1.0\Microsoft.Azure.PowerShell.Cmdlets.KeyVault.deps.json
And this:
Gci “C:\Program Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.208”
I made sure I had the latest update of this module and restarted the ISE, and it worked fine.