1. Packages
  2. Azure Native v2
  3. API Docs
  4. cache
  5. LinkedServer
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.cache.LinkedServer

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

Response to put/get linked server (with properties) for Redis cache. Azure REST API version: 2023-04-01. Prior API version in Azure Native 1.x: 2020-06-01.

Other available API versions: 2023-05-01-preview, 2023-08-01, 2024-03-01, 2024-04-01-preview, 2024-11-01.

Example Usage

LinkedServer_Create

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

return await Deployment.RunAsync(() => 
{
    var linkedServer = new AzureNative.Cache.LinkedServer("linkedServer", new()
    {
        LinkedRedisCacheId = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2",
        LinkedRedisCacheLocation = "West US",
        LinkedServerName = "cache2",
        Name = "cache1",
        ResourceGroupName = "rg1",
        ServerRole = AzureNative.Cache.ReplicationRole.Secondary,
    });

});
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cache.NewLinkedServer(ctx, "linkedServer", &cache.LinkedServerArgs{
			LinkedRedisCacheId:       pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2"),
			LinkedRedisCacheLocation: pulumi.String("West US"),
			LinkedServerName:         pulumi.String("cache2"),
			Name:                     pulumi.String("cache1"),
			ResourceGroupName:        pulumi.String("rg1"),
			ServerRole:               cache.ReplicationRoleSecondary,
		})
		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.cache.LinkedServer;
import com.pulumi.azurenative.cache.LinkedServerArgs;
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 linkedServer = new LinkedServer("linkedServer", LinkedServerArgs.builder()
            .linkedRedisCacheId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2")
            .linkedRedisCacheLocation("West US")
            .linkedServerName("cache2")
            .name("cache1")
            .resourceGroupName("rg1")
            .serverRole("Secondary")
            .build());

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

const linkedServer = new azure_native.cache.LinkedServer("linkedServer", {
    linkedRedisCacheId: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2",
    linkedRedisCacheLocation: "West US",
    linkedServerName: "cache2",
    name: "cache1",
    resourceGroupName: "rg1",
    serverRole: azure_native.cache.ReplicationRole.Secondary,
});
Copy
import pulumi
import pulumi_azure_native as azure_native

linked_server = azure_native.cache.LinkedServer("linkedServer",
    linked_redis_cache_id="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2",
    linked_redis_cache_location="West US",
    linked_server_name="cache2",
    name="cache1",
    resource_group_name="rg1",
    server_role=azure_native.cache.ReplicationRole.SECONDARY)
Copy
resources:
  linkedServer:
    type: azure-native:cache:LinkedServer
    properties:
      linkedRedisCacheId: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2
      linkedRedisCacheLocation: West US
      linkedServerName: cache2
      name: cache1
      resourceGroupName: rg1
      serverRole: Secondary
Copy

Create LinkedServer Resource

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

Constructor syntax

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

@overload
def LinkedServer(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 linked_redis_cache_id: Optional[str] = None,
                 linked_redis_cache_location: Optional[str] = None,
                 name: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 server_role: Optional[ReplicationRole] = None,
                 linked_server_name: Optional[str] = None)
func NewLinkedServer(ctx *Context, name string, args LinkedServerArgs, opts ...ResourceOption) (*LinkedServer, error)
public LinkedServer(string name, LinkedServerArgs args, CustomResourceOptions? opts = null)
public LinkedServer(String name, LinkedServerArgs args)
public LinkedServer(String name, LinkedServerArgs args, CustomResourceOptions options)
type: azure-native:cache:LinkedServer
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. LinkedServerArgs
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. LinkedServerArgs
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. LinkedServerArgs
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. LinkedServerArgs
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. LinkedServerArgs
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 linkedServerResource = new AzureNative.Cache.LinkedServer("linkedServerResource", new()
{
    LinkedRedisCacheId = "string",
    LinkedRedisCacheLocation = "string",
    Name = "string",
    ResourceGroupName = "string",
    ServerRole = "Primary",
    LinkedServerName = "string",
});
Copy
example, err := cache.NewLinkedServer(ctx, "linkedServerResource", &cache.LinkedServerArgs{
	LinkedRedisCacheId:       "string",
	LinkedRedisCacheLocation: "string",
	Name:                     "string",
	ResourceGroupName:        "string",
	ServerRole:               "Primary",
	LinkedServerName:         "string",
})
Copy
var linkedServerResource = new LinkedServer("linkedServerResource", LinkedServerArgs.builder()
    .linkedRedisCacheId("string")
    .linkedRedisCacheLocation("string")
    .name("string")
    .resourceGroupName("string")
    .serverRole("Primary")
    .linkedServerName("string")
    .build());
Copy
linked_server_resource = azure_native.cache.LinkedServer("linkedServerResource",
    linked_redis_cache_id=string,
    linked_redis_cache_location=string,
    name=string,
    resource_group_name=string,
    server_role=Primary,
    linked_server_name=string)
Copy
const linkedServerResource = new azure_native.cache.LinkedServer("linkedServerResource", {
    linkedRedisCacheId: "string",
    linkedRedisCacheLocation: "string",
    name: "string",
    resourceGroupName: "string",
    serverRole: "Primary",
    linkedServerName: "string",
});
Copy
type: azure-native:cache:LinkedServer
properties:
    linkedRedisCacheId: string
    linkedRedisCacheLocation: string
    linkedServerName: string
    name: string
    resourceGroupName: string
    serverRole: Primary
Copy

LinkedServer 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 LinkedServer resource accepts the following input properties:

LinkedRedisCacheId This property is required. string
Fully qualified resourceId of the linked redis cache.
LinkedRedisCacheLocation
This property is required.
Changes to this property will trigger replacement.
string
Location of the linked redis cache.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name of the Redis cache.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
ServerRole This property is required. Pulumi.AzureNative.Cache.ReplicationRole
Role of the linked server.
LinkedServerName Changes to this property will trigger replacement. string
The name of the linked server that is being added to the Redis cache.
LinkedRedisCacheId This property is required. string
Fully qualified resourceId of the linked redis cache.
LinkedRedisCacheLocation
This property is required.
Changes to this property will trigger replacement.
string
Location of the linked redis cache.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name of the Redis cache.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
ServerRole This property is required. ReplicationRole
Role of the linked server.
LinkedServerName Changes to this property will trigger replacement. string
The name of the linked server that is being added to the Redis cache.
linkedRedisCacheId This property is required. String
Fully qualified resourceId of the linked redis cache.
linkedRedisCacheLocation
This property is required.
Changes to this property will trigger replacement.
String
Location of the linked redis cache.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of the Redis cache.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
serverRole This property is required. ReplicationRole
Role of the linked server.
linkedServerName Changes to this property will trigger replacement. String
The name of the linked server that is being added to the Redis cache.
linkedRedisCacheId This property is required. string
Fully qualified resourceId of the linked redis cache.
linkedRedisCacheLocation
This property is required.
Changes to this property will trigger replacement.
string
Location of the linked redis cache.
name
This property is required.
Changes to this property will trigger replacement.
string
The name of the Redis cache.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group.
serverRole This property is required. ReplicationRole
Role of the linked server.
linkedServerName Changes to this property will trigger replacement. string
The name of the linked server that is being added to the Redis cache.
linked_redis_cache_id This property is required. str
Fully qualified resourceId of the linked redis cache.
linked_redis_cache_location
This property is required.
Changes to this property will trigger replacement.
str
Location of the linked redis cache.
name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Redis cache.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group.
server_role This property is required. ReplicationRole
Role of the linked server.
linked_server_name Changes to this property will trigger replacement. str
The name of the linked server that is being added to the Redis cache.
linkedRedisCacheId This property is required. String
Fully qualified resourceId of the linked redis cache.
linkedRedisCacheLocation
This property is required.
Changes to this property will trigger replacement.
String
Location of the linked redis cache.
name
This property is required.
Changes to this property will trigger replacement.
String
The name of the Redis cache.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group.
serverRole This property is required. "Primary" | "Secondary"
Role of the linked server.
linkedServerName Changes to this property will trigger replacement. String
The name of the linked server that is being added to the Redis cache.

Outputs

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

GeoReplicatedPrimaryHostName string
The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
Id string
The provider-assigned unique ID for this managed resource.
PrimaryHostName string
The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover.
ProvisioningState string
Terminal state of the link between primary and secondary redis cache.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
GeoReplicatedPrimaryHostName string
The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
Id string
The provider-assigned unique ID for this managed resource.
PrimaryHostName string
The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover.
ProvisioningState string
Terminal state of the link between primary and secondary redis cache.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
geoReplicatedPrimaryHostName String
The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
id String
The provider-assigned unique ID for this managed resource.
primaryHostName String
The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover.
provisioningState String
Terminal state of the link between primary and secondary redis cache.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
geoReplicatedPrimaryHostName string
The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
id string
The provider-assigned unique ID for this managed resource.
primaryHostName string
The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover.
provisioningState string
Terminal state of the link between primary and secondary redis cache.
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
geo_replicated_primary_host_name str
The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
id str
The provider-assigned unique ID for this managed resource.
primary_host_name str
The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover.
provisioning_state str
Terminal state of the link between primary and secondary redis cache.
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
geoReplicatedPrimaryHostName String
The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
id String
The provider-assigned unique ID for this managed resource.
primaryHostName String
The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover.
provisioningState String
Terminal state of the link between primary and secondary redis cache.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Supporting Types

ReplicationRole
, ReplicationRoleArgs

Primary
Primary
Secondary
Secondary
ReplicationRolePrimary
Primary
ReplicationRoleSecondary
Secondary
Primary
Primary
Secondary
Secondary
Primary
Primary
Secondary
Secondary
PRIMARY
Primary
SECONDARY
Secondary
"Primary"
Primary
"Secondary"
Secondary

Import

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

$ pulumi import azure-native:cache:LinkedServer cache2 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName} 
Copy

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

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi