azure-keyvault

How to grab value from promise in Nodejs

孤街醉人 提交于 2020-08-10 08:44:12
问题 Hi I am writing a nodejs code in Azure functions to capture the username saved in Azure key vault. Here is the code I have written module.exports = async function (context, req) { var msRestAzure = require('ms-rest-azure'); var KeyVault = require('azure-keyvault'); function getKeyVaultCredentials() { return msRestAzure.loginWithAppServiceMSI({ resource: 'https://vault.azure.net/' }); } function getKeyVaultSecret(credentials) { let keyVaultClient = new KeyVault.KeyVaultClient(credentials);

How to output secret uri in ARM template?

隐身守侯 提交于 2020-08-03 02:29:20
问题 I am unable to output the secret URI from my secret resource in my ARM template. Any ideas on how to do that? 回答1: If you mean you want to have it from the KeyVault, try this: "outputs":{ "mySecretUri": { "type": "string", "value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', parameters('keyVaultName'), parameters('mySecretName'))).secretUri]" } } 回答2: In my case the secret is a generated value which changes with every ARM deployment. This requires the specification of the

How to output secret uri in ARM template?

爷,独闯天下 提交于 2020-08-03 02:28:14
问题 I am unable to output the secret URI from my secret resource in my ARM template. Any ideas on how to do that? 回答1: If you mean you want to have it from the KeyVault, try this: "outputs":{ "mySecretUri": { "type": "string", "value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', parameters('keyVaultName'), parameters('mySecretName'))).secretUri]" } } 回答2: In my case the secret is a generated value which changes with every ARM deployment. This requires the specification of the

How to output secret uri in ARM template?

穿精又带淫゛_ 提交于 2020-08-03 02:27:19
问题 I am unable to output the secret URI from my secret resource in my ARM template. Any ideas on how to do that? 回答1: If you mean you want to have it from the KeyVault, try this: "outputs":{ "mySecretUri": { "type": "string", "value": "[reference(resourceId('Microsoft.KeyVault/vaults/secrets', parameters('keyVaultName'), parameters('mySecretName'))).secretUri]" } } 回答2: In my case the secret is a generated value which changes with every ARM deployment. This requires the specification of the

How to extract Secret key from Azure key vault in Azure Function App on Nodejs stack

て烟熏妆下的殇ゞ 提交于 2020-07-22 05:19:48
问题 I have created an Azure Function app in Nodejs version 12. My hosting environment is windows. What is the easiest way to capture the username and password which are saved in Azure key vault inside my function. Also I am using Inline code Editor so how should be capture the credentials in code. Thanks 回答1: The node SDK used in above answer is going to be deprecated and won't have new feature and releases. Instead, the new versions are released here: https://www.npmjs.com/package/@azure

Can't add Microsoft.Azure.Cdn service principal to Key Vault access policies

假装没事ソ 提交于 2020-05-18 01:47:26
问题 I cannot add Microsoft.Azure.Cdn service principal to Key Vault access policies. I have run the following command in PowerShell. New-AzureRmADServicePrincipal -ApplicationId "xxxxxx-xxxx-xxxx-xxxx-xxxxxxx" I got the following result. Secret: System.Security.SecureString ServicePrincipalNames : {xxxxxx-xxxx-xxxx-xxxx-xxxxxxx, https://microsoft.onmicrosoft.com/yyyyyyy-yyyy-yyyy-yyyy-yyyyyyyy} ApplicationId: xxxxxx-xxxx-xxxx-xxxx-xxxxxxx DisplayName: Microsoft.Azure.Cdn Id: zzzzzzzz-zzzz-zzzz

Can't add Microsoft.Azure.Cdn service principal to Key Vault access policies

百般思念 提交于 2020-05-18 01:45:49
问题 I cannot add Microsoft.Azure.Cdn service principal to Key Vault access policies. I have run the following command in PowerShell. New-AzureRmADServicePrincipal -ApplicationId "xxxxxx-xxxx-xxxx-xxxx-xxxxxxx" I got the following result. Secret: System.Security.SecureString ServicePrincipalNames : {xxxxxx-xxxx-xxxx-xxxx-xxxxxxx, https://microsoft.onmicrosoft.com/yyyyyyy-yyyy-yyyy-yyyy-yyyyyyyy} ApplicationId: xxxxxx-xxxx-xxxx-xxxx-xxxxxxx DisplayName: Microsoft.Azure.Cdn Id: zzzzzzzz-zzzz-zzzz

Can't add Microsoft.Azure.Cdn service principal to Key Vault access policies

陌路散爱 提交于 2020-05-18 01:45:30
问题 I cannot add Microsoft.Azure.Cdn service principal to Key Vault access policies. I have run the following command in PowerShell. New-AzureRmADServicePrincipal -ApplicationId "xxxxxx-xxxx-xxxx-xxxx-xxxxxxx" I got the following result. Secret: System.Security.SecureString ServicePrincipalNames : {xxxxxx-xxxx-xxxx-xxxx-xxxxxxx, https://microsoft.onmicrosoft.com/yyyyyyy-yyyy-yyyy-yyyy-yyyyyyyy} ApplicationId: xxxxxx-xxxx-xxxx-xxxx-xxxxxxx DisplayName: Microsoft.Azure.Cdn Id: zzzzzzzz-zzzz-zzzz

KeyVault --> Azure Pipeline --> XML variable substitution adds extra single quote to the end which breaks the connection string

落爺英雄遲暮 提交于 2020-05-17 07:46:13
问题 I asked previously how to do variable substitution with Azure KeyVault here, and was able to get it mostly working save one last issue. For some unknown reason, the substitution occurs perfectly but it adds one extra single quote at the end. Since these are connection strings in the web.config, that extra single quote breaks it. I have no idea what is adding that extra single quote. I did quadruple check KeyVault to ensure its not there as a typo. I have tried doing XML variable substitution

Secret name is not supporting special character

杀马特。学长 韩版系。学妹 提交于 2020-04-30 10:13:44
问题 I have a requirement where I need to store my secret name as fname_lname. But when I tried with underscore I got following error. For time being to bypass the error I wrote a utility to convert from underscore to hyphen and vice versa. Is there any reason why there is no support for basic special character like underscore? az keyvault secret set --vault-name 'my-kv' -n 'fname_lname' -v 'myvalue' parameter 'secret_name' must conform to the following pattern: '^[0-9a-zA-Z-]+$'. 回答1: It seems