Table of Contents

Class FunctionsOperations

Namespace
Ando.Operations
Assembly
ando.dll

Provides Azure Functions deployment operations for build scripts. Methods register steps in the workflow rather than executing immediately.

public class FunctionsOperations : OperationsBase
Inheritance
FunctionsOperations
Inherited Members

Constructors

FunctionsOperations(StepRegistry, IBuildLogger, Func<ICommandExecutor>)

Provides Azure Functions deployment operations for build scripts. Methods register steps in the workflow rather than executing immediately.

public FunctionsOperations(StepRegistry registry, IBuildLogger logger, Func<ICommandExecutor> executorFactory)

Parameters

registry StepRegistry
logger IBuildLogger
executorFactory Func<ICommandExecutor>

Methods

DeployWithSwap(string, string, string, string?)

Registers a step to deploy to a specific slot and then swap to production. This enables zero-downtime deployments.

public void DeployWithSwap(string functionAppName, string zipPath, string slotName = "staging", string? resourceGroup = null)

Parameters

functionAppName string

Name of the Azure Function App.

zipPath string

Path to the deployment zip file.

slotName string

Staging slot name (defaults to "staging").

resourceGroup string

Optional resource group name.

DeployZip(string, string, string?, Action<FunctionsDeployOptions>?)

Registers a step to deploy a function app using zip deploy. Requires the function app to already exist in Azure.

public void DeployZip(string functionAppName, string zipPath, string? resourceGroup = null, Action<FunctionsDeployOptions>? configure = null)

Parameters

functionAppName string

Name of the Azure Function App.

zipPath string

Path to the deployment zip file.

resourceGroup string

Optional resource group name. If null, Azure CLI will determine it.

configure Action<FunctionsDeployOptions>

Optional configuration for deployment options.

GetFuncCliInstallInstructions()

Gets OS-specific installation instructions for Azure Functions Core Tools.

public static string GetFuncCliInstallInstructions()

Returns

string

Installation command or URL for the current platform.

IsFuncCliAvailable()

Checks if Azure Functions Core Tools is installed and available.

public static bool IsFuncCliAvailable()

Returns

bool

True if func CLI is available, false otherwise.

Publish(string, string?, Action<FunctionsDeployOptions>?)

Registers a step to publish a function app using Azure Functions Core Tools. This is the recommended approach for .NET and other compiled functions.

public void Publish(string functionAppName, string? projectPath = null, Action<FunctionsDeployOptions>? configure = null)

Parameters

functionAppName string

Name of the Azure Function App.

projectPath string

Optional path to the function project directory.

configure Action<FunctionsDeployOptions>

Optional configuration for deployment options.

Restart(string, string?, string?)

Registers a step to restart a function app.

public void Restart(string functionAppName, string? resourceGroup = null, string? slot = null)

Parameters

functionAppName string

Name of the Azure Function App.

resourceGroup string

Optional resource group name.

slot string

Optional slot name. If null, restarts the production slot.

Show(string, string?)

Registers a step to show function app information.

public void Show(string functionAppName, string? resourceGroup = null)

Parameters

functionAppName string

Name of the Azure Function App.

resourceGroup string

Optional resource group name.

Start(string, string?, string?)

Registers a step to start a function app.

public void Start(string functionAppName, string? resourceGroup = null, string? slot = null)

Parameters

functionAppName string

Name of the Azure Function App.

resourceGroup string

Optional resource group name.

slot string

Optional slot name. If null, starts the production slot.

Stop(string, string?, string?)

Registers a step to stop a function app.

public void Stop(string functionAppName, string? resourceGroup = null, string? slot = null)

Parameters

functionAppName string

Name of the Azure Function App.

resourceGroup string

Optional resource group name.

slot string

Optional slot name. If null, stops the production slot.

SwapSlots(string, string, string?, string)

Registers a step to swap deployment slots.

public void SwapSlots(string functionAppName, string sourceSlot, string? resourceGroup = null, string targetSlot = "production")

Parameters

functionAppName string

Name of the Azure Function App.

sourceSlot string

Source slot name to swap from.

resourceGroup string

Optional resource group name.

targetSlot string

Target slot name (defaults to "production").