0
votes

Is there any workaround to do Storage failover using CICD pipeline ? Below links talk about installing preview version. I tried to put 1.1.1-preview in preferred version on Azure powershell task but doesn't work

https://docs.microsoft.com/en-us/azure/storage/common/storage-initiate-account-failover?tabs=azure-powershell

Solution:

I added all powershell commands on this link and it worked through CICD https://docs.microsoft.com/en-us/azure/storage/common/storage-initiate-account-failover?tabs=azure-powershell

1
Storage failover results in a modification to a storage account's DNS (and then turns that storage account into LRS until geo-replication is added again). I'm not sure why this is something you'd ever want in a CI/CD pipeline, since it's not a deployment option, but a forced failover scenario to an existing storage account.David Makogon
I am working on a pipeline for Disaster recovery so intention is to automate everything.user2895589

1 Answers

0
votes

I tried to put 1.1.1-preview in preferred version on Azure powershell task but doesn't work

The 1.1.1-preview is one version of Az.Storage module, instead of version of Azure Powershell.

So if you set 1.1.1-preview as Preferred Azure PowerShell Version, the Azure Powershell task can't recognize this version and the error will be thrown:

[error]The Azure PowerShell version '1.1.1.preview' specified is not in the correct format.

So I suggest using Azure CLI task (Inline Script mode) with content below:

az storage account show \ --name accountName \ --expand geoReplicationStats
az storage account failover \ --name accountName

You can refer to related document here.