Azure / Azure/azure-powershell

[Feature]: New-AzSqlDatabaseImport authenticate using an access token instead of username / password.

Open
#18,023 3 comments 3 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad customer-reported feature-request Service Attention SQL
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description of the new feature

Today, New-AzSqlDatabaseImport authenticate using username / password.

It would be nice to be able to authenticate via access token, using the following command where I've replaced
-AdministratorLogin $Credential.UserName -AdministratorLoginPassword $Credential.Password
with
-AccessToken = (Get-AzAccessToken -ResourceUrl https://database.windows.net).Token

$importRequest = New-AzSqlDatabaseImport `
-ResourceGroupName $SqlServer.ResourceGroupName -ServerName $SqlServer.ServerName `
-DatabaseName $DatabaseName `
-AccessToken = (Get-AzAccessToken -ResourceUrl https://database.windows.net).Token `
-Edition GeneralPurpose `
-StorageKeyType StorageAccessKey `
-StorageUri $storageURI `
-StorageKey $storageKey `
-ServiceObjectiveName GP_S_Gen5_4 `
-DatabaseMaxSizeBytes $DatabaseMaxSizeBytes

Current installed versions:

az version
{
"azure-cli": "2.35.0",
"azure-cli-core": "2.35.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {}
}

### Proposed implementation details (optional)

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.