Skip to content

Commit 7dc1846

Browse files
authored
Update GitHub Actions for latest version of SQL action (#34891)
1 parent 386223a commit 7dc1846

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

azure-sql/database/connect-github-actions-sql-db.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure SQL Database from a GitHub Actions workflow
44
author: juliakm
55
ms.author: jukullam
66
ms.reviewer: wiassaf, mathoma
7-
ms.date: 02/11/2025
7+
ms.date: 08/05/2025
88
ms.service: azure-sql-database
99
ms.subservice: connect
1010
ms.topic: quickstart
@@ -26,14 +26,14 @@ You need:
2626

2727
## Workflow file overview
2828

29-
A GitHub Actions workflow is defined by a YAML (.yml) file in the `/.github/workflows/` path in your repository. This definition contains the various steps and parameters that make up the workflow.
29+
A GitHub Actions workflow is defined by a YAML (.yml) file in the `/.github/workflows/` path in your repository. This file has the steps and parameters that make up the workflow.
3030

3131
The file has two sections:
3232

3333
|Section |Tasks |
3434
|---------|---------|
35-
|**Authentication** | 1.1. Generate deployment credentials. |
36-
|**Deploy** | 1. Deploy the database. |
35+
|**Authentication** | 1. Generate deployment credentials. |
36+
|**Deploy** | 2. Deploy the database. |
3737

3838
## Generate deployment credentials
3939

@@ -69,7 +69,7 @@ You'll set the connection string as a GitHub secret, `AZURE_SQL_CONNECTION_STRIN
6969

7070
2. Select **Set up your workflow yourself**.
7171

72-
3. Delete everything after the `on:` section of your workflow file. For example, your remaining workflow may look like this.
72+
3. Delete everything after the `on:` section of your workflow file. For example, your remaining workflow can look like this.
7373

7474
```yaml
7575
name: SQL for GitHub Actions
@@ -132,14 +132,14 @@ You'll set the connection string as a GitHub secret, `AZURE_SQL_CONNECTION_STRIN
132132
5. Use the Azure SQL Deploy action to connect to your SQL instance. You should have a dacpac package (`Database.dacpac`) at the root level of your repository. Use the `AZURE_SQL_CONNECTION_STRING` GitHub secret you created earlier.
133133

134134
```yaml
135-
- uses: azure/sql-action@v2
135+
- uses: azure/sql-action@v2.3
136136
with:
137137
connection-string: ${{ secrets.AZURE_SQL_CONNECTION_STRING }}
138138
path: './Database.dacpac'
139-
action: 'Publish'
139+
action: 'publish'
140140
```
141141

142-
6. Complete your workflow by adding an action to logout of Azure. Here's the completed workflow. The file appears in the `.github/workflows` folder of your repository.
142+
5. Complete your workflow by adding an action to logout of Azure. Here's the completed workflow. The file appears in the `.github/workflows` folder of your repository.
143143

144144
# [OpenID Connect](#tab/openid)
145145

@@ -162,6 +162,12 @@ You'll set the connection string as a GitHub secret, `AZURE_SQL_CONNECTION_STRIN
162162
client-id: ${{ secrets.AZURE_CLIENT_ID }}
163163
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
164164
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
165+
- uses: azure/[email protected]
166+
with:
167+
connection-string: ${{ secrets.AZURE_SQL_CONNECTION_STRING }}
168+
path: './Database.dacpac'
169+
action: 'publish'
170+
165171
# Azure logout
166172
- name: logout
167173
run: |
@@ -187,11 +193,11 @@ You'll set the connection string as a GitHub secret, `AZURE_SQL_CONNECTION_STRIN
187193
- uses: azure/login@v2
188194
with:
189195
creds: ${{ secrets.AZURE_CREDENTIALS }}
190-
- uses: azure/sql-action@v2
196+
- uses: azure/sql-action@v2.3
191197
with:
192198
connection-string: ${{ secrets.AZURE_SQL_CONNECTION_STRING }}
193199
path: './Database.dacpac'
194-
action: 'Publish'
200+
action: 'publish'
195201
196202
# Azure logout
197203
- name: logout

0 commit comments

Comments
 (0)