I'm configuring a pipeline to deploy a test environment for an app, along with app services and storage there is a SQL database. I have already automated the creation of all of them in azure and is working.
After the test is finished, the environment is destroyed to save resources until a new test is required.
Now I need to add a SQL user to the test database while deploying, it's on the same server, to simplify the login already exists, so I want to assign the same to the new database.
Something like this.
Server1 already has user1 as login (was manually created)
Database1 already has user1 as user (was manually assigned)
Desired:
- Add User1 as user of database2
There is a way to automate this while building the test environment?
Thanks in advance.