microsoft / microsoft/DacFx

Provide some support for secrets

Open
#381 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**

I'm currently moving a Synapse Serverless project over to dacpac deployments.

This contains some elements such as

```
CREATE MASTER KEY ENCRYPTION
BY PASSWORD = '$(database_master_key)'

CREATE DATABASE SCOPED CREDENTIAL [CosmosDbCredential]
WITH IDENTITY = N'SHARED ACCESS SIGNATURE',
SECRET = '$(cosmos_account_read_key)';
```

with the values passed in as SQL Cmd variables.

I also like to have a "Preview" step in my SQLPackage.exe pipelines where the deployer can sanity check the script that will be run and validate that it doesn't include any unexpected elements (and to save this script as a pipeline artefact).

At the moment the default behaviour is that this will expose these secrets in plain text.

**Describe the solution you'd like**

Potentially a checkbox in SSDT to mark SQL Cmd variables as "sensitive" and save this information to the project - and an argument that can be passed to the Script action that controls whether or not the script output contains unredacted values for these or not. There may well be better options than this though!

**Describe alternatives you've considered**
Doing some post processing of the script to replace these values but I'm sure this is a common need (and post processing means the plain text will still be persisted to a file somewhere first).

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Begin with the SQLPackage.exe Script action and its SQL Cmd variable handling; inspect how Preview output currently renders the supplied values. Done means the secret-marking and script-output requirements are addressed without persisting unredacted values, including the shown master-key and database-scoped credential examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, sql
Domain
databases, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.