Contentful Backup Azure Web Job - azure

I want to have an Azure Web Job that will run periodically and create Contentful Spaces backups in Azure Blob Storage.
I know that Contentful has their own CLI but not sure how can I run the CLI in an Azure Web Job using a .NET Core Console Application. Is that possible ?
I also found that they have their own API: https://www.contentful.com/developers/docs/references/content-management-api/ can I use this API to export Contentful data to a JSON file using .NET Core Console Application ?
PS: All the backups need to be done in a way that I can import the data again if necessary.

This is not a direct answer, but suggestion for you.
I'm not familiar with Contentful, but for azure webjobs, there are 2 things you should remember:
1.If you're using .NET core console application, first, you can include all the logic in the console application and make sure it can work locally.
2.You should avoid these limitations(especially no UI operation) when publish to azure.
So in your .NET core console application, you can use api or sdk and make sure it works locally, then follow this article to create the proper webjobs.
Hope it helps.

Related

Dotnet-counters output from Azure App Services

I'm trying to find a way to get dotnet-counters output from Azure App Services to either the Azure Portal (good enough for some trouble shooting) or some other console tool.
Does anyone know of a way to get the data, even when the app service is running across multiple app service plans? I was picturing maybe there is an app service extension (but no luck so far).
Eventually I'll want to automate this so I can get the data onto our monitoring system, but first baby steps.... just need something I can manually eyeball to help debug issues.
Anyone have any thoughts on how to do this?
Thanks
Ken
From offical doc, we can install dotnet-counters by cli command and download .exe directly.
As azure web app running in sandbox environment, so we can't add dotnet-counters to env, which means we can install it, but we can't use it.
So my solution is,
we can download .exe file directly.
After downloading finished, we can copy and paste it to wwwroot.
Then we can use it on scm site and azure portal.
On kudu site.
On azure portal.

Handling Azure Event Hub events via Azure Functions vs .NET Console App using Azure.Messaging.EventHub SDK, any practical differences?

My app needs a background service that constantly receives and handles events streamed from an Azure Event Hub.
I see that Azure Functions has built-in triggers for this, but the problem is that my app is written in .NET 5 and Azure Function support for it is fairly immature at this point.
I also see from this documentation that .NET has an readily-made SDK Azure.Messaging.EventHubs. My understanding is that this will run as a console app.
I'm already using the Azure App Service (Linux plan) to host the main web app.
So if I create a console app using Azure.Messaging.EventHubs, I'd want to deploy it as something like a web job, but the Linux app service plan doesn't support it. I guess I can deploy the console app it to a separate Windows App Service plan.
What's the next best option? Are there any practical differences compared to using Azure Functions?
There's also this .NET Core Worker Service that's more optimized for background services. I wonder if there's a place for it in this use case.
These options are confusing me a bit. Your advices would be greatly appreciated.
Azure function should be the best choice. It has the built-in eventhub trigger and process logic, and easy to setup / configure(like logging via Application Insights) / less code to write. And recently(Mar 10 2021), it is supported for running production .NET 5 apps on Azure Functions. I suggest you can give it a try and use it if no issues.
For azure webjobs, in this case, if you're directly using the SDK, you need to write many codes and configure something like logging.
For .NET Core Worker Service, it can also be published as azure webjobs if you want to use it. You can follow this doc on how to publish worker service as azure webjob.

Migrating Windows task scheduler applications to Azure

I have a console application connecting to database and executing DML transactions. This console application is currently scheduled using windows task scheduler. I am planning to migrate this to Azure.
Which is the recommended strategy ?
Should this be moved as Azure webjobs or function apps ?
Since you already have a console project, then it's more easier to use Azure Webjobs to achieve that.
To create a webjob, just create a .zip file which includes the .exe / .dll and other necessary files, then upload to azure. For schedule, please refer to Create a scheduled WebJob. For more details, you can refer to this doc.
Note: there're some limitation of azure webjobs / azure function, see Azure-Web-App-sandbox. But if you only need to connecting to database and executing DML transactions, you can ignore the limits.
And yes, you can also do this via azure function, but since you already have a console project, it's easier to use webjobs.

Deploying java app using Azure SDK for Java/Net

Is it possible to create a tomcat and MySQL/SqlServer service using azure-sdk-for-java or azure-sdk-for-net, and deploy a war file programmatically?
I went through the example codes about creating resource groups and virtual machines, but couldn't find an api about creating a tomcat, sqlserver or MySQL inside sdk.
If this is not possible what is the way to make a programmatic/automatic deployment to azure?
According to your description, based on my understanding, I think you want to create an Azure website with tomcat and database to deploy a Java WebApp all at one time programmatically.
For the purpose, per my experience, you need to implement these via do the three steps below.
Create a webapp with tomcat & database using ARM template in a Java/.NET program with Azure SDK for Java/.NET. There are many existing samples which include two Azure deployment templates (sample 1, 2) & sample deployment program (for Java & .NET) that you can refer to.
Get publish settings file or set deployment credentials to get the credentials you used for deployment. It seems that you need to do this step manually, not programmatically.
Deploy your Java WebApp programmatically via FTP, Kudu REST API or others that you can refer to some offical documents & wiki. Meanwhile, you can refer to the Azure Java WebApp sample on GitHub to know what files you need to upload.
Hope it helps. Any concern, please feel free to let me know.

Deploying Applications other than WebApp using Azure Resource Manager

I am currently looking into using ARM to deploy new environments of our Azure Components. We have a lot of web apis that are deployed to Cloud Services, since we need access to the underlying OS to get CPU usage for App Dynamics metrics. When reading through ARM, it seems as if they are deprecating Cloud Services, but I have some confusion about what is replacing it. I see that you can create Web Apps using this and use Publish from Visual Studio to deploy the app it, but I see no options for Cloud Services. So what is the preferred method to do this? Creating a VM and deploying using Web Deploy? What about VM scaling. Any help would be greatly appreciated.
My company is in the process of moving a legacy app to Azure using Cloud Services and we were concerned about the future of Cloud Services. Since we are somewhat early into the project and would like to use the ARM model we thought it would be easier to make a move now if we knew the future. After a few conversations with project leads at Microsoft on this topic we were only told that we should continue working with Cloud Services as they would continue to be supported.
It's quite clear that the move to ARM was not well thought out in terms of direction and consequences of existing services that many people are already using. Reading between the lines I would say that there is no plan to convert Cloud Services from the ASM to ARM model.
If application insights (https://azure.microsoft.com/en-us/services/application-insights/) are sufficient for your monitoring needs, then you can use web apps. These can be deployed via ARM, and can automatically deploy from a git repo or web deploy package. See this example:
https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy
The issue here that you may be trying to do operations which are restricted by the web app sandbox.
Failing that, you can use an ARM template to set up a VM and then invoke a custom site extension which will run powershell code to do further provisioning. This powershell code can fetch any package that you may want to install. See this ARM template for example: https://github.com/Azure/azure-quickstart-templates/tree/9ad72f1f5f0008c14311be79eee036b871712394/201-list-storage-keys-windows-vm
Once the VM is created you would be able to modify it and scale as needed.

Resources