Deploying java app using Azure SDK for Java/Net - azure

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.

Related

Contentful Backup Azure Web Job

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.

How to access DLLs in a PaaS WebApp?

I would like to run ILSpy on one of my DLLs to verify code is running on a deployment slot and unable to figure out how to retrieve the DLLs from my PaaS WebApp.
As all mentioned above, If we want to get the published files from the Azure WebApp, we could use the Kudu tool to do that easily.
More info about Azure website file structure, we could refer to this document. If you want to know more about Azure WebApp, you could refer to Azure WebApp Sandbox.

Azure management API nodejs sdk for managing web apps

I am trying to provision a web app through Azure nodejs SDK
Are there any examples or repos that help in doing this?
Create a new web app.
set up the deployment source to bitbucket
sync with deployment source.
setup the environment variables
restart the app.
All of this done through management API...
Any inputs or guidance?
You can check out the official code sample for managing your web apps here.
This code sample includes the following:
create a resource group
create a hosting plan
create a website
list websites in a resource group
get details for a given website
update site config for a website
For other operations please refer to the SDK documentation for WebApps.

How do you create an installer for Azure Web Apps / Azure Websites

I am a software vendor with a .net web solution that I want customers to be able to easily install / deploy into Azure Web Web Apps / Azure Websites along with a Sql Azure backend. I can't find any installer tool that supports this scenario. I have also looked into the Azure Marketplace but it seems the only option there is to create VM images. I want my customer's to avoid having to deploy to an manage VMs and adopt the IaaS model. Instead they should be able to install to Azure Web Apps with a package that copies all the web solution files and installs and connects the Azure Sql. Is this possible or will I have to manually deploy and configure Azure solution for each customer?
You can use the VS Marketplace to do the deployment. What you need is to create an ARM template. There is a huge number of samples here: https://github.com/Azure/azure-quickstart-templates - you can pick one of the web app ones - for example: https://azure.microsoft.com/en-us/resources/templates/201-web-app-sql-database/ - has a SQL database linked to a web app.
The ARM template allows you to do a "no-hands" deployment of the resources and know when they are ready for further action. You can also deploy from any of the supported continuous deployment options (see the template with a GitHub connection as an example) or you can use ftp/msdeploy after the deployment is successful.
This is a good tutorial https://learn.microsoft.com/en-us/azure/azure-resource-manager/vs-azure-tools-resource-groups-deployment-projects-create-deploy
This is the github example mentioned in previous answer
https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy

Create Azure cloud service config from existing setup

I have two Azure VM's running in a cloud service. They contains almost the same thing. Some TCP port's are also opened between them.
Is it possible to create a deploy package from this existing setup so that at a later time can deploy this setup in an easy way. I.e. I want to be able to do this:
1. Create deploy package from existing setup *
2. Delete whole existing cloud service including VM's
3. Deploy the package from step 1 and have everything created again.
*I can save one of the VM's to my Azure storage and use it as template for both of them if that is easier.
How to accomplish this if it is possible?
Yes, you can take what you have as a template and use it to stand up multiple silos. But in IaaS, there isn't a notion of a deployment package. There's a few things you'll need to do...
1) understand how to take an existing VM and turn it into an image
2) use Powershell or another DevOps style automation suite (Chef/Puppet/etc..) to define deploy your silo.
You seem specifically interested in how to create an image so I'd recommend using the tutorial we have published on this. http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-capture-image-windows-server/ This does of course presume you're running Windows Server. But a Linux version it can be found at: http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-linux-capture-image/
The automation of a deployment depends on a great many things, so I'd suggest at a starting point, familiarizing yourself with the management API: http://msdn.microsoft.com/en-us/library/windowsazure/ee460799.aspx
With the implementation of Resource Manager, you can now easily use JSON template to deploy and redeploy resources in Azure. There are also starter templates available - https://azure.microsoft.com/en-us/documentation/templates/

Resources