I'm trying to migrate the pulumi code for an Azure storage account (which was originally created with the legacy Azure provider) to the Azure-Nextgen provider. The Aliases
property isn't working as expected. Is this possible, or am I missing something obvious?:
Original:
var storageAccount = new Account($"storage_{storageName}", new AccountArgs
{
Name = $"{storageName}",
ResourceGroupName = resourceGroup.Name,
AccountReplicationType = "LRS",
AccountTier = "Standard",
Location = resourceGroup.Location,
IsHnsEnabled = true,
MinTlsVersion = "TLS1_2"
},
new CustomResourceOptions()
{
Protect = true
});
New:
var storageAccount = new StorageAccount($"storage_{storageName}",
new StorageAccountArgs()
{
AccountName = $"{storageName}",
Location = location,
ResourceGroupName = resourceGroup.Name,
Kind = Kind.StorageV2,
AccessTier = AccessTier.Hot,
Sku = new SkuArgs()
{
Name = SkuName.Standard_LRS
},
IsHnsEnabled = true,
MinimumTlsVersion = MinimumTlsVersion.TLS1_2
},
new CustomResourceOptions()
{
Protect = true,
Aliases =
{
new Alias
{
Urn = "urn:pulumi:myEnvironment::myStack::azure:storage/account:Account::storage_storageName"
}
}
});
Pulumi preview in console:
azure:storage:Account (storage_storageName):
error: Preview failed: refusing to delete protected resource 'urn:pulumi:myEnvironment::myStack::azure:storage/account:Account::storage_storageName'