Describe the bug
The following error occurred when running "autorest" in the Azs.Backup.Admin Azure Stack module located in "...\Azure\azurestack-powershell\src\Azs.Backup.Admin". The result is no files are generated by autorest.
Here is the repository:
https://github.com/Azure/azurestack-powershell
PS C:\tasks\Azure\azurestack-powershell\src\Azs.Backup.Admin> autorest
AutoRest code generation utility [cli version: 3.0.6247; node: v12.18.3, max-memory: 2048 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
There is a new version of AutoRest available (3.0.6339).
> You can install the newer version with with npm install -g autorest@latest
Loading AutoRest core 'C:\Users\weshi1\.autorest\@[email protected]\node_modules\@autorest\core\dist' (3.0.6373)
The default version of @autorest/powershell has been bummped from 2.1+ to 3.0+.
> If you still want to use 2.1+ version, please specify it with --use:@autorest/[email protected].{x}, e.g 2.1.401.
Loading AutoRest extension '@autorest/powershell' (~3.0.0->3.0.421)
Loading AutoRest extension '@autorest/modelerfour' (4.15.414->4.15.414)
[Exception] No input files provided.
Use --help to get help information.
Expected behavior
The module should build and not throw an exception as it did in older autorest versions.
So this is actually the unexpected consequences of changing the order in which the configuration blocks are loaded so latter blocks can override previous blocks values.
The issue is that if you define the a alue in a block and try to use it in a condition in a later block it won't work.
In this case there is in this required file https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/azsadmin/resource-manager/backup/readme.md the definition of tag then its use in a condition right under.

There is some work in progress to refactor the configuration loading and resolve this issue, should hopefully get that in in the next few days. In the meantime the workaround is to either remove that condition(As it brings no value in this case) or explicitly add input-file somewhere else.
Thanks @timotheeguerin, removing the condition worked for the module.
The issue looks starting from autorest core 3.0.6372
@TheOnlyWei could you give a try to this PR https://github.com/Azure/autorest/pull/3893#issuecomment-782222109 and let me know if that resolve the issue and confirm there isn't any new problems.
The fix should be there. However as this change is quite large and could have other unexpected consequences, it won't be published to latest yet.
Please use version 3.1.0-dev.2 for now using --version:3.1.0-dev.2
Hi @timotheeguerin, the build from https://github.com/Azure/autorest/pull/3893#issuecomment-782222109 worked with the tag string put back in backup module readme.md module when I ran:
autorest --reset
autorest --version:https://tinyurl.com/yba242k3 --use:https://tinyurl.com/y94ye4vl"
The fix should be there. However as this change is quite large and could have other unexpected consequences, it won't be published to latest yet.
Please use version3.1.0-dev.2for now using--version:@autorest/[email protected]
I believe it should be --version:3.1.0-dev.2. And with this version, I will run the issue as below.
Error: Cannot resolve pipeline stage 'modelerfour/identity' for stage 'tweakm4codemodel'. Looked for pipeline stages:
- modelerfour/identity
@dalauli could you share what command line you used?
nvm, figured out, opened a seperate issue for that https://github.com/Azure/autorest/issues/3911