Trying to create "Free SQL Server License: SQL Server 2019 Developer on Windows Server 2022 - Gen1" on Azure portal with free trial account. on Review + Create tab there is hourly price mentioned. Isn't it free for a month?

SSR 20 Reputation points
2024-01-14T16:31:56.1033333+00:00

User's image

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,986 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 97,996 Reputation points
    2024-01-14T16:57:01.7733333+00:00

    Hi,

    There is no charge for the SQL Server license (since it is Developer Edition), however, there are charges for the VM Compute, Disks, public IP address, bandwidth, etc. The Compute charge for the VM is only when it is not Deallocated--in other words Compute charges accrue when VM is running. Storage and other charges accrue all the time, regardless if VM is running or Deallocated.

    The above charges would be deducted from the $200 Azure Free trial first month credit, so you wouldn't pay anything in the first month.

    Please note there are certain resources that are free for the first 12 months of Azure Free account, so if you were to use one of those with above VM then it wouldn't accrue against the $200 credit. For example, if one of the disks that you attached to above VM was one of the included two free Premium P6 disks, then that would be covered and wouldn't deduct from the credit. Click on See all free services on page below to see list:

    https://azure.microsoft.com/en-us/free#all-free-services

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. SSR 20 Reputation points
    2024-04-20T15:16:26.5333333+00:00

    --Last restore of DB

    Select Destination_database_name,

       restore_date,database_name as Source_database,				
    
       Physical_device_name as Backup_file_used_to_restore 				
    

    from msdb.dbo.restorehistory rh

    inner join msdb.dbo.backupset bs

    on rh.backup_set_id=bs.backup_set_id				
    

    inner join msdb.dbo.backupmediafamily bmf

    on bs.media_set_id =bmf.media_set_id				
    

    ORDER BY [rh].[restore_date] DESC

    --Sarath login scripts

    DB_permissions

    DECLARE

    @sql VARCHAR(2048)
    
    ,@sort INT 
    

    DECLARE tmp CURSOR FOR

    /*********************************************/

    /********* DB CONTEXT STATEMENT *********/

    /*********************************************/

    SELECT '-- [-- DB CONTEXT --] --' AS [-- SQL STATEMENTS --],

        1 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT 'USE' + SPACE(1) + QUOTENAME(DB_NAME()) AS [-- SQL STATEMENTS --],

        1 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT '' AS [-- SQL STATEMENTS --],

        2 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    /*********************************************/

    /********* DB USER CREATION *********/

    /*********************************************/

    SELECT '-- [-- DB USERS --] --' AS [-- SQL STATEMENTS --],

        3 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT 'IF NOT EXISTS (SELECT [name] FROM sys.database_principals WHERE [name] = ' + SPACE(1) + '''' + [name] + '''' + ') BEGIN CREATE USER ' + SPACE(1) + QUOTENAME([name]) + ' FOR LOGIN ' + QUOTENAME([name]) + ' WITH DEFAULT_SCHEMA = ' + QUOTENAME([default_schema_name]) + SPACE(1) + 'END; ' AS [-- SQL STATEMENTS --],

        4 AS [-- RESULT ORDER HOLDER --]
    

    FROM sys.database_principals AS rm

    WHERE [type] IN ('U', 'S', 'G') -- windows users, sql users, windows groups

    UNION

    /*********************************************/

    /********* DB ROLE PERMISSIONS *********/

    /*********************************************/

    SELECT '-- [-- DB ROLES --] --' AS [-- SQL STATEMENTS --],

        5 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT 'EXEC sp_addrolemember @rolename ='

    + SPACE(1) + QUOTENAME(USER_NAME(rm.role_principal_id), '''') + ', @membername =' + SPACE(1) + QUOTENAME(USER_NAME(rm.member_principal_id), '''') AS [-- SQL STATEMENTS --],
    
        6 AS [-- RESULT ORDER HOLDER --]
    

    FROM sys.database_role_members AS rm

    WHERE USER_NAME(rm.member_principal_id) IN (

                                                --get user names on the database
    
                                                SELECT [name]
    
                                                FROM sys.database_principals
    
                                                WHERE [principal_id] > 4 -- 0 to 4 are system users/schemas
    
                                                and [type] IN ('G', 'S', 'U') -- S = SQL user, U = Windows user, G = Windows group
    
                                              )
    

    --ORDER BY rm.role_principal_id ASC

    UNION

    SELECT '' AS [-- SQL STATEMENTS --],

        7 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    /*********************************************/

    /********* OBJECT LEVEL PERMISSIONS *********/

    /*********************************************/

    SELECT '-- [-- OBJECT LEVEL PERMISSIONS --] --' AS [-- SQL STATEMENTS --],

        8 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT CASE

            WHEN perm.state <> 'W' THEN perm.state_desc 
    
            ELSE 'GRANT'
    
        END
    
        + SPACE(1) + perm.permission_name + SPACE(1) + 'ON ' + QUOTENAME(SCHEMA_NAME(obj.schema_id)) + '.' + QUOTENAME(obj.name) --select, execute, etc on specific objects
    
        + CASE
    
                WHEN cl.column_id IS NULL THEN SPACE(0)
    
                ELSE '(' + QUOTENAME(cl.name) + ')'
    
          END
    
        + SPACE(1) + 'TO' + SPACE(1) + QUOTENAME(USER_NAME(usr.principal_id)) COLLATE database_default
    
        + CASE 
    
                WHEN perm.state <> 'W' THEN SPACE(0)
    
                ELSE SPACE(1) + 'WITH GRANT OPTION'
    
          END
    
            AS [-- SQL STATEMENTS --],
    
        9 AS [-- RESULT ORDER HOLDER --]
    

    FROM

    sys.database_permissions AS perm
    
        INNER JOIN
    
    sys.objects AS obj
    
            ON perm.major_id = obj.[object_id]
    
        INNER JOIN
    
    sys.database_principals AS usr
    
            ON perm.grantee_principal_id = usr.principal_id
    
        LEFT JOIN
    
    sys.columns AS cl
    
            ON cl.column_id = perm.minor_id AND cl.[object_id] = perm.major_id
    

    --WHERE usr.name = @OldUser

    --ORDER BY perm.permission_name ASC, perm.state_desc ASC

    UNION

    SELECT '' AS [-- SQL STATEMENTS --],

    10 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    /*********************************************/

    /********* DB LEVEL PERMISSIONS *********/

    /*********************************************/

    SELECT '-- [--DB LEVEL PERMISSIONS --] --' AS [-- SQL STATEMENTS --],

        11 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT CASE

            WHEN perm.state <> 'W' THEN perm.state_desc --W=Grant With Grant Option
    
            ELSE 'GRANT'
    
        END
    
    + SPACE(1) + perm.permission_name --CONNECT, etc
    
    + SPACE(1) + 'TO' + SPACE(1) + '[' + USER_NAME(usr.principal_id) + ']' COLLATE database_default --TO <user name>
    
    + CASE 
    
            WHEN perm.state <> 'W' THEN SPACE(0) 
    
            ELSE SPACE(1) + 'WITH GRANT OPTION' 
    
      END
    
        AS [-- SQL STATEMENTS --],
    
        12 AS [-- RESULT ORDER HOLDER --]
    

    FROM sys.database_permissions AS perm

    INNER JOIN
    
    sys.database_principals AS usr
    
    ON perm.grantee_principal_id = usr.principal_id
    

    --WHERE usr.name = @OldUser

    WHERE [perm].[major_id] = 0

    AND [usr].[principal_id] > 4 -- 0 to 4 are system users/schemas
    
    AND [usr].[type] IN ('G', 'S', 'U') -- S = SQL user, U = Windows user, G = Windows group
    

    UNION

    SELECT '' AS [-- SQL STATEMENTS --],

        13 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT '-- [--DB LEVEL SCHEMA PERMISSIONS --] --' AS [-- SQL STATEMENTS --],

        14 AS [-- RESULT ORDER HOLDER --]
    

    UNION

    SELECT CASE

            WHEN perm.state <> 'W' THEN perm.state_desc --W=Grant With Grant Option
    
            ELSE 'GRANT'
    
            END
    
                + SPACE(1) + perm.permission_name --CONNECT, etc
    
                + SPACE(1) + 'ON' + SPACE(1) + class_desc + '::' COLLATE database_default --TO <user name>
    
                + QUOTENAME(SCHEMA_NAME(major_id))
    
                + SPACE(1) + 'TO' + SPACE(1) + QUOTENAME(USER_NAME(grantee_principal_id)) COLLATE database_default
    
                + CASE
    
                    WHEN perm.state <> 'W' THEN SPACE(0)
    
                    ELSE SPACE(1) + 'WITH GRANT OPTION'
    
                    END
    
            AS [-- SQL STATEMENTS --],
    
        15 AS [-- RESULT ORDER HOLDER --]
    

    from sys.database_permissions AS perm

    inner join sys.schemas s
    
        on perm.major_id = s.schema_id
    
    inner join sys.database_principals dbprin
    
        on perm.grantee_principal_id = dbprin.principal_id
    

    WHERE class = 3 --class 3 = schema

    ORDER BY [-- RESULT ORDER HOLDER --]

    OPEN tmp

    FETCH NEXT FROM tmp INTO @sql, @sort

    WHILE @@FETCH_STATUS = 0

    BEGIN

        PRINT @sql
    
        FETCH NEXT FROM tmp INTO @sql, @sort    
    

    END

    CLOSE tmp

    DEALLOCATE tmp

    --fix orphan users

    --Part 1 - Find orphaned users in current Database

    sp_change_users_login @Action='Report';

    go

    --Part 2 - Fix orphaned users in current Database

    DECLARE @SQL VARCHAR(100)

    DECLARE curSQL CURSOR

        FOR SELECT
    
                'EXEC sp_change_users_login ''UPDATE_ONE'', ''' + name
    
                + ''', ''' + name + ''''
    
            FROM
    
                sysusers
    
            WHERE
    
                issqluser = 1
    
                AND name NOT IN ('guest', 'dbo', 'sys', 'INFORMATION_SCHEMA')
    

    OPEN curSQL

    FETCH curSQL INTO @SQL

    WHILE @@FETCH_STATUS = 0

      BEGIN
    
            EXEC (
    
                  @SQL
    
                )
    
            FETCH curSQL INTO @SQL
    
      END
    

    CLOSE curSQL

    DEALLOCATE curSQL

    GO

    --Same as Part 1

    --You can comment this part out, but it shows you that the orphaned users were actually fixed.

    sp_change_users_login @Action='Report'

    go

    0 comments No comments

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.