Skip to content

Azure

terradart_azure wraps the official hashicorp/azurerm provider. Every resource and data source at the current pin (kAzureProviderVersionConstraint) has a factory. Entra ID (azuread) is a separate provider and is not in this package.

terradart_azure is not on pub.dev until its first publish, so dart pub get on the dependency below fails today.

pubspec.yaml
dependencies:
terradart_core: ^0.35.0
terradart_azure: ^0.35.0

AzureProvider has no client id, client secret, client certificate, or OIDC token parameter. Credentials never enter the synthesized JSON, and synth needs none. terradart plan and terradart apply authenticate through ARM_CLIENT_ID, ARM_CLIENT_SECRET, ARM_CLIENT_CERTIFICATE, ARM_USE_OIDC, ARM_USE_MSI, ARM_USE_CLI, and the other ARM_* variables the provider reads. An omitted subscription falls back to ARM_SUBSCRIPTION_ID. An omitted tenant falls back to ARM_TENANT_ID. With those variables set, terradart apply synthesizes the Stack and applies it.

The provider requires a features block. const AzureProvider() emits an empty one, which is enough for terraform validate.

lib/group_stack.dart
import 'package:terradart_azure/provider.dart';
import 'package:terradart_azure/resource.dart';
final class GroupStack extends Stack {
GroupStack()
: super(
providers: [const AzureProvider()],
appExports: AppExports('lib/generated/group_stack.app.dart'),
) {
final group = add(AzurermResourceGroup(
'app',
location: .literal('eastus'),
name: .literal('app'),
));
addConstant('resourceGroupName', .ref(group.name));
addOutput('resource_group_id', group.id);
}
}

The app reads the group name as GroupStackConstants.resourceGroupName. After apply, GroupStackOutputs.resourceGroupId is the group id. The Stack can sit next to a Google, AWS, Cloudflare, or Appwrite Stack in the same package. It can also share one Stack with any of them.