mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
777 B
777 B
<# .DESCRIPTION This runbook activates a SQL Server license using the Managed Identity The runbook accepts the following parameters:
-LicenseID (The license resource URI)
.NOTES
AUTHOR: Alexander (Sasha) Nosov
LASTEDIT: June 15, 2024
#>
param ( [Parameter (Mandatory= $true)] [string] $LicenseId, )
Suppress warnings
Update-AzConfig -DisplayBreakingChangeWarning $false
Logging in to Azure..."
try { Connect-AzAccount -Identity } catch { Write-Error -Message $.Exception throw $.Exception }
$currentLicense = Get-AzResource -ResourceId $LicenseId $currentLicense.properties.activationState = "Activated" $currentLicense | Set-AzResource -Force