Visual Studio Code :: Configure Kusto Connection - azure

I'm new to Kusto.
I'm trying to follow this guide that should help me identify unused resources on Azure.
The first command is pretty easy:
resources
| where type == "microsoft.compute/disks"
But it fails miserably with the error: Request is invalid and cannot be executed. ('where' operator: Failed to resolve table or column expression named 'resources')
I have tried with other resources:
Samples
SampleIoTData
SampleMetrics
ContosoSales
SampleLogs
But non seems working.
I have also tried
Add Azure Data Explorer cluster
Add Azure Application Insights
And none seems to work.
So how do you connect to your Azure Subscription through Visual Studio Code and Kusto?

Kusto was created within Microsoft and used internally within Microsoft.
Log Analytics & Application Insights (as of today, components of Azure Monitor) are Microsoft's SaaS (Software as a Service) that use Kusto as back-end.
Azure Resource Graph is another Microsoft's SaaS that uses Kusto as back-end.
Those SaaS externalize (different) subsets of the Kusto query language (KQL).
Those SaaS are unrelated.
Azure Data Explorer (abbrevated ADX) is Microsoft's offering of Kusto as PaaS (Platform as a Service), to its customers.
Some reading:
https://en.wikipedia.org/wiki/Azure_Data_Explorer
There is a Visual Studio Code plugin that supports executing KQL queries against ADX clusters & Application Insight.
Samples, SampleIoTData etc. are databases of an ADX publicly available cluster, called Help.
resources is a table of Azure Resource Graph.
You can query it through the Azure Portal:
https://portal.azure.com/#view/HubsExtension/ArgQueryBlade
I'm not familiar with a formal option to query it from Visual Studio Code, but if you search on the web, you can find some projects developed by individuals.

Click the "Extensions" button, search for "kusto notebooks" and click "Install"
Press the "Kusto" button and then the "Add Cluster" button
Select the 1st connection type ("Azure Data Explorer Cluster")
Enter the cluster URL
Note the newly create cluster and databases on the left
Click the "Explorer" button and then create a new file with .knb suffix.
In your newly created file, click the "Configure Kusto Connection" button
Select the require connection
Select the required database
Add a "Code" cell, write your code and execute it

Related

Azure Data Studio - way to change default connection type for Azure SQL Databases?

I just recently started to use Azure Data Studio to replace SSMS and VS Code. So far it is working great. I do have one "issue" I was wondering if anyone else encounters. I run the application with my Azure AD Admin. Under Connections I see all of my subscriptions and the underlying databases:
When I try to expand a server, I get an error that it is trying to connect with a SQL account:
It then brings up the connection details where it is set to use SQL Authentication:
If I change the Authentication type to Azure Active Directory - Universal with MFA support, and click connect it does without issue.
My question is, is there a way to change what the server connection uses as a default so I don't have to try to expand, fail, change auth type, and then connect? It is nice not having to manually create all of the connections to all of our subscriptions and sql servers and just have them load there and open them.
I searched all the settings of Azure data studio, but did not find the option to change the default authentication type of login Azure SQL.
User and workspace setttings of Azure data studio, you can refrence this document.
You can click the power plug icon in the right and then choose Authentication type to login to the server.

Application Insights Desktop Applicaion

My company is moving to Azure Application Insights. The logging is fine, but having to go into the Azure web portal to write a query stinks. Are there any desktop application to use like SSMS to query with? I have googled for it. but "Application Insights Application" is a bit redundant and didn't yield great results...
Update 03/30:
Here are the detailed steps(assume you have already downloaded the tool):
1.Open Kusto Explorer, in the "Connections" menu -> select "Add group", and follow the screenshot below to add a group:
2.Right click the group name -> select "Add connection", then follow the screenshot below to create connection to your application insights:
3.When the connection is ok, you can expand the group, and your application insights is there; you can then write your query code to query data:
The referenced doc: here and here.
Original answer:
You can use the client tool Kusto Explorer to query Application Insights logs. And here is already a similar issue.
For any details about that, please send a mail to adxproxy#microsoft.com.

Unable to display SQL Azure table definition in Visual Studio 2013

The error I am getting is:
Problem loading: The designer encountered an error while loading the table definition
I can view the data within the tables inside VS just fine and can even query the data too. This is a fresh install on my computer.
What I have tried:
Tried viewing the table in both "Server Explorer" and "SQL Server
Object Explorer."
Checked if my login credentials has permissions to
create tables in the "Management Portal."
Installed SSMS and still cannot show the design of the table
Tried connecting to the database using OLE DB and SQL Server data providers, but I still get the same issue
Added my IP connection to the server firewall and turned on "Windows Azure Services"
Set the connection timout counter to zero
This is the image of my error. I generated a very simple user table just for testing purposes from the Management Portal.
This is a simple test to connect to the Azure database without using a project template. This is my first time using SQL Azure just to warn you. Sure I can just stick to using the Management Portal to change the table definition and stuff like that, but I was wanting to keep everything in one program.
I have found this issue only applies when using the new "Basic/Standard" tier of databases in Azure. If you switch back to the older style "Web/Business" tiers it will start working again.
I found this on a Microsoft forum after struggling for hours. It still takes an age to load, but with the preview SSDT tools, I did get a visual editor for the first time.
Posted by Microsoft on 1/7/2015 at 1:59 PM:
This bug has been fixed in the Preview release to support Azure SQL Database Update V12
See http://blogs.msdn.com/b/ssdt/archive/2014/12/18/sql-server-database-tooling-preview-release-for-the-latest-azure-sql-database-update-v12-preview.aspx for details of this.
The fix will also be included in our next full (non-Preview) release.
Thanks,
Kevin Cunnane,
SQL Server database tooling team

How to create a backup in Windows Azure

I was trying to create a WindowsAzure backup but I have no success because only create tables structure without data. This is the procedure which I was following:
1.Select the database you want to back up in new portal of windows azure https://manage.windowsazure.com
2.In the footer you will have an option to import/export. Click export. This opens a modal popup. Select the storage account you want to use and type in a appropriate name to save the *.bacpac file.
3.Once the file is saved to storage, download it to local, open sql server 2012 management studio. Select the database server. Right click on it and in the context menu you will find Import Data-Tier Application. Select the bacpac file from you local and follow the settings.
How can I create a backup but also saving the data?
CREATE DATABASE XXXXXX AS COPY OF YYYYY
MSDN link has a full article on all the different ways you can do this, the above is only one of them.
LMGTFY: http://msdn.microsoft.com/en-us/library/windowsazure/ff951624.aspx
There are a few approaches apart from the T-SQL scripted approach, two provided by Red Gate are:
SQL Azure Backup Application - A free desktop application, as well as a command line tool, that allows you to transfer a complete backup of an SQL Azure database to your local environment, or another environment thta you have access to.
SQL Azure Backup Hosted - A hosted solution variant, which has a number of features
Microsoft recently did a pretty comprehensive blog covering all the ways to backup a SQL Azure database.
http://blogs.msdn.com/b/windows_azure_technical_support_wats_team/archive/2013/03/04/different-ways-to-backup-your-windows-azure-sql-database.aspx
Just so you know - I develop option number 7 :)

How to create tables in windows azure?

I am new to windows azure.Can anyone please tell me the process of creating database and tables in windows azure and how to connect to that connection to application .we have windows azure account .please clarify my doubts.any of pdf books for deploying the rest wcf services in cloud let me know the links.
Thanks,
It is May 2014 and that Silverlight online tool just is not really much better.
Best approach is to use SSMS (SQL Server Management Studio) you can even use the free tools tool.
Connect to your Azure with the portal supplied server url / port ... and then your username /password.
Say you scripted out an existing database tables and want to execute that script, you have much more freedom and control with SSMS than online.
For table creation note that a few caveats, One that is common is that not all of T-SQL is supported and a typical script from another database table(s) you end up needed to strip off the two "ON [PRIMARY]" parts of the create statement
Click on the database server in the management portal. 1st thing you would do is manage the allowed IP Addresses which can access this server/database. Allow your local IP address there. After that you have 2 choices:
Use Sql Server Management Studio - It does not have the table editor and you would need to write T-SQL scripts manually.
Use Silverlight based database management utility - to access this, click on the Manage Url link as shown in the screenshot below.
Since you cannot have wizards for Adding/Editing tables, constraints or keys for Azure DB, even if you have connected it through MS SQL Server Management Studio, you can use RazorSQL for this purpose. It gives you a feeling like you are playing with your azure DB in management studio, same as you do with your normal DBs

Resources