Connect to backend of VSO - azure-devops

Is there a way to get the server info of my VSO account and access using SQL Server?
I've tried logging in using the URL
{account}.visualstudio.com
But I got a sever not found error

No, the back-end databases are SQL Azure instances, different from the TFS on-premise databases. I cannot see MS ever giving you access to the database - maybe the data, but not the database.
You can only use the API (old and new REST) and Power BI tools to perform queries.
If you have a specific problem you are trying to solve, post it as a new question because it may be possible without database access.

Related

Postgres with Azure Active Directory Authentication

In our organization, we are having common credentials to access the postgres databases, which every developers know, as it is hardcoded in application's connection string. Due to which, whenever a DML/DDL changes happens on databases, it is hard for us trace, as the developers use to make changes on their own. We can't have individual logins for each developers which is tedious to manage.
Note: Also, we can't ensure that the credentials won't be shared with the peer developers.
To get rid of this, we thought of integrating Postgres with Azure Active Directory, for Authentication.
If we can map Azure AD group/users to Postgres, security will be tightened as well as maintenance overhead will also reduce.
But, I couldn't find a article to implement this, since most of the articles says the integration for Azure managed postgresql with Azure AD, and not for the postgres running on VMs.
Can anyone guide me or share a detailed article to implement the Azure AD integration for Postgres running on a VM(IaaS)
In Azure portal go to the postgresql database select Authentication and set active directory admin.
You can specify an Azure AD group instead of an individual user to have multiple administrators.
Connecting to postgresql :
1.Login to Azure subscription.
2.Get the access token of the postgresql serverusing below command:
az account get-access-token --resource https://ossrdbms-aad.database.windows.net
3.Use that token as password for login with postgresql server.
Creating user
CREATE USER "user1#yourtenant.onmicrosoft.com" IN ROLE azure_ad_user;
Token validation:
Token is signed by Azure AD and has not been tampered with
Token was issued by Azure AD for the tenant associated with the server
Token has not expired
Token is for the Azure Database for PostgreSQL resource (and not another Azure resource)
Reference Link: Use Azure Active Directory - Azure Database for PostgreSQL - Single Server | Microsoft Learn
Using Azure Active Directory is a great idea for the reasons you specified, but unfortunately there's no native support for connection to Azure Active Directory with a local Postgres database (which is essentially what you have with Postgres in a VM). It can be done through the LDAP protocol, however.
FULL DISCLOSURE: I haven't actually done this part myself (or used the steps in the tutorial link), but this is my understanding from working with system operators. Use LDAP to connect to Azure AD then Postgres to connect via LDAP. More information on LDAP authentication in Postgres can be found here.
Bhavani's answer is about Azure Database for PostgreSQL, which is a Azure-native database service. This part I have used and I highly recommend it; you get Azure AD integration and can manage the database performance and connectivity specifically without having to also manage VM performance. Note that their screenshot is for the Flexible Server while the reference link says 'Single Server'; I recommend Flexible Server.

Google Data Studio JDBC connection to PostgreSQL integration with Sheets?

Google Apps Script JDBC doesn't support a connection to PostgreSQL directly but Google Data Studio supports a connection to PostgreSQL to pull data and build reports. I've also heard they support a low-key export to .csv option. Is it then possible to exploit the Data Studio Service in Google Apps Script to populate Google Sheets with that data, effectively creating a workaround?
All I need is a one-way access from PostgreSQL into Google Sheets by means of Google Apps Script, I do NOT expect to import anything back into my database.
Looking at the reference documentation, the built-in Apps Script service for DataStudio does not allow you to pull data from a connected data source. It can be used to create connectors but its does not allow direct access to connected data sources.
However, you can try creating a custom API or server-less mirco-service in a language that supports PostgreSQL, and then expose that service as HTTP endpoints that you can call via URLFetchApp. You can leverage Google Cloud Functions to do this and write the mirco-service in either back-end Javascript(Node.js), Python or Go. This approach will take you well-outside the bounds of your typical GAS script, but it is a viable option.

Connect Power BI Service to PostgreSQL Database on Azure

I´m using the Power BI Service (https://app.powerbi.com) to present important KPI´s. Now I move to a new System which is fully based on Azure. The main database is a PostgreSQL Instance (DbaaS - https://azure.microsoft.com/en-us/services/postgresql/).
Connecting to the database from my local Power BI Desktop Version and querying data works perfect. But as soon as I deploy the Report on Power BI Service, I´m unable to automate data refresh cause it seems that the Power BI Service can only connect to the PostgreSQL instance on Azure using a local Data Gateway.
In fact it doesn´t make much sense to use an on-prem connector to bring data from one cloud application to another.
Does anybody know how I and if I can connect Power BI Service and PostgreSQL Database on Azure directly?
Thanks a lot in advance & best,
Michael
It seems that you need to configure a gateway to make it working https://blogs.msdn.microsoft.com/chmitch/2018/06/04/complete-guide-to-setting-up-power-bi-connecting-to-postgres-w-refresh-enabled/
Hope it helps.
I did not go so far myself. My expectation was to connect Postgres to Power BI in a few clicks and get a dashboard online. I was very surprised that it needs dancing with ssl certificates, configuring gateway o_O.

Get metrics via API

I'm using Azure SQL, and there is a page in there with metrics
From what I understood the new Azure Managment Portal consumes only public apis. What I'm trying to find out is how to access these metrics via a REST or SOAP api. I've searched through the MSDN documentation but couldn't come up with anything.
Anyone have any ideas?
I presume Microsoft did not provide Azure Database monitoring REST or SOAP API as it would not be used much.
DBAs can connect to Azure Database and gather all the necessary statistics via dynamic management views which are quite powerful.
However, I do not have any article / documentation confirming my presumptions.
try the new sys.event_log and sys.database_connection_stats DMVs instead.
see: Announcing: New System Views for Windows Azure SQL Database

SharePoint Online in Office 365 with SQL Azure and Entity Framework

I am trying to build a web part to be hosted on SharePoint online (part of Office 365). I want to use Entity Framework to connect to a DB in SQL Azure. Is this even possible? I tried deploying one solution, but I get very unhelpful error saying "Web Part Error: Sandboxed code execution request failed.".
Anyone get this combination working?
I found out that this is not possible. The reason is due to the restricted permissions in the Sandbox and cannot use a proxy to bypass that. The only way to access SQL Azure from within SharePoint online in Office 365 is via a web service exposing operations on the entities residing in SQL Azure. I am currently investigating that approach and once I have more info, I can update this answer.
Update 7/27: Using a web service serving SQL Azure data, we can integrate SQL Azure with SharePoint. The component in SharePoint that enables this integration is called 'Business Connectivity Services'.
More can be found here: http://blogs.msdn.com/b/donovanf/archive/2012/06/25/office-365-o365-business-connectivity-services-bcs-hands-on-lab-wiring-up-o365-bcs-to-a-windows-azure-service-for-office-2010-and-sharepoint-online-solutions.aspx