Skip to content
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

[Feature Request] skip add firewall rule #66

Closed
mayong43111 opened this issue Jan 6, 2022 · 3 comments
Closed

[Feature Request] skip add firewall rule #66

mayong43111 opened this issue Jan 6, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@mayong43111
Copy link

Hi,
I have a customer who has very strict access, they don't want to open a firewall every time and they used self-hosted. could you add a parameter like as.

  skipFirewallSetting:
    description: 'Parameters which skip Firewall Setting'
    required: false
    default: 'false'
        let skipFirewallSetting = (core.getInput('skipFirewallSetting') != 'true');
        
        if(skipFirewallSetting){
            const runnerIPAddress = await SqlUtils.detectIPAddress(inputs.serverName, inputs.connectionString);
            if(runnerIPAddress) {
                let azureResourceAuthorizer = await AuthorizerFactory.getAuthorizer();
                let azureSqlResourceManager = await AzureSqlResourceManager.getResourceManager(inputs.serverName, azureResourceAuthorizer);
                firewallManager = new FirewallManager(azureSqlResourceManager);
                await firewallManager.addFirewallRule(runnerIPAddress);
            }
        }
@mayong43111 mayong43111 added the need-to-triage Requires investigation label Jan 6, 2022
@dzsquared dzsquared added enhancement New feature or request and removed need-to-triage Requires investigation labels Jan 6, 2022
@mayong43111
Copy link
Author

That’s a not good idea.

@mayong43111
Copy link
Author

sorry @dzsquared , I thought it was the firewall, but I was wrong. The customer uses the service principal, so the SQLPackage needs to use /AccessToken. The firewall error is a login failure.

@mayong43111
Copy link
Author

temp solution

$token = (az account get-access-token --resource=${{ env.server_name }} --query accessToken --scope=https://database.windows.net/.default)
& "${{ env.sqlpackage_path }}" /Action:Publish "/TargetConnectionString:"${{ env.connection_string}}" /SourceFile:./xxx.dacpac /AccessToken:$token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants