php - Symfony - Azure Vault for DB password

Is it possible to use Azure Vault to store MySQL DB credentials in Symfony? Right now the credentials are stored in an .env file (encrypted) but there's a request to use Azure Key Vault instead. I've never heard about such a setup, is it possbile at all?
Answer
Solution:
There is no official PHP SDK for Azure keyvault, you could call the REST API - to store the MySQL DB credentials directly as secrets in the keyvault. If you want to retrieve them, use
to do that.
There are some prerequisites to call the rest apis.
1.Register an application with Azure AD and create a service principal.
2.Get values for signing in and create a new application secret.
3.Add the service principal to the keyvault access policy with correct secret permissions.
4.Use the AAD client credential flow to get the token, then call the rest api.
Here is a sample wrapper of calling the rest apis, you could refer to it. See Add secret and Get secret.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: the requested url was not found on this server. xampp
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.