Creating child resource if not exist - (Creating KeyVault secret if not exist) #3804
-
|
I would like to create a child resource, in this case a KeyVault secret if not already exists, but I cant figure out how to do this The reason for this is that SQL servers requires a admin account and admin password, but I nether need or want these since I use Azure AD authentication instead. But... For redeployment reasons I need to save/know the password, so my thinking is to save the password in a KeyVault and generate the password (create the KeyVault secret child resourse) the first time only. Any idea how to implement a logic that only creates a resource (or maybe simplier a child resource) only if it doesn't exist without using deployment scripts |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
It's a chicken or egg scenario for sure. I always bootstrap a keyvault and then securely/manually enter the secrets ahead of time and also import certs. That way I can securely read them back during the deployment via a Template Parameter, which is a (I think the only) secure way to handle secrets as part of deployments, unless you are using list*() to read them from somewhere else. What is your plan or do you have another (secure) way to generate a secret during the deployment which you then plan to write it into the keyvault initially? |
Beta Was this translation helpful? Give feedback.
It's a chicken or egg scenario for sure.
I always bootstrap a keyvault and then securely/manually enter the secrets ahead of time and also import certs. That way I can securely read them back during the deployment via a Template Parameter, which is a (I think the only) secure way to handle secrets as part of deployments, unless you are using list*() to read them from somewhere else.
What is your plan or do you have another (secure) way to generate a secret during the deployment which you then plan to write it into the keyvault initially?