I'm very new to Azure Devops. Successfully created CI/CD pipeline for Sql database using dacpac. SQL servers are sitting on AZ VM. As part of it I have created a deployment group and ran power shell script generated by azure on server A. While creating CD pipeline, mistakenly given Server B as target server for deployment. Surprising it was not failed, deployment was successful.
I thought each server should be added to the deployment group. but with out adding the server B I'm able to deploy. Can somebody explain the behind the scenes.
The deployment to Server B was successful is because Server B is accessible from Server A (You can have a test using Invoke-Sqlcmd to connect to server B from server A).
When you created a deployment group on server A, you also installed a pipeline agent on the server. When you run the deployment group job in CD pipeline. it would be executed on the pipeline agent on the server A. And since Server B is accessible from Server A, So the deployment will be successful.
For better understanding the situation. Let's say you create a self-hosted agent on your Azure VM. You can deploy to the sql server hosted on the same Azure VM. And any other sql servers on different machines as long as they can be accessed from the machine where the self-hosted agent is installed.