getService

Use this data source to access information about an existing API Management Service.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.apimanagement.getService({
name: "search-api",
resourceGroupName: "search-service",
});
export const apiManagementId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.apimanagement.get_service(name="search-api",
resource_group_name="search-service")
pulumi.export("apiManagementId", example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.ApiManagement.GetService.Invoke(new()
{
Name = "search-api",
ResourceGroupName = "search-service",
});
return new Dictionary<string, object?>
{
["apiManagementId"] = example.Apply(getServiceResult => getServiceResult.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
Name: "search-api",
ResourceGroupName: "search-service",
}, nil)
if err != nil {
return err
}
ctx.Export("apiManagementId", example.Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.apimanagement.ApimanagementFunctions;
import com.pulumi.azure.apimanagement.inputs.GetServiceArgs;
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) {
final var example = ApimanagementFunctions.getService(GetServiceArgs.builder()
.name("search-api")
.resourceGroupName("search-service")
.build());
ctx.export("apiManagementId", example.applyValue(getServiceResult -> getServiceResult.id()));
}
}
variables:
example:
fn::invoke:
function: azure:apimanagement:getService
arguments:
name: search-api
resourceGroupName: search-service
outputs:
apiManagementId: ${example.id}

Return

A collection of values returned by getService.

Parameters

argument

A collection of arguments for invoking getService.


suspend fun getService(name: String, resourceGroupName: String, tags: Map<String, String>? = null): GetServiceResult

Return

A collection of values returned by getService.

Parameters

name

The name of the API Management service.

resourceGroupName

The Name of the Resource Group in which the API Management Service exists.

tags

A mapping of tags assigned to the resource.

See also


suspend fun getService(argument: suspend GetServicePlainArgsBuilder.() -> Unit): GetServiceResult

Return

A collection of values returned by getService.

Parameters

argument

Builder for com.pulumi.azure.apimanagement.kotlin.inputs.GetServicePlainArgs.

See also