I created a class based DSC Resource as a Powershell Module and successfully uploaded it to
Azure Automation/Modules. It has a green icon and seems to be added successfully. Now I want to use this module in State Configuration file. So I created configuration like this:
Configuration Temp01 {
Import-DscResource -ModuleName 'MyModule' -ModuleVersion 1.0.0
Node 'localhost' {
MyResource Test01 {
Param = ...
}
}
}
compiling this configuration on Azure
fails with error:
Exception calling "NewScriptBlock" with "1" argument(s): "At line:3 char:5 + Import-DscResource -ModuleName 'MyModule' -ModuleVersion 1. ... +
~~~~~~~ Could not find the module '<MyModule, 1.0.0>'." (At line:3 char:5 + Import-DscResource -ModuleName 'MyModule' -
What should I do ? How I could use my custom module in State Configuration ?

After a workaround on your issue, the process and configuration set up you have followed is good to me. Check below points that might be the cause of the conflicts.
ModuleVersionproperty matches the version you are specifying in your configuration and Azure Automation modules.nxmodule along with yourmymodule. It must be imported to compile the DSC resources if you are using PowerShell gallery. Refer MSDoc for more relevant information.Import-Module -Name 'C:\path\Module.psd1' -ModuleVersion 1.0.0Virtual machine >> Extensions + applications >> Check the version is matching with your uploaded version.Set-DscLocalConfigurationManagercommand before importing the DSC resource to apply LCM settings prior with the required version.