How two set up three app services for the same domain on Azure - html

Presently I have two app services on Azure
An Angular 7 application - mydomainUI.azurewebsites.net
A NET Core web API - mydomainAPI.azurewebsites.net
I also have two DNS records on godaddy:
An A record to the Azure IP address and a
text record # to mydomainUI.azurewebsites.net
Angular makes the API calls to the azure domain. Everything works fine but the home page load takes too long with all the Angular overhead. I would like to add a third app service: a fast loading MVC application that handles the home page ONLY. It would be something like mydomainPUBLIC.azurewebsites.net. All other requests should be handled by the Angular routing of the UI app service. The browser should only show mydomain.com for everything and not the azure domains.
Can this be done without sub-domains? What DNS record(s) would I have to add on godaddy? Any other considerations?
Thank you in advance

I don't think you can route to different web app service with the same domain unless you use subdomains. However, if you consider using path-based URL to access your different web apps, here are two options for you.
You can place multiple web apps in the same web app service with different Azure virtual directories. See here1 and here2. Then set the custom domains in your current web app service.
You could use Azure application gateway route to multiple web app services based on Path URL. URL Path-Based Routing allows you to route traffic to back-end server pools based on URL Paths of the request.
You could follow this to configure App Service with Application Gateway. You need to
Create three backend pools and place each app service in the separate backend pool.
Create three HTTP Settings and Custom Probe with “Pick Hostname” switches enabled(Check Use App Service check box)
Create a basic backend listener and a path-based routing rule. Refer to this tutorial.
If you face any question, please let me know.

Related

Use Custom Domain for Openshift 3.9 Routes

I am completely new to Networking and setting up Domains. But recently I bought a domain (xyz-demos.com) and I want to use it as a domain to my Openshift App Routes. I did not find any proper guide on how to do it.
In Openshift I have 3 apps running with routes as,
appname-namespace.serverIP.nip.io
app1-namespace1.35.55.55.555.nip.io
app2-namespace2.35.55.55.555.nip.io
app3-namespace3.35.55.55.555.nip.io
any other app deployed in the future will just append its name,
appName-namespace.serverIP.nip.io
How do I map my custom domain so that all my Openshift apps use it? Something like, how to replace
35.55.55.555.nip.io with xyz-demos.com
appname-namespace.xyz-demos.com
app1-namespace1.xyz-demos.com
app2-namespace2.xyz-demos.com
app3-namespace3.xyz-demos.com
I am using a domain from GoDaddy and Openshift Origin 3.9.
Note - The reason why I am going with custom domains, is that
*.nip.io domains are restricted in my office network as Dynamic DNS and I do not know a way around it.
This is a kind of configuration what you need to do in the cluster creation time, I mean, in the inventory file of your cluster creation you need to configure the following fields:
openshift_master_cluster_hostname=ocp.xyz-demos.com
openshift_master_cluster_public_hostname=ocp.xyz-demos.com
openshift_master_default_subdomain=xyz-demos.com
Dont forget to configure the certs of your domain:
openshift_master_overwrite_named_certificates=True
openshift_master_named_certificates=[{"certfile": "/etc/ansible/certs/xyz-demos.com.crt", "keyfile": "/etc/ansible/certs/xyz-demos.com.key", "cafile": "/etc/ansible/certs/ca-xyz-demos.com.crt"}]
And force the Routers to add this new subdomain in the new Routes:
openshift_hosted_router_force_subdomain=xyz-demos.com
Thoses fields are responsible to expose your admin console and application routes.

Gmail Add-On Multiple configuration

I am researching building a Gmail Add-On.
We have several clients that host their own sites, plus clients that are we are hosting.
If the client is self hosted their URL is https://api.clientname.com
If the client is hosted by us the URL is https://api.company.com
Need to store that plus a few other settings in a configuration somewhere on the server like appsettings.json.
Is this possible in a Gmail Add-on using a single build and deploy method?
I hope this helps.
1.Try to store the appsettings.json in some server. This should be accessible through http requests.
2.Whenever you need to access this settings, use URLFetchApp of the appscript to fetch the file.
You can read more about URLFetchApp here
Or if you would like to cache it , refer this.

Azure APP GW infront of API Manager (without VNET)

Anyone know of a guide on how to but APP GW infront of APIM, should be possible but cant figure out how (or not sure how to setup APP GW).
thx
I have exactly this same issue and seems there is not a way of having an exposed APIM to put in front of it one APP GW. What is pretty annoying.
The only way I find is to put APIM in a internal VNET https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-integrate-internal-vnet-appgateway
Yes, you can actually forward traffic from Application Gateway to API Management with VNET configuration set to 'None'
Normally add your listener
Add your backend pool with the default FQDN (xxx.azure-api.net) of the API Management
Add a heath probe pointing to xxx.azure-api.net/status-0123456789abcdef
Add a HTTPS backend setting with Backend authentication certificate with Use for App service set 'yes' and a custom probe the aforementioned.
Add a rule combining all the above and a path based rule with just a '/'
This is all you need.
In order to expose management and developer portal through application gateway you need all the above but the health probes should point to xxx.portal.azure-api.net/signin and xxx.management.azure-api.net/ServiceStatus accordingly

Displaying private HTML file from AWS S3

I'm currently hosting a static website on AWS S3. I have parts of the website that I only want AWS Cognito authenticated users to access. These parts of the S3 bucket are restricted to certain roles. As I understand it, once a Cognito user has received their temporary AWS credentials, I need to use the S3 sdk to load the restricted object (index.html) from S3 and display it in the webpage. Is this the correct approach, and once I have the object back from S3, how do I go about loading it into the webpage? Thank you!
You will need application logic that runs in the back-end to control your security and to store/retrieve data. While much of this can be done from the browser, it is open to hacking. Therefore, you need your access control logic in the back-end.
Option 1: API Gateway and Lambda functions
You can have a static web page served out of Amazon S3, which makes API calls to Lambda functions via API Gateway. This is known as the serverless model.
Here's a sample diagram from the Serverless Code website:
Basically, Lambda functions receive the request, determine whether the user is authorised, determines what they would receive back (eg a pre-signed URL to a different page) and sends it back to the web page. The benefit of this design is that it does not require any servers.
Option 2: Amazon EC2 servers
Alternatively, you can run Amazon EC2 instances fronted by an Elastic Load Balancer. This is traditional application design allowing you to use many different frameworks. However, there is an on-going cost for the servers even when nobody is using your application.

Login in app using Web-Server

I am developing windows phone-8 app In this I need to register e-mail and password and after I have to login with registered user-name and password.I am using HttpWebRequest Class but don't know how it is possible please share with me any info or link regarding that.
You don't even need a separate web server running an auth service. Instead, you could use Windows Azure Mobile Services. There are several reasons for that, the main being the fact that you can easily manage outgoing data (register users) and check for existing data (authenticating users).
You can use the Azure Mobile Services client if you need an abstracted out data access layer.