You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to first define how to authenticate with Azure. You can use a [service principal](/azure/active-directory/develop/app-objects-and-service-principals#service-principal-object) or [OpenID Connect](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect).
48
+
You'll need to first define how to authenticate with Azure. The recommended, more secure option is to [sign in with OpenID Connect using a Microsoft Entra application or a user-assigned managed identity](/azure/developer/github/connect-from-azure-openid-connect). If necessary, you can also use [sign in with a service principal and secret](/azure/developer/github/connect-from-azure-secret). This approach is less secure and not recommended.
49
49
50
50
### Generate deployment credentials
51
51
@@ -79,18 +79,17 @@ You use a `pipeline.yml` file to deploy your Azure Machine Learning pipeline. Th
79
79
80
80
Your workflow authenticates with Azure, sets up the Azure Machine Learning CLI, and uses the CLI to train a model in Azure Machine Learning.
81
81
82
-
# [Service principal](#tab/userlevel)
83
-
82
+
# [OpenID Connect](#tab/openid)
84
83
85
84
Your workflow file is made up of a trigger section and jobs:
86
85
- A trigger starts the workflow in the `on` section. The workflow runs by default on a cron schedule and when a pull request is made from matching branches and paths. Learn more about [events that trigger workflows](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows).
87
-
- In the jobs section of the workflow, you check out code and log into Azure with your service principal secret.
86
+
- In the jobs section of the workflow, you checkout code and log into Azure with the Azure login action using OpenID Connect.
87
+
====
88
88
- The jobs section also includes a setup action that installs and sets up the [Machine Learning CLI (v2)](how-to-configure-cli.md). Once the CLI is installed, the run job action runs your Azure Machine Learning `pipeline.yml` file to train a model with NYC taxi data.
89
89
90
-
91
90
### Enable your workflow
92
91
93
-
1. In your forked repository, open `.github/workflows/cli-jobs-pipelines-nyc-taxi-pipeline.yml` and verify that your workflow looks like this.
92
+
1. In your forked repository, open `.github/workflows/cli-jobs-pipelines-nyc-taxi-pipeline.yml` and verify that your workflow looks like this.
94
93
95
94
```yaml
96
95
name: cli-jobs-pipelines-nyc-taxi-pipeline
@@ -114,9 +113,11 @@ Your workflow file is made up of a trigger section and jobs:
@@ -125,24 +126,29 @@ Your workflow file is made up of a trigger section and jobs:
125
126
run: bash -x ../../../run-job.sh pipeline.yml
126
127
working-directory: cli/jobs/pipelines/nyc-taxi
127
128
```
128
-
129
+
129
130
1. Select **View runs**.
130
131
1. Enable workflows by selecting **I understand my workflows, go ahead and enable them**.
131
132
1. Select the **cli-jobs-pipelines-nyc-taxi-pipeline workflow** and choose to **Enable workflow**.
133
+
132
134
:::image type="content" source="media/how-to-github-actions-machine-learning/enable-github-actions-ml-workflow.png" alt-text="Screenshot of enable GitHub Actions workflow.":::
135
+
133
136
1. Select **Run workflow** and choose the option to **Run workflow** now.
137
+
134
138
:::image type="content" source="media/how-to-github-actions-machine-learning/github-actions-run-workflow.png" alt-text="Screenshot of run GitHub Actions workflow.":::
135
139
136
-
# [OpenID Connect](#tab/openid)
140
+
# [Service principal](#tab/userlevel)
141
+
137
142
138
143
Your workflow file is made up of a trigger section and jobs:
139
144
- A trigger starts the workflow in the `on` section. The workflow runs by default on a cron schedule and when a pull request is made from matching branches and paths. Learn more about [events that trigger workflows](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows).
140
-
- In the jobs section of the workflow, you check out code and log into Azure with the Azure login action using OpenID Connect.
145
+
- In the jobs section of the workflow, you checkout code and log into Azure with your service principal secret.
141
146
- The jobs section also includes a setup action that installs and sets up the [Machine Learning CLI (v2)](how-to-configure-cli.md). Once the CLI is installed, the run job action runs your Azure Machine Learning `pipeline.yml` file to train a model with NYC taxi data.
142
147
148
+
143
149
### Enable your workflow
144
150
145
-
1. In your forked repository, open `.github/workflows/cli-jobs-pipelines-nyc-taxi-pipeline.yml` and verify that your workflow looks like this.
151
+
1. In your forked repository, open `.github/workflows/cli-jobs-pipelines-nyc-taxi-pipeline.yml` and verify that your workflow looks like this.
146
152
147
153
```yaml
148
154
name: cli-jobs-pipelines-nyc-taxi-pipeline
@@ -166,11 +172,9 @@ Your workflow file is made up of a trigger section and jobs:
@@ -179,16 +183,14 @@ Your workflow file is made up of a trigger section and jobs:
179
183
run: bash -x ../../../run-job.sh pipeline.yml
180
184
working-directory: cli/jobs/pipelines/nyc-taxi
181
185
```
182
-
186
+
183
187
1. Select **View runs**.
184
188
1. Enable workflows by selecting **I understand my workflows, go ahead and enable them**.
185
189
1. Select the **cli-jobs-pipelines-nyc-taxi-pipeline workflow** and choose to **Enable workflow**.
186
-
187
190
:::image type="content" source="media/how-to-github-actions-machine-learning/enable-github-actions-ml-workflow.png" alt-text="Screenshot of enable GitHub Actions workflow.":::
188
-
189
191
1. Select **Run workflow** and choose the option to **Run workflow** now.
190
-
191
192
:::image type="content" source="media/how-to-github-actions-machine-learning/github-actions-run-workflow.png" alt-text="Screenshot of run GitHub Actions workflow.":::
0 commit comments