Azure blob access from Html web app - html

I have a html Web App running off of Azure. I'm trying to figure out how to write and read to a blob from there. I understand I will need a Shared access key, connection string, use a HTTPS and/or HTTP request, use CORS, but now I'm just trying to fill in some blanks about how to set up the endpoints and if I need something in the back end of the web app. How can implement setting up the endpoints with the CORS? Do I need to set up a logic app? What else do I need to set up with the Web App? Will it be better to set up on a Virtual machine? Thank you in advance.
Jonathan

There are several web apps tutorials used with blob storage. Some tutorials i'd highly recommend are as below:
Gallery Photo Web App tutorial:
Provides an example with sample code on how to use a web application with Azure blob storage
Using Azure storage with hosted Azure Web App:
Provides an example on how to integrate and use storage with Azure hosted Web app, including the source code.
Video tutorial:
Video Tutorial showing the use of Azure web App and Storage operations.
These should get you started.

Related

Splitting web-app and mobile-app request in Yii2

I created a restful web-app platform using yii2 framework. It is working with no problems using a browser. Now I'm developing a mobile-app with angular and ionic and I'm searching for some guide to help me splitting the request from browser and app. Using the browser the web-app is configured to have a html view response, how can I detect a mobile-app request to change response in JSON format in each controller/action?
It's my first mobile-app development.
I just fighted this same war this week and I ended up splitting the folders and generating a new yii-app with fresh controllers just for the api.
I tried creating the api folder inside the web backend project, but I had to much problems with redirections, and as I was working from Android emulator fueled by Expo it was almost impossible to reach the api inside my localhost from outside.
At the end in the API REST you just reuse the database connection, rest of files are new. So there is no much to win in placing it in the same folder/project.
By the way, read this documentation: Implementing RESTful Web Service APIs in Yii2
As a code example you could check my yii2 web app: https://github.com/jvidalv/fempoble
And the api that works with the web: https://github.com/jvidalv/api-fempoble

hosting a JSON file for a 3rd party app/service to use

We currently use Jive Cloud N which can use the Rest API and allows the use of Custom Apps. Our UI devs have created an app which uses a JS GET to pull data from a JSON file for our "Birthdays and Anniversaries" tile.
At the moment, the JSON file is hosted on our UI dev's Google Cloud Apps account, but we wish to host it internally so we don't have to keep contacting them for changes.
I uploaded the file to our OneDrive for Business storage and created a public URL with full read permissions but the Jive platform is throwing an error trying to load the custom app.
The error is that the file
has been blocked by CORS policy: No "Access-Control-Allow-Origin"
header is present
Our dev said that to get it working on his Google Cloud App storage, he had to specify the allow-control-allow-origin field in the server's server app.yaml file. I don't know what this is and if there is an equivalent for ODfB/SharePoint.
To get to my question: How can I host this JSON file on ODfB or even somewhere on our Azure tenancy so that it can be used? Or am I better off trying to setup a Google Cloud App storage location and replicate our dev's setup? FYI - I'd prefer the former because we're using M$ for a number of cloud hosted services already.
Thanks in advance
To get to my question: How can I host this JSON file on ODfB or even somewhere on our Azure tenancy so that it can be used?
FYI - I'd prefer the former because we're using M$ for a number of cloud hosted services already.
Per my understanding, you could leverage Azure Blob Storage to store your JSON file, and you could use Microsoft Azure Storage Explorer to easily manage/share your files.
Moreover, You could manage anonymous read access to your containers and blobs, refer to this tutorial for more details. Also, you could leverage SAS to grant limited access to your storage account for other clients, you could follow this tutorial for getting started with SAS.
For a simple way, you could create your storage account and leverage Microsoft Azure Storage Explorer to manage/share your file as follows:
For cross domain accessing, you need to configure CORS Setting:
For sharing your file(blob), you could Set Container Public Access Level or leverage SAS to grant limited access to your file for other clients as follows:
Right click your container, select "Set Public Access Level":
Sample file for share: https://brucechen.blob.core.windows.net/brucechen/index.json
Also, you could right click your JSON file, click "Get Shared Access Signature":
Sample file for share: https://brucechen.blob.core.windows.net/brucechen/index.json?st=2017-02-28T08%3A04%3A00Z&se=2017-09-01T08%3A04%3A00Z&sp=r&sv=2015-12-11&sr=b&sig=rVkorHeNOd4j2YhkmmxZ6DfXVLf1FoN2smY6mNRIoWs%3D

Marketo integrate to custom app

I want to integrate marketo with my web app. In such way that the marketo leads or data automatically sync to app at regular interval.
My web application is in php.
I am new to marketo, Please help.
Only way this is done is by connecting to Marketo Via the Marketo REST or SOAP API, documentation to get you started can be found here:
http://developers.marketo.com/getting-started/
There are several integration platforms available today that let you connect various web apps and automate tasks through a simple interface. These cloud integration platforms use API of the web applications in the backend. All you need to do is connect the apps together and configure the settings. You can connect your own app or on-prem system to web services like Marketo, Salesforce, etc.
Here's a short blog post that shows how apps can be integrated.
https://www.built.io/blog/favorite-services-coupled-together
Let me know if this was helpful.
If you are just wanting to sync data back and forth a webhook might do it for you. That is what I currently use to sync data from Marketo to a PHP app and back to Marketo. Lots of addons to Marketo actually work this way.
Webhooks are also a lot easier/quicker to set up on the Marketo end and then on the PHP side you basically just have to handle the POST.
Marketo Webhook Docs: http://developers.marketo.com/webhooks/

Create front end website for Google App Engine app

I have created a Google App Engine website using the tutorials and have uploaded it to AAA.appspot.com. But I would like to create a www.AAA.com website and pull data out of the App Engine. In Google App Engine settings you can add www.AAA.com to access Google App Engine API. What I need is a tool or tutorial recommendation to get me started on developing www.AAA.com. I'm very new to website development but am an experience programmer. So I have the Java servlet code setup but I cannot get the front end to connect to it.
In my html form can I do something like <form action="http://AAA.appspot.com/GET_Request_URL" method="get">? What about post requests?
One classic way to connect an HTML front-end to an App Engine back-end is by using the Google JavaScript client library https://developers.google.com/api-client-library/javascript/start/start-js
Romin Irani has nice tutorials on this method, see https://rominirani.com/google-cloud-endpoints-tutorial-part-1-b571ad6c7cd2#.sbsqvfu3n and in particular Part 4 https://rominirani.com/google-cloud-endpoints-tutorial-part-4-37ea3aac7948#.ivyo2i4pb
Yes you can do that. But I prefer doing it in below way, using reference paths (or) app handler names rather than full URLs
<form action="/mainpage" method="post">
You can use the app handlers only if the code is in GAE. Otherwise, as I said you can do the way you are currently doing by providing complete URLs. It will work for both POST and GET as long as URL has POST and GET methods implemented.

Store Data using HTML, Retrieve using PhoneGap App

Say the user browsed to http://mydomain.com?data=data and the HTML stored this URL + data.
Then the user launched a native app built with PhoneGap and the App wants to retrieve http://thedomain.com?data=data that was stored by the HTML5 webpage.
Is there common storage between the Browsed HTML and the Native PhoneGap App so data can be passed from web browsing to Native Mobile Application?
Some ideas and a snippet would help greatly to figure this out. Thanks!
not possible i guess. your app is separate. it wont be able to access the localstorage quota of your website.
What do you mean by 'the HTML stored this URL + data' ?
The HTML cannot store itself anything dymamically. It's a language ;) anyway the browser with html5 can do.
You have two options:
a\ local storage
http://www.w3schools.com/html5/html5_webstorage.asp
b\ web sql database
http://html5doctor.com/introducing-web-sql-databases/
now about synchro:
Best way to synchronize local HTML5 DB (WebSQL Storage, SQLite) with a server (2 way sync)
'Is there common storage between...' <- sure. the same browser and the same domain -> no problem
want more? only books like that can help you: http://books.google.ie/books/about/The_Web_Application_Hacker_s_Handbook.html?id=_jv97STVvrQC&redir_esc=y