MMT
MMT

Reputation: 2111

Azure CLI create KEY for an app

I'm struggeling to find a way how one can add/create a key for the app in Azure AD using CLI?

What I mean by the key is authentication token with the expiry time under AD->App Name->Settings->Keys.

All of the documentation I have found so far is for adding everything but the key as if Microsoft again decided that it's better to CLICK like a monkey rather then use CLI or API.

Is this possible, can you create the key through CLI?

Upvotes: 1

Views: 1105

Answers (1)

Shui shengbao
Shui shengbao

Reputation: 19223

For a new Azure AD app, you could specify a key with Azure Cli 2.0. For example.

az ad app create --display-name "test" --homepage "http://localhost" --identifier-uris "https://localhost" --password "123adfaesdf"

You could use az ad app update to modify expiry time.

However, currently, Azure Cli does not support add a new key for an existing app. You also could refer to this similar question.

Upvotes: 2

Related Questions