New-CmAzPaasSql

Create SQL databases

Completes following:

  • Creates SQL Server.
  • Creates databases.
  • Configures firewall (for postgres mariaDB mysql)
  • Enable log analytics (Optional)

This command forms part of the PaaS Building Block.

Parameters

-SettingsFile

Required. (String) File path for the settings file to be converted into a settings object.

-SettingsObject

Required. (Object) Object containing the configuration values required to run this cmdlet.

-TagSettingsFile

Required. (String) File path for the tag settings file to be converted into a tag settings object.

-WhatIf

(Switch) Run the command without executing any actions, so that no changes are made. The command will output a description of actions to be performed against the affected resources in the console window. Use this option if you are unsure of the overall impact of your command and wish to review it before committing to making changes.

-Confirm

(Switch) Run the command without executing any actions, so that no changes are made. The command will output a description of actions to be performed against the affected resources in the console window. Use this option if you are unsure of the overall impact of your command and wish to review it before committing to making changes.

Usage

Example 1

1
New-CmAzPaasSql -SettingsFile ./sql.yml

Example 2

1
New-CmAzPaasSql -SettingsObject $settings

Settings

Beta documentation
The following schema documentation is automatically generated as part of a recent roadmap task. There may be inaccuracies or incomplete information while we flush out bugs; please refer to the packed project settings examples where necessary.

Settings Root.

Component

component [string | null]

Value to determine what cmdlet should be dynamically loaded for these settings.

Location

location [string] Mandatory

Deployment location for all resources.

Service

service [object] Mandatory

Contains dependency and publish details for service location.

Dependencies

dependencies [object]

Contains dependency details for service location.

ResourceGroup

resourceGroup [string]

Dependency value to fetch existing resource type.

Workpace

workpace [string | null]

Dependency value to fetch existing resource type.

Keyvault

keyvault [string | null]

Global overriding dependency value to fetch existing resource type.

Publish

publish [object | null]

Global default value to publish on deployed resource type.

Server

server [string | null]

Global default value to publish on deployed resource type.

Database

database [string | null]

Global default value to publish on deployed resource type.

ElasticPool

elasticPool [string | null]

Global default value to publish on deployed resource type.

LogRetentionPeriodInDays

logRetentionPeriodInDays [integer | null]

Retention in days for SQLSecurityAuditEvents in an existing workspace.

Default:30

SqlConfig

sqlConfig [array] Mandatory

Container of details required to deploy servers, databases and/or other associated resources.

Family

family [string]

The database product to use.

Valid values:"azureSql" , "postgressql" , "mariaDb" , "mySql"

Type

type [string | null]

The type of db instance to use.

Default:

Valid values:"single" , "elasticPool" , "managed" , "" , ""

ServerName

serverName [string]

Becomes part of the generated server's name, if no db is defined, one db is created with this value as part of the db's generated name.

ElasticPoolName

elasticPoolName [string | null]

Becomes part of the generated elastic pool's name

Service

service [object | null] Mandatory

Contains dependency and publish details for service location.

Publish

publish [object | null]

Contains publish details for service location.

Server

server [string | null]

Local overriding value to publish on deployed existing resource type.

ElasticPool

elasticPool [string | null]

Local overriding value to publish on deployed existing resource type.

Dependencies

dependencies [object | null]

Contains dependency details for service location.

Keyvault

keyvault [string | null]

Local overriding dependency value to fetch existing resource type.

Version

version [string | null]

An explanation about purpose of this instance.

Databases

databases [array | null]

List of details required to deploy all databases.

AdministratorLogin

administratorLogin [string]

Administrator username.

PasswordSecretName

passwordsecretName [string]

Name of secret in an existing key vault which represents the administrator password.

Sku

sku [object]

Sku details container.

Name

name [string]

The sku name.

Capacity

capacity [integer]

The sku capacity.

FirewallRules

firewallRules [array | null]

List of ip ranges required to deploy all firewall rules.

StartIpAddress

startIpAddress [string | null]

Minimum ip address value in range. Must follow ipv4 format.

Default:0.0.0.0

EndIpAddress

endIpAddress [string | null]

Maximum ip address value in range. Must follow ipv4 format.

Default:255.255.255.255

Examples

The following example files are automatically generated from the settings file schema definition to show how the specification can be used in practise. Cloudmarque can accept both JSON and YAML parameter files.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  "component": "string",
  "location": "string",
  "service": {
    "dependencies": {
      "resourceGroup": "string",
      "workpace": "string",
      "keyvault": "string"
    },
    "publish": {
      "server": "string",
      "database": "string",
      "elasticPool": "string"
    }
  },
  "logRetentionPeriodInDays": "30",
  "sqlConfig": [
    {
      "family": "azureSql",
      "type": "single",
      "serverName": "string",
      "elasticPoolName": "string",
      "service": {
        "publish": {
          "server": "string",
          "elasticPool": "string"
        },
        "dependencies": {
          "keyvault": "string"
        }
      },
      "version": "string",
      "databases": [

      ],
      "administratorLogin": "string",
      "passwordsecretName": "string",
      "sku": {
        "name": "string",
        "capacity": 0
      },
      "firewallRules": [
        {
          "startIpAddress": "0.0.0.0",
          "endIpAddress": "255.255.255.255"
        }
      ]
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
component: "string"    # Optional
location: "string"    # Mandatory
service:     # Mandatory
  dependencies:     # Mandatory
    resourceGroup: "string"    # Mandatory
    workpace: "string"    # Optional
    keyvault: "string"    # Optional
  publish:     # Optional
    server: "string"    # Optional
    database: "string"    # Optional
    elasticPool: "string"    # Optional
logRetentionPeriodInDays: "30"    # Optional
sqlConfig:     # Mandatory
  - family: "azureSql"    # Mandatory
    type: "single"    # Optional
    serverName: "string"    # Mandatory
    elasticPoolName: "string"    # Optional
    service:     # Optional
      publish:     # Optional
        server: "string"    # Optional
        elasticPool: "string"    # Optional
      dependencies:     # Optional
        keyvault: "string"    # Optional
    version: "string"    # Optional
    databases:     # Optional
      -     administratorLogin: "string"    # Mandatory
    passwordsecretName: "string"    # Mandatory
    sku:     # Mandatory
      name: "string"    # Mandatory
      capacity: 0    # Mandatory
    firewallRules:     # Optional
      - startIpAddress: "0.0.0.0"    # Mandatory
        endIpAddress: "255.255.255.255"    # Mandatory