https://pulumi.com logo
#dotnet
Title
# dotnet
b

boundless-monkey-2042

07/29/2021, 2:50 PM
Having trouble with FileArchive, an empty folder is created in the Storage Account. The folder is in the same folder as Pulumi.dev.yaml I have tried passing the folder Source = new FileArchive(".\\wwwroot\\"), as well as .zip. Running Pulumi v3.8.0 referencing Pulumi.AzureNative v1.19.0
Copy code
var wwwroot = new Storage.Blob("wwwroot", new Storage.BlobArgs
        {
            ResourceGroupName = resourceGroup.Name,
            AccountName = storageAccount.Name,
            ContainerName = staticWebsite.ContainerName,
            Source = new FileArchive(".\\wwwroot.zip"),
            ContentType = "Folder",
        });
t

tall-librarian-49374

07/29/2021, 2:53 PM
Try forward slash?
new FileArchive("./wwwroot")
?
b

boundless-monkey-2042

07/29/2021, 3:01 PM
Source = new FileArchive("./wwwroot.zip"), AND Source = new FileArchive("./wwwroot"), same result no error no files.
Following Pulumi examples I added index and 404 html files from the same source folder to the $web container and they upload correctly.
Copy code
var index_html = new Storage.Blob("index.html", new Storage.BlobArgs
        {
            ResourceGroupName = resourceGroup.Name,
            AccountName = storageAccount.Name,
            ContainerName = staticWebsite.ContainerName,
            Source = new FileAsset("./wwwroot/index.html"),
            ContentType = "text/html",
        });

        var notfound_html = new Storage.Blob("404.html", new Storage.BlobArgs
        {
            ResourceGroupName = resourceGroup.Name,
            AccountName = storageAccount.Name,
            ContainerName = staticWebsite.ContainerName,
            Source = new FileAsset("./wwwroot/404.html"),
            ContentType = "text/html",
        });
Started here - https://github.com/pulumi/examples/tree/master/azure-ts-static-website Pulumi up, all good. Added
Copy code
const wwwroot = new storage.Blob("wwwroot", {
    resourceGroupName: resourceGroup.name,
    accountName: storageAccount.name,
    containerName: staticWebsite.containerName,
    source: new pulumi.asset.FileArchive(`./wwwroot`),
    contentType: "folder",
});
Returned
error: Error: failed to register new resource index.html [azure-nativestorageBlob]: 2 UNKNOWN: failed to compute asset hash: asset path './wwwroot' is a directory; try using an archive
@tall-librarian-49374 any further insight on this one?
t

tall-librarian-49374

07/29/2021, 4:02 PM
That doesn’t look right. Could you open an issue in azure-native?
b

boundless-monkey-2042

07/29/2021, 4:03 PM
OK
9 Views