You can use Azure DevOps pipeline variables, and they define at the pipeline level or within specific tasks, allowing you to customize their values based on your deploying environment.
How to pass the environment name in the SQL script?
We have 2 environments stage and prod
reference-{env}-central - is the user name
azure-{env}-central.database.windows.net; - is the server name.
IF EXISTS (SELECT * FROM sys.server_principals WHERE NAME = 'reference-{env}-central')
DROP LOGIN [reference-{env}-central] :azure-{env}-central.database.windows.net;
I want to know how to pass the environment name stage and prod whereever {env} is there becuase when i point to stage environment in the Azure pipeline task properties. It should select the name stage in place of {env} and drop the login and when pointed to prod it should select the name dev and drop the login
Azure SQL Database
Microsoft Security Microsoft Entra Microsoft Entra ID
SQL Server Other
1 answer
Sort by: Most helpful
-
Vahid Ghafarpour 23,385 Reputation points Volunteer Moderator
2023-07-21T18:35:35.76+00:00