Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
How to access my Stripe secret from azure key vault to inject into checkout.js

I'm developing a web app in dotnet 6 C# core razor pages. I have setup an Azure key vault with my Stripe Api Key and Publishable Key. I use the following code to access the key from the Key Vault.

public readonly IConfiguration _configuration;
PublicKey = _configuration["PublishableKey"].ToString();

This code I have tested and it does return the Publishable Key. I then need to inject that key into a javascript file checkout.js.

const stripe = Stripe('');

I tried this in the cshtml file,

@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@Configuration["PublishableKey"].ToString()

That worked in the cshtml file. I then tried this in the javerscript file checkout.js.

 const stripe = Stripe('@Configuration["PublishableKey"].ToString()')

I also tried.

@Model.PublicKey

But neither returned the key. How do I reference this key in the javascript file? Your help would be appreciated Thank-you.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!