azure-keyvault

How to set a secret in Azure Key Vault from a local asp.net application

帅比萌擦擦* 提交于 2021-02-19 02:49:08
问题 I have a local asp.net core 3.1 application that I want to set a secret in an Azure Key Vault. The following is the code I used from Microsoft: string secretName = "xxSecret"; string keyVaultName = Environment.GetEnvironmentVariable("KEY_VAULT_NAME"); var kvUri = "https://" + keyVaultName + ".vault.azure.net"; var secretClient = new SecretClient(new Uri(kvUri), new DefaultAzureCredential()); string secretValue = "test"; secretClient.SetSecret(secretName, secretValue); KeyVaultSecret secret =

get-azurekeyvaultkey does not return “public key”

六眼飞鱼酱① 提交于 2021-02-11 15:26:47
问题 I am just testing out Azure Key Vault with key/pairs and am attempting to retrieve the public key. I first created a Key Vault (name = "VaultTest") using Azure portal. I then created a Key (Name = "TestKey1") again using Azure portal. I see the key in the portal and when I click on it I see the following information: Properties : Key Type: RSA RSA Key Size 2048 Created: "date time" Updated: "date time" Key Identifier: //vault path/keys/TestKey1/Key identifier Settings : Set activation date:

get-azurekeyvaultkey does not return “public key”

梦想的初衷 提交于 2021-02-11 15:26:26
问题 I am just testing out Azure Key Vault with key/pairs and am attempting to retrieve the public key. I first created a Key Vault (name = "VaultTest") using Azure portal. I then created a Key (Name = "TestKey1") again using Azure portal. I see the key in the portal and when I click on it I see the following information: Properties : Key Type: RSA RSA Key Size 2048 Created: "date time" Updated: "date time" Key Identifier: //vault path/keys/TestKey1/Key identifier Settings : Set activation date:

Azure keyvault, request for multiple secrets

只愿长相守 提交于 2021-02-11 12:33:11
问题 Im making use of the following node library azure-keyvault to get retrieve stored secrets from azure keyvault. Ive only found the client.getSecret api exposed to retrieve a secret value. Im searching for a way to retrieve multiple secret values in one call. I hav'nt found one yet. Is there a way to do this that i'm missing or its simply not supported. 回答1: Here is the complete code for getting the multiple client secret at once: var credentials = new KeyVault.KeyVaultCredentials(authenticator

How to pass an Azure pipeline variable to an ARM template used by AzureResourceManagerTemplateDeployment@3 task?

旧城冷巷雨未停 提交于 2021-02-11 08:08:03
问题 I am trying to perform the following 2 steps in my Azure pipeline scheduled for every night: Put a self-signed cert into a keyvault Deploy Service Fabric cluster via ARM template and use the cert thumbprint and secret id as params. The first step of creating the certificate in the keyvault works well for me: # import the self-signed certificate ccg-self-signed-cert into the Keyvault - task: AzurePowerShell@5 inputs: azureSubscription: '${{ parameters.ArmConnection }}' ScriptType:

How to write a secret to azure key vault from Azure DevOps pipeline?

£可爱£侵袭症+ 提交于 2021-02-11 04:56:31
问题 I have created a Key Vault in Azure DevOps using ARM and I now want to write a secret to it within the same pipeline. I created an Azure PowerShell task with the following inline PowerShell: $secretvalue = ConvertTo-SecureString $(Secret) -AsPlainText -Force Set-AzureKeyVaultSecret -VaultName $(VaultName) -Name $(SecretName) -SecretValue (ConvertTo-SecureString $(Secret) -AsPlainText -Force) The key vault gets created fine, but I get the following error when trying to write the secret: [error

Use KeyVaultClient with MSAL Token “Unauthorized”

眉间皱痕 提交于 2021-02-10 18:50:50
问题 How can a desktop application use Azure AD to read KeyVault secrets? I am able to acquire a MSAL token but handing it to KeyVaultClient always results in: Microsoft.Azure.KeyVault.Models.KeyVaultErrorException: Operation returned an invalid status code 'Unauthorized' I'm not even sure KeyVault supports this kind of token but in my Googling I've seen examples of the older ADAL tokens being used. My KeyVault has access policies for both my Azure AD account and a group I'm a member of. The

Azure Portal Error: Failed to start virtual machine 'xxxx'. Error: The Key Vault secret referenced with the URL 'xxxx' does not exist

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 04:14:24
问题 I have deleted some Key Vaults from my resource manager after assuming that they are not used anywhere in my configuration and that those were some leftovers from my testing. Now I can't start my virtual machines and this error message appears. Failed to start virtual machine 'xxxx'. Error: The Key Vault secret referenced with the URL 'xxxx' does not exist. Could you please advise me how to put my virtual machines back on track since I can't afford the time building them again? Thanks a lot.

Azure Portal Error: Failed to start virtual machine 'xxxx'. Error: The Key Vault secret referenced with the URL 'xxxx' does not exist

瘦欲@ 提交于 2021-02-10 04:11:18
问题 I have deleted some Key Vaults from my resource manager after assuming that they are not used anywhere in my configuration and that those were some leftovers from my testing. Now I can't start my virtual machines and this error message appears. Failed to start virtual machine 'xxxx'. Error: The Key Vault secret referenced with the URL 'xxxx' does not exist. Could you please advise me how to put my virtual machines back on track since I can't afford the time building them again? Thanks a lot.

Azure Portal Error: Failed to start virtual machine 'xxxx'. Error: The Key Vault secret referenced with the URL 'xxxx' does not exist

孤街醉人 提交于 2021-02-10 04:10:22
问题 I have deleted some Key Vaults from my resource manager after assuming that they are not used anywhere in my configuration and that those were some leftovers from my testing. Now I can't start my virtual machines and this error message appears. Failed to start virtual machine 'xxxx'. Error: The Key Vault secret referenced with the URL 'xxxx' does not exist. Could you please advise me how to put my virtual machines back on track since I can't afford the time building them again? Thanks a lot.