-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passwordless sqlcmd sqlOperation #4140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a lot of questions and need some more information on the high level approach for this feature.
How does a user leverage it? Custom metadata in bicep (scary).
Looks very tightly coupled to unrelated generic components. Lets chat.
func downloadSqlCmd( | ||
ctx context.Context, | ||
transporter policy.Transporter, | ||
sqlCmdVersion semver.Version, | ||
extractImplementation extractSqlCmdCliFromFileImplementation, | ||
path string) error { | ||
|
||
binaryName := func(platform string) string { | ||
return fmt.Sprintf("sqlcmd-%s", platform) | ||
} | ||
|
||
systemArch := runtime.GOARCH | ||
// arm and x86 not supported (similar to bicep) | ||
var releaseName string | ||
switch runtime.GOOS { | ||
case "windows": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this custom download/install logic is starting to scare me... azd
is not a package manager but instead we should consider leveraging existing package manager like winget or choco to help install missing required components.
I don't think maintaining install/download scripts for various tools is something we want to get into the business of maintaining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked ofline to Wallace about this.
Maybe we can keep bringing stand-alone binaries to ~/.azd folder if the tool is under Microsoft umbrella. Like gh-cli, bicep-cli, swa-cli, and now sqlcmd-cli.
We definitely don't want to use azd to pull other tools like terraform or something else.
The main idea of using standalone binaries is to have only azd to know about it and be the less invasive to customer's PC. We also don't want to deal with min versions and updates when asking for tools to be installed in the system.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
const AzdMetadataTypePrincipalLogin AzdMetadataType = "principalLogin" | ||
const AzdMetadataTypePrincipalId AzdMetadataType = "principalId" | ||
const AzdMetadataTypePrincipalType AzdMetadataType = "principalType" | ||
const AzdMetadataTypeIpAddress AzdMetadataType = "ipAddress" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very nervous about this feature (and also the implementation) - Are we totally hosed if we don't have it? I assume this is for us to be able to scope some firewall rules to "the current user's machine" but I am very nervous about corner cases in the implementation with respect to things like NAT.
|
||
// GetIpAddress returns the public IP address of the caller. | ||
func GetIpAddress() (string, error) { | ||
resp, err := http.Get("https://api.ipify.org") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we must add this, let's figure out a way to do it using an azure backed service (ideally one we don't run!). But this feels like the sort of thing that's going to be a footgun
// sqlCmdCliVersion is the minimum version of sqlCmd cli that we require | ||
var sqlCmdCliVersion semver.Version = semver.MustParse("1.8.0") | ||
|
||
func NewSqlCmdCli(ctx context.Context, console input.Console, commandRunner exec.CommandRunner) (*SqlCmdCli, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Let's name the exported CLI type, Cli
and this method NewCli
as we are now doing for the other tools.
Hi @vhvb1989. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Hi @vhvb1989. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass. |
Adding 2 features to leverage azd for setting up SQL Server with EntraId Auth.
Based on: https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-service-principal?view=azuresql
Feature 1) - azd-metadata for bicep input parameters
Feature 2) - sqlScript operation [for azd.operations]