How can I access secrets (MATLAB vault) in web apps?

11 Ansichten (letzte 30 Tage)
MathWorks Support Team
MathWorks Support Team am 22 Okt. 2025 um 0:00
Bearbeitet: MathWorks Support Team am 28 Okt. 2025 um 16:19
I am deploying an app to MATLAB Web App Server that uses secrets. Currently, this works in my local MATLAB installation using setSecret and getSecret. How can I use these secrets when deploying this app as a web app on MATLAB Web App Server? 

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 28 Okt. 2025 um 0:00
Bearbeitet: MathWorks Support Team am 28 Okt. 2025 um 16:19
There are a few options for this workflow.
Use MATLAB Web App Server's Secrets Vault (requires admin access)
As of R2024a, MATLAB Web App Server maintains its own server-side secrets vault. A server administrator can add, remove, and implement access control for secrets on supported releases. Refer to the following documentation for more information:
Use Environment Variables
Your web app can access secrets stored as environment variables either on your server machine or packaged with your app. Packaging environment variables with your app (as an .env file) and loading them at app startup can be a great option if you do not have access to the server machine. For more information, refer to the documentation:
Package Code with Secrets 
As of R2024b, you can package MATLAB vault secrets with your web app using a secrets manifest JSON file. This file can be included during compilation by specifying the path as the SecretsManifest name-value argument with compiler.build.webAppArchive. For more information, see:

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Web App Server finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by