How can an Azure DevOps Extension Access Data from an External Website - azure-devops-extensions

I'm just starting to investigate how to develop an Azure DevOps extension that displays data sourced from an external website. Possible? I tried this in my extension's HTML file using javascript in the VSS.ready() hook but, not surprisingly, MS blocks the cross-domain call. I've started to read about how extensions can have their own private data but then that goes into a rabbit hole about how I can update that data as a push from my website on a scheduled basis.
Thanks!

Related

Azure DevOps Extension Development without Client Library

I am trying to write an Extension for Azure DevOps 2019 Server which will list the available dashboards and allow them to be deleted.
I have already created an extension and have used the REST Client to get work items. As per here: https://learn.microsoft.com/en-ca/azure/devops/extend/reference/client/rest-clients?view=azure-devops
However it appears that there is no REST Client for the API Dashboard functions that I need to use. How can I make calls to the API from within an Extension when there is no REST Client available? I can't find an example of this.
You can use azure-devops-node-api that have methods to interact with the dashboards.
In addition, you can use the Dashboard Rest API and make Http request like every rest api call, you can read here "5 Ways to Make HTTP Requests in Node.js".

Which Google Cloud products do I need for my use case?

I wish to route a phone call to an ASP.NET MVC web app that is hosted on a server, and then open a web socket to gain access to the call's audio. I am not concerned about how to access the audio or process it etc. All I am needing help with is hosting a web app and opening an accessible web socket.
I have tried app engine, but with little success as I couldn't manage to open a web socket... I was able to get everything working with Azure services, however, I would like to transfer my web app to Google's services.
Can I stil use app engine to host the ASP.NET MVC app? If so, how can I open a websocket?
Thanks
You can host ASP.NET apps in App Engine Flexible but can't use websockets YET.
As for comment 231, it seems that its release in Flexible environment is likely in the not so distant future.
This is currently not possible with Google App Engine. However, you can always use Google Compute Engine, which is essentially a VM in Google's network that you can configure as your own webserver and you have virtually full control of its connectivity and ports.

Is 'Word as a Service' possible via MS Graph API?

I have found some, but not all, pieces of the puzzle.
Using Graph APIs, when a user selects a document in my own web application, I can:-
Create a new temporary folder in their OneDrive account
Upload my.docx file to this location
Get the url for my.docx
Open the URL in a new tab, loading Office 365's MSWord editor (or viewer and editor after one more click)
This is where it gets a bit trickier. How can I get the edited content back into the location where my web application historically stored these documents?
Theorising, I can:-
Create a webhook subscription to the new folder I create
Implement a webhook listener (and validation) service
When the listener receives an 'update' notice for the document:-
Call the download(content) API, or from the driveItem metadata, download it from #microsoft.graph.downloadUrl
Persist it to my desired location within my web application
To me this sounds like it'll suffer from big delays. The webhook subscriptions typically send batches of changes and the frequency looks uncertain. It certainly wouldn't be great for versioning every individual save operation during the editing session.
Have I missed some more obvious path to Word as a Service? i.e. another API or a mixture of APIs?
Alternatives I've considered but haven't yet scoped: implement WOPI or WebDav within my own web application.
It sounds like you're only using OneDrive to take advantage of its built-in support for the MS-WOPI protocol. WOPI is basically an enhanced WebDav interface that is used by Office to work with remote document (i.e. files stored on OneDrive, Box, DropBox, etc.).
Your solution is generally fine and it is certainly easy enough to orchestrate. You can absolutely use webhooks to subscribe to changes to the file. You'll likely want some mechanism in your app to notify your system when they're "done" so you can clean up the file afterwards.
If you want a more robust solution, you'll need to look at WOPI. Implementing WOPI would allow you to keep these files on your system permanently. Office Online would use the WOPI interface to speak with your storage system and open/save/edit files in-place.
Keep in mind that implementing WOPI (or any protocol for that matter) is often a non-trivial endeavor. You will also need to get your final solution validated and whitelisted by Office before it can be used. Details on this process and how to request access can be found at the Microsoft Cloud Storage Provider Program website.
Today OneNote and Excel are the only office "document clients" that have API's exposed via a REST API publicly available in the Microsoft Graph.
The only other "publicly available options" I'm aware of are:
WOPI APIs, that kind of act like a REST API but muche older
The office add-in model (hosted in a client) with the JavaScript API
The word object library (old, relying on dcoms and needs to have office installed and licensed on the machine)

On demand assets loading for WebView rendering

I have a scenario that, when a user connects to the server from the mobile app the scripts used for the Web View needs to be downloaded from the server. Then store it locally and uses this scripts for further Web View rendering.
Only when we upgrade the server the client should update the scripts from the server.
Is this possible to achieve this in Xamarin.Forms? If yes, can you share me your ideas?
There are a number of ways that you could achieve this. One possible way is this:
Create an endpoint on your server that can respond to requests for the latest version number of your scripts.
Query this endpoint from the app using httpclient.
If the version number on the server is greater than the version number on the app, then query the server again to retrieve the scripts required, and store them on the device.

Can I use Sql Server Database from iOS?

There are a lot of ways to have a database on server ( I can use my own server or I can use MS Azure (for Azure I found REST API Description https://msdn.microsoft.com/en-us/library/azure/gg715283.aspx , but I didn't find a way to add some rows to a table or to get information from the table)), but I want to edit the database and get proper rows from the server database from iOS code without having server API. There are a lot of ready solutions such as Backendless.com , but they are not stable.
So is there any way to connect to the remote SQL server database on the remove server or to MS Azure database and to edit rows and fetch data?
May there are some framework for iOS to do than? (for example in .Net there are Linq framework and Entity Framework).
In your question, you linked to a management API for SQL Database service - this has nothing to do with data manipulation; it's strictly a management API for dealing with servers and databases.
If you want to direct-connect from an IOS app to SQL Database Service (or SQL Server in a VM), you'd need to find a client library for IOS (and recommendations of such a library are not in scope for StackOverflow). There is no native SQL Server client library specifically provided through the Azure SDKs / APIs.
Outside of a native client library, there is Azure Mobile Services, which provides an API stack specifically designed around use by mobile apps (whether IOS, Android, Windows Phone, or even JavaScript). The API stack provided here, by default, gives CRUD operations for SQL Database tables. Additionally, it supports adding custom API calls, where you have complete control of your API calls.
Any other API stack would require you to choose the stack and run it yourself (whether in a Linux or Windows VM, Cloud Service, or Web App - there's no single right way to do this).
Documentation for Azure Mobile Apps (and related API feature, such as monitoring) is here.
Since you are developing in Azure consider automatic REST API from SlashDB, which is available from their Marketplace.
https://azure.microsoft.com/en-us/marketplace/partners/vte/slashdb-slashdb-azure/
SlashDB reflects the entire database as URL-linked structure so a lot of queries need not even be written. It supports SELECT, INSERT and UPDATE. In addition to that it allows for defining an API end-point to call a stored procedure or return results of a SQL query.
Disclosure: I am the founder and CEO of the company behind SlashDB, but you don't have to take my word it - just try it.

Resources