If you have not created an azure pipeline for your repo, then push the yaml file wont trigger a pipeline, since it doesnot exist.
- How do I use curl request to create an Azure Pipeline from yaml file using the CLI?
If you intend to create your azure pipeline using curl request. You can call Build Definition Create restful api to create a pipeline via cli.
POST https://dev.azure.com/{organization}/{project}/_apis/build/definitions?api-version=5.1
See below script example:
Check here to get a personal access token.
You can call repository list rest api to get the id of your repository. You can also get the repository id for the UI (go to Project Settings--> Repositories under Repo--> select the your repository-->You will see the repository id in the address bar repositoryId=96a56858-..-...
)
curl -X POST \
-u username:personalaccesstoken https://dev.azure.com/{organization}/{project}/_apis/build/definitions?api-version=5.1 \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name" : "MyPipelineName";
"repository" : {
"url" : "<the-https-link-to-my-Git-repo>";
"defaultBranch" : "refs/heads/master";
"id" : "Id of the repository";
"type" : "TfsGit";
};
"process" : {
"yamlFilename": "path to/my-pipeline.yml";
"type" : 2;
};
"path": "\A New Folder";
"type" : "build";
}'
You can also create azure pipeline from your azure devops project UI portal. Please check the detailed steps here. Since you already have your yaml file. You can choose Existing Azure Pipeline YAML file
during the setting up wizard. See below:

To enable triggerring your pipeline automatically after your created your pipeline via above methods. You need to define triggers in your yaml file. See here for more information.
For below example: every push to master branch will trigger build on master branch.
trigger:
- master
Note: yaml file must exist in the branch to trigger a build against this branch.