Troubleshooting ERROR: The subscription is not registered to use namespace ‘Microsoft.ContainerInstance’.

While trying to create the Azure Container Instances on one of the newly created Azure Subscription, we came across this strange error, “ERROR: The subscription is not registered to use namespace ‘Microsoft.ContainerInstance'”. So we checked our configuration and the way we were creating the Azure Containers, and it all seemed okay. So we dig a little around by using PowerShell, authenticate to Azure using Login-AzureRmAccount and fire few commands.

The first command we fired was classic Get-Command to check if there are any existing cmdlets to help with Azure Resources and sure enough, there it was:
Continue reading “Troubleshooting ERROR: The subscription is not registered to use namespace ‘Microsoft.ContainerInstance’.”

Configure Code Coverage for Dotnet Core 2.0 based applications using SonarQube and Azure DevOps

Using MSBuild tool to get code coverage and configure Azure DevOps pipelines to include code coverage results is an easy task for .NET framework based applications. Azure DevOps (formerly VSTS) contains inbuilt functionality to analyze code coverage files generated and publish results back to VSTS itself. However, it is quite a challenge to get it right and working for .NET Core 2.0 based applications. In this blog post, we’ll cover steps on how to get code coverage results for .NET Core based application using SonarQube and Azure DevOps. Continue reading “Configure Code Coverage for Dotnet Core 2.0 based applications using SonarQube and Azure DevOps”

Azure DevOps build pipelines fails with error: To use the property “sonar.branch.name”, the branch plugin is required but not installed.

After upgrading our SonarQube Community version to the newly released version, our build pipelines hosted in the Azure DevOps (formerly VSTS) started failing with below errors:

“02:14:02.317 ERROR: Caused by: Validation of project reactor failed:
o To use the property “sonar.branch.name”, the branch plugin is required but not installed. See the documentation of branch support: https://redirect.sonarsource.com/doc/branches.html”

We were using the same release branches that we were using earlier and there was no changes made to the build configuration. Continue reading “Azure DevOps build pipelines fails with error: To use the property “sonar.branch.name”, the branch plugin is required but not installed.”

SonarQube fails to analyze dotnet core code with error Duplicate ProjectGuid: “00000000-0000-0000-0000-000000000000”

After making some changes to the build definition of one of the dotnet core repositories, we started observing this error with the SonarQube tasks inside the build definition in VSTS:

sonarqube code analysis task failed

When we checked the complete logs, we observed below issue:

Continue reading “SonarQube fails to analyze dotnet core code with error Duplicate ProjectGuid: “00000000-0000-0000-0000-000000000000””

Publishing Dotnet Core creates multiples nested directories

This is one of the errors that we encountered in the ASP.NET core build process. To this date, this issue can be easily reproduced by creating a ASP.NET core web api process and repeating ‘dotnet publish’ command with using an output directory and parameter –output. However, it does not happen with the simple console applications.

When we try to publish files, it creates nested multiple output directories like below: Continue reading “Publishing Dotnet Core creates multiples nested directories”

Dotnet Core 2.0 build fails with Error MSB4062: The “GetDotNetHost” task could not be loaded from the assembly

We were recently observing this issue with one of the new source code repositories for a solution that was written in .NET Core 2.0. The source code was coded using Visual Studio and it was working fine on the developers machine. However, when building it using dotnet core publish task, it kept failing with below error:

T12:47:54.2728059Z C:\Windows\ServiceProfiles\NetworkService.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.4\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(45,5): error MSB4062: The “GetDotNetHost” task could not be loaded from the assembly C:\Windows\ServiceProfiles\NetworkService.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.4\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll. Assembly with same name is already loaded Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask
Continue reading “Dotnet Core 2.0 build fails with Error MSB4062: The “GetDotNetHost” task could not be loaded from the assembly”

Azure RM Resource group deployment failed with error: Creating the deployment xx would exceed the quota of ‘800’.

Recently while deploying the source code using our CI/CD pipelines, we have got this error:

There were errors in your deployment. Error code: DeploymentQuotaExceeded.

2018-05-30T04:52:38.0042831Z ##[error]Creating the deployment ‘azuredeploy-20180430-045236-1abd’ would exceed the quota of ‘800’. The current deployment count is ‘800’, please delete some deployments before creating a new one. Please see https://aka.ms/arm-deploy for usage details.

2018-05-30T04:52:38.0051084Z ##[error]Task failed while creating or updating the template deployment.

One of the steps used by our release pipelines uses ARM template to make sure that resource being targeted has required azure configuration.
Continue reading “Azure RM Resource group deployment failed with error: Creating the deployment xx would exceed the quota of ‘800’.”