Azure Web App Service / Rest API - How to upload a website page - azure

I have a web app service on azure that is hosting a RESTful api which deals with my MySQL database. I am wondering if its possible to somehow (either manually, or otherwise) upload a page to this app service as well. For instance, i have my URL from azure, and my API lives under /api
I was wondering if i can create a php/html page or something that I can upload to /meetingConfirm
so i can do something like /meetingConfirm?id=hash
And have a page which i can send email links to encoded for each meeting, to allow people to respond to invites. It would be a simple page that just updates a value via the API and then displays a confirmation.

For this, you don't need a separate page to be uploaded for each user. You can just add a multi-threading Id generator code and save the last used Id in your DB for future requests.
I am referring to a solution like this(as I am not sure about your tech stack, sharing python approach): How do you generate random unique identifiers in a multi process and multi thread environment?

Related

Can I set my Node.js Backend to access my Google Drive to list/download/upload?

I want my back-end to use the Google Drive API to be able to list/upload/download files from a normal google drive folder (as opposed to a cloud bucket). But not the user's Google Drive, only MY drive.
As far as the end-user is concerned they would just be on my site but when they upload a file, my back-end would receive it and store it on MY google drive. Same for a simple list of files in the folder, I just want them to click my front-end button and have it send a call to my back end, then my back-end sends a call to the google API and returns a list.... effectively making my back-end the middle man for my google Drive. So that my users don't need a google account to access my site
My reasoning is I want my users to NOT need a google account, but I will still need to share these folders with contractors. The contractors can have a google account, that doesn't bother me, And I don't want to have to re-invent the wheel by building a separate front-end for my contractors to download these folders when Google Drive already has perfectly working UI that will zip a folder and download it already built.
So I want:
User -> front-end -> my backend -> google drive
I have seen posts on doing this for other services, like analytics and calendar, but I really need drive capabilities.
A user could be either my client who needs to upload and download OR my client's clients (who will only ever need to upload)
Main Question:
Can I set my NodeJS Back-end to access my Google Drive to list/download/upload
If it is possible:
How, and should I? As I write this, I am thinking of issues... like, will uploading a file from Front-end to back-end then to google drive be too cumbersome to be practical? (These are video files that could be around 300-400mb).
If not possible OR it is too cumbersome:
Can anyone suggest anything that will make access to Google Cloud bucket folders easier? Package? Example? Method? Tutorial?
Frontend: VueJS with axios
Backend: super basic node/express API/back-end on an AWS ec2 server
The short Answer is Yes.
The way to do this is with a service account as these accounts are special credentials to be used by a service. These accounts are of the form: service-account-name#project-id.iam.gserviceaccount.com.
Once you have the service account you will need to grant access to this service account on the Google Drive location. To grant access to this service account share the location (files or folders) with this account, as if you were sharing the files with another user, just by adding the email on the edit permitions.
And Finally to manipulate the files there programatically you can use the NodeJS Client Library which will make the task easier than manipulate the API calls directly.

Is it possible to set up an own push service within an intranet?

I would have asked this in a follow-up comment to this comment but my reputation is still too low.
So here are the questions: Is it possible to change the endpoint URL of a browser or to add an endpoint URL so that my application can send its POST request not to a web service owned by the browser manufacturer but to a web service that runs inside my intranet? As my application is run in an intranet without connection to the internet a customized browser wouldn't be a perfect solution but it would be possible.
And now for the 2nd part: If it is possible - are there ready-to-use push service libraries for PHP? So far all I've found are libraries that let an application send notifications like https://github.com/web-push-libs/web-push-php.
Is it possible to change the endpoint URL of a browser
No, currently it is not possible to change the browser push service.
And in any case you would also have to run an instance of the browser push service on your own servers (e.g. https://github.com/mozilla-services/autopush).
I think in this case you can just use any transport like web sockets, for instance and a notification API to show it to the user. Not sure if persistent connections will work within service worker context, but this should not be a problem if you're still customizing a browser.

Create a frontend website for Horizon OpenStack

I have setup a private cloud which has 2 computes and the back end is working successfully. OpenStack and Horizon is used to create and manage instances.
Basically, Horizon would be used on an administrator level and not by the user. So for the user to enter inputs like RAM, Disk Storage, Image etc, i want to create a frontend (ReactJS, NodeJS) website though which they can provide the details for VM creation.
The flow would be:
User provides all details through an HTML form.
Those details go to the Administrator sitting who will check the details and then approve the request.
Once the request is approved, VM is created and user can manage the VM.
I want to achieve somewhat like the above.
The goal is to not allow access for the user to create, manage VM instances through horizon.
Any help ?
EDITS
The flow should be the following :
Login to the front end user dashboard.
Allow user to create a flavor by accepting the values.
Store the values into MySQL DB.
Admin would get the request inn his login. An 'Accept' and 'Decline' button would be there on each flavor entry. If admin accepts, using shelljs the openstack flavor creation command is run and the output is saved in db.
The user could get the accepted flavor on his side.
The user would create a VM instance by selecting the flavor which he recieved above.
Using openstack create server command, the VM would be created and a token url would be generated which will be displayed to the user.
8.When user clicks on the url, VM is launched.
So the above is the goal to be achieved using React, NodeJS and MySQL.
The difficult parts would be:-
Running the openstack cli commands using shelljs
Generating a token url.
I hope there might be a way to do this.
Thanks
Not sure how to help you on this. Some ideas:
You will need a python backend unless you want your backend to talk to the OpenStack REST API directly. Similarly to Horizon, using the Django Python web framework will save you some time with using the python client APIs
Then you can build a frontend app with ReactJS and BackboneJS. Since ReactJS itself will not let you communicate with the HTTP Response generated by your backend. Also, you should look into Redux to deal with the data flow.
Here is an open source project which does what you want mostly: https://github.com/cyverse/atmosphere/
HTH

Facebook Graph request is empty when called from Azure

We're building a mobile application that uses Facebook login and attempts to show users their friends that are also using the application.
We generate an access token as part of the login process and pass this up to our server hosted in Azure.
When we request the users friends using:
https://graph.facebook.com/me/friends?access_token=[access_token]&fields=id%2Cname&limit=5
We get the following response on our Azure servers:
{"data":[]}
However requesting the URL directly from my local browser returns a number of records - regardless of whether I'm logged into Facebook or not.
The Facebook App that the user logged in via is published to live (otherwise they wouldn't be able to log in at all).
The only users that return results when called from within Azure are users configured as testers or developers in the Facebook app - is there a setting I've missed?
Looks like the "Country Restricted" setting was causing the problem - we'd limited this to users in the UK which meant requests from the Azure servers in Dublin where returning empty.
Removing this restriction (or possibly increasing to include Ireland) resolved the issue.
Note that this restriction doesn't impact test users, developers or administrators, all of whom work throughout testing and into release.

Foursquare API Access without registered application

I have just an idea for now to develop an application based on foursquare API.
I checked in the website that a creation of an application inside the foursquare is needed to access the api functions.
There some form fields in the application creation that cannot be filled by me as I don't have an application yet, like web address home page, privacy police page, etc.
I want to perform some tests for a certain time and then choose if I'll proceed with the application development or not.
For now I just need access for the venue stats function. Do you know if it's possible to have access to this function without have an official application?
Regards,
Rodrigo Lima
You need to create an application in order to get an OAuth token, which you need to call venues/stats. In practice, during testing, the only real field that needs to be accurate is the redirect URI, which you'll need for OAuth. The others can take dummy values for now, so long as you go and change them before you publish.

Resources