How to get the IP Address for Azure DevOps Hosted Agents to add to the white list

前端 未结 5 923
北恋
北恋 2020-12-16 16:21

Is there a way to the IP address range for the hosted machine running?

This is related to the Release Pipeline -> Hosted agent.

Issue: Getting access denied

5条回答
  •  独厮守ぢ
    2020-12-16 16:55

    In case you came looking here becasue you're getting this error when trying to use Azure DevOps to MSBuild and deploy to an Azure SQL server and going slightly mad because nothing seems to be on the internet and people are all taking about using power shell scripts to find out the IP address of the server and white listing etc.., then you may be better of using a task called "Azure SQL Database deployment" in your yml file as well as the MSBuild like so:

    - task: MSBuild@1
      displayName: Build the database project
      inputs:
        solution: '**/projectname.sqlproj'
        msbuildArguments: '/t:Restore /t:Build '
    
    
    
    - task: SqlAzureDacpacDeployment@1
      inputs:
        azureSubscription: ''
        AuthenticationType: 'server'
        ServerName: '.database.windows.net'
        DatabaseName: ''
        SqlUsername: ''
        SqlPassword: ''
        deployType: 'DacpacTask'
        DeploymentAction: 'Publish'
        DacpacFile: '**/projectname.dacpac'
        IpDetectionMethod: 'AutoDetect'
    

    the IpDetectionMethod of auto worked for me put it does allow you to easily put in your own values (although i haven't tried that)

提交回复
热议问题