Tidy up - Unused Project and Nuget package reference using Visual Studio 2019

If you are a Developer/Architect using Visual Studio as IDE for your development activities, this blog post will be of your interest. During the Ignite 2021 conference, Microsoft released Visual Studio 2019 v16.9 and v16.10 Preview 1. As part of version 16.10 Preview 1, one of the cool features they introduced is to "Remove Unused References..." for any Projects and Nuget packages that are not in use. At the time of writing this blog post, we have Visual Studio Version 16.10.0 (official release) which includes this new feature.  As part of development, we generally get carried away and introduce new Nuget package references to your project and add new references to your Projects. By the end of development, you will not be 100% sure which are not being referenced and unused which means you will leave those unused project references in your application. Now you might be wondering what's the big deal in it since it doesn't harm. The advantage of removing unused project r

Setting up Azure Service Connection in Azure DevOps


You can specify your Azure subscription directly in the release pipeline task, or you can use an organizational account or a Service Principal and configure Service connection in Azure DevOps. 

In this post will see how Service Principal can be created.


Tools which can be used to create Service Principal in Azure:
Irrespective of the tool choice commands remain same. There are two types of authentication available for service principals: Password-based authentication, and certificate-based authentication.This post we will be looking demonstrating Password-based authentication.

Steps

1.      Log into Azure by running the below command. When prompted, open the browser and login with Microsoft credentials.

az login

2.      Create a Service Principal by running the following command. The output displayed will be similar to the screenshot below.

az ad sp create-for-rbac --name <http://AzureDevOps>

Note: AppId and Password from this step which will be used in future steps

3.      Role assignment for the Service Principal. The output displayed will be similar to the screenshot below. Output should display the role definition what we have provided.

az role assignment create --assignee <AppId> --role Contributor

If you are receiving null information back after running this command, you can also check in the azure Portal by logging into your azure subscription and in the Azure Portal going to Subscriptions > Access control (IAM).

4.      Log in with the Service Principal to verify if the access is working fine by running the following command. Use the values from Step 2 for AppId, Password and Tenant_ID.

az login --service-principal --username <App_Id> --password <Password> --tenant <TENANT_ID>


Comments

RavishKumar said…
perfect Raju Bhai !!!

Popular posts from this blog

Tidy up - Unused Project and Nuget package reference using Visual Studio 2019

Swagger UI for Azure Function v2 & v3 APIs

Authenticate Azure Functions - API Keys