11

I have successfully created an Azure Key Vault, but I cannot add any secrets to it. I am following the instructions (https://azure.microsoft.com/en-gb/documentation/articles/key-vault-get-started/), but when I try

$secretvalue = ConvertTo-SecureString 'Pa$$w0rd' -AsPlainText -Force
$secret = Set-AzureKeyVaultSecret -VaultName 'ContosoKeyVault' -Name 'SQLPassword' -SecretValue $secretvalue

I am getting this exception:

Set-AzureKeyVaultSecret : The remote name could not be resolved: 'mykeyvault.vault.azure.net'.

Any ideas what the problem could be?

Harish
  • 789
  • 1
  • 7
  • 21
Dan O'Leary
  • 2,660
  • 6
  • 24
  • 50
  • 3
    This seems like an intermittent fault. The same code didn't work yesterday afternoon, worked this morning, and now doesn't work again. – Dan O'Leary Apr 29 '16 at 15:10
  • 1
    I have a C#-application which takes various parameters (using the API), creates a key vault based on the parameters and adds some secrets. I have seven sets of parameters (giving seven vaults) and all vault are created, but adding the first secret (at first) gave the error above in all cases. Not changing anything (the application or the parameters), suddenly (after 10 minutes or so) two of the parameter sets succeeded. And then one more. But still (half an hour later) the four last still fail. I can see no indication that the vaults have a "being created" status or anything like that. – Christian Rygg Oct 26 '16 at 22:10
  • I get this issue 20% of the time when trying to create key vault secrets – johnstaveley Apr 18 '17 at 06:44
  • Could you try it in another network? – EagleDev Mar 15 '19 at 23:05

2 Answers2

4

This fixed it for me:

ipconfig /flushdns

taken from issue here:

https://github.com/Azure/azure-powershell/issues/1524

johnstaveley
  • 1,400
  • 1
  • 22
  • 46
2

I suspect it might be related to your internet connection, proxies, some settings on your machine, etc... Switching wifi network fixed my error message.

Boris Lipschitz
  • 9,236
  • 5
  • 53
  • 63