Continues development for Azure Function - azure

I have Azure Function running Power Shell that built in a cloud itself (no local files).
I need to copy it to another Azure subscription,
I see a lot of example how to deploy, but my question is how to take all the files of function from Azure and put it in Azure Devops repository with some script, without downloading it to my computer.

I don't think there's a direct way to take all the files of function from Azure and put it in Azure DevOps repository without downloading them first.
Basically, we need to download app content to your local machine first, and then push it to Azure DevOps repository.
You can reference the following blogs to do that:
Copying an Azure Function App using the Portal, GitHub and Cloud
Shell
How to… copy Function Apps

Related

Deploy Azure function from GitHub actions to Azure portal

I am new to Azure and i would like to deploy a folder with my function azure (python file) and create a function in my function app. Do i need a function.json file and what is it for? I am using GitHub actions as CI / CD. Which method can I use? ZIP deploy, Storage Azure deploy, serverless, other? I tested a lot of things with no results.
The manual:
Which has a section: Source Control.
Which points to: Continuous deployment for Azure Functions

proper scm for a static website deployed to a storage account?

Can you point me to a url which describes proper SCM for a Static Website deployed to a Storage Account? I have a ReactJS website deployed as a static website to an Azure Storage Account. Currently I'm just pushing updated deployments via an Azure extension in VS Code.
Separately, I have an App Service which has an associated Deployment Center with a configured Pipeline and its own Azure DevOps source code repo. The App Service setup as I've described seems to have at least a decent start on some semblance of SCM.
When viewing the webpage for a storage account in the Azure portal, I don't see a "Deployment Center" left nav item like I do for an App Service in the portal. In the Azure portal, looks like a storage account can only have a single static website b/c "static website" exists as a single left nav item for a particular storage account page in the Azure portal. If I click on the "static website" left nav item for my deployed ReactJS app, I don't see any type of additional hook into the Deployment Center. A "git status" on my local code folder indicates that the folder is not a git repo.
So I'd like to get my static website code into an Azure DevOps repo. I need the code to be source-controlled and since my App Service is in an Azure DevOps repo, I'd like the same for my static website code for consistency. I'm also assuming that the code needs to be in an Azure DevOps repo in order to easily and fully leverage Azure DevOps functionality like pipelines, etc.
So can you advise how I can get from point A to point B for this scenario or if there may be constraints or alternatives with what I'm trying to achieve here?
You can make use of Azure File Copy task to push the build artifacts to Blob Storage. From the documentation link:
Use this task in a build or release pipeline to copy files to
Microsoft Azure storage blobs or virtual machines (VMs).
The task is used to copy application files and other artifacts that
are required in order to install the app; such as PowerShell scripts,
PowerShell-DSC modules, and more.
You would need to push the artifacts to $web blob container as this container is used to serve static website.
You can learn more about it here: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-file-copy?view=azure-devops

How to deploy NodeJS project to Azure websites?

We have a NodeJs project we are building with TeamCity, then using FTP, uploading the built files to our Azure web app (.azurewebsites). The project contains thousands of files, so the FTP upload times are very slow (takes a very long time). We would prefer to package the build as a ZIP file, then upload the ZIP with FTP (much faster). However, how do we unzip the ZIP file on Azure using script?
Or is there a better way to deploy our build to our Azure web app?
NOTES:
This is an Azure web app service, does not live on a VM
Our process needs to be automated with script to support CI/CD
Deployments with Git and other repos are not feasible
You can use the Kudu API or MsBuild to deploy an app (web app or Function) to Azure App service. The deployment is usually done in 2 parts:
Deploy the app service using ARM templates
Deploy the code/App using one of these methods
If you're using VSTS, there are templates for both steps and make it a 2min process to setup. If you're not using VSTS, the Kudu API is he best way to solve the problem.
You can find more information here : https://github.com/projectkudu/kudu/wiki/REST-API
You can also use the Azure PowerShell Management cmdlets to achieve the same. However, this is at the moment only supported on Windows

Jenkins deploy website to Azure Platform as a Service

I have successfully implemented Jenkins to deploy to a server hosted locally, but now I need to create a job to deploy to a Azure hosted website running on PaaS. Both the Jenkins host and Website hosts are Windows machines.
I have found a link for setting up a virtual machine template for Azure Slave plugin, but there is no VM because it is IaaS and I dont have additional slaves in this case.
I am asking about the plug ins and process flow please.
Which Azure Plugin should I use in Jenkins (if any)?
E.g. Azure PublisherSettings Credentials plugin
Do I use the Get-AzurePublishSettingsFile and Import-AzurePublishSettingsFile ?
Would these contain all the relevant details required for Jenkins to know
where to copy to?
Would I create a zip file of the build, upload the zip to BLOB storage,
and then extract it to the website?
Is it possible to upload a zip file and then proceeding to extract the files once the whole file has been uploaded?
If the connection is interrupted at any stage while uploading 1000 individual files then the website will be unstable and therefore I need to investigate a single file upload with extraction thereafter.
So if I were you I'd do the following:
1. Install jenkins powershell plugin, install Azure PowerShell commandlets.
2. Create a job in Jenkins that creates a the zip file and uploads it to Azure Storage
3. Create an ARM template to deploy Azure WebApp from the zip file in Azure Storage.
4. Create a job to deploy said template.
So the ARM template would take the zip file and upload it to the Azure WebApp and the WebApp would handle all the hassle with the zip file internally.

FTP'ing a Suave app to Azure

Having never used Azure before I'm attempting to deploy a simple F# Suave app to Azure using FTP. Ultimately I want to deploy via github but I initially thought FTP'ing it would be the easy first step. According to https://suave.io/azure-app-service.html it should be straight forward.
These are the steps I followed
Created a new web app in Azure including a resource group
and app service plan. All on the Free Tier.
Downloaded the publishsettings XML file that Azure created.
Cloned this repo: https://github.com/isaacabraham/fsharp-demonstrator
Used FileZilla to connect via FTP using the creds
from step 2.
Uploaded the files (via FTP) from
fsharp-demonstrator/src/SuaveHost (which includes the necessary web.config file) from the repo cloned at step 3 to
the site\wwwroot on Azure.
Navigated to Azure site url.
Then I receive the error:
The specified CGI application encountered an error and the server terminated the process.
(When I look at the folders on Azure under site\wwwroot I don't see any obj or bin folders. I don't think any msbuild process occurred. That doesn't seem right.)
Anybody got any idea what the problem is?
I suspect the issue is that when you deploy via FTP, then Azure does not automatically run the deploy script specified in the .deployment file.
The build.fsx script uses Kudu service to deploy the built files, so it might be easier to just use Github deployment rather than FTP - this way, Azure will do the deployment for you.
If you want to deploy via FTP, you'll need to build the project locally and upload the output. I'm not sure how to best do this with Isaac's Kudu-based demo though (ultimately, you need web.config that points to your built executable like this)

Resources