Editar

Partilhar via


New-AzSqlInstanceServerTrustCertificate

Creates a new server trust certificate.

Syntax

New-AzSqlInstanceServerTrustCertificate
   [-ResourceGroupName] <String>
   [-InstanceName] <String>
   [-Name] <String>
   [-PublicKey] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlInstanceServerTrustCertificate
   [-Name] <String>
   [-PublicKey] <String>
   [-InstanceObject] <AzureSqlManagedInstanceModel>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

New-AzSqlInstanceServerTrustCertificate cmdlet creates a server trust certificate on an Azure SQL Managed Instance.

Examples

Example 1: Create a new server trust certificate

$publicKey = "0x1C8E3F85BCD8A2C1D082CE42D7A1E8112651A906B15F5F244134142C53B050FCBF2571965C522EBB86B4F1B790F3AD31E689950EE909B87C25A1BB51DA328BEEB1BB0FD44AB3CB774B8CC9F72B486476DEB8B1C95210B84C4A0F18310CD83F299CAF0D567EBCE2DD008581622D72499F8EC9A686BA526916E7F78DCA90BA0ADD8C2E5F601017D374E2FBD0818458BFC11C8268BC21383613323153163C0F33E09D03586A3BBFDA3628F0358FBADE41602BD05C4E47CDB67A9914F35B315B7844C2F2D1352034B56D6B155D38415B816247779E7A0EB3431765D9A48F4649E647CCD2EA8F38E8B5D415833BA8337BA00FED2F00D9066B9CAEF7BAA8C553F7B8787BCEF63AC98E05372981520BD5A598356590736B547F3B300F1D710EC3003D398AEB94589E196C42C5F6A1873D6138D9F666A2D6F24DAFB12FBD6B0124B2CFFAD51EF67032832900A9E113625BE4C4FB012923BB9886B52B733A5F8BFF04122A2474828F2EE5FC66154D9EBA92A21F0BFD6E8AAEE7DCC45BB3883A410E603C9D98A5BB913853D1B7543E694FF74F8CA9174BE152A96530803DD03C15BC258E77925877BCAF748CA85230ABBF90789F4856200166D110D369FB03B6593339CCE498CDA69016289056F4638E761B9904129DB36B6B4CD17D49567C27FF11059C0569ABF48C438CB6128F2B2F245BDB066B6BF1155BCA11E9D6B0BD8A1607F2F5BB42AF7498D1B8410AA1E5E3E23A3CA6FB933D3894C8D1A2162E735CFCB7BEDFB3318DAE32AE9E24900B9B0F472ABD563550C9E696836889123F0ED2E7A9A4B90C2C617C8ADCF088CE2A7EC8AB97A80C00F3296241C7B320118A1182E327919007930417004A301249EAACF139D611D9C30DAFDF8672F5347C488250F46D45E7D7E9BF3BE99ECD1C60A046FC80EB1DC473FD2E1A7672235F8A834338A4810E32CB24C9C24D09234995A3D038D70379B900E6C9217EF19062775B050CF7CA52D3D72E294E2315AA544247B436D46AD08D55957B9688C576E35760B527B7F7EB71E6209301C59B6643C921F2FB182D237E81DC6205BF6740C8EDC48C65DAB0546C1098C2DCBF0E3B31A47868A721942022E0B5DBFFFBBC4767699C7F0ABD6DEBE7D5FB91"
New-AzSqlInstanceServerTrustCertificate -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Certificate01" -PublicKey $publicKey

ResourceGroupName : ResourceGroup01
InstanceName      : ManagedInstance01
Id                : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/serverTrustCertificates/Certificate01
Type              : Microsoft.Sql/managedInstances/serverTrustCertificates
Name              : Certificate01
Thumbprint        : 0x7D989DF34BD0FD0D2F9F6B3B6A7096856F5AB004
PublicKey         : 0x1C8E3F85BCD8A2C1D082CE42D7A1E8112651A906B15F5F244134142C53B050FCBF2571965C522EBB86B4F1B790F3AD31E689950EE909B87C25A1BB51DA328BEEB1BB0FD44AB3CB774B8CC9F72B486476DEB8B1C95210B84C4A0F18310CD83F299CAF0D567EBCE2DD008581622D72499F8EC9A686BA526916E7F78DCA90BA0ADD8C2E5F601017D374E2FBD0818458BFC11C8268BC21383613323153163C0F33E09D03586A3BBFDA3628F0358FBADE41602BD05C4E47CDB67A9914F35B315B7844C2F2D1352034B56D6B155D38415B816247779E7A0EB3431765D9A48F4649E647CCD2EA8F38E8B5D415833BA8337BA00FED2F00D9066B9CAEF7BAA8C553F7B8787BCEF63AC98E05372981520BD5A598356590736B547F3B300F1D710EC3003D398AEB94589E196C42C5F6A1873D6138D9F666A2D6F24DAFB12FBD6B0124B2CFFAD51EF67032832900A9E113625BE4C4FB012923BB9886B52B733A5F8BFF04122A2474828F2EE5FC66154D9EBA92A21F0BFD6E8AAEE7DCC45BB3883A410E603C9D98A5BB913853D1B7543E694FF74F8CA9174BE152A96530803DD03C15BC258E77925877BCAF748CA85230ABBF90789F4856200166D110D369FB03B6593339CCE498CDA69016289056F4638E761B9904129DB36B6B4CD17D49567C27FF11059C0569ABF48C438CB6128F2B2F245BDB066B6BF1155BCA11E9D6B0BD8A1607F2F5BB42AF7498D1B8410AA1E5E3E23A3CA6FB933D3894C8D1A2162E735CFCB7BEDFB3318DAE32AE9E24900B9B0F472ABD563550C9E696836889123F0ED2E7A9A4B90C2C617C8ADCF088CE2A7EC8AB97A80C00F3296241C7B320118A1182E327919007930417004A301249EAACF139D611D9C30DAFDF8672F5347C488250F46D45E7D7E9BF3BE99ECD1C60A046FC80EB1DC473FD2E1A7672235F8A834338A4810E32CB24C9C24D09234995A3D038D70379B900E6C9217EF19062775B050CF7CA52D3D72E294E2315AA544247B436D46AD08D55957B9688C576E35760B527B7F7EB71E6209301C59B6643C921F2FB182D237E81DC6205BF6740C8EDC48C65DAB0546C1098C2DCBF0E3B31A47868A721942022E0B5DBFFFBBC4767699C7F0ABD6DEBE7D5FB91

This command creates a server trust certificate with given name and public key.

Example 2: Create a new server trust certificate on a managed instance using an instance object

$publicKey = "0x1C8E3F85BCD8A2C1D082CE42D7A1E8112651A906B15F5F244134142C53B050FCBF2571965C522EBB86B4F1B790F3AD31E689950EE909B87C25A1BB51DA328BEEB1BB0FD44AB3CB774B8CC9F72B486476DEB8B1C95210B84C4A0F18310CD83F299CAF0D567EBCE2DD008581622D72499F8EC9A686BA526916E7F78DCA90BA0ADD8C2E5F601017D374E2FBD0818458BFC11C8268BC21383613323153163C0F33E09D03586A3BBFDA3628F0358FBADE41602BD05C4E47CDB67A9914F35B315B7844C2F2D1352034B56D6B155D38415B816247779E7A0EB3431765D9A48F4649E647CCD2EA8F38E8B5D415833BA8337BA00FED2F00D9066B9CAEF7BAA8C553F7B8787BCEF63AC98E05372981520BD5A598356590736B547F3B300F1D710EC3003D398AEB94589E196C42C5F6A1873D6138D9F666A2D6F24DAFB12FBD6B0124B2CFFAD51EF67032832900A9E113625BE4C4FB012923BB9886B52B733A5F8BFF04122A2474828F2EE5FC66154D9EBA92A21F0BFD6E8AAEE7DCC45BB3883A410E603C9D98A5BB913853D1B7543E694FF74F8CA9174BE152A96530803DD03C15BC258E77925877BCAF748CA85230ABBF90789F4856200166D110D369FB03B6593339CCE498CDA69016289056F4638E761B9904129DB36B6B4CD17D49567C27FF11059C0569ABF48C438CB6128F2B2F245BDB066B6BF1155BCA11E9D6B0BD8A1607F2F5BB42AF7498D1B8410AA1E5E3E23A3CA6FB933D3894C8D1A2162E735CFCB7BEDFB3318DAE32AE9E24900B9B0F472ABD563550C9E696836889123F0ED2E7A9A4B90C2C617C8ADCF088CE2A7EC8AB97A80C00F3296241C7B320118A1182E327919007930417004A301249EAACF139D611D9C30DAFDF8672F5347C488250F46D45E7D7E9BF3BE99ECD1C60A046FC80EB1DC473FD2E1A7672235F8A834338A4810E32CB24C9C24D09234995A3D038D70379B900E6C9217EF19062775B050CF7CA52D3D72E294E2315AA544247B436D46AD08D55957B9688C576E35760B527B7F7EB71E6209301C59B6643C921F2FB182D237E81DC6205BF6740C8EDC48C65DAB0546C1098C2DCBF0E3B31A47868A721942022E0B5DBFFFBBC4767699C7F0ABD6DEBE7D5FB91"
$instance = Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -Name "ManagedInstance01"
New-AzSqlInstanceServerTrustCertificate -InstanceObject $instance -Name "Certificate01" -PublicKey $publicKey

ResourceGroupName : ResourceGroup01
InstanceName      : ManagedInstance01
Id                : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/serverTrustCertificates/Certificate01
Type              : Microsoft.Sql/managedInstances/serverTrustCertificates
Name              : Certificate01
Thumbprint        : 0x7D989DF34BD0FD0D2F9F6B3B6A7096856F5AB004
PublicKey         : 0x1C8E3F85BCD8A2C1D082CE42D7A1E8112651A906B15F5F244134142C53B050FCBF2571965C522EBB86B4F1B790F3AD31E689950EE909B87C25A1BB51DA328BEEB1BB0FD44AB3CB774B8CC9F72B486476DEB8B1C95210B84C4A0F18310CD83F299CAF0D567EBCE2DD008581622D72499F8EC9A686BA526916E7F78DCA90BA0ADD8C2E5F601017D374E2FBD0818458BFC11C8268BC21383613323153163C0F33E09D03586A3BBFDA3628F0358FBADE41602BD05C4E47CDB67A9914F35B315B7844C2F2D1352034B56D6B155D38415B816247779E7A0EB3431765D9A48F4649E647CCD2EA8F38E8B5D415833BA8337BA00FED2F00D9066B9CAEF7BAA8C553F7B8787BCEF63AC98E05372981520BD5A598356590736B547F3B300F1D710EC3003D398AEB94589E196C42C5F6A1873D6138D9F666A2D6F24DAFB12FBD6B0124B2CFFAD51EF67032832900A9E113625BE4C4FB012923BB9886B52B733A5F8BFF04122A2474828F2EE5FC66154D9EBA92A21F0BFD6E8AAEE7DCC45BB3883A410E603C9D98A5BB913853D1B7543E694FF74F8CA9174BE152A96530803DD03C15BC258E77925877BCAF748CA85230ABBF90789F4856200166D110D369FB03B6593339CCE498CDA69016289056F4638E761B9904129DB36B6B4CD17D49567C27FF11059C0569ABF48C438CB6128F2B2F245BDB066B6BF1155BCA11E9D6B0BD8A1607F2F5BB42AF7498D1B8410AA1E5E3E23A3CA6FB933D3894C8D1A2162E735CFCB7BEDFB3318DAE32AE9E24900B9B0F472ABD563550C9E696836889123F0ED2E7A9A4B90C2C617C8ADCF088CE2A7EC8AB97A80C00F3296241C7B320118A1182E327919007930417004A301249EAACF139D611D9C30DAFDF8672F5347C488250F46D45E7D7E9BF3BE99ECD1C60A046FC80EB1DC473FD2E1A7672235F8A834338A4810E32CB24C9C24D09234995A3D038D70379B900E6C9217EF19062775B050CF7CA52D3D72E294E2315AA544247B436D46AD08D55957B9688C576E35760B527B7F7EB71E6209301C59B6643C921F2FB182D237E81DC6205BF6740C8EDC48C65DAB0546C1098C2DCBF0E3B31A47868A721942022E0B5DBFFFBBC4767699C7F0ABD6DEBE7D5FB91

This command creates a server trust certificate using a parent instance object.

Example 3: Create a new server trust certificate by piping an instance object

$instance = Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -Name "ManagedInstance01"
$publicKey = "0x1C8E3F85BCD8A2C1D082CE42D7A1E8112651A906B15F5F244134142C53B050FCBF2571965C522EBB86B4F1B790F3AD31E689950EE909B87C25A1BB51DA328BEEB1BB0FD44AB3CB774B8CC9F72B486476DEB8B1C95210B84C4A0F18310CD83F299CAF0D567EBCE2DD008581622D72499F8EC9A686BA526916E7F78DCA90BA0ADD8C2E5F601017D374E2FBD0818458BFC11C8268BC21383613323153163C0F33E09D03586A3BBFDA3628F0358FBADE41602BD05C4E47CDB67A9914F35B315B7844C2F2D1352034B56D6B155D38415B816247779E7A0EB3431765D9A48F4649E647CCD2EA8F38E8B5D415833BA8337BA00FED2F00D9066B9CAEF7BAA8C553F7B8787BCEF63AC98E05372981520BD5A598356590736B547F3B300F1D710EC3003D398AEB94589E196C42C5F6A1873D6138D9F666A2D6F24DAFB12FBD6B0124B2CFFAD51EF67032832900A9E113625BE4C4FB012923BB9886B52B733A5F8BFF04122A2474828F2EE5FC66154D9EBA92A21F0BFD6E8AAEE7DCC45BB3883A410E603C9D98A5BB913853D1B7543E694FF74F8CA9174BE152A96530803DD03C15BC258E77925877BCAF748CA85230ABBF90789F4856200166D110D369FB03B6593339CCE498CDA69016289056F4638E761B9904129DB36B6B4CD17D49567C27FF11059C0569ABF48C438CB6128F2B2F245BDB066B6BF1155BCA11E9D6B0BD8A1607F2F5BB42AF7498D1B8410AA1E5E3E23A3CA6FB933D3894C8D1A2162E735CFCB7BEDFB3318DAE32AE9E24900B9B0F472ABD563550C9E696836889123F0ED2E7A9A4B90C2C617C8ADCF088CE2A7EC8AB97A80C00F3296241C7B320118A1182E327919007930417004A301249EAACF139D611D9C30DAFDF8672F5347C488250F46D45E7D7E9BF3BE99ECD1C60A046FC80EB1DC473FD2E1A7672235F8A834338A4810E32CB24C9C24D09234995A3D038D70379B900E6C9217EF19062775B050CF7CA52D3D72E294E2315AA544247B436D46AD08D55957B9688C576E35760B527B7F7EB71E6209301C59B6643C921F2FB182D237E81DC6205BF6740C8EDC48C65DAB0546C1098C2DCBF0E3B31A47868A721942022E0B5DBFFFBBC4767699C7F0ABD6DEBE7D5FB91"
$instance | New-AzSqlInstanceServerTrustCertificate -Name "Certificate01" -PublicKey $publicKey

ResourceGroupName : ResourceGroup01
InstanceName      : ManagedInstance01
Id                : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/serverTrustCertificates/Certificate01
Type              : Microsoft.Sql/managedInstances/serverTrustCertificates
Name              : Certificate01
Thumbprint        : 0x7D989DF34BD0FD0D2F9F6B3B6A7096856F5AB004
PublicKey         : 0x1C8E3F85BCD8A2C1D082CE42D7A1E8112651A906B15F5F244134142C53B050FCBF2571965C522EBB86B4F1B790F3AD31E689950EE909B87C25A1BB51DA328BEEB1BB0FD44AB3CB774B8CC9F72B486476DEB8B1C95210B84C4A0F18310CD83F299CAF0D567EBCE2DD008581622D72499F8EC9A686BA526916E7F78DCA90BA0ADD8C2E5F601017D374E2FBD0818458BFC11C8268BC21383613323153163C0F33E09D03586A3BBFDA3628F0358FBADE41602BD05C4E47CDB67A9914F35B315B7844C2F2D1352034B56D6B155D38415B816247779E7A0EB3431765D9A48F4649E647CCD2EA8F38E8B5D415833BA8337BA00FED2F00D9066B9CAEF7BAA8C553F7B8787BCEF63AC98E05372981520BD5A598356590736B547F3B300F1D710EC3003D398AEB94589E196C42C5F6A1873D6138D9F666A2D6F24DAFB12FBD6B0124B2CFFAD51EF67032832900A9E113625BE4C4FB012923BB9886B52B733A5F8BFF04122A2474828F2EE5FC66154D9EBA92A21F0BFD6E8AAEE7DCC45BB3883A410E603C9D98A5BB913853D1B7543E694FF74F8CA9174BE152A96530803DD03C15BC258E77925877BCAF748CA85230ABBF90789F4856200166D110D369FB03B6593339CCE498CDA69016289056F4638E761B9904129DB36B6B4CD17D49567C27FF11059C0569ABF48C438CB6128F2B2F245BDB066B6BF1155BCA11E9D6B0BD8A1607F2F5BB42AF7498D1B8410AA1E5E3E23A3CA6FB933D3894C8D1A2162E735CFCB7BEDFB3318DAE32AE9E24900B9B0F472ABD563550C9E696836889123F0ED2E7A9A4B90C2C617C8ADCF088CE2A7EC8AB97A80C00F3296241C7B320118A1182E327919007930417004A301249EAACF139D611D9C30DAFDF8672F5347C488250F46D45E7D7E9BF3BE99ECD1C60A046FC80EB1DC473FD2E1A7672235F8A834338A4810E32CB24C9C24D09234995A3D038D70379B900E6C9217EF19062775B050CF7CA52D3D72E294E2315AA544247B436D46AD08D55957B9688C576E35760B527B7F7EB71E6209301C59B6643C921F2FB182D237E81DC6205BF6740C8EDC48C65DAB0546C1098C2DCBF0E3B31A47868A721942022E0B5DBFFFBBC4767699C7F0ABD6DEBE7D5FB91

This command creates a server trust certificate by piping a parent instance object.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InstanceName

Name of Azure SQL Managed Instance.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InstanceObject

Instance input object.

Type:AzureSqlManagedInstanceModel
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Name of the certificate.

Type:String
Aliases:CertificateName
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PublicKey

Value of certificate encoded public key.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of the resource group.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureSqlManagedInstanceModel

Outputs

AzureSqlInstanceServerTrustCertificateModel