az bicep build failed using latest (v0.6.1 Latest) version of Bicep in azure devops pipeline. Issue with latest version of Bicep
It looks like there are some issue with latest version of Bicep. We are using "az bicep install" command in CICD pipeline and the lastest version of bicep failed with following error message
Installing Bicep CLI v0.6.1... Successfully installed Bicep CLI to "/apps/agent3/_work/_temp/.azclitask/bin/bicep". ERROR: Failure processing application bundle. Failed to determine location for extracting embedded files. DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and a read-write cache directory couldn't be created.
I have try the old version and it works fine. Following work fine
az bicep install --version v0.5.6
Agent: Linux
Please fix the issue with new version
I could not reproduce the issue with the ubuntu-latest build agent. Are you using self-hosted build machines?
yes, My organization is using self hosted agents. I don't have further details about agents as I don't have access but it works fine with older bicep version and never have this issue before
We are going to do some investigation on our side.
This will be very hard to debug if we don't have a clear sense of what the self-hosted agent looks like. Are you able to get us any more details?
As a workaround, you might be able to set the DOTNET_BUNDLE_EXTRACT_BASE_DIR yourself, but not sure what the value of this variable should be...
Here are some more details about the env variable: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file/overview#including-native-libraries
@sunilkhuttan Also, it might help to narrow down why the behavior is different in the newest Bicep if you set the COREHOST_TRACEFILE=t.log or COREHOST_TRACE=1 variables (see https://github.com/dotnet/runtime/issues/3821#issuecomment-548216385), once with the new Bicep and once with the old, and compare them. Thanks!
@StephenWeatherford, I try to set these variable 'COREHOST_TRACEFILE=t.log or COREHOST_TRACE=1' inside the bash script task, just before running the 'az bicep install' command and it does not produce any output in console. I am not sure if this is correct place to set these.

As an alternative I am using older version of bicep using this command and it is working fine 'az bicep install --version v0.5.6'
Following is the output

Is t.log being written out to the file system when you try this out in your pipeline? Also, can you try this with the newest v0.6.11 release?
Same issue with v0.6.11 as well

In order to solve this, we need some more debugging info. This does not appear to be a bicep-specific issue. We're happy to try to help debug this, but there may be other better forums for solving this one.
This seems related: https://github.com/dotnet/runtime/issues/53346
Will Reopen upon User Feedback/Response
Hi, I am still having the same issue. az bicep build only work with following version "az bicep install --version v0.5.6"
It does not work with latest version Here is the debug output AzTaks-Debug-output.txt
Please provide any suggestion how can I fix it, thanks
@sunilkhuttan does the problem go away if you run the following immediately before invoking the az bicep command?
export DOTNET_BUNDLE_EXTRACT_BASE_DIR="$HOME/.net"
e.g.
export DOTNET_BUNDLE_EXTRACT_BASE_DIR="$HOME/.net"
az bicep install
Thanks @anthony-c-martin it worked fine after setting the environment variable - export DOTNET_BUNDLE_EXTRACT_BASE_DIR="$HOME/.net"
Just a question, It used to work fine before when installing bicep v0.5.6 or earlier but why it failed after this specific version?
We're not sure, likely a change in dotnet although we haven't been able to track anything down. Since we don't see it we'd need more info to try to understand. But if this works for you, and since it doesn't seem to be bothering anyone else, there seems to be no reason to investigate further. Thanks!
This happens today in my azure devops pipeline (totally unrelated to az bicep). This seems to be related to the user's permission. The app is trying to exract the bundle but the user doesn't have write permission, so setting the directory as sugggested works.
In azure devops pipeline this is what I do:
export DOTNET_BUNDLE_EXTRACT_BASE_DIR="$(System.ArtifactsDirectory)/.net"