azure-keyvault

Authenticating to Azure Key Vault locally using DefaultAzureCredential

﹥>﹥吖頭↗ 提交于 2020-12-15 02:01:38
问题 I am attempting to run this 'Retrieve a secret from the vault' example locally (Ubuntu 19.10) to retrieve a secret from an Azure Key Vault: from azure.keyvault.secrets import SecretClient from azure.identity import DefaultAzureCredential client = SecretClient(vault_url="https://<<vaultname>>.vault.azure.com", credential=DefaultAzureCredential()) secret = client.get_secret("<<mysecret>>") However I receive the following error: azure.core.exceptions.ClientAuthenticationError: No credential in

Authenticating to Azure Key Vault locally using DefaultAzureCredential

大憨熊 提交于 2020-12-15 01:55:36
问题 I am attempting to run this 'Retrieve a secret from the vault' example locally (Ubuntu 19.10) to retrieve a secret from an Azure Key Vault: from azure.keyvault.secrets import SecretClient from azure.identity import DefaultAzureCredential client = SecretClient(vault_url="https://<<vaultname>>.vault.azure.com", credential=DefaultAzureCredential()) secret = client.get_secret("<<mysecret>>") However I receive the following error: azure.core.exceptions.ClientAuthenticationError: No credential in

Authenticating to Azure Key Vault locally using DefaultAzureCredential

旧时模样 提交于 2020-12-15 01:54:22
问题 I am attempting to run this 'Retrieve a secret from the vault' example locally (Ubuntu 19.10) to retrieve a secret from an Azure Key Vault: from azure.keyvault.secrets import SecretClient from azure.identity import DefaultAzureCredential client = SecretClient(vault_url="https://<<vaultname>>.vault.azure.com", credential=DefaultAzureCredential()) secret = client.get_secret("<<mysecret>>") However I receive the following error: azure.core.exceptions.ClientAuthenticationError: No credential in

ARM template error Bad JSON content found in the request

爷,独闯天下 提交于 2020-12-13 05:37:04
问题 I am trying to deploy an ARM template using the Azure DevOps release pipeline. Azure KeyVault is one of the resources in the template. the deployment is successful when I use the Powershell script. however, when Azure DevOps Release pipeline is used, deployment fails with error "Bad JSON content found in the request" https://i.stack.imgur.com/o9sbD.png The key vault resource definition is as below. { "type": "Microsoft.KeyVault/vaults", "apiVersion": "2018-02-14", "name": "[parameters(

Retrieving Keyvault Secret Integrated in a httptrigger/queuetrigger -Python

强颜欢笑 提交于 2020-12-13 03:45:13
问题 I have successfully integrated a secret in a httptrigger. I need to retrieve and parse the secret in a python code. The following piece of code returns the vault id and not the secret. How do I get it to output a secret values? Can the same be done for a queuetrigger? Httptrigger import logging import os import azure.functions as func def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') test = os.environ["testkeyvault"] return

v2 Azure Function with Service Bus trigger not firing

走远了吗. 提交于 2020-12-10 15:56:30
问题 I am using Azure Functions V2 with a Service Bus trigger using 1.0.23 of the C# Functions SDK. I'm using the following approach to get secrets from KeyVault and use them within the settings of the triggers: How to map Azure Functions secrets from Key Vault automatically The function, especially when it has done nothing for a while, doesn't fire when there are messages on the subscription. If I then go to the portal and execute manually (yes, that particular execution is fired with a null

Azure Managed Identity from within a docker container running locally

☆樱花仙子☆ 提交于 2020-12-05 05:12:03
问题 I am running a docker container consisting of a asp.net core 2.2 api. This api needs access to Azure key vault and I have signed in into Visual studio with a user that has the right access policies on the Key Vault to retrieve secrets. However, when I use visual studio tools for docker to debug the container, this particular sign in does not seem to propogate inside the container running locally. But when i run the application locally(without running it in docker container) the asp net core

Azure Managed Identity from within a docker container running locally

主宰稳场 提交于 2020-12-05 05:11:21
问题 I am running a docker container consisting of a asp.net core 2.2 api. This api needs access to Azure key vault and I have signed in into Visual studio with a user that has the right access policies on the Key Vault to retrieve secrets. However, when I use visual studio tools for docker to debug the container, this particular sign in does not seem to propogate inside the container running locally. But when i run the application locally(without running it in docker container) the asp net core

Using AddAzureKeyVault makes my application 10 seconds slower

拜拜、爱过 提交于 2020-12-03 02:55:39
问题 I’m having this very simple .NET Core application: static void Main(string[] args) { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); builder.AddAzureKeyVault("https://MyKeyVault.vault.azure.net"); var stopwatch = new Stopwatch(); stopwatch.Start(); var configuration = builder.Build(); var elapsed = stopwatch.Elapsed; Console.WriteLine($"Elapsed time: {elapsed.TotalSeconds}"); } The

How can I create an X509Certificate2 object from an Azure Key Vault KeyBundle

扶醉桌前 提交于 2020-12-02 06:03:45
问题 I am using Azure Key Vault to protect our keys and secrets, but I am unsure how I can use the KeyBundle I retrieve using the .net SDK. How can I create an X509Certificate2 object? 回答1: When you import / create a certificate in KeyVault, 3 entities are created: Certificate - contains all the relevant details about the certificate, including its public part (i.e. public key, validity period, thumbprint etc.) Secret - contains the private key (which is the private part of the certificate) in