How getting the client IP to add as a firewall rule for Synapse Analytics

pmscorca 987 Reputation points
2024-08-30T08:38:45.13+00:00

Hi,

I need to get the client IP to add a firewall rule for Synapse.

Which is the command to use, please? Thanks

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,917 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 89,386 Reputation points Microsoft Employee
    2024-08-30T11:13:42.71+00:00

    @pmscorca - Thanks for the question and using MS Q&A platform.

    You can use Azure Portal (GUI mode) or programmatically (REST API, PowerShell or CLI) to create a firewall rule to allow access to your Azure Synapse Analytics workspace from your machine.

    Azure Portal:

    You can also add IP firewall rules to a Synapse workspace after the workspace is created. Select Firewalls under Security from Azure portal. To add a new IP firewall rule, give it a name, Start IP, and End IP. Select Save when done.

    User's image

    Azure CLI:
    Follow the steps mentioned in an official documentation: Quickstart: Create an Azure Synapse Analytics workspace

    You can create a firewall rule to allow access to your Azure Synapse Analytics workspace from your machine: az synapse workspace firewall-rule create

    ClientIP=$(curl -sb -H "Accept: application/json" "$WorkspaceDev" | jq -r '.message')
    ClientIP=${ClientIP##'Client Ip address : '}
    echo "Creating a firewall rule to enable access for IP address: $ClientIP"
    
    az synapse workspace firewall-rule create --end-ip-address $ClientIP --start-ip-address $ClientIP --name "Allow Client IP" --resource-group $SynapseResourceGroup --workspace-name $SynapseWorkspaceName
    

    For more information on the methods to manage the firewall programmatically, see:

    For more details, refer to Azure Synapse Analytics IP firewall rules.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.