1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. ServerKey
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

azure-native.sql.ServerKey

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

A server key.

Uses Azure REST API version 2023-08-01. In version 2.x of the Azure Native provider, it used API version 2021-11-01.

Other available API versions: 2015-05-01-preview, 2020-02-02-preview, 2020-08-01-preview, 2020-11-01-preview, 2021-02-01-preview, 2021-05-01-preview, 2021-08-01-preview, 2021-11-01, 2021-11-01-preview, 2022-02-01-preview, 2022-05-01-preview, 2022-08-01-preview, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native sql [ApiVersion]. See the version guide for details.

Example Usage

Creates or updates a server key

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var serverKey = new AzureNative.Sql.ServerKey("serverKey", new()
    {
        KeyName = "someVault_someKey_01234567890123456789012345678901",
        ResourceGroupName = "sqlcrudtest-7398",
        ServerKeyType = AzureNative.Sql.ServerKeyType.AzureKeyVault,
        ServerName = "sqlcrudtest-4645",
        Uri = "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901",
    });

});
Copy
package main

import (
	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sql.NewServerKey(ctx, "serverKey", &sql.ServerKeyArgs{
			KeyName:           pulumi.String("someVault_someKey_01234567890123456789012345678901"),
			ResourceGroupName: pulumi.String("sqlcrudtest-7398"),
			ServerKeyType:     pulumi.String(sql.ServerKeyTypeAzureKeyVault),
			ServerName:        pulumi.String("sqlcrudtest-4645"),
			Uri:               pulumi.String("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.ServerKey;
import com.pulumi.azurenative.sql.ServerKeyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var serverKey = new ServerKey("serverKey", ServerKeyArgs.builder()
            .keyName("someVault_someKey_01234567890123456789012345678901")
            .resourceGroupName("sqlcrudtest-7398")
            .serverKeyType("AzureKeyVault")
            .serverName("sqlcrudtest-4645")
            .uri("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const serverKey = new azure_native.sql.ServerKey("serverKey", {
    keyName: "someVault_someKey_01234567890123456789012345678901",
    resourceGroupName: "sqlcrudtest-7398",
    serverKeyType: azure_native.sql.ServerKeyType.AzureKeyVault,
    serverName: "sqlcrudtest-4645",
    uri: "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

server_key = azure_native.sql.ServerKey("serverKey",
    key_name="someVault_someKey_01234567890123456789012345678901",
    resource_group_name="sqlcrudtest-7398",
    server_key_type=azure_native.sql.ServerKeyType.AZURE_KEY_VAULT,
    server_name="sqlcrudtest-4645",
    uri="https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901")
Copy
resources:
  serverKey:
    type: azure-native:sql:ServerKey
    properties:
      keyName: someVault_someKey_01234567890123456789012345678901
      resourceGroupName: sqlcrudtest-7398
      serverKeyType: AzureKeyVault
      serverName: sqlcrudtest-4645
      uri: https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901
Copy

Create ServerKey Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServerKey(name: string, args: ServerKeyArgs, opts?: CustomResourceOptions);
@overload
def ServerKey(resource_name: str,
              args: ServerKeyArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def ServerKey(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              resource_group_name: Optional[str] = None,
              server_key_type: Optional[Union[str, ServerKeyType]] = None,
              server_name: Optional[str] = None,
              key_name: Optional[str] = None,
              uri: Optional[str] = None)
func NewServerKey(ctx *Context, name string, args ServerKeyArgs, opts ...ResourceOption) (*ServerKey, error)
public ServerKey(string name, ServerKeyArgs args, CustomResourceOptions? opts = null)
public ServerKey(String name, ServerKeyArgs args)
public ServerKey(String name, ServerKeyArgs args, CustomResourceOptions options)
type: azure-native:sql:ServerKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServerKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServerKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServerKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServerKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServerKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var serverKeyResource = new AzureNative.Sql.ServerKey("serverKeyResource", new()
{
    ResourceGroupName = "string",
    ServerKeyType = "string",
    ServerName = "string",
    KeyName = "string",
    Uri = "string",
});
Copy
example, err := sql.NewServerKey(ctx, "serverKeyResource", &sql.ServerKeyArgs{
	ResourceGroupName: pulumi.String("string"),
	ServerKeyType:     pulumi.String("string"),
	ServerName:        pulumi.String("string"),
	KeyName:           pulumi.String("string"),
	Uri:               pulumi.String("string"),
})
Copy
var serverKeyResource = new ServerKey("serverKeyResource", ServerKeyArgs.builder()
    .resourceGroupName("string")
    .serverKeyType("string")
    .serverName("string")
    .keyName("string")
    .uri("string")
    .build());
Copy
server_key_resource = azure_native.sql.ServerKey("serverKeyResource",
    resource_group_name="string",
    server_key_type="string",
    server_name="string",
    key_name="string",
    uri="string")
Copy
const serverKeyResource = new azure_native.sql.ServerKey("serverKeyResource", {
    resourceGroupName: "string",
    serverKeyType: "string",
    serverName: "string",
    keyName: "string",
    uri: "string",
});
Copy
type: azure-native:sql:ServerKey
properties:
    keyName: string
    resourceGroupName: string
    serverKeyType: string
    serverName: string
    uri: string
Copy

ServerKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ServerKey resource accepts the following input properties:

ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ServerKeyType
This property is required.
Changes to this property will trigger replacement.
string | Pulumi.AzureNative.Sql.ServerKeyType
The server key type like 'ServiceManaged', 'AzureKeyVault'.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
KeyName Changes to this property will trigger replacement. string
The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: YourVaultName_YourKeyName_YourKeyVersion
Uri Changes to this property will trigger replacement. string
The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to be in this format: 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion'
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ServerKeyType
This property is required.
Changes to this property will trigger replacement.
string | ServerKeyType
The server key type like 'ServiceManaged', 'AzureKeyVault'.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
KeyName Changes to this property will trigger replacement. string
The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: YourVaultName_YourKeyName_YourKeyVersion
Uri Changes to this property will trigger replacement. string
The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to be in this format: 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion'
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverKeyType
This property is required.
Changes to this property will trigger replacement.
String | ServerKeyType
The server key type like 'ServiceManaged', 'AzureKeyVault'.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
keyName Changes to this property will trigger replacement. String
The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: YourVaultName_YourKeyName_YourKeyVersion
uri Changes to this property will trigger replacement. String
The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to be in this format: 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion'
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverKeyType
This property is required.
Changes to this property will trigger replacement.
string | ServerKeyType
The server key type like 'ServiceManaged', 'AzureKeyVault'.
serverName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
keyName Changes to this property will trigger replacement. string
The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: YourVaultName_YourKeyName_YourKeyVersion
uri Changes to this property will trigger replacement. string
The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to be in this format: 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion'
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
server_key_type
This property is required.
Changes to this property will trigger replacement.
str | ServerKeyType
The server key type like 'ServiceManaged', 'AzureKeyVault'.
server_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the server.
key_name Changes to this property will trigger replacement. str
The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: YourVaultName_YourKeyName_YourKeyVersion
uri Changes to this property will trigger replacement. str
The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to be in this format: 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion'
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverKeyType
This property is required.
Changes to this property will trigger replacement.
String | "ServiceManaged" | "AzureKeyVault"
The server key type like 'ServiceManaged', 'AzureKeyVault'.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
keyName Changes to this property will trigger replacement. String
The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: YourVaultName_YourKeyName_YourKeyVersion
uri Changes to this property will trigger replacement. String
The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to be in this format: 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion'

Outputs

All input properties are implicitly available as output properties. Additionally, the ServerKey resource produces the following output properties:

AutoRotationEnabled bool
Key auto rotation opt-in flag. Either true or false.
AzureApiVersion string
The Azure API version of the resource.
CreationDate string
The server key creation date.
Id string
The provider-assigned unique ID for this managed resource.
Kind string
Kind of encryption protector. This is metadata used for the Azure portal experience.
Location string
Resource location.
Name string
Resource name.
Subregion string
Subregion of the server key.
Thumbprint string
Thumbprint of the server key.
Type string
Resource type.
AutoRotationEnabled bool
Key auto rotation opt-in flag. Either true or false.
AzureApiVersion string
The Azure API version of the resource.
CreationDate string
The server key creation date.
Id string
The provider-assigned unique ID for this managed resource.
Kind string
Kind of encryption protector. This is metadata used for the Azure portal experience.
Location string
Resource location.
Name string
Resource name.
Subregion string
Subregion of the server key.
Thumbprint string
Thumbprint of the server key.
Type string
Resource type.
autoRotationEnabled Boolean
Key auto rotation opt-in flag. Either true or false.
azureApiVersion String
The Azure API version of the resource.
creationDate String
The server key creation date.
id String
The provider-assigned unique ID for this managed resource.
kind String
Kind of encryption protector. This is metadata used for the Azure portal experience.
location String
Resource location.
name String
Resource name.
subregion String
Subregion of the server key.
thumbprint String
Thumbprint of the server key.
type String
Resource type.
autoRotationEnabled boolean
Key auto rotation opt-in flag. Either true or false.
azureApiVersion string
The Azure API version of the resource.
creationDate string
The server key creation date.
id string
The provider-assigned unique ID for this managed resource.
kind string
Kind of encryption protector. This is metadata used for the Azure portal experience.
location string
Resource location.
name string
Resource name.
subregion string
Subregion of the server key.
thumbprint string
Thumbprint of the server key.
type string
Resource type.
auto_rotation_enabled bool
Key auto rotation opt-in flag. Either true or false.
azure_api_version str
The Azure API version of the resource.
creation_date str
The server key creation date.
id str
The provider-assigned unique ID for this managed resource.
kind str
Kind of encryption protector. This is metadata used for the Azure portal experience.
location str
Resource location.
name str
Resource name.
subregion str
Subregion of the server key.
thumbprint str
Thumbprint of the server key.
type str
Resource type.
autoRotationEnabled Boolean
Key auto rotation opt-in flag. Either true or false.
azureApiVersion String
The Azure API version of the resource.
creationDate String
The server key creation date.
id String
The provider-assigned unique ID for this managed resource.
kind String
Kind of encryption protector. This is metadata used for the Azure portal experience.
location String
Resource location.
name String
Resource name.
subregion String
Subregion of the server key.
thumbprint String
Thumbprint of the server key.
type String
Resource type.

Supporting Types

ServerKeyType
, ServerKeyTypeArgs

ServiceManaged
ServiceManaged
AzureKeyVault
AzureKeyVault
ServerKeyTypeServiceManaged
ServiceManaged
ServerKeyTypeAzureKeyVault
AzureKeyVault
ServiceManaged
ServiceManaged
AzureKeyVault
AzureKeyVault
ServiceManaged
ServiceManaged
AzureKeyVault
AzureKeyVault
SERVICE_MANAGED
ServiceManaged
AZURE_KEY_VAULT
AzureKeyVault
"ServiceManaged"
ServiceManaged
"AzureKeyVault"
AzureKeyVault

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:sql:ServerKey sqlcrudtest-4645 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi