Deploying Azure Function code with ARM/Azure Resource Group - azure

I am stuck with an issue where I want to deploy an Azure function and the code with Azure Resource Group but it seems this isn't supported? I followed the steps here and edited it to include an Azure Function project instead of the web app
https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/create-visual-studio-deployment-project#deploy-code-with-your-infrastructure
We are wanting to list an app in the market place that will deploy an Azure function into the customer's environment (and not our own) - hence assuming this needs to be a 'managed app' and needs the ARM/ARG template

ARM can only be used to define the structure, but the deployment part still needs to use other methods.
Have a look of this doc:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code

Related

How to create Standard Logic App using Rest api?

Using the official documentation Azure Logic Apps, i'm able to create and work with Consumption Logic Apps. Is it possible to create Standard Logic App using Rest API in similar way?
The simple answer, as it currently stands and looks to be, is no.
As per the documentation ... https://learn.microsoft.com/en-us/azure/logic-apps/single-tenant-overview-compare#create-build-and-deploy-options
There are currently limited options for a standard logic app.
Standard
Consumption
Update
Standard logic apps now have additional ways to deploy, still not the full suite but it's grown.
This is tecnically possible but you need to rethink the definition.
Logic App Standard (aka. Single-Tenant Logic App) is built on top of the function runtime and the infrastructure is seperated from the actual workflow definition. Deployment to the resource basically works the same way as for Function Apps.
Deploy the infrastructure
Deploy the workflow (function for function apps).
More on that here: DevOps deployment for single-tenant Azure Logic Apps
For your case you would:
Deploy the infrastructure via the REST API
Storage account
Server Farm (App Service Plan)
Site (App Service)
Build the Logic App Standard project and create a zip archive.
Deploy the archive using zip deployment via REST API.
This sounds easy but requires more work, see links below.
Links:
Set up DevOps deployment for Standard logic app workflows in single-tenant Azure Logic Apps
Deploy ZIP file with REST APIs

Azure - Automatically add new Appservice to Frontdoor

We are deploying a lot of Appservices in Azure trough Azure Devops in different pipelines. For each Appservice we deploy a West and a North Europe instance. We would like to add them automatically to Azure Fontdoor (with ARM template) with a frontend domain. We have ARM templates in place (the default one from Microsoft) but the template is not incremental. So when we add one the allready configured ones dissapear.
Any idea how we can add Appservices one by one to Frontdoor without having the full list off appservices available?
You could try to use the ARM template deployment task. This task supports incremental deployment of app service.
I use the azuredeploy.parameters.json file to input the parameters.
Here is the example:
Then I use this file in the ARM template deployment task and select the incremental option.
For the first time, you can directly use the parameters in the file.
For the next time, you could add custom parameters to the Override template parameters field.
Result:
App service will not be overwritten.
Hope this helps.

Copy Azure Resources to client azure account

We are working on following within Azure portal
Azure Functions
Data Factory
Logic Apps
Storage account (not files)
Now as we are done with development, we need to deploy these azure resources in client's UAT environment
I looked around (might be missing something) and found that deployment of Azure resources is not straightforward.
In Azure, it is like another subscription, correct?
So found this blog, which works with different PowerShell scripts to copies from one subscription to another
This is the right approach? & it cover everything required for resources to execute flawless (I still need to go thru scripts) for e.g. permissions, Data Factory datasets, etc?
Any other way to deploy (kind of export & import)?
Basically what you need is to create a reusable arm template, your question lacks some details yet ARM templates are the way of automated deployment in Azure, on a high-level
start by authoring your arm template to deploy the vanilla required resources look here
https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites/functions
https://learn.microsoft.com/en-us/azure/templates/microsoft.datafactory/factories
https://learn.microsoft.com/en-us/azure/templates/microsoft.logic/integrationaccounts
https://learn.microsoft.com/en-us/azure/templates/microsoft.datalakeanalytics/accounts/storageaccounts
you can combine all of them in one big template using ARM template dependency and other functions
look here
https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions
after you finish ARM templates can be used in many ways including PowerShell, direct API calls or even you can create a deployment in Azure and save it to be reused with a click
look here, also if there will be a high volume of users consider adding it to market place.
https://learn.microsoft.com/en-us/azure/azure-resource-manager/
after finishing your implementation of vanilla resources you can then move into adding any customization you might have.
this is the right and best way to do "afaik"
also look here to see all of your existing resources in an arm template view
https://resources.azure.com/
my understanding of Azure is that almost everything with some few exceptions has an ARM template representation
hope this would help.

How to deploy Azure Function app including code using ARM template from Azure marketplace

I want to deploy a Function App including code using an ARM template that is going to be published in the Azure Marketplace as a Managed App.
I've seen in the docs that you can add a sourcecontrols element in the ARM template that you can use to point to e.g. a GitHub repository. However, I don't want to use a repository, I want to code to be uploaded to the Function App.
I also know you can upload the code using the Azure CLI or powershell, however this will not be possible when publishing the app in the marketplace.
Is there a way to have a package that contains everything including the code and have that uploaded to the Function App all using an ARM template in the Azure Marketplace?
You should take a look at Run-From-Zip. Basically, you host the zip package somewhere (typically storage blob), and in ARM template you just set a WEBSITE_RUN_FROM_ZIP App Setting pointing to it.
As an alternative, you could use the ARM msdeploy extension, and point it to the zip package (e.g. something like this).

Enterprise standards for deploying the ARM templates along with source code in to azure environment using VSTS?

I working on Azure ARM templates, I developed few ARM templates for production environment it includes vnet, subnet, web app, API app, storage and database etc...
I had the source code contains the MVC application and Azure API Application and check in the code into VSTS team repository.
Source code managed in VS2017:
Currently I created Build and Release for source code along with ARM templates in single build and release by following this link.
I have few questions in my mind after implemented above process in my current environment:
What are best industry practices to manage the source code and ARM templates in VS2017?
How to know which version of ARM template deployed in specified resource group?
For suppose if someone changes the application code only, then also ARM template deployed along with modified source code into azure. is it recommended approach?
Is it recommended approach for deploying the source code along with ARM templates at time by creating single build and release definition In VSTS?
Is it recommended way to give application settings and connection strings in web app and API app arm templates?
What is the enterprise implementations to deploy the ARM templates and source code into azure environment using VSTS?
You can deploy ARM and web application in the same build/release, simple workflow:
Check the template file has been updated or not through VSTS REST API (e.g. Get a single commit with changed items)
Check the related resource is existing in Azure through Azure PowerShell task (e.g. Find-AzureRmResource, Get-AzureRmResource)
Add a new variable per to the results of step1 and step3 through Logging Command (e.g. isUpdated: Write-Host "##vso[task.setvariable variable= isUpdated;]true")
Add Azure Resource Group Deployment task and choose custom conditions in Run this taks box (Custom condition: eq(variables[isUpdated '], 'true')
Add corresponding tasks to deploy your web app.

Resources