How to change Time Zone of Azure Static Web App instance? - azure

I am trying to change the timezone for an Azure Static Web App instance.
I have tried adding WEBSITE_TIME_ZONE but does not seem to work. (Based on tutorials for Azure Web App Services)
I was not able to find and documentations or tutorials to do this for Static Web Apps

Related

Can not link Azure Function App to Static Web App, error "Cannot link backend with a preexisting Azure Static Web Apps configuration."

I am following this turorial and trying to link Function App to Static Web App. But I keep getting "Cannot link backend with a preexisting Azure Static Web Apps configuration."
.
However, I could link this Function App to another test Static Web App. And those two Static Web Apps are identical, well atleast I am pretty sure they are identical.
When creating a Static Web app deploy routine I left api location empty - api_location: "".
Static Web App is using Standart plan (not free).
EDIT
Adding Static Web App JSON view.
Issue may cause because of Read-only Lock under configuration setting
Created a new Static WebApp on West Europe Region
If any lock exists on Static Web Apps should not allow to add any backend APIs
Link new Backend APIs as Function App with Lock
After Removal of lock, Static Web Apps will allow to link new Backend
API Version check :

Solving my CORS-Problem in Azure with standard features?

the following components describe my solution in Azure which I want to bring to work:
Client: The clients are common Browsers from anonymous users all over the internet that are making ajax requests to the backend server which is generelly a simple web api which is implemented with .NET Core.
Azure Web App 1: This azure web app is the frontend app consisting of static html and java script files.
Azure Web App 2: This azure web app is the backend app which is implemented in .NET Core and serves the web api interface.
In general, the browser is served with the static content by Azure Web App 1 and wants to execute an Ajax request to the azure Azure Web App 2. This does currently not work because I get a CORS error. Needless to say, because the clients are anonyous browsers, I do not konw their IP addresses.
Can anyone tell me what I have to do in Azure so that this scenario is going to work? I explicitly want to separate the frontend app from the backend app and deploy them independently on different Azure Web Apps. I think this should be a common scenario and hope that there are easy ways to get these scenario work.
Thank you to all the guys who try to help me with this challenge!
Best regards!
As I understand, you want to create a multitier application (screenshots below), in which the API back-end apps can be accessed only from the front-end tier.
You can use combination of networking features available in App Service to accomplish your scenario. Namely, Regional VNET and Service/Private endpoints. With App Service networking features, you can control traffic going to your backend app.
Also, on App Service, you could have those two separate apps in the same App Service Plan (ASP), since you pay only for ASP, saving costs.
-Just to highlight, you can continue to add apps to an existing plan as long as the plan has enough resources to handle the load. The apps in the same App Service plan all share the same compute resource.
Also, see this doc for the flow/process for this setup:
Create two web apps connected securely with Private Endpoint and VNet integration
Referenced from this doc App Service networking features- screenshots and use cases.
I found an easy way to resolve my problem. So for my scenario, I do not need any additional services or components like the Azure application gateway.
My solution is related to https://learn.microsoft.com/de-de/aspnet/core/security/cors?view=aspnetcore-5.0.
First the ASP.NET core web api needs the following Code in Startup.cs:
public void ConfigureServices(IServiceCollection services)
{
var origins = new List<string>
{
"https://xxx-apifrontend.blob.core.windows.net/",
"https://127.0.0.1:5500",
"https://localhost:5500"
};
services.AddCors(options =>
{
options.AddPolicy(name: MyAllowSpecificOrigins,
builder =>
{
builder.WithOrigins(origins.ToArray())
.AllowAnyMethod()
.AllowAnyHeader()
.SetIsOriginAllowed((host) => true);
});
});
...
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
app.UseRouting();
app.UseCors(MyAllowSpecificOrigins);
...
}
But in Azure, this is still not enough. Secondly, the allowed origins must also be declared in the CORS section of the Azure web app. I did this through the Azure Portal:

Static web site on Storage Account & App Service

I've a conceptual question about Static web site on Storage Account & App Service.
My team have develop an Angular10 + ASP.NET Core (API) application. Our frontend (Angular10) only consumes our API , so the availability of our app depends on the availability of both, frontend + backend (our API will NOT be consumed by any other app). We don't have any latence issue or requirement as our final users are all in the same region. Our app must be consumed through HTTPS and with a specific name (CNAME).
When we deploy the app to Azure, my team decide to deploy it separately using a Store Account as static web site for Angular 10 and an AppService for the API as backend of our App.
As far I see on MS docs (here is the related article):
"App Service Static Web Apps is a great alternative to Azure Storage static website hosting and is also appropriate in cases where you don't require a web server to render content"
Because of we currently need an AppService to render content, i have some questions:
The app works but, is a correct arquitectural approach or is better only publish our app to an AppService?
There are any security/cost related/whatever topic that makes StaticWebSite + AppService approach better than only AppService deploy?
I think that this approach does not give us any facility or advantage. Instead of this, we have to configure more things on Azure to connect through SSL and to give a CNAME to our app and AppService deploy.
Please, can you give me your oppinion?
Thanks in advance
Best regards
Luis
The best approach would be to split out the SPA and API and host them separately. This creates a loose coupling between the applications giving you more flexibility around performance, scalability, and deployment.
The .NET Core API could be hosted on an Azure App Service, or could it even be refactored into running as a set of serverless Azure Functions? Converting it into functions would allow for auto scaling and a likely reduction in cost as you only pay when the function is running. It depends what the API methods are actually doing.
The SPA could be hosted as a static web site in a storage account blob container, and with a CDN endpoint mapped to it you can set it up to expose the SPA using HTTPS on a custom domain. Alternatively you could use an Azure Static Web App (although this is still in preview). This simplifies the deployment of SPAs as it will connect to your code repo and build and deploy the SPA for you when changes are committed to the repo.
That would of course mean configuring two separate CNAME subdomain records (assuming you wanted to the API to have a custom domain name), but that's not a big deal and ultimately a clearer separation on concerns.
Static Web Hosting: https://learn.microsoft.com/en-gb/azure/storage/blobs/storage-blob-static-website-how-to
Azure Static Web Apps: https://learn.microsoft.com/en-gb/azure/static-web-apps/overview
Static Hosting with Azure CDN: https://www.red-gate.com/simple-talk/cloud/azure/static-hosting-with-azure-blob-storage-and-azure-cdn/
Hosting option depends on your requirements.
Use case for using Static web site on Storage Account is a need to manipulate or process data on the server side, simply call the relevant managed Azure service like Azure Cognitive Services or leverage a web server of your own hosted on Azure Functions.
https://azure.microsoft.com/en-us/blog/static-websites-on-azure-storage-now-generally-available/
Your are Static web site makes a call to Azure WebApp API, so you should have Azure WebApp Plan.
Azure WebApp Plan can host both API and Static web site. Benefits of such scenario are:
Reduce cost as you can host multiple WebApps in same Azure WebApp Plan.
Azure WebApp gives you more hosting features versus Storage Account
Deployment can be implemented in same way for both Static web site and API

Host a static Blazor Application

I am looking for a hosting service for my Blazor Server web application. It is a simple static website with some extensions to send emails and styling but there is no database or API project currently.
I looked into Godaddy but looks like it does not provide hosting. Also I tried to host it on Netlify but it did not work and there are no tutorials or support fo .Net Core 3.1.
What would be the best place to host a simple blazor app? I am trying to find a cheaper option than Azure

Hosting azure app api on custom server

I am working on xamarin android. I want to connect my local DB to my mobile app. For this i have created a azure app api with swagger. Now i want it to use it locally i.e. i don't want it to host on azure portal all i want is to host it on my static IP on which I have bought. I have searched for this question but can't find any thing related to it. Is there a way to host my azure app api on custom server?
Any help would be highly appreciated

Resources