CompositionalIT / farmer

Repeatable Azure deployments with ARM templates - made easy!
https://compositionalit.github.io/farmer
MIT License
523 stars 157 forks source link

Deploying of content in storage account use_static_website does not finish #1014

Closed ravicini closed 12 months ago

ravicini commented 1 year ago

I ran into an error when deploying a storage account, including the use_static_website .

We use noVNC, and I'd like to deliver the content from a storage account as a static website. The noVNC sources (zip) can be downloaded here: https://github.com/novnc/noVNC/releases/tag/v1.4.0 I'm extracting the zip and try to deploy it directly through use_static_website.

Observed behaviour:

I could not pinpoint the issue yet.

The simplest code to reproduce the error:

let ExtractZip (source: string) =
    printfn "Uncompressing %s" (Path.GetFileName(source))
    let archive = ZipFile.Open(source, ZipArchiveMode.Read)
    archive.ExtractToDirectory(".", true)
    let pathParts = source.Replace(".zip", "").Split('/')
    let directory = pathParts[pathParts.Length - 1]
    let directoryInfo = new DirectoryInfo(directory)
    directoryInfo.FullName

let noVncDir = ExtractZip "resources/noVNC-1.4.0.zip"

let noVncStorage =
        storageAccount {
            name "stecockpitnovnc"
            sku Sku.Standard_LRS
            default_blob_access_tier DefaultAccessTier.Hot
            use_static_website noVncDir "vnc.html"
            min_tls_version Tls12
        }

let deployment = arm {
    location Location.WestEurope
    add_resource noVncStorage
}

deployment
|> Deploy.execute "infrastructure" Deploy.NoParameters
|> printfn "%A"
ravicini commented 1 year ago

To verify if the issue is on my zip, I added a directory with a vnc.html file and copy this to the output directory. When I use the temp directory as upload folder containing only this one HTML, the upload done by farmer works perfectly good.

Considering uploading the content after the initial deployment through the Azure.Storage library. The feature by farmer to provide a directory is awesome though, would be nice if we could find the issue.

martinbryant commented 1 year ago

Hi @ravicini I have been unable to reproduce the problem using the example you have given.

I did take out the steps that you have that extract the zip file and just passed the directory of the uncompressed file to the use_static_website and everything uploads and works correctly.

Could you try the same with all of the files and see how you get on?

martinbryant commented 12 months ago

@ravicini I am going to close this issue - please let me know if the issue persists and I'll have a further look

ravicini commented 11 months ago

Hi @martinbryant thanks for the reproduction test. I was unable to follow up and retest it up to now, I should be able to do it in the following days.