Home > Software engineering >  Is it possible to log into Azure from my .net core app using just user and pass?
Is it possible to log into Azure from my .net core app using just user and pass?

Time:10-05

I'm trying to log into Azure from my application to get some blob from Azure Blob. The Azure.Identity nugget package has some methods for that, like some TokenCredentials class and, what I wanted to use, UsernamePasswordCredential Class, which an example of it's constructor called is something like this:

    private TokenCredential GetAzureBlobTokenCredential(DataProtectionSettings options)
    {
        return new UsernamePasswordCredential(options.AzureUser, options.AzurePass, options.AzureTenantId, options.AzureClientId);
    }

But it seems that I cannot use it without a tenantId and clientId (passing the params as null returns a NullArgumentException). I would like to use an "admin" user and pass without the need of registering the applications, because this will be a traversal user used in different apps. It's that possible? Is there an alternative? Or should I stick with the tenantId and clientId?

CodePudding user response:

You always need to register an application. To acquire a token, you need a client id.

  • Related