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
registryStepRegistryloggerIBuildLoggerexecutorFactoryFunc<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
functionAppNamestringName of the Azure Function App.
zipPathstringPath to the deployment zip file.
slotNamestringStaging slot name (defaults to "staging").
resourceGroupstringOptional 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
functionAppNamestringName of the Azure Function App.
zipPathstringPath to the deployment zip file.
resourceGroupstringOptional resource group name. If null, Azure CLI will determine it.
configureAction<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
functionAppNamestringName of the Azure Function App.
projectPathstringOptional path to the function project directory.
configureAction<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
functionAppNamestringName of the Azure Function App.
resourceGroupstringOptional resource group name.
slotstringOptional 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
functionAppNamestringName of the Azure Function App.
resourceGroupstringOptional 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
functionAppNamestringName of the Azure Function App.
resourceGroupstringOptional resource group name.
slotstringOptional 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
functionAppNamestringName of the Azure Function App.
resourceGroupstringOptional resource group name.
slotstringOptional 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")