Skip to content

Commit 2f673f1

Browse files
authored
[Containerapp] az containerapp env create: Support --dapr-connection-string to set application insights connection string used by Dapr to export service to service communication telemetry (#28625)
1 parent 30f20c4 commit 2f673f1

5 files changed

Lines changed: 3289 additions & 0 deletions

File tree

src/azure-cli/azure/cli/command_modules/containerapp/_params.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def load_arguments(self, _):
157157

158158
with self.argument_context('containerapp env', arg_group='Dapr') as c:
159159
c.argument('instrumentation_key', options_list=['--dapr-instrumentation-key'], help='Application Insights instrumentation key used by Dapr to export Service to Service communication telemetry')
160+
c.argument('dapr_connection_string', options_list=['--dapr-connection-string', '-d'], help='Application Insights connection string used by Dapr to export service to service communication telemetry.')
160161

161162
with self.argument_context('containerapp env', arg_group='Virtual Network') as c:
162163
c.argument('infrastructure_subnet_resource_id', options_list=['--infrastructure-subnet-resource-id', '-s'], help='Resource ID of a subnet for infrastructure components and user app containers.')

src/azure-cli/azure/cli/command_modules/containerapp/containerapp_env_decorator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def set_argument_location(self, location):
6363
def get_argument_instrumentation_key(self):
6464
return self.get_param("instrumentation_key")
6565

66+
def get_argument_dapr_connection_string(self):
67+
return self.get_param("dapr_connection_string")
68+
6669
def get_argument_infrastructure_subnet_resource_id(self):
6770
return self.get_param("infrastructure_subnet_resource_id")
6871

@@ -181,6 +184,9 @@ def construct_payload(self):
181184
if self.get_argument_instrumentation_key() is not None:
182185
self.managed_env_def["properties"]["daprAIInstrumentationKey"] = self.get_argument_instrumentation_key()
183186

187+
if self.get_argument_dapr_connection_string() is not None:
188+
self.managed_env_def["properties"]["daprAIConnectionString"] = self.get_argument_dapr_connection_string()
189+
184190
# Vnet
185191
self.set_up_vnet_configuration()
186192

src/azure-cli/azure/cli/command_modules/containerapp/custom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ def create_managed_environment(cmd,
806806
logs_key=None,
807807
location=None,
808808
instrumentation_key=None,
809+
dapr_connection_string=None,
809810
infrastructure_subnet_resource_id=None,
810811
docker_bridge_cidr=None,
811812
platform_reserved_cidr=None,

0 commit comments

Comments
 (0)