Hi, thank you for your question at Q&A. I understand you want to create a website secured by TLS certificate in IIS using Desired State Configuration.
I have not tried your code myself, but I notice 2 things that may be worth checking out. First of all the x in xWebsite leads me to believe you may still be using an older version of the at that time experimental module. So I recommend updating to the more current WebAdministrationDsc module You can install the module to Azure automation from the modules page by clicking the Azure Automation tab on the Installation options there.
Once you installed the updated module to Azure automation you will have to update your code with the new resource names as the resource names are slightly different in the updated module.
I think it's also worth adding a dependency to your code to make the Website resource dependant on the creation of the PFX certificate.