Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modules] SQL server databases added support for createMode #2878

Merged
merged 14 commits into from
Mar 11, 2023
Merged

[Modules] SQL server databases added support for createMode #2878

merged 14 commits into from
Mar 11, 2023

Conversation

thofle
Copy link
Contributor

@thofle thofle commented Mar 7, 2023

Description

Adds support for createMode on microsoft.sql/servers/databases allowing replicas or restores of databases to be created.

Pipeline references

For module/pipeline changes, please create and attach the status badge of your successful run.

Pipeline

Type of Change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • My corresponding pipelines / checks run clean and green without any errors or warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (readme)
  • I did format my code

@thofle
Copy link
Contributor Author

thofle commented Mar 7, 2023

Output from "secondary" test using Test-ModuleLocally

VERBOSE: Running local tests for [servers]
VERBOSE: Using [3] tokens
VERBOSE: Applying Token Prefix '<<' and Token Suffix '>>'
VERBOSE: Processing Tokens for file: deploy.test.bicep
VERBOSE: Token Replacement Status: True
VERBOSE: Deploy Module [servers] with test file [deploy.test.bicep]
VERBOSE: Performing the operation "Deploy" on target "Module [servers] with test file [deploy.test.bicep]".
VERBOSE: Performing the operation "Trigger" on target "Deployment without parameter file".
VERBOSE: Determined deployment scope [subscription]
VERBOSE: Deploying with deployment name [s-s-secondary-t1-20230307T1303425234Z]
VERBOSE: Setting context to subscription [x]
VERBOSE: Using Bicep v0.14.46
VERBOSE:
VERBOSE: 13:31:54 - Template is valid.
VERBOSE: 13:31:56 - Create template deployment 's-s-secondary-t1-20230307T1303425234Z'
VERBOSE: 13:31:56 - Checking deployment status in 5 seconds
VERBOSE: 13:32:02 - Resource Microsoft.Resources/deployments 'avux4yttcza4a-nestedDependencies' provisioning status is running
VERBOSE: 13:32:02 - Resource Microsoft.Resources/deployments '5ouazysmi4wge-test-sqlsec' provisioning status is running
VERBOSE: 13:32:02 - Resource Microsoft.Resources/resourceGroups 'y' provisioning status is succeeded
VERBOSE: 13:32:02 - Checking deployment status in 13 seconds
VERBOSE: 13:32:16 - Resource Microsoft.Sql/servers 'tfsbx-sqlsec-pri' provisioning status is running
VERBOSE: 13:32:16 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-xajrsuoqes3lu' provisioning status is running
VERBOSE: 13:32:16 - Checking deployment status in 15 seconds
VERBOSE: 13:32:31 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-xajrsuoqes3lu' provisioning status is succeeded
VERBOSE: 13:32:32 - Checking deployment status in 15 seconds
VERBOSE: 13:32:48 - Checking deployment status in 15 seconds
VERBOSE: 13:33:04 - Resource Microsoft.Resources/deployments 'xajrsuoqes3lu-Sql-DB-0' provisioning status is running
VERBOSE: 13:33:04 - Resource Microsoft.Sql/servers/databases 'tfsbx-sqlsec-pri/db1' provisioning status is running
VERBOSE: 13:33:04 - Resource Microsoft.Sql/servers 'tfsbx-sqlsec-pri' provisioning status is succeeded
VERBOSE: 13:33:04 - Resource Microsoft.Sql/servers 'tfsbx-sqlsec-pri' provisioning status is succeeded
VERBOSE: 13:33:04 - Checking deployment status in 14 seconds
VERBOSE: 13:33:20 - Checking deployment status in 14 seconds
VERBOSE: 13:33:35 - Checking deployment status in 14 seconds
VERBOSE: 13:33:51 - Resource Microsoft.Resources/deployments '3qczk6p7xq2co-db1-shortTermBackupRetention' provisioning status is running
VERBOSE: 13:33:51 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-rcmwplq6qgkxs' provisioning status is running
VERBOSE: 13:33:51 - Resource Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies 'tfsbx-sqlsec-pri/db1/default' provisioning status is running
VERBOSE: 13:33:51 - Resource Microsoft.Resources/deployments '3qczk6p7xq2co-db1-longTermBackupRetention' provisioning status is running
VERBOSE: 13:33:51 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-vaaf4ve637ln2' provisioning status is running
VERBOSE: 13:33:51 - Resource Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies 'tfsbx-sqlsec-pri/db1/default' provisioning status is running
VERBOSE: 13:33:51 - Resource Microsoft.Sql/servers/databases 'tfsbx-sqlsec-pri/db1' provisioning status is succeeded
VERBOSE: 13:33:51 - Resource Microsoft.Sql/servers/databases 'tfsbx-sqlsec-pri/db1' provisioning status is succeeded
VERBOSE: 13:33:51 - Checking deployment status in 14 seconds
VERBOSE: 13:34:07 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-rcmwplq6qgkxs' provisioning status is succeeded
VERBOSE: 13:34:07 - Resource Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies 'tfsbx-sqlsec-pri/db1/default' provisioning status is succeeded
VERBOSE: 13:34:07 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-vaaf4ve637ln2' provisioning status is succeeded
VERBOSE: 13:34:07 - Checking deployment status in 5 seconds
VERBOSE: 13:34:15 - Checking deployment status in 5 seconds
VERBOSE: 13:34:21 - Resource Microsoft.Resources/deployments '3qczk6p7xq2co-db1-shortTermBackupRetention' provisioning status is succeeded
VERBOSE: 13:34:21 - Resource Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies 'tfsbx-sqlsec-pri/db1/default' provisioning status is succeeded
VERBOSE: 13:34:22 - Checking deployment status in 5 seconds
VERBOSE: 13:34:29 - Checking deployment status in 5 seconds
VERBOSE: 13:34:35 - Checking deployment status in 5 seconds
VERBOSE: 13:34:42 - Resource Microsoft.Resources/deployments '3qczk6p7xq2co-db1-longTermBackupRetention' provisioning status is succeeded
VERBOSE: 13:34:42 - Checking deployment status in 5 seconds
VERBOSE: 13:34:48 - Resource Microsoft.Resources/deployments 'xajrsuoqes3lu-Sql-DB-0' provisioning status is succeeded
VERBOSE: 13:34:48 - Checking deployment status in 5 seconds
VERBOSE: 13:34:56 - Checking deployment status in 16 seconds
VERBOSE: 13:35:18 - Resource Microsoft.Resources/deployments 'avux4yttcza4a-nestedDependencies' provisioning status is succeeded
VERBOSE: 13:35:18 - Resource Microsoft.Resources/deployments '5ouazysmi4wge-test-sqlsec' provisioning status is succeeded
VERBOSE: 13:35:18 - Resource Microsoft.Resources/deployments '5ouazysmi4wge-test-sqlsec' provisioning status is succeeded
VERBOSE: 13:35:18 - Resource Microsoft.Resources/deployments 'avux4yttcza4a-nestedDependencies' provisioning status is succeeded
VERBOSE: 13:35:18 - Checking deployment status in 12 seconds
VERBOSE: 13:35:36 - Resource Microsoft.Resources/deployments 'avux4yttcza4a-test-sqlsec' provisioning status is running
VERBOSE: 13:35:36 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-3xicox4aittnq' provisioning status is running
VERBOSE: 13:35:36 - Resource Microsoft.Sql/servers 'tfsbx-sqlsec-sec' provisioning status is running
VERBOSE: 13:35:36 - Checking deployment status in 9 seconds
VERBOSE: 13:35:51 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-3xicox4aittnq' provisioning status is succeeded
VERBOSE: 13:35:51 - Checking deployment status in 10 seconds
VERBOSE: 13:36:07 - Checking deployment status in 10 seconds
VERBOSE: 13:36:24 - Checking deployment status in 8 seconds
VERBOSE: 13:36:41 - Resource Microsoft.Resources/deployments '3xicox4aittnq-Sql-DB-0' provisioning status is running
VERBOSE: 13:36:41 - Resource Microsoft.Sql/servers/databases 'tfsbx-sqlsec-sec/db1' provisioning status is running
VERBOSE: 13:36:41 - Resource Microsoft.Sql/servers 'tfsbx-sqlsec-sec' provisioning status is succeeded
VERBOSE: 13:36:41 - Resource Microsoft.Sql/servers 'tfsbx-sqlsec-sec' provisioning status is succeeded
VERBOSE: 13:36:42 - Checking deployment status in 7 seconds
VERBOSE: 13:36:55 - Checking deployment status in 9 seconds
VERBOSE: 13:37:09 - Checking deployment status in 10 seconds
VERBOSE: 13:37:26 - Checking deployment status in 10 seconds
VERBOSE: 13:37:42 - Checking deployment status in 9 seconds
VERBOSE: 13:37:57 - Checking deployment status in 11 seconds
VERBOSE: 13:38:14 - Checking deployment status in 9 seconds
VERBOSE: 13:38:30 - Checking deployment status in 10 seconds
VERBOSE: 13:38:46 - Checking deployment status in 9 seconds
VERBOSE: 13:39:01 - Resource Microsoft.Resources/deployments 'pvphpwa5qxu5a-db1-shortTermBackupRetention' provisioning status is running
VERBOSE: 13:39:01 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-yimkirjvgynny' provisioning status is running
VERBOSE: 13:39:01 - Resource Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies 'tfsbx-sqlsec-sec/db1/default' provisioning status is running
VERBOSE: 13:39:01 - Resource Microsoft.Resources/deployments 'pvphpwa5qxu5a-db1-longTermBackupRetention' provisioning status is running
VERBOSE: 13:39:01 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-v356v2ukixyay' provisioning status is running
VERBOSE: 13:39:01 - Resource Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies 'tfsbx-sqlsec-sec/db1/default' provisioning status is running
VERBOSE: 13:39:01 - Resource Microsoft.Sql/servers/databases 'tfsbx-sqlsec-sec/db1' provisioning status is succeeded
VERBOSE: 13:39:01 - Resource Microsoft.Sql/servers/databases 'tfsbx-sqlsec-sec/db1' provisioning status is succeeded
VERBOSE: 13:39:01 - Checking deployment status in 10 seconds
VERBOSE: 13:39:18 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-yimkirjvgynny' provisioning status is succeeded
VERBOSE: 13:39:18 - Resource Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies 'tfsbx-sqlsec-sec/db1/default' provisioning status is succeeded
VERBOSE: 13:39:18 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-v356v2ukixyay' provisioning status is succeeded
VERBOSE: 13:39:18 - Checking deployment status in 8 seconds
VERBOSE: 13:39:33 - Resource Microsoft.Resources/deployments 'pvphpwa5qxu5a-db1-shortTermBackupRetention' provisioning status is succeeded
VERBOSE: 13:39:33 - Resource Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies 'tfsbx-sqlsec-sec/db1/default' provisioning status is succeeded
VERBOSE: 13:39:33 - Checking deployment status in 9 seconds
VERBOSE: 13:39:49 - Resource Microsoft.Resources/deployments 'pvphpwa5qxu5a-db1-longTermBackupRetention' provisioning status is succeeded
VERBOSE: 13:39:49 - Checking deployment status in 9 seconds
VERBOSE: 13:40:05 - Resource Microsoft.Resources/deployments 'avux4yttcza4a-test-sqlsec' provisioning status is succeeded
VERBOSE: 13:40:05 - Resource Microsoft.Resources/deployments '3xicox4aittnq-Sql-DB-0' provisioning status is succeeded
VERBOSE: Result
VERBOSE: ------
VERBOSE:
Id                      : /subscriptions/x/providers/Microsoft.Resources/deployments/s-s-secondary-t1-20230307T1303425234Z
DeploymentName          : s-s-secondary-t1-20230307T1303425234Z
Location                : norwayeast
ProvisioningState       : Succeeded
Timestamp               : 07/03/2023 12:39:57
Mode                    : Incremental
TemplateLink            :
Parameters              :
                          Name                 Type                       Value
                          ===================  =========================  ==========
                          resourceGroupName    String                     "y"
                          location             String                     "norwayeast"
                          serviceShort         String                     "sqlsec"
                          password             SecureString               null

Outputs                 :
DeploymentDebugLogLevel :




Name                           Value
----                           -----
DeploymentNames                {s-s-secondary-t1-20230307T1303425234Z}
DeploymentOutput
VERBOSE: Restoring Tokens
VERBOSE: Using [3] tokens
VERBOSE: Applying Token Prefix '<<' and Token Suffix '>>'
VERBOSE: Swapping 'Value' with 'Name'
VERBOSE: Processing Tokens for file: deploy.test.bicep
VERBOSE: Token Replacement Status: True

@thofle thofle marked this pull request as ready for review March 7, 2023 13:15
@thofle thofle requested a review from a team as a code owner March 7, 2023 13:15
thofle and others added 11 commits March 8, 2023 10:57
Hardcoded database name

Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
@thofle
Copy link
Contributor Author

thofle commented Mar 8, 2023

Latest run after making changes:

VERBOSE: Deploy Module [servers] with test file [deploy.test.bicep]
VERBOSE: Performing the operation "Trigger" on target "Deployment without parameter file".
VERBOSE: Determined deployment scope [subscription]
VERBOSE: Deploying with deployment name [s-s-secondary-t1-20230308T1203234247Z]
VERBOSE: Setting context to subscription [x]
VERBOSE: Using Bicep v0.14.46
VERBOSE: 
VERBOSE: 12.11.33 - Template is valid.
VERBOSE: 12.11.34 - Create template deployment 's-s-secondary-t1-20230308T1203234247Z'
VERBOSE: 12.11.34 - Checking deployment status in 5 seconds
VERBOSE: 12.11.40 - Resource Microsoft.Resources/deployments 'ybiesi2p5b2fu-nestedDependencies' provisioning status is running
VERBOSE: 12.11.40 - Resource Microsoft.Sql/servers 'tfsb-sqlsec-pri' provisioning status is running
VERBOSE: 12.11.40 - Resource Microsoft.Resources/resourceGroups 'ms.sql.servers-sqlsec-rg' provisioning status is succeeded
VERBOSE: 12.11.40 - Checking deployment status in 12 seconds
VERBOSE: 12.11.52 - Checking deployment status in 16 seconds
VERBOSE: 12.12.09 - Checking deployment status in 14 seconds
VERBOSE: 12.12.23 - Checking deployment status in 15 seconds
VERBOSE: 12.12.39 - Resource Microsoft.Sql/servers/databases 'tfsb-sqlsec-pri/db1' provisioning status is running
VERBOSE: 12.12.39 - Resource Microsoft.Sql/servers 'tfsb-sqlsec-pri' provisioning status is succeeded
VERBOSE: 12.12.39 - Checking deployment status in 15 seconds
VERBOSE: 12.12.54 - Checking deployment status in 15 seconds
VERBOSE: 12.13.10 - Checking deployment status in 15 seconds
VERBOSE: 12.13.25 - Checking deployment status in 15 seconds
VERBOSE: 12.13.41 - Resource Microsoft.Resources/deployments 'ybiesi2p5b2fu-test-sqlsec' provisioning status is running
VERBOSE: 12.13.41 - Resource Microsoft.Resources/deployments 'ybiesi2p5b2fu-nestedDependencies' provisioning status is succeeded
VERBOSE: 12.13.41 - Resource Microsoft.Sql/servers/databases 'tfsb-sqlsec-pri/db1' provisioning status is succeeded
VERBOSE: 12.13.41 - Resource Microsoft.Resources/deployments 'ybiesi2p5b2fu-nestedDependencies' provisioning status is succeeded
VERBOSE: 12.13.41 - Checking deployment status in 15 seconds
VERBOSE: 12.13.57 - Resource Microsoft.Sql/servers 'tfsb-sqlsec-sec' provisioning status is running
VERBOSE: 12.13.57 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-qnpaizrxubbgk' provisioning status is succeeded
VERBOSE: 12.13.57 - Checking deployment status in 15 seconds
VERBOSE: 12.14.13 - Checking deployment status in 14 seconds
VERBOSE: 12.14.28 - Checking deployment status in 15 seconds
VERBOSE: 12.14.44 - Checking deployment status in 14 seconds
VERBOSE: 12.14.59 - Resource Microsoft.Resources/deployments 'qnpaizrxubbgk-Sql-DB-0' provisioning status is running
VERBOSE: 12.14.59 - Resource Microsoft.Sql/servers/databases 'tfsb-sqlsec-sec/db1' provisioning status is running
VERBOSE: 12.14.59 - Resource Microsoft.Sql/servers 'tfsb-sqlsec-sec' provisioning status is succeeded
VERBOSE: 12.14.59 - Resource Microsoft.Sql/servers 'tfsb-sqlsec-sec' provisioning status is succeeded
VERBOSE: 12.14.59 - Checking deployment status in 15 seconds
VERBOSE: 12.15.16 - Checking deployment status in 14 seconds
VERBOSE: 12.15.31 - Checking deployment status in 14 seconds
VERBOSE: 12.15.46 - Checking deployment status in 15 seconds
VERBOSE: 12.16.03 - Checking deployment status in 14 seconds
VERBOSE: 12.16.18 - Checking deployment status in 15 seconds
VERBOSE: 12.16.34 - Resource Microsoft.Resources/deployments '5uzr6gqaaqwxy-db1-shortTermBackupRetention' provisioning status is running
VERBOSE: 12.16.34 - Resource Microsoft.Resources/deployments '5uzr6gqaaqwxy-db1-longTermBackupRetention' provisioning status is running
VERBOSE: 12.16.34 - Resource Microsoft.Sql/servers/databases 'tfsb-sqlsec-sec/db1' provisioning status is succeeded
VERBOSE: 12.16.34 - Resource Microsoft.Sql/servers/databases 'tfsb-sqlsec-sec/db1' provisioning status is succeeded
VERBOSE: 12.16.34 - Checking deployment status in 14 seconds
VERBOSE: 12.16.50 - Resource Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies 'tfsb-sqlsec-sec/db1/default' provisioning status is running
VERBOSE: 12.16.50 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-pufnd2ewavfby' provisioning status is running
VERBOSE: 12.16.50 - Resource Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies 'tfsb-sqlsec-sec/db1/default' provisioning status is running
VERBOSE: 12.16.50 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-eh6236dnt4ekc' provisioning status is running
VERBOSE: 12.16.50 - Checking deployment status in 14 seconds
VERBOSE: 12.17.06 - Resource Microsoft.Resources/deployments '5uzr6gqaaqwxy-db1-shortTermBackupRetention' provisioning status is succeeded
VERBOSE: 12.17.06 - Resource Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies 'tfsb-sqlsec-sec/db1/default' provisioning status is succeeded
VERBOSE: 12.17.06 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-pufnd2ewavfby' provisioning status is succeeded
VERBOSE: 12.17.06 - Resource Microsoft.Resources/deployments 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-eh6236dnt4ekc' provisioning status is succeeded
VERBOSE: 12.17.06 - Checking deployment status in 14 seconds
VERBOSE: 12.17.22 - Resource Microsoft.Resources/deployments '5uzr6gqaaqwxy-db1-longTermBackupRetention' provisioning status is succeeded
VERBOSE: 12.17.22 - Resource Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies 'tfsb-sqlsec-sec/db1/default' provisioning status is succeeded
VERBOSE: 12.17.22 - Checking deployment status in 13 seconds
VERBOSE: 12.17.37 - Resource Microsoft.Resources/deployments 'ybiesi2p5b2fu-test-sqlsec' provisioning status is succeeded
VERBOSE: 12.17.37 - Resource Microsoft.Resources/deployments 'qnpaizrxubbgk-Sql-DB-0' provisioning status is succeeded
VERBOSE: Result
VERBOSE: ------
VERBOSE: 
Id                      : /subscriptions/x/providers/Microsoft.Resources/deployments/s-s-secondary-t1-20230308T1203234247Z
DeploymentName          : s-s-secondary-t1-20230308T1203234247Z
Location                : westeurope
ProvisioningState       : Succeeded
Timestamp               : 08.03.2023 11.17.34
Mode                    : Incremental
TemplateLink            : 
Parameters              : 
                          Name                 Type                       Value     
                          ===================  =========================  ==========
                          resourceGroupName    String                     "ms.sql.servers-sqlsec-rg"
                          location             String                     "westeurope"
                          serviceShort         String                     "sqlsec"  
                          password             SecureString               null      

Outputs                 : 
DeploymentDebugLogLevel : 




Name                           Value
----                           -----
DeploymentOutput
DeploymentNames                {s-s-secondary-t1-20230308T1203234247Z}

@AlexanderSehr AlexanderSehr merged commit 7af6f27 into Azure:main Mar 11, 2023
@eriqua eriqua changed the title [Modules] Added support for createMode [Modules] SQL server databases added support for createMode Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants