Viewing docs for Defang Azure v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang
Viewing docs for Defang Azure v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang
Create Service Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Service(name: string, args: ServiceArgs, opts?: ComponentResourceOptions);@overload
def Service(resource_name: str,
args: ServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Service(resource_name: str,
opts: Optional[ResourceOptions] = None,
image: Optional[str] = None,
command: Optional[Sequence[str]] = None,
deploy: Optional[_compose.DeployConfigArgs] = None,
domain_name: Optional[str] = None,
entrypoint: Optional[Sequence[str]] = None,
environment: Optional[Mapping[str, str]] = None,
health_check: Optional[_compose.HealthCheckConfigArgs] = None,
platform: Optional[str] = None,
ports: Optional[Sequence[_compose.ServicePortConfigArgs]] = None,
project_name: Optional[str] = None)func NewService(ctx *Context, name string, args ServiceArgs, opts ...ResourceOption) (*Service, error)public Service(string name, ServiceArgs args, ComponentResourceOptions? opts = null)
public Service(String name, ServiceArgs args)
public Service(String name, ServiceArgs args, ComponentResourceOptions options)
type: defang-azure:Service
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "defang-azure_service" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- options ComponentResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var serviceResource = new DefangAzure.Service("serviceResource", new()
{
Image = "string",
Command = new[]
{
"string",
},
Deploy = new DefangAzure.Compose.Inputs.DeployConfigArgs
{
Replicas = 0,
Resources = new DefangAzure.Compose.Inputs.ResourcesArgs
{
Reservations = new DefangAzure.Compose.Inputs.ResourceConfigArgs
{
Cpus = 0,
Memory = "string",
},
},
},
DomainName = "string",
Entrypoint = new[]
{
"string",
},
Environment =
{
{ "string", "string" },
},
HealthCheck = new DefangAzure.Compose.Inputs.HealthCheckConfigArgs
{
IntervalSeconds = 0,
Retries = 0,
StartPeriodSeconds = 0,
Test = new[]
{
"string",
},
TimeoutSeconds = 0,
},
Platform = "string",
Ports = new[]
{
new DefangAzure.Compose.Inputs.ServicePortConfigArgs
{
Target = 0,
AppProtocol = "string",
Listener = "string",
Mode = "string",
Protocol = "string",
},
},
ProjectName = "string",
});
example, err := defangazure.NewService(ctx, "serviceResource", &defangazure.ServiceArgs{
Image: pulumi.String("string"),
Command: pulumi.StringArray{
"string",
},
Deploy: &compose.DeployConfigArgs{
Replicas: pulumi.Int(0),
Resources: &compose.ResourcesArgs{
Reservations: &compose.ResourceConfigArgs{
Cpus: pulumi.Float64(0),
Memory: pulumi.String("string"),
},
},
},
DomainName: "string",
Entrypoint: pulumi.StringArray{
"string",
},
Environment: pulumi.StringMap{
"string": pulumi.String("string"),
},
HealthCheck: &compose.HealthCheckConfigArgs{
IntervalSeconds: pulumi.Int(0),
Retries: pulumi.Int(0),
StartPeriodSeconds: pulumi.Int(0),
Test: pulumi.StringArray{
pulumi.String("string"),
},
TimeoutSeconds: pulumi.Int(0),
},
Platform: "string",
Ports: compose.ServicePortConfigArray{
&compose.ServicePortConfigArgs{
Target: pulumi.Int(0),
AppProtocol: pulumi.String("string"),
Listener: pulumi.String("string"),
Mode: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
},
ProjectName: "string",
})
resource "defang-azure_service" "serviceResource" {
image = "string"
command = ["string"]
deploy = {
replicas = 0
resources = {
reservations = {
cpus = 0
memory = "string"
}
}
}
domain_name = "string"
entrypoint = ["string"]
environment = {
"string" = "string"
}
health_check = {
interval_seconds = 0
retries = 0
start_period_seconds = 0
test = ["string"]
timeout_seconds = 0
}
platform = "string"
ports {
target = 0
app_protocol = "string"
listener = "string"
mode = "string"
protocol = "string"
}
project_name = "string"
}
var serviceResource = new Service("serviceResource", ServiceArgs.builder()
.image("string")
.command("string")
.deploy(DeployConfigArgs.builder()
.replicas(0)
.resources(ResourcesArgs.builder()
.reservations(ResourceConfigArgs.builder()
.cpus(0.0)
.memory("string")
.build())
.build())
.build())
.domainName("string")
.entrypoint("string")
.environment(Map.of("string", "string"))
.healthCheck(HealthCheckConfigArgs.builder()
.intervalSeconds(0)
.retries(0)
.startPeriodSeconds(0)
.test("string")
.timeoutSeconds(0)
.build())
.platform("string")
.ports(ServicePortConfigArgs.builder()
.target(0)
.appProtocol("string")
.listener("string")
.mode("string")
.protocol("string")
.build())
.projectName("string")
.build());
service_resource = defang_azure.Service("serviceResource",
image="string",
command=["string"],
deploy={
"replicas": 0,
"resources": {
"reservations": {
"cpus": float(0),
"memory": "string",
},
},
},
domain_name="string",
entrypoint=["string"],
environment={
"string": "string",
},
health_check={
"interval_seconds": 0,
"retries": 0,
"start_period_seconds": 0,
"test": ["string"],
"timeout_seconds": 0,
},
platform="string",
ports=[{
"target": 0,
"app_protocol": "string",
"listener": "string",
"mode": "string",
"protocol": "string",
}],
project_name="string")
const serviceResource = new defang_azure.Service("serviceResource", {
image: "string",
command: ["string"],
deploy: {
replicas: 0,
resources: {
reservations: {
cpus: 0,
memory: "string",
},
},
},
domainName: "string",
entrypoint: ["string"],
environment: {
string: "string",
},
healthCheck: {
intervalSeconds: 0,
retries: 0,
startPeriodSeconds: 0,
test: ["string"],
timeoutSeconds: 0,
},
platform: "string",
ports: [{
target: 0,
appProtocol: "string",
listener: "string",
mode: "string",
protocol: "string",
}],
projectName: "string",
});
type: defang-azure:Service
properties:
command:
- string
deploy:
replicas: 0
resources:
reservations:
cpus: 0
memory: string
domainName: string
entrypoint:
- string
environment:
string: string
healthCheck:
intervalSeconds: 0
retries: 0
startPeriodSeconds: 0
test:
- string
timeoutSeconds: 0
image: string
platform: string
ports:
- appProtocol: string
listener: string
mode: string
protocol: string
target: 0
projectName: string
Service 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 Service resource accepts the following input properties:
- Image string
- Command List<string>
- Deploy
Defang
Labs. Defang Azure. Compose. Inputs. Deploy Config - Domain
Name string - Entrypoint List<string>
- Environment Dictionary<string, string>
- Health
Check DefangLabs. Defang Azure. Compose. Inputs. Health Check Config - Platform string
- Ports
List<Defang
Labs. Defang Azure. Compose. Inputs. Service Port Config> - Project
Name string
- Image string
- Command []string
- Deploy
Deploy
Config Args - Domain
Name string - Entrypoint []string
- Environment map[string]string
- Health
Check HealthCheck Config Args - Platform string
- Ports
Service
Port Config Args - Project
Name string
- image string
- command list(string)
- deploy object
- domain_
name string - entrypoint list(string)
- environment map(string)
- health_
check object - platform string
- ports list(object)
- project_
name string
- image String
- command List<String>
- deploy
Deploy
Config - domain
Name String - entrypoint List<String>
- environment Map<String,String>
- health
Check HealthCheck Config - platform String
- ports
List<Service
Port Config> - project
Name String
- image string
- command string[]
- deploy
compose
Deploy Config - domain
Name string - entrypoint string[]
- environment {[key: string]: string}
- health
Check composeHealth Check Config - platform string
- ports
compose
Service Port Config[] - project
Name string
- image str
- command Sequence[str]
- deploy
compose.
Deploy Config Args - domain_
name str - entrypoint Sequence[str]
- environment Mapping[str, str]
- health_
check compose.Health Check Config Args - platform str
- ports
Sequence[compose.
Service Port Config Args] - project_
name str
- image String
- command List<String>
- deploy Property Map
- domain
Name String - entrypoint List<String>
- environment Map<String>
- health
Check Property Map - platform String
- ports List<Property Map>
- project
Name String
Outputs
All input properties are implicitly available as output properties. Additionally, the Service resource produces the following output properties:
- Endpoint string
- Endpoint string
- endpoint string
- endpoint String
- endpoint string
- endpoint str
- endpoint String
Supporting Types
DeployConfig, DeployConfigArgs
- replicas Number
- resources Property Map
HealthCheckConfig, HealthCheckConfigArgs
- Interval
Seconds int - Retries int
- Start
Period intSeconds - Test List<string>
- Timeout
Seconds int
- Interval
Seconds int - Retries int
- Start
Period intSeconds - Test []string
- Timeout
Seconds int
- interval_
seconds number - retries number
- start_
period_ numberseconds - test list(string)
- timeout_
seconds number
- interval
Seconds Integer - retries Integer
- start
Period IntegerSeconds - test List<String>
- timeout
Seconds Integer
- interval
Seconds number - retries number
- start
Period numberSeconds - test string[]
- timeout
Seconds number
- interval_
seconds int - retries int
- start_
period_ intseconds - test Sequence[str]
- timeout_
seconds int
- interval
Seconds Number - retries Number
- start
Period NumberSeconds - test List<String>
- timeout
Seconds Number
ResourceConfig, ResourceConfigArgs
Resources, ResourcesArgs
ServicePortConfig, ServicePortConfigArgs
- Target int
- App
Protocol string - Listener string
- Mode string
- Protocol string
- Target int
- App
Protocol string - Listener string
- Mode string
- Protocol string
- target number
- app_
protocol string - listener string
- mode string
- protocol string
- target Integer
- app
Protocol String - listener String
- mode String
- protocol String
- target number
- app
Protocol string - listener string
- mode string
- protocol string
- target int
- app_
protocol str - listener str
- mode str
- protocol str
- target Number
- app
Protocol String - listener String
- mode String
- protocol String
Package Details
- Repository
- defang-azure DefangLabs/pulumi-defang
- License
- Apache-2.0
Viewing docs for Defang Azure v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang