https://pulumi.com logo
Title
e

echoing-dress-72742

11/21/2022, 9:31 AM
var nicCoreMediaDevStorageAccount = new StorageAccount("mgcoremedia", new StorageAccountArgs
{
    ResourceGroupName = resourceGroup.Name,
    Kind = "StorageV2",
    
    Sku = new AzureNative.Storage.Inputs.SkuArgs()
    {
        Name = SkuName.Standard_LRS
    },
    Location = "Norway East",
});
Is there a way to set a specific name on a storage account through Pulumi, right now the storage account ends up looking with a generated name appended to the name I have given.
f

fierce-dinner-64337

11/21/2022, 9:42 AM
I think I know that. You also need to specify the Name in the args object i.e ResourceGroupArgs
so if you create for example a Resource Group: var rg = new ResourceGroup("dev-rg", new ResourceGroupArgs(){ ResourceGroupName = "*dev-rg*"})
In the StorageAccountArgs, there is a Name property. I think you need to set it there as well ie mgcoremedia..
s

stocky-restaurant-98004

11/22/2022, 4:21 PM
FYI, the hex characters tacked on are done so that you can deploy the same stack multiple times in the same environment.
If you don't need this (or specifically don't want it for your use case), then do as @fierce-dinner-64337 suggested: supply an explicit name input to the resource.
e

echoing-dress-72742

11/24/2022, 8:06 AM
Thank you 🙂 I fixed it. Looking better now