Will the SQL Server License option on a dedicated host be in the Rest API?

유진 210 Reputation points
2024-01-26T00:53:28.37+00:00

Hello. I'm working on distributing a dedicated host with RestAPI. I'm going to distribute the same settings as the previously distributed dedicated host, but I don't have a SQL Server license option, so I always have to deal with this in Azure Portal. Can't you include this option in the Rest API? I really want it. User's image


SQL Server on Azure Virtual Machines
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 21,651 Reputation points Microsoft Employee
    2024-01-30T05:24:35.7966667+00:00

    @유진 Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on the shared screenshot, I have understood that you are trying to enable the option related to sql server license for the host group using the Rest API.

    Unfortunately, using the existing REST API Dedicated Host - Create or Update the allowed values to update the license type is for only windows server only.

    If you want to enable the SQL Server license using the Rest API use the below rest api and with appropriate request body as shown below.

    REST API:

    https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/providers/Microsoft.SoftwarePlan/hybridUseBenefits/SQL_{hostGroupName}_{hostName}?api-version=2019-06-01-preview
    
    • For SQL Server Enterprise Edition SA or Subscription option use the below request Body
    {
      "type": "Microsoft.SoftwarePlan/hybridUseBenefits",
      "sku": {
        "name": "SQL_Server_EE_AHB"
      }
    }
    
    
    • For SQL Server licenses acquired before October 1 2019 option use the below.
    {
      "type": "Microsoft.SoftwarePlan/hybridUseBenefits",
      "sku": {
        "name": "SQL_Server_Perpetual"
      }
    }
    

    Note : I have found this Rest API using the Network/fiddler(f12) traces from the browser.

    I hope the answer helps. Please let me know if you have any further queries.

    Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.