File resource credential itermittant error with Azure Storage Share

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of nicklaws nicklaws 9 months, 3 weeks ago.

  • Author
    Posts
  • #54627
    Profile photo of nicklaws
    nicklaws
    Participant

    I have the following resource setup in an Azure Automation DSC. For some reason it fails only sometimes and I can't figure out why. When searching I found a post on stackoverflow that had a link here, but that link resolves to a 404 now. So I'm hoping someone might recall/know why this fails sometimes. The error is:
    "A specified logon session does not exist. It may already have been terminated."

    File StorageShare
       {
        DestinationPath = "C:\Temp\Test\"
        Type            = "Directory"    
        Ensure          = "Present"
        Recurse         = $True
        SourcePath      = "\\account.file.core.windows.net\testshare\Web\Site1"
        Credential      = $Cred
       }
    
  • #54915
    Profile photo of Michael Greene
    Michael Greene
    Participant

    When you say "only sometimes" can you give more detail? The same configuration sometimes works and sometimes doesn't with no changes or is it based on changes to the configuration properties?

    Is the $cred object the storage account name and storage key or an Azure AD account?

  • #54932
    Profile photo of nicklaws
    nicklaws
    Participant

    Michael,
    Thanks for the reply! No changes to the configuration. I can let it sit on the same mof for days and I will see it switch between several compliant reports to a fail report and vice versa. The $cred is the storage account name and storage key.

    -Nick

You must be logged in to reply to this topic.