Module/Azure/Upload-BCSJsonToAzureBlob.ps1

<#
.SYNOPSIS
 
.DESCRIPTION
 
.EXAMPLE
 
.NOTES
    Author: Mathias Stjernfelt
    Website: http://www.brightcom.se
#>

function Set-BCSAzStorageBlobContent {
    [CmdletBinding(SupportsShouldProcess = $true)]
    Param (
        [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)]
        [string]$storageAccountName,
        [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)]
        [string]$resourceGroupName,
        [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)]
        [string]$containerName,
        [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)]
        [string]$blobName,
        [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)]
        [string]$fileName
    )

    process {
        try {
            $StorageContainers = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName
            $ctx = $StorageContainers.Context

            if ($PSCmdlet.ShouldProcess("Target", "Operation")) {
                Set-AzStorageBlobContent -Container $containerName -Context $ctx -Blob $blobName -File $fileName -Force
            }
        }
        catch {
            throw "An error occured: $_.Exception";
        }
    }
}

Export-ModuleMember -Function Set-BCSAzStorageBlobContent