Create Azure Cloud Service target command

Azure Cloud Service

Command: New-OctopusAzureCloudServiceTarget

ParameterValue
-nameName for the Octopus deployment target
-azureCloudServiceNameName of the Azure Cloud Service
-azureStorageAccountName of the Azure Storage Account
-azureDeploymentSlotDeployment slot.
Options are staging (default), production
-swapSwap staging to production, or just deploy.
Options are swap (default), deploy
-instanceCountUse the current instance count from Azure, or use the value in the configuration file.
Options are current (default), configuration
-octopusAccountIdOrNameName or Id of the Account Resource in Octopus. Must be a Management Certificate Account
-octopusRolesComma separated list of target tags to assign
-updateIfExistingWill update an existing Cloud Service target with the same name, create if it doesn’t exist
-octopusDefaultWorkerPoolIdOrNameName or Id of the Worker Pool for the deployment target to use. (Optional). Added in 2020.6.0.

Example:

# Using default options
New-OctopusAzureCloudServiceTarget -name "My Azure Cloud Service Target" `
                                   -azureCloudServiceName "CloudService1" `
                                   -azureStorageAccount "MyAzureCloudStorageAccount" `
                                   -octopusAccountIdOrName "Service Management Cert Account" `
                                   -octopusRoles "AzureCloudService" `
                                   -updateIfExisting

# Overriding default values
New-OctopusAzureCloudServiceTarget -name "My Azure Cloud Service Target" `
                                   -azureCloudServiceName "CloudService1" `
                                   -azureStorageAccount "MyAzureCloudStorageAccount" `
                                   -azureDeploymentSlot "production" `
                                   -swap "deploy" `
                                   -instanceCount "configuration" `
                                   -octopusAccountIdOrName "Service Management Cert Account" `
                                   -octopusDefaultWorkerPoolIdOrName "Azure Worker Pool" `
                                   -octopusRoles "AzureCloudService"

If your process creates dynamic deployment targets from a script, and then deploys to those targets in a subsequent step, make sure you add a full health check step for the role of the newly created targets after the step that creates and registers the targets.

This allows Octopus to ensure the new targets are ready for deployment by staging packages required by subsequent steps that perform the deployment.

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Page updated on Thursday, June 27, 2024