Skip to content

[FEATURE REQ] When in prompt mode, Infrastructure pre-adds param location string = resourceGroup().location. #42276

@mitchdenny

Description

@mitchdenny

Library name

Azure.Provisioning

Please describe the feature.

When in prompt mode we need the CDK to prepend the following parameter to the construct:

param location string = resourceGroup().location

This parameter would then be used whenever a resource is added to the construct. The following Aspire code:

var construct1 = builder.AddAzureConstruct("construct1", (construct) =>
{
    var account = construct.AddStorageAccount(
        name: "bob",
        kind: StorageKind.BlobStorage,
        sku: StorageSkuName.StandardLrs
        );
   
    account.AddOutput(data => data.PrimaryEndpoints.TableUri, "tableUri", isSecure: true);
});

... would result in the following Bicep:

targetScope = 'resourceGroup'

param location string = resourceGroup().location

resource storageAccount_SOTvKjFQy 'Microsoft.Storage/storageAccounts@2022-09-01' = {
  name: toLower(take(concat('bob', uniqueString(resourceGroup().id)), 24))
  location: location
  sku: {
    name: 'Standard_LRS'
  }
  kind: 'StorageV2'
  properties: {
  }
}

output tableUri string = storageAccount_SOTvKjFQy.properties.primaryEndpoints.table

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageProvisioning

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions