diff --git a/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/README.md b/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/README.md index 2ce4b9ac..9a2d7cfb 100644 --- a/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/README.md +++ b/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/README.md @@ -27,7 +27,7 @@ You can scahedule to run the the command as a runbook. To set it up using Azure 1. Open a command shell on your device and run this command. It will copy the script to your local folder. ```console -curl https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.md -o activate-pcore-license.ps1 +curl https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.ps1 -o activate-pcore-license.ps1 ``` 1. [Create a new automation account](https://ms.portal.azure.com/#create/Microsoft.AutomationAccount) or open an existing one. In the Advanced section, make sure that *System assigned identity* is selecetd. 1. In the **Process automation** group select **Runbooks** diff --git a/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.md b/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.ps1 similarity index 95% rename from samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.md rename to samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.ps1 index cb4b28fb..ffaa1bcd 100644 --- a/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.md +++ b/samples/manage/azure-arc-enabled-sql-server/activate-pcore-license/activate-pcore-license.ps1 @@ -1,36 +1,36 @@ -.<# - .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 24, 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 - +.<# + .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 24, 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 +