Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
What is the recommended way of deploying a single Windows Azure Cloud Services application to multiple data centers?
Should I put an existing app on hold in all data centers, then after deployment is complete re-enable them? Or there is a better way doing this?
Ideally I'd like to have an ability to set in a Windows Azure cloud project's config file the list of data centers so that during a single publish operation the app would be uploaded to multiple data centers simultaneously (for example North Central US, West Europe and East Asia data centers).
What you have described will require a bit of custom deployment logic. I would recommend that you get familiar with PowerShell and the Windows Azure Management Cmdlets. A bunch of examples for how to deploy packaged with PowerShell are available on Github.
I would upload your Azure package and service configuration files to each host service's staging slot that you have in each datacenter (i.e. your multiple datacenters) using the same PowerShell script with different arguments for each hosted service. You'll need to have some custom wait logic that polls the status of the staging slot deployment and waits for the READY status. Once this is complete you know your VM is ready and if your application load quickly you can then perform a VIP Swap using PowerShell as well.
The PowerShell commands that you will need to accomplish this are the following:
New-Deployment (Use this to deploy to each of your datacenter's hosted services)
Get-HostedService (Use this to get the status of your newly deployed hosted services)
Move-Deployment (Use this to perform a VIP Swap once all your staging slot deployments are ready)
Note that even when you build this there is a chance that things will be out of sync for a few seconds at best and a few minutes at worst so your new deployment will always need to be backwards with your underlying data storage systems/schema.
I'd recommend using the Windows Azure Service Management REST API for this. PowerShell tends to be repetitive and slow for multiple deployments (i.e. the package is uploaded to storage for each deployment, even if it is the same package). There is a great and complete example on using the REST API at Windows Azure ServiceManagement Sample. We have extended this sample for a similar situation: We have 45+ microsites using the same code base and use the REST API to deploy to each service instance asynchronously. We upload the package to an Azure Blob and then trigger an asynchronous update of each service using the Blob URL. With the REST API, you can run your updates from a build server or an Azure Worker Role.
Related
At the company that i work, they deploy applications to azure using Azure App Services.
This involves creating the App service manually, and setting up the pipelines manually.
My question is if there is another way to host and run applications in Azure without using App Services?
The reason for this is that i don't like the manually work when setting up a app service and all it's configuration.
Any suggestions?
What you actually need is setting up CI/CD pipelines for your application to create resource(AppService in this case) and deploy on them.
If you are new to Azure Devops, i would highly recommend to explore Devops starter service to deploy your application with few clicks and see how it creates resources and pipelines automatically
On the 2nd question, there are many compute options available on Azure such as Virtual Machines , AKS (Containers Orchestration) , Container instances etc.
You can explore those compute options using the decision tree here
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Coming from Firebase where setting up a whole serverless application with Authentication, File Storage, Database,Cloud Functions and Hosting is quite straight forward, we are currently investigating how to achieve something similar with Azure. After reading some docs and studying samples, I find solutions for setting up those components independently but nothing really concrete how to manage them in combination.
The main questions I have are:
Continous Deployment with Staging: How can I do a proper staging in Azure when I have configured a serverless application with functions, database, authentication etc.? In firebase there is a json file defining my backend and I can deploy it to the firebase project i want (e.g. myapp-dev, myapp-test, myapp-prod). Is there something similiar in Azure? For webapps I found the "slots" but for DB, Storage, API Gateway etc. - how can I do this in Azure? I guess one should use the Azure Pipelines, but is there any proper documentation or example on how to handle all the components of a serverless application with this?
Config-As-Code: Most documentation/tutorials in Azure start with either doing the complete configuration in the Azure Portal UI, or in Visual Studio (Code). As a Team we want all the configuration in a git repo and maintain it from there right from the start. I guess the Azure Resource Manager (ARM) is for this? If so - what is the recommended approach to ramp up serverless projects with ARM?
Side Note: We use Node.js for functions in Backend. So no .NET or Java.
Unfortunately you'll need to build this out yourself using ARM Templates. You can write nested templates, modules and extensions, dependencies, configurations etc.
You can sometimes get started by combining various solutions and deployments from the Quick Start Library:
https://azure.microsoft.com/en-au/resources/templates/
https://github.com/Azure/azure-quickstart-templates
For more complex deployments I've pulled apart the Sitecore ARM templates purely for the deployment structure.
https://github.com/Sitecore/Sitecore-Azure-Quickstart-Templates
You can also manually create resources in Azure Portal and click on "Automation Options" just before you Deploy to get the JSON required.
Out of the box though, Azure is severely lacking in solution based deployments.
Sometimes in our website which is deployed on Azure web roles, issue comes related to small bugs in javascript and HTML. We go to all instances of webroles and fix these JS and HTML file on machines.
But I was looking into some automated way of doing this, downloading the files to patch from some central location and replace the files in all azure web roles. I am using ASP .net MVC for website.
It is possible to redeploy the website with the patch in the package but we don't want to wait for long deployment time. Please let me know if it is possible via some internal WEB API which replaces the content on all azure web roles.
There are 2 ways to deploy a new webrole:
redeploy
inplace update
The first one is the slowest, meaning new VM's are booted.
With inplace upgrade (https://azure.microsoft.com/en-us/documentation/articles/cloud-services-update-azure-service/)
The new application package is mounted on a new drive (usually F: instead of E:) and the IIS website is swapped to the new drive.
You can try this by going to the old portal and upload a new application package. In just a few seconds/minutes the update is done.
After digging many things on stackoverflow, I crafted my own solution which is creating a topic and subscribing to the topic in code when website starts. When I want to patch the web app then I send a message to Topic to start patching then each machine in the web roles will get notification from topic and start patching themselves. Patching itself is very easy, which is going to a web storage and downloading files from there and replacing files in approot.
When azure maintenance happens this patching may go away, so for this situation I made patching work started at start up of website too.
Cloud service deployment packages tend to be slow since they are basically a recipe on how to build and configure your deployment. The deployment not only puts the recipe out in Azure (so it can be used again if it needs to move your machine), but also follows the recipe to build out a VM for your Cloud Service (WebRoles/WorkerRoles are platform as a service so you don't have to worry about the OS and infrastructure level like you would if you were using the Virtual Machine Azure product but they do still run in VMs on physical hardware).
What you are looking to do is something that will update the recipe (your cloud service package) and your deployment after it is out and running already ... there is no simple way to do that in Cloud Services.
However, yes you could create a startup script that could pull the site files from blob storage or some other centralized location - this would compare to how applications (fiddler for example) look for updates then know how to update and replace themselves. For that sort of feature you will likely need to run code as an elevated user - one nice thing about startup scripts are they can run as an elevated user - so they can do about anything you need done on a machine (but will require you to restart the instance for them to run). Basically you would need to write some code that will allow your site to update itself. This link may help: https://azure.microsoft.com/en-us/documentation/articles/cloud-services-startup-tasks/
If you have the ability to migrate to WebApps and WebJobs, I would recommend looking into that since that compute product solves your problem really well.
Here is a useful answer of the differences between WebApps and Cloud Services: What is the difference between an Azure Web Site and an Azure Web Role
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.
I am currently working on a project in which I need to accomplish the following using a scheduled task in an Azure Mobile Service (if it's possible):
Update a cloud service deployment configuration to put the cloud service into maintenance mode.
Wait a predetermined length of time for any pending work in the cloud service to complete.
Perform a backup of SQL Azure database used by the cloud service.
Wait another predetermined length of time for the backup to complete.
Update the cloud service deployment configuration to bring the cloud service out of maintenance mode.
I've got step 3 figured out already and steps 2 and 4 are relatively trivial to add. My hangup is with updating the cloud service deployment configuration using the Azure Service Management REST Api.
(I've come across no other means of doing this in a Node.js script).
The calls to the endpoint using the provided Node.js module request (example: http://msdn.microsoft.com/en-us/library/windowsazure/jj631641.aspx) are easy enough but the requests must contain a management certificate as per http://msdn.microsoft.com/en-us/library/windowsazure/ee460782.aspx
So my question is: How do I attach my management certificate to the request?
Keeping in mind that this is to be done within a scheduled task (which is a Node.js script).
Management certificate is just a standard certificate file (.cer) (X.509 v3). You can put the contents in a string (Don't kill me for suggesting this) or a table which your script would read.
Once you have the certificate content in hand as a string, you can attach it to the HTTPS request you are making to the Azure service management API. Nate Good has a nice post on how to achieve this with nodejs. He is reading the certs from files, so you'll have to change that part and replace it with your cert strings.