What client is connecting to Azure SQL Data Warehouse? - azure-sqldw

I am planning to automate the KILL of user queries running over a configurable amount of time. I see that
sys.dm_pdw_exec_sessions
has the login_name, but the client_id column looks to me like an Azure IP (104.*) and not the IP (10.*) from my company's servers/PCs.
Is it possible to know the client context for an ADW query?

If you connect from your laptop to Azure SQL DW the IP will usually match your public IP. Compare to http://www.myipaddress.com and see if it matches. It won't be your internal 10.* IP address because you can't put Azure SQL DW on a VNET at the moment.

sys.dm_pdw_exec_sessions also has app_name, which gives some good details, for example:
'Mashup Engine' in the above example is Power BI Desktop.
You could also instigate a policy that all queries had to use the LABEL syntax to give additional query context, kill queries that don't comply? See below for additional details:
https://learn.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-develop-label

Related

Power BI Embedded Approach for 100s of SQL Targets

I'm trying to find the best approach to delivering a BI solution to 400+ customers which each have their own database.
I've got PowerBI Embedded working using service principal licensing and I have the PowerBI service connected to my data through the On Premise Data Gateway.
I've build my first report pointing to 1 of the customer databases. Which works lovely.
What I want to do next, when embedding the report, is to tell PowerBI, for this session, to get the database from a different database.
I'm struggling to find somewhere where this is explained, or to understand if this is even possible.
I'm trying to avoid creating 400+ WorkSpaces or 400+ Data Sets.
If someone could point me in the right direction, it would be appreciated.
You can configure the report to use parameters and these parameters can be used to configure the source for your dataset:
https://www.phdata.io/blog/how-to-parameterize-data-sources-power-bi/
These parameters can be set by the app hosting the embedded report:
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/update-parameters-in-group
Because the app is setting the parameter, each user will only see their own data. Since this will be a live connection, you would need to think about how the underlying server can support the workload.
An alternative solution would be to consolidate the customer databases into a single database (just the relevant tables) and use row level security to restrict access for each customer. The advantage to this design is that you take the burden off of the underlying SQL instance and push it into a PBI dataset that is made to handle huge datasets with sub-second response times.
More on that here: https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-rls

What is the underlying connection mode when using live connection? (import or direct query mode)

Live connections
When connecting to SQL Server Analysis Services,
there's an option to either import data from or connect live to, the
selected data model. If you use import, you define a query against
that external SQL Server Analysis Services source, and the data is
imported as normal. If you use connect live, there's no query defined,
and the entire external model is shown in the field list.
My understanding was that import/direct query can be used to query a data source like SQL server. Where as live mode is used to connect to an existing power bi dataset, or SSAS, or azure analysis service.
The above quote says When connecting to SQL Server Analysis Services, there's an option to either import data from or connect live to, the selected data model. - So does this mean that the live mode allows us to choose between import/direct query to the live model?
When connecting to SQL Server Analysis Services, there's an option to
either import data from or connect live to, the selected data model.
This quote means that you do not have to use a live connection with SSAS models. Instead you can construct a query and import the data. The dataset would be limited to whatever was in the query. If you use a live connection, you have access to the entire model.

Can we use button to change data source in power bi?

I am new in power bi. I am using SQL connection for data load in power bi.
I created the report in Dev environment. But I want to use the same report in all environment(dev/test/uat/prod).
Question: Is it possible to switch the connection via button click in dashboard?
You'll have to use a parameter to select the connection and store the report in template format - *.pbit. Then you can easily create different versions of the report from the template by specifying the according parameter setting.
The only way to use a slicer for changing the environment would be to load the data from all different environments into the model first - which is clearly not recommended.
Power BI offers Deployment Pipelines for this purpose. This tool will allow you to create 3 workspaces for dev, test and production stages. Then you can deploy from one stage to another by clicking a button in Power BI Service or using the REST API. In the pipeline you can define rules for dataset and parameters, which can be used to automatically change the datasource when deploying to the next stage, i.e. to change the datasource from your dev database to the test database, or from test database to production one.
You can also implement similar functionality using the API. See for example this answer.
Its tricky question.
Try with above answers, if those not work try with these approach.
I don't think for the moment they didn't implement solution for that.
From my experience I had to create 3 dashboards and gateways to dev, test and prod dashboard.
If your dev,test,prod database column names are same you just copy past your dashboard and rename it according to that.
Then go to change data source and add new test env host and change schema to test env.
If you get few errors you have to resolve , check column names, host and finally you have to sync your data.
You can use same approach for the prod env .
once you publish, you can point to gateway for dev,test or prod environment.
Note: Establish gateway on your server.

Error when Connecting PowerBI to Snowflake

I am receiving an error when connecting Power BI to Snowflake.
"Unable to Connect - We encountered an error while trying to connect. Details: "The server name should only be a host name".
I am putting our server in as:
https://xxxxxx.east-us-2.azure.snowflakecomputing.com
And I have put in the name of the Warehouse (compute) that I want to use to process the load:
PRD_BI_GENERAL_US_XS
I chose Import mode and left all the optional fields blank.
Try it without the "https://":
xxxxxx.east-us-2.azure.snowflakecomputing.com
Either from Power BI Desktop or Power BI service, the target Server when connecting to a Snowflake account has to be the hostname, therefore it doesn't need the HTTPS:// which instead is required to get to the Snowflake Account via Web UI.
An example would be: contoso.snowflakecomputing.com
Also, in order to successfully connect from Power BI you have to impersonate a Snowflake Role that is allowed 'Usage' permission on the Virtual Warehouse and the Database you want to get to. This can be done by having that specific Role as the Default Role for your Login.
Note that, since February 2021, Power BI Desktop supports Snowflake custom roles.
Reference:
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-connect-snowflake#:~:text=To%20connect%20to%20a%20Snowflake,the%20box%20and%20select%20O
https://powerbi.microsoft.com/en-us/blog/power-bi-february-2021-feature-summary/#_Toc63074806
.

Power BI Gateway on-prem server

I have a MSSQL server on-prem and followed the steps from Microsofts Docs
in order to install the gateway.
Than i managed the gateway via manage gateways within power bi (cloud) and the test there worked and i got the green check.
Now the question how do i get the data from the gateway into a dataset? when i try to add a new dataset there and click on data bases i only get Azure SQL Database, Azure SQL Data Warehouse, SQL Server Analysis and Spark on Azure HDInsight but now sign of my fresh data gateway to my on-prem db.
Currently you can only access on premise SQL Server databases by building a model & publishing it to powerbi.com using the Power BI Desktop.
If you select "Import" as your connection option, Power BI will store the required data online. You will be able to query on that fixed data and work with it even when your connection to the on premises server is down. You can update your fixed dataset with new data if your connection is properly defined in your gateway.
If you select "DirectQuery" in your Power BI Desktop you will require an active connection to the On premises server for any reporting to work online. On the up side, it'll work on live data and will not store any data online.
When publishing, Power BI Desktop will try to match your connections used in your report to the ones defined in your gateways. If it can find a match, it'll automaticly link those up. It'll give you an informational message to let you know if this step succeeded after publishing. At the same time it'll add a dataset using the same data you used in the reports you just built.