diff --git a/sdk/provisioning/Azure.Provisioning/src/Construct.cs b/sdk/provisioning/Azure.Provisioning/src/Construct.cs index 8a567f3fe53e0..fbd09eb7307b2 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Construct.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Construct.cs @@ -22,10 +22,13 @@ public abstract class Construct : IConstruct, IPersistableModel private List _constructs; private List _outputs; private List _existingResources; + private string _environmentName; /// public string Name { get; } /// + public string EnvironmentName => GetEnvironmentName(); + /// public IConstruct? Scope { get; } /// public ResourceGroup? ResourceGroup { get; protected set; } @@ -44,8 +47,9 @@ public abstract class Construct : IConstruct, IPersistableModel /// The the construct is. /// The tenant id to use. If not passed in will try to load from AZURE_TENANT_ID environment variable. /// The subscription id to use. If not passed in will try to load from AZURE_SUBSCRIPTION_ID environment variable. + /// The environment name to use. If not passed in will try to load from AZURE_ENV_NAME environment variable. /// is and is null. - protected Construct(IConstruct? scope, string name, ConstructScope constructScope = ConstructScope.ResourceGroup, Guid? tenantId = null, Guid? subscriptionId = null) + protected Construct(IConstruct? scope, string name, ConstructScope constructScope = ConstructScope.ResourceGroup, Guid? tenantId = null, Guid? subscriptionId = null, string? envName = null) { if (scope is null && constructScope == ConstructScope.ResourceGroup) { @@ -70,6 +74,13 @@ protected Construct(IConstruct? scope, string name, ConstructScope constructScop { Subscription = scope is null ? this.GetOrCreateSubscription(subscriptionId) : scope.Subscription ?? scope.GetOrCreateSubscription(subscriptionId); } + + _environmentName = envName ?? Environment.GetEnvironmentVariable("AZURE_ENV_NAME") ?? throw new Exception("No environment variable found named 'AZURE_ENV_NAME'"); + } + + private string GetEnvironmentName() + { + return _environmentName is null ? Scope!.EnvironmentName : _environmentName; } /// diff --git a/sdk/provisioning/Azure.Provisioning/src/IConstruct.cs b/sdk/provisioning/Azure.Provisioning/src/IConstruct.cs index 0a2d893c537f0..1aac6f267bd77 100644 --- a/sdk/provisioning/Azure.Provisioning/src/IConstruct.cs +++ b/sdk/provisioning/Azure.Provisioning/src/IConstruct.cs @@ -18,6 +18,11 @@ public interface IConstruct /// public string Name { get; } + /// + /// Gets the environment name of the construct. + /// + public string EnvironmentName { get; } + /// /// Gets the scope. /// diff --git a/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs b/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs index d5bf0f3bfd189..12d6915131b45 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs +++ b/sdk/provisioning/Azure.Provisioning/src/Infrastructure.cs @@ -15,16 +15,15 @@ namespace Azure.Provisioning public abstract class Infrastructure : Construct #pragma warning restore AZC0012 // Avoid single word type names { - internal static readonly string Seed = Environment.GetEnvironmentVariable("AZURE_ENV_NAME") ?? throw new Exception("No environment variable found named 'AZURE_ENV_NAME'"); - /// /// Initializes a new instance of the class. /// /// The to use for the root . /// The tenant id to use. If not passed in will try to load from AZURE_TENANT_ID environment variable. /// The subscription id to use. If not passed in will try to load from AZURE_SUBSCRIPTION_ID environment variable. - public Infrastructure(ConstructScope constructScope = ConstructScope.Subscription, Guid? tenantId = null, Guid? subscriptionId = null) - : base(null, "default", constructScope, tenantId, subscriptionId) + /// The environment name to use. If not passed in will try to load from AZURE_ENV_NAME environment variable. + public Infrastructure(ConstructScope constructScope = ConstructScope.Subscription, Guid? tenantId = null, Guid? subscriptionId = null, string? envName = null) + : base(null, "default", constructScope, tenantId, subscriptionId, envName) { } diff --git a/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVault.cs b/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVault.cs index 3891eb9f953b9..c18a95f4008b0 100644 --- a/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVault.cs +++ b/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVault.cs @@ -25,8 +25,8 @@ public class KeyVault : Resource /// The version. /// The location. public KeyVault(IConstruct scope, string? name = null, string version = "2023-02-01", AzureLocation? location = default) - : base(scope, null, GetName(name), ResourceTypeName, version, ArmKeyVaultModelFactory.KeyVaultData( - name: GetName(name), + : base(scope, null, GetName(scope, name), ResourceTypeName, version, ArmKeyVaultModelFactory.KeyVaultData( + name: GetName(scope, name), resourceType: ResourceTypeName, location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS, properties: ArmKeyVaultModelFactory.KeyVaultProperties( @@ -46,9 +46,9 @@ public KeyVault(IConstruct scope, string? name = null, string version = "2023-02 { } - private static string GetName(string? name) + private static string GetName(IConstruct scope, string? name) { - return name is null ? $"kv-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + return name is null ? $"kv-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; } /// diff --git a/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVaultSecret.cs b/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVaultSecret.cs index 01068c27b6f7d..5424eed7d8854 100644 --- a/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVaultSecret.cs +++ b/sdk/provisioning/Azure.Provisioning/src/keyvault/KeyVaultSecret.cs @@ -22,8 +22,8 @@ public class KeyVaultSecret : Resource /// The name. /// The version. public KeyVaultSecret(IConstruct scope, string name, string version = "2023-02-01") - : base(scope, null, GetName(name), ResourceTypeName, version, ArmKeyVaultModelFactory.KeyVaultSecretData( - name: GetName(name), + : base(scope, null, GetName(scope, name), ResourceTypeName, version, ArmKeyVaultModelFactory.KeyVaultSecretData( + name: GetName(scope, name), resourceType: ResourceTypeName, properties: ArmKeyVaultModelFactory.SecretProperties( value: Guid.Empty.ToString()) @@ -39,8 +39,8 @@ public KeyVaultSecret(IConstruct scope, string name, string version = "2023-02-0 /// The connection string. /// The version. public KeyVaultSecret(IConstruct scope, string name, ConnectionString connectionString, string version = "2023-02-01") - : base(scope, null, GetName(name), ResourceTypeName, version, ArmKeyVaultModelFactory.KeyVaultSecretData( - name: GetName(name), + : base(scope, null, GetName(scope, name), ResourceTypeName, version, ArmKeyVaultModelFactory.KeyVaultSecretData( + name: GetName(scope, name), resourceType: ResourceTypeName, properties: ArmKeyVaultModelFactory.SecretProperties( value: connectionString.Value) @@ -48,7 +48,7 @@ public KeyVaultSecret(IConstruct scope, string name, ConnectionString connection { } - private static string GetName(string? name) => name is null ? $"kvs-{Infrastructure.Seed}" : name; + private static string GetName(IConstruct scope, string? name) => name is null ? $"kvs-{scope.EnvironmentName}" : name; /// protected override Resource? FindParentInScope(IConstruct scope) diff --git a/sdk/provisioning/Azure.Provisioning/src/resourcemanager/ResourceGroup.cs b/sdk/provisioning/Azure.Provisioning/src/resourcemanager/ResourceGroup.cs index 15ad7f5f1288e..c67648ff3f7b5 100644 --- a/sdk/provisioning/Azure.Provisioning/src/resourcemanager/ResourceGroup.cs +++ b/sdk/provisioning/Azure.Provisioning/src/resourcemanager/ResourceGroup.cs @@ -24,15 +24,15 @@ public class ResourceGroup : Resource /// The version of the resourceGroup. /// The location of the resourceGroup. public ResourceGroup(IConstruct scope, string? name = default, string version = "2023-07-01", AzureLocation? location = default) - : base(scope, null, GetName(name), ResourceType, version, ResourceManagerModelFactory.ResourceGroupData( - name: GetName(name), + : base(scope, null, GetName(scope, name), ResourceType, version, ResourceManagerModelFactory.ResourceGroupData( + name: GetName(scope, name), resourceType: ResourceType, tags: new Dictionary { { "azd-env-name", Environment.GetEnvironmentVariable("AZURE_ENV_NAME") ?? throw new Exception("No environment variable 'AZURE_ENV_NAME' was found") } }, location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS)) { } - private static string GetName(string? name) => name is null ? $"rg-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"rg-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; /// protected override Resource? FindParentInScope(IConstruct scope) diff --git a/sdk/provisioning/Azure.Provisioning/src/resources/DeploymentScript.cs b/sdk/provisioning/Azure.Provisioning/src/resources/DeploymentScript.cs index 13d9d35d80b6a..5fa087a2dbcc6 100644 --- a/sdk/provisioning/Azure.Provisioning/src/resources/DeploymentScript.cs +++ b/sdk/provisioning/Azure.Provisioning/src/resources/DeploymentScript.cs @@ -27,8 +27,8 @@ public class DeploymentScript : Resource /// The resource version. /// The resource location. public DeploymentScript(IConstruct scope, string resourceName, IEnumerable scriptEnvironmentVariables, string scriptContent, string version = _defaultVersion, AzureLocation? location = default) - : base(scope, null, GetName(resourceName), ResourceTypeName, version, ArmResourcesModelFactory.AzureCliScript( - name: GetName(resourceName), + : base(scope, null, GetName(scope, resourceName), ResourceTypeName, version, ArmResourcesModelFactory.AzureCliScript( + name: GetName(scope, resourceName), resourceType: ResourceTypeName, location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS, azCliVersion: "2.37.0", @@ -51,8 +51,8 @@ public DeploymentScript(IConstruct scope, string resourceName, IEnumerableThe resource version. /// The resource location. public DeploymentScript(IConstruct scope, string resourceName, Resource database, Parameter appUserPasswordSecret, Parameter sqlAdminPasswordSecret, string version = _defaultVersion, AzureLocation? location = default) - : base(scope, null, GetName(resourceName), ResourceTypeName, version, ArmResourcesModelFactory.AzureCliScript( - name: GetName(resourceName), + : base(scope, null, GetName(scope, resourceName), ResourceTypeName, version, ArmResourcesModelFactory.AzureCliScript( + name: GetName(scope, resourceName), resourceType: ResourceTypeName, location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS, azCliVersion: "2.37.0", @@ -88,7 +88,7 @@ alter role db_owner add member ${APPUSERNAME} Scope.AddParameter(sqlAdminPasswordSecret); } - private static string GetName(string? name) => name is null ? $"deploymentScript-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"deploymentScript-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; /// protected override Resource? FindParentInScope(IConstruct scope) diff --git a/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlDatabase.cs b/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlDatabase.cs index f3c9a63226d7f..46f6a5f4d51af 100644 --- a/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlDatabase.cs +++ b/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlDatabase.cs @@ -23,8 +23,8 @@ public class SqlDatabase : Resource /// The version. /// The location. public SqlDatabase(IConstruct scope, string? name = default, string version = "2022-08-01-preview", AzureLocation? location = default) - : base(scope, null, GetName(name), ResourceTypeName, version, ArmSqlModelFactory.SqlDatabaseData( - name: GetName(name), + : base(scope, null, GetName(scope, name), ResourceTypeName, version, ArmSqlModelFactory.SqlDatabaseData( + name: GetName(scope, name), resourceType: ResourceTypeName, location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS)) { @@ -39,7 +39,7 @@ public SqlDatabase(IConstruct scope, string? name = default, string version = "2 public ConnectionString GetConnectionString(Parameter passwordSecret, string userName = "appUser") => new ConnectionString(this, passwordSecret, userName); - private static string GetName(string? name) => name is null ? $"db-{Infrastructure.Seed}" : name; + private static string GetName(IConstruct scope, string? name) => name is null ? $"db-{scope.EnvironmentName}" : name; /// protected override Resource? FindParentInScope(IConstruct scope) diff --git a/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlFirewallRule.cs b/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlFirewallRule.cs index 957086cd6d53f..fed4b8b6b4a1c 100644 --- a/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlFirewallRule.cs +++ b/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlFirewallRule.cs @@ -20,8 +20,8 @@ public class SqlFirewallRule : Resource /// The name. /// The version. public SqlFirewallRule(IConstruct scope, string? name = default, string version = "2020-11-01-preview") - : base(scope, null, GetName(name), ResourceTypeName, version, ArmSqlModelFactory.SqlFirewallRuleData( - name: GetName(name), + : base(scope, null, GetName(scope, name), ResourceTypeName, version, ArmSqlModelFactory.SqlFirewallRuleData( + name: GetName(scope, name), resourceType: ResourceTypeName, startIPAddress: "0.0.0.1", endIPAddress: "255.255.255.254" @@ -29,7 +29,7 @@ public SqlFirewallRule(IConstruct scope, string? name = default, string version { } - private static string GetName(string? name) => name is null ? $"fw-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"fw-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; /// protected override Resource? FindParentInScope(IConstruct scope) diff --git a/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlServer.cs b/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlServer.cs index fda0ca79c1107..d81db47b618fa 100644 --- a/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlServer.cs +++ b/sdk/provisioning/Azure.Provisioning/src/sqlmanagement/SqlServer.cs @@ -24,8 +24,8 @@ public class SqlServer : Resource /// The version. /// The location. public SqlServer(IConstruct scope, string name, string? version = default, AzureLocation? location = default) - : base(scope, null, GetName(name), ResourceTypeName, version ?? "2022-08-01-preview", ArmSqlModelFactory.SqlServerData( - name: GetName(name), + : base(scope, null, GetName(scope, name), ResourceTypeName, version ?? "2022-08-01-preview", ArmSqlModelFactory.SqlServerData( + name: GetName(scope, name), location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS, resourceType: ResourceTypeName, version: "12.0", @@ -36,7 +36,7 @@ public SqlServer(IConstruct scope, string name, string? version = default, Azure { } - private static string GetName(string? name) => name is null ? $"sql-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"sql-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; /// protected override Resource? FindParentInScope(IConstruct scope) diff --git a/sdk/provisioning/Azure.Provisioning/src/websites/AppServicePlan.cs b/sdk/provisioning/Azure.Provisioning/src/websites/AppServicePlan.cs index 570cd913f62eb..33d538d5083ce 100644 --- a/sdk/provisioning/Azure.Provisioning/src/websites/AppServicePlan.cs +++ b/sdk/provisioning/Azure.Provisioning/src/websites/AppServicePlan.cs @@ -16,7 +16,7 @@ public class AppServicePlan : Resource { private const string ResourceTypeName = "Microsoft.Web/serverfarms"; - private static string GetName(string? name) => name is null ? $"appServicePlan-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"appServicePlan-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; /// /// Initializes a new instance of the . @@ -26,8 +26,8 @@ public class AppServicePlan : Resource /// The version. /// The location. public AppServicePlan(IConstruct scope, string resourceName, string version = "2021-02-01", AzureLocation? location = default) - : base(scope, null, GetName(resourceName), ResourceTypeName, version, ArmAppServiceModelFactory.AppServicePlanData( - name: GetName(resourceName), + : base(scope, null, GetName(scope, resourceName), ResourceTypeName, version, ArmAppServiceModelFactory.AppServicePlanData( + name: GetName(scope, resourceName), location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS, sku: new AppServiceSkuDescription() { Name = "B1" }, isReserved: true)) diff --git a/sdk/provisioning/Azure.Provisioning/src/websites/WebSite.cs b/sdk/provisioning/Azure.Provisioning/src/websites/WebSite.cs index 658d71c47dfb9..971d1275813da 100644 --- a/sdk/provisioning/Azure.Provisioning/src/websites/WebSite.cs +++ b/sdk/provisioning/Azure.Provisioning/src/websites/WebSite.cs @@ -32,7 +32,7 @@ public enum WebSiteRuntime public class WebSite : Resource { private const string ResourceTypeName = "Microsoft.Web/sites"; - private static string GetName(string? name) => name is null ? $"webSite-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"webSite-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; private ApplicationSettingsResource AppSettings { get; } @@ -47,8 +47,8 @@ public class WebSite : Resource /// The version. /// The location. public WebSite(IConstruct scope, string resourceName, AppServicePlan appServicePlan, WebSiteRuntime runtime, string runtimeVersion, string version = "2021-02-01", AzureLocation? location = default) - : base(scope, null, GetName(resourceName), ResourceTypeName, version, ArmAppServiceModelFactory.WebSiteData( - name: GetName(resourceName), + : base(scope, null, GetName(scope, resourceName), ResourceTypeName, version, ArmAppServiceModelFactory.WebSiteData( + name: GetName(scope, resourceName), location: location ?? Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS, resourceType: ResourceTypeName, kind: "app,linux", diff --git a/sdk/provisioning/Azure.Provisioning/src/websites/WebSiteConfigLogs.cs b/sdk/provisioning/Azure.Provisioning/src/websites/WebSiteConfigLogs.cs index dbc9fb50c84d8..05c819a59fdf8 100644 --- a/sdk/provisioning/Azure.Provisioning/src/websites/WebSiteConfigLogs.cs +++ b/sdk/provisioning/Azure.Provisioning/src/websites/WebSiteConfigLogs.cs @@ -14,7 +14,7 @@ public class WebSiteConfigLogs : Resource { private const string ResourceTypeName = "Microsoft.Web/sites/config"; - private static string GetName(string? name) => name is null ? $"logs-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"logs-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; /// /// Initializes a new instance of the . diff --git a/sdk/provisioning/Azure.Provisioning/src/websites/WebSitePublishingCredentialPolicy.cs b/sdk/provisioning/Azure.Provisioning/src/websites/WebSitePublishingCredentialPolicy.cs index 3ea15b58c9874..467b9995e8e10 100644 --- a/sdk/provisioning/Azure.Provisioning/src/websites/WebSitePublishingCredentialPolicy.cs +++ b/sdk/provisioning/Azure.Provisioning/src/websites/WebSitePublishingCredentialPolicy.cs @@ -14,7 +14,7 @@ public class WebSitePublishingCredentialPolicy : Resource name is null ? $"publishingCredentialPolicy-{Infrastructure.Seed}" : $"{name}-{Infrastructure.Seed}"; + private static string GetName(IConstruct scope, string? name) => name is null ? $"publishingCredentialPolicy-{scope.EnvironmentName}" : $"{name}-{scope.EnvironmentName}"; /// /// Initializes a new instance of the class. @@ -24,8 +24,8 @@ public class WebSitePublishingCredentialPolicy : ResourceThe version. /// The location. public WebSitePublishingCredentialPolicy(IConstruct scope, string resourceName, string version = "2021-02-01", AzureLocation? location = default) - : base(scope, null, GetName(resourceName), ResourceTypeName, version, ArmAppServiceModelFactory.CsmPublishingCredentialsPoliciesEntityData( - name: GetName(resourceName), + : base(scope, null, GetName(scope, resourceName), ResourceTypeName, version, ArmAppServiceModelFactory.CsmPublishingCredentialsPoliciesEntityData( + name: GetName(scope, resourceName), allow: false)) { } diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/ResourceGroupOnly/main.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/ResourceGroupOnly/main.bicep index ebdc8a642983e..dca2c6a38ba8e 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/ResourceGroupOnly/main.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/ResourceGroupOnly/main.bicep @@ -1,8 +1,8 @@ targetScope = subscription -resource resourceGroup_IABVtvgDt 'Microsoft.Resources/resourceGroups@2023-07-01' = { - name: 'rg-mnash-cdk' +resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = { + name: 'rg-TEST' location: 'westus' tags: { azd-env-name: 'mnash-cdk' diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL1/main.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL1/main.bicep index 4548b14a79487..a52a2bd00e065 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL1/main.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL1/main.bicep @@ -9,8 +9,8 @@ param sqlAdminPassword string param appUserPassword string -resource resourceGroup_IABVtvgDt 'Microsoft.Resources/resourceGroups@2023-07-01' = { - name: 'rg-mnash-cdk' +resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = { + name: 'rg-TEST' location: 'westus' tags: { azd-env-name: 'mnash-cdk' @@ -18,9 +18,9 @@ resource resourceGroup_IABVtvgDt 'Microsoft.Resources/resourceGroups@2023-07-01' } } -resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' = { - scope: resourceGroup_IABVtvgDt - name: 'appServicePlan-mnash-cdk' +resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' = { + scope: resourceGroup_I6QNkoPsb + name: 'appServicePlan-TEST' location: 'westus' sku: { name: 'B1' @@ -30,15 +30,15 @@ resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' = { } } -resource webSite_kwcoFVmFY 'Microsoft.Web/sites@2021-02-01' = { - scope: resourceGroup_IABVtvgDt - name: 'frontEnd-mnash-cdk' +resource webSite_W5EweSXEq 'Microsoft.Web/sites@2021-02-01' = { + scope: resourceGroup_I6QNkoPsb + name: 'frontEnd-TEST' location: 'westus' identity: { } kind: 'app,linux' properties: { - serverFarmId: '/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-mnash-cdk/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' + serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST' siteConfig: { linuxFxVersion: 'node|18-lts' alwaysOn: true @@ -58,14 +58,14 @@ resource webSite_kwcoFVmFY 'Microsoft.Web/sites@2021-02-01' = { } } -resource applicationSettingsResource_GTzB2G8tg 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_kwcoFVmFY +resource applicationSettingsResource_NslbdUwEt 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_W5EweSXEq name: 'appsettings' } -resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' = { - scope: resourceGroup_IABVtvgDt - name: 'kv-mnash-cdk' +resource keyVault_CRoMbemLF 'Microsoft.KeyVault/vaults@2023-02-01' = { + scope: resourceGroup_I6QNkoPsb + name: 'kv-TEST' location: 'westus' properties: { tenantId: '00000000-0000-0000-0000-000000000000' @@ -76,8 +76,8 @@ resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' = { } } -resource keyVaultAddAccessPolicy_pzaknyGaJ 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultAddAccessPolicy_OttgS6uaT 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'add' properties: { accessPolicies: [ @@ -95,25 +95,25 @@ resource keyVaultAddAccessPolicy_pzaknyGaJ 'Microsoft.KeyVault/vaults/accessPoli } } -resource keyVaultSecret_mAspwDx0h 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_nMDmVNMVq 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'sqlAdminPassword' properties: { value: '00000000-0000-0000-0000-000000000000' } } -resource keyVaultSecret_qg5TJE5co 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_PrlUnEuAz 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'appUserPassword' properties: { value: '00000000-0000-0000-0000-000000000000' } } -resource sqlServer_h9WlA3ws7 'Microsoft.Sql/servers@2022-08-01-preview' = { - scope: resourceGroup_IABVtvgDt - name: 'sqlserver-mnash-cdk' +resource sqlServer_zjdvvB2wl 'Microsoft.Sql/servers@2022-08-01-preview' = { + scope: resourceGroup_I6QNkoPsb + name: 'sqlserver-TEST' location: 'westus' properties: { administratorLogin: 'sqladmin' @@ -124,34 +124,34 @@ resource sqlServer_h9WlA3ws7 'Microsoft.Sql/servers@2022-08-01-preview' = { } } -resource sqlDatabase_5rllN3VNV 'Microsoft.Sql/servers/databases@2022-08-01-preview' = { - parent: sqlServer_h9WlA3ws7 - name: 'db-mnash-cdk' +resource sqlDatabase_U7NzorRJT 'Microsoft.Sql/servers/databases@2022-08-01-preview' = { + parent: sqlServer_zjdvvB2wl + name: 'db-TEST' location: 'westus' properties: { } } -resource keyVaultSecret_dZU0IKkqM 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_NP8ELZpgb 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'connectionString' properties: { - value: 'Server=${sqlServer_h9WlA3ws7.properties.fullyQualifiedDomainName}; Database=${sqlDatabase_5rllN3VNV.name}; User=appUser; Password=${appUserPassword}' + value: 'Server=${sqlServer_zjdvvB2wl.properties.fullyQualifiedDomainName}; Database=${sqlDatabase_U7NzorRJT.name}; User=appUser; Password=${appUserPassword}' } } -resource sqlFirewallRule_mYeCi9UIt 'Microsoft.Sql/servers/firewallRules@2020-11-01-preview' = { - parent: sqlServer_h9WlA3ws7 - name: 'firewallRule-mnash-cdk' +resource sqlFirewallRule_eS4m8st65 'Microsoft.Sql/servers/firewallRules@2020-11-01-preview' = { + parent: sqlServer_zjdvvB2wl + name: 'firewallRule-TEST' properties: { startIpAddress: '0.0.0.1' endIpAddress: '255.255.255.254' } } -resource deploymentScript_CQw5nRksz 'Microsoft.Resources/deploymentScripts@2020-10-01' = { - scope: resourceGroup_IABVtvgDt - name: 'cliScript-mnash-cdk' +resource deploymentScript_3Zq2Pl8xa 'Microsoft.Resources/deploymentScripts@2020-10-01' = { + scope: resourceGroup_I6QNkoPsb + name: 'cliScript-TEST' location: 'westus' kind: 'AzureCLI' properties: { @@ -179,11 +179,11 @@ SCRIPT_END } { name: 'DBNAME' - value: '_p_.sqlDatabase_5rllN3VNV.name' + value: '_p_.sqlDatabase_U7NzorRJT.name' } { name: 'DBSERVER' - value: '_p_.sqlServer_h9WlA3ws7.properties.fullyQualifiedDomainName' + value: '_p_.sqlServer_zjdvvB2wl.properties.fullyQualifiedDomainName' } { name: 'SQLCMDPASSWORD' @@ -200,15 +200,15 @@ SCRIPT_END } } -resource webSite_bbXnyuYEl 'Microsoft.Web/sites@2021-02-01' = { - scope: resourceGroup_IABVtvgDt - name: 'backEnd-mnash-cdk' +resource webSite_4pzZqR2OO 'Microsoft.Web/sites@2021-02-01' = { + scope: resourceGroup_I6QNkoPsb + name: 'backEnd-TEST' location: 'westus' identity: { } kind: 'app,linux' properties: { - serverFarmId: '/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-mnash-cdk/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' + serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST' siteConfig: { linuxFxVersion: 'dotnetcore|6.0' alwaysOn: true @@ -228,8 +228,8 @@ resource webSite_bbXnyuYEl 'Microsoft.Web/sites@2021-02-01' = { } } -resource applicationSettingsResource_6U6Xi0A5f 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_bbXnyuYEl +resource applicationSettingsResource_Pfdqa0OdT 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_4pzZqR2OO name: 'appsettings' properties: { SCM_DO_BUILD_DURING_DEPLOYMENT: 'False' @@ -237,8 +237,8 @@ resource applicationSettingsResource_6U6Xi0A5f 'Microsoft.Web/sites/config@2021- } } -resource webSiteConfigLogs_caWaXRSC1 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_kwcoFVmFY +resource webSiteConfigLogs_giqxapQs0 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_W5EweSXEq name: 'logs' properties: { applicationLogs: { @@ -262,4 +262,4 @@ resource webSiteConfigLogs_caWaXRSC1 'Microsoft.Web/sites/config@2021-02-01' = { } } -output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_kwcoFVmFY.identity.principalId +output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_W5EweSXEq.identity.principalId diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/main.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/main.bicep index 92be332406f79..bdf01644e8798 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/main.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/main.bicep @@ -9,8 +9,8 @@ param sqlAdminPassword string param appUserPassword string -resource resourceGroup_IABVtvgDt 'Microsoft.Resources/resourceGroups@2023-07-01' = { - name: 'rg-mnash-cdk' +resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = { + name: 'rg-TEST' location: 'westus' tags: { azd-env-name: 'mnash-cdk' @@ -18,9 +18,9 @@ resource resourceGroup_IABVtvgDt 'Microsoft.Resources/resourceGroups@2023-07-01' } } -resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' = { - scope: resourceGroup_IABVtvgDt - name: 'appServicePlan-mnash-cdk' +resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' = { + scope: resourceGroup_I6QNkoPsb + name: 'appServicePlan-TEST' location: 'westus' sku: { name: 'B1' @@ -30,9 +30,9 @@ resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' = { } } -resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' = { - scope: resourceGroup_IABVtvgDt - name: 'kv-mnash-cdk' +resource keyVault_CRoMbemLF 'Microsoft.KeyVault/vaults@2023-02-01' = { + scope: resourceGroup_I6QNkoPsb + name: 'kv-TEST' location: 'westus' properties: { tenantId: '00000000-0000-0000-0000-000000000000' @@ -43,8 +43,8 @@ resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' = { } } -resource keyVaultAddAccessPolicy_pzaknyGaJ 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultAddAccessPolicy_OttgS6uaT 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'add' properties: { accessPolicies: [ @@ -64,12 +64,12 @@ resource keyVaultAddAccessPolicy_pzaknyGaJ 'Microsoft.KeyVault/vaults/accessPoli module TestFrontEndWebSite './resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep' = { name: 'TestFrontEndWebSite' - scope: resourceGroup_IABVtvgDt + scope: resourceGroup_I6QNkoPsb } module TestCommonSqlDatabase './resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep' = { name: 'TestCommonSqlDatabase' - scope: resourceGroup_IABVtvgDt + scope: resourceGroup_I6QNkoPsb params: { sqlAdminPassword: sqlAdminPassword appUserPassword: appUserPassword @@ -78,7 +78,7 @@ module TestCommonSqlDatabase './resources/TestCommonSqlDatabase/TestCommonSqlDat module TestBackEndWebSite './resources/TestBackEndWebSite/TestBackEndWebSite.bicep' = { name: 'TestBackEndWebSite' - scope: resourceGroup_IABVtvgDt + scope: resourceGroup_I6QNkoPsb } output SERVICE_API_IDENTITY_PRINCIPAL_ID string = TestFrontEndWebSite.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestBackEndWebSite/TestBackEndWebSite.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestBackEndWebSite/TestBackEndWebSite.bicep index bd596b730e5b2..3ffe35b0a5e0c 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestBackEndWebSite/TestBackEndWebSite.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestBackEndWebSite/TestBackEndWebSite.bicep @@ -1,16 +1,16 @@ -resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' existing = { - name: 'appServicePlan_zDVZJZSeJ' +resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' existing = { + name: 'appServicePlan_kjMZSF1FP' } -resource webSite_bbXnyuYEl 'Microsoft.Web/sites@2021-02-01' = { +resource webSite_vYvIqKCDk 'Microsoft.Web/sites@2021-02-01' = { name: 'backEnd-mnash-cdk' location: 'westus' identity: { } kind: 'app,linux' properties: { - serverFarmId: '/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-mnash-cdk/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' + serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST' siteConfig: { linuxFxVersion: 'dotnetcore|6.0' alwaysOn: true @@ -30,8 +30,8 @@ resource webSite_bbXnyuYEl 'Microsoft.Web/sites@2021-02-01' = { } } -resource applicationSettingsResource_6U6Xi0A5f 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_bbXnyuYEl +resource applicationSettingsResource_Ys2FlARU8 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_vYvIqKCDk name: 'appsettings' properties: { SCM_DO_BUILD_DURING_DEPLOYMENT: 'False' diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep index 3e60c785959ed..cc03c51298219 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep @@ -7,27 +7,27 @@ param sqlAdminPassword string param appUserPassword string -resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' existing = { - name: 'keyVault_n6Xn70PzJ' +resource keyVault_CRoMbemLF 'Microsoft.KeyVault/vaults@2023-02-01' existing = { + name: 'keyVault_CRoMbemLF' } -resource keyVaultSecret_mAspwDx0h 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_nMDmVNMVq 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'sqlAdminPassword' properties: { value: '00000000-0000-0000-0000-000000000000' } } -resource keyVaultSecret_qg5TJE5co 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_PrlUnEuAz 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'appUserPassword' properties: { value: '00000000-0000-0000-0000-000000000000' } } -resource sqlServer_h9WlA3ws7 'Microsoft.Sql/servers@2022-08-01-preview' = { +resource sqlServer_GfC780gjO 'Microsoft.Sql/servers@2022-08-01-preview' = { name: 'sqlserver-mnash-cdk' location: 'westus' properties: { @@ -39,24 +39,24 @@ resource sqlServer_h9WlA3ws7 'Microsoft.Sql/servers@2022-08-01-preview' = { } } -resource sqlDatabase_5rllN3VNV 'Microsoft.Sql/servers/databases@2022-08-01-preview' = { - parent: sqlServer_h9WlA3ws7 +resource sqlDatabase_06pzzL812 'Microsoft.Sql/servers/databases@2022-08-01-preview' = { + parent: sqlServer_GfC780gjO name: 'db-mnash-cdk' location: 'westus' properties: { } } -resource keyVaultSecret_dZU0IKkqM 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_NP8ELZpgb 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_CRoMbemLF name: 'connectionString' properties: { - value: 'Server=${sqlServer_h9WlA3ws7.properties.fullyQualifiedDomainName}; Database=${sqlDatabase_5rllN3VNV.name}; User=appUser; Password=${appUserPassword}' + value: 'Server=${sqlServer_GfC780gjO.properties.fullyQualifiedDomainName}; Database=${sqlDatabase_06pzzL812.name}; User=appUser; Password=${appUserPassword}' } } -resource sqlFirewallRule_mYeCi9UIt 'Microsoft.Sql/servers/firewallRules@2020-11-01-preview' = { - parent: sqlServer_h9WlA3ws7 +resource sqlFirewallRule_uT1qFq1g9 'Microsoft.Sql/servers/firewallRules@2020-11-01-preview' = { + parent: sqlServer_GfC780gjO name: 'firewallRule-mnash-cdk' properties: { startIpAddress: '0.0.0.1' @@ -64,7 +64,7 @@ resource sqlFirewallRule_mYeCi9UIt 'Microsoft.Sql/servers/firewallRules@2020-11- } } -resource deploymentScript_CQw5nRksz 'Microsoft.Resources/deploymentScripts@2020-10-01' = { +resource deploymentScript_rue7c15EI 'Microsoft.Resources/deploymentScripts@2020-10-01' = { name: 'cliScript-mnash-cdk' location: 'westus' kind: 'AzureCLI' @@ -93,11 +93,11 @@ SCRIPT_END } { name: 'DBNAME' - value: '_p_.sqlDatabase_5rllN3VNV.name' + value: '_p_.sqlDatabase_06pzzL812.name' } { name: 'DBSERVER' - value: '_p_.sqlServer_h9WlA3ws7.properties.fullyQualifiedDomainName' + value: '_p_.sqlServer_GfC780gjO.properties.fullyQualifiedDomainName' } { name: 'SQLCMDPASSWORD' diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep index be72582d752ad..0d174dead7e52 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL2/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep @@ -1,20 +1,20 @@ -resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' existing = { - name: 'appServicePlan_zDVZJZSeJ' +resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' existing = { + name: 'appServicePlan_kjMZSF1FP' } -resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' existing = { - name: 'keyVault_n6Xn70PzJ' +resource keyVault_CRoMbemLF 'Microsoft.KeyVault/vaults@2023-02-01' existing = { + name: 'keyVault_CRoMbemLF' } -resource webSite_kwcoFVmFY 'Microsoft.Web/sites@2021-02-01' = { +resource webSite_5n5qLSHlO 'Microsoft.Web/sites@2021-02-01' = { name: 'frontEnd-mnash-cdk' location: 'westus' identity: { } kind: 'app,linux' properties: { - serverFarmId: '/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-mnash-cdk/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' + serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST' siteConfig: { linuxFxVersion: 'node|18-lts' alwaysOn: true @@ -34,13 +34,13 @@ resource webSite_kwcoFVmFY 'Microsoft.Web/sites@2021-02-01' = { } } -resource applicationSettingsResource_GTzB2G8tg 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_kwcoFVmFY +resource applicationSettingsResource_0dS4jj7Cg 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_5n5qLSHlO name: 'appsettings' } -resource webSiteConfigLogs_caWaXRSC1 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_kwcoFVmFY +resource webSiteConfigLogs_PBLecfGMJ 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_5n5qLSHlO name: 'logs' properties: { applicationLogs: { @@ -64,4 +64,4 @@ resource webSiteConfigLogs_caWaXRSC1 'Microsoft.Web/sites/config@2021-02-01' = { } } -output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_kwcoFVmFY.identity.principalId +output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_5n5qLSHlO.identity.principalId diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/main.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/main.bicep index 8fef00febd4e7..332fa072a043b 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/main.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/main.bicep @@ -9,8 +9,8 @@ param sqlAdminPassword string param appUserPassword string -resource resourceGroup_IABVtvgDt 'Microsoft.Resources/resourceGroups@2023-07-01' = { - name: 'rg-mnash-cdk' +resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = { + name: 'rg-TEST' location: 'westus' tags: { azd-env-name: 'mnash-cdk' @@ -20,7 +20,7 @@ resource resourceGroup_IABVtvgDt 'Microsoft.Resources/resourceGroups@2023-07-01' module TestWebSiteWithSqlBackEnd './resources/TestWebSiteWithSqlBackEnd/TestWebSiteWithSqlBackEnd.bicep' = { name: 'TestWebSiteWithSqlBackEnd' - scope: resourceGroup_IABVtvgDt + scope: resourceGroup_I6QNkoPsb params: { sqlAdminPassword: sqlAdminPassword appUserPassword: appUserPassword diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestBackEndWebSite/TestBackEndWebSite.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestBackEndWebSite/TestBackEndWebSite.bicep index bd596b730e5b2..c3a87e43bb8c3 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestBackEndWebSite/TestBackEndWebSite.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestBackEndWebSite/TestBackEndWebSite.bicep @@ -1,16 +1,16 @@ -resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' existing = { - name: 'appServicePlan_zDVZJZSeJ' +resource appServicePlan_rxltck14T 'Microsoft.Web/serverfarms@2021-02-01' existing = { + name: 'appServicePlan_rxltck14T' } -resource webSite_bbXnyuYEl 'Microsoft.Web/sites@2021-02-01' = { +resource webSite_vYvIqKCDk 'Microsoft.Web/sites@2021-02-01' = { name: 'backEnd-mnash-cdk' location: 'westus' identity: { } kind: 'app,linux' properties: { - serverFarmId: '/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-mnash-cdk/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' + serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' siteConfig: { linuxFxVersion: 'dotnetcore|6.0' alwaysOn: true @@ -30,8 +30,8 @@ resource webSite_bbXnyuYEl 'Microsoft.Web/sites@2021-02-01' = { } } -resource applicationSettingsResource_6U6Xi0A5f 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_bbXnyuYEl +resource applicationSettingsResource_Ys2FlARU8 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_vYvIqKCDk name: 'appsettings' properties: { SCM_DO_BUILD_DURING_DEPLOYMENT: 'False' diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep index 3e60c785959ed..f2d661d1fa839 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep @@ -7,27 +7,27 @@ param sqlAdminPassword string param appUserPassword string -resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' existing = { - name: 'keyVault_n6Xn70PzJ' +resource keyVault_sofGLX66Z 'Microsoft.KeyVault/vaults@2023-02-01' existing = { + name: 'keyVault_sofGLX66Z' } -resource keyVaultSecret_mAspwDx0h 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_FJBMvLS18 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_sofGLX66Z name: 'sqlAdminPassword' properties: { value: '00000000-0000-0000-0000-000000000000' } } -resource keyVaultSecret_qg5TJE5co 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_yNzymUIqj 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_sofGLX66Z name: 'appUserPassword' properties: { value: '00000000-0000-0000-0000-000000000000' } } -resource sqlServer_h9WlA3ws7 'Microsoft.Sql/servers@2022-08-01-preview' = { +resource sqlServer_GfC780gjO 'Microsoft.Sql/servers@2022-08-01-preview' = { name: 'sqlserver-mnash-cdk' location: 'westus' properties: { @@ -39,24 +39,24 @@ resource sqlServer_h9WlA3ws7 'Microsoft.Sql/servers@2022-08-01-preview' = { } } -resource sqlDatabase_5rllN3VNV 'Microsoft.Sql/servers/databases@2022-08-01-preview' = { - parent: sqlServer_h9WlA3ws7 +resource sqlDatabase_06pzzL812 'Microsoft.Sql/servers/databases@2022-08-01-preview' = { + parent: sqlServer_GfC780gjO name: 'db-mnash-cdk' location: 'westus' properties: { } } -resource keyVaultSecret_dZU0IKkqM 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultSecret_EcymP2r3i 'Microsoft.KeyVault/vaults/secrets@2023-02-01' = { + parent: keyVault_sofGLX66Z name: 'connectionString' properties: { - value: 'Server=${sqlServer_h9WlA3ws7.properties.fullyQualifiedDomainName}; Database=${sqlDatabase_5rllN3VNV.name}; User=appUser; Password=${appUserPassword}' + value: 'Server=${sqlServer_GfC780gjO.properties.fullyQualifiedDomainName}; Database=${sqlDatabase_06pzzL812.name}; User=appUser; Password=${appUserPassword}' } } -resource sqlFirewallRule_mYeCi9UIt 'Microsoft.Sql/servers/firewallRules@2020-11-01-preview' = { - parent: sqlServer_h9WlA3ws7 +resource sqlFirewallRule_uT1qFq1g9 'Microsoft.Sql/servers/firewallRules@2020-11-01-preview' = { + parent: sqlServer_GfC780gjO name: 'firewallRule-mnash-cdk' properties: { startIpAddress: '0.0.0.1' @@ -64,7 +64,7 @@ resource sqlFirewallRule_mYeCi9UIt 'Microsoft.Sql/servers/firewallRules@2020-11- } } -resource deploymentScript_CQw5nRksz 'Microsoft.Resources/deploymentScripts@2020-10-01' = { +resource deploymentScript_rue7c15EI 'Microsoft.Resources/deploymentScripts@2020-10-01' = { name: 'cliScript-mnash-cdk' location: 'westus' kind: 'AzureCLI' @@ -93,11 +93,11 @@ SCRIPT_END } { name: 'DBNAME' - value: '_p_.sqlDatabase_5rllN3VNV.name' + value: '_p_.sqlDatabase_06pzzL812.name' } { name: 'DBSERVER' - value: '_p_.sqlServer_h9WlA3ws7.properties.fullyQualifiedDomainName' + value: '_p_.sqlServer_GfC780gjO.properties.fullyQualifiedDomainName' } { name: 'SQLCMDPASSWORD' diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep index be72582d752ad..0d70791d6abee 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep @@ -1,20 +1,20 @@ -resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' existing = { - name: 'appServicePlan_zDVZJZSeJ' +resource appServicePlan_rxltck14T 'Microsoft.Web/serverfarms@2021-02-01' existing = { + name: 'appServicePlan_rxltck14T' } -resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' existing = { - name: 'keyVault_n6Xn70PzJ' +resource keyVault_sofGLX66Z 'Microsoft.KeyVault/vaults@2023-02-01' existing = { + name: 'keyVault_sofGLX66Z' } -resource webSite_kwcoFVmFY 'Microsoft.Web/sites@2021-02-01' = { +resource webSite_5n5qLSHlO 'Microsoft.Web/sites@2021-02-01' = { name: 'frontEnd-mnash-cdk' location: 'westus' identity: { } kind: 'app,linux' properties: { - serverFarmId: '/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-mnash-cdk/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' + serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-mnash-cdk' siteConfig: { linuxFxVersion: 'node|18-lts' alwaysOn: true @@ -34,13 +34,13 @@ resource webSite_kwcoFVmFY 'Microsoft.Web/sites@2021-02-01' = { } } -resource applicationSettingsResource_GTzB2G8tg 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_kwcoFVmFY +resource applicationSettingsResource_0dS4jj7Cg 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_5n5qLSHlO name: 'appsettings' } -resource webSiteConfigLogs_caWaXRSC1 'Microsoft.Web/sites/config@2021-02-01' = { - parent: webSite_kwcoFVmFY +resource webSiteConfigLogs_PBLecfGMJ 'Microsoft.Web/sites/config@2021-02-01' = { + parent: webSite_5n5qLSHlO name: 'logs' properties: { applicationLogs: { @@ -64,4 +64,4 @@ resource webSiteConfigLogs_caWaXRSC1 'Microsoft.Web/sites/config@2021-02-01' = { } } -output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_kwcoFVmFY.identity.principalId +output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_5n5qLSHlO.identity.principalId diff --git a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestWebSiteWithSqlBackEnd/TestWebSiteWithSqlBackEnd.bicep b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestWebSiteWithSqlBackEnd/TestWebSiteWithSqlBackEnd.bicep index f75d0d8cc4022..aa4406796a9d3 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestWebSiteWithSqlBackEnd/TestWebSiteWithSqlBackEnd.bicep +++ b/sdk/provisioning/Azure.Provisioning/tests/Infrastructure/WebSiteUsingL3/resources/TestWebSiteWithSqlBackEnd/TestWebSiteWithSqlBackEnd.bicep @@ -7,7 +7,7 @@ param sqlAdminPassword string param appUserPassword string -resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' = { +resource appServicePlan_rxltck14T 'Microsoft.Web/serverfarms@2021-02-01' = { name: 'appServicePlan-mnash-cdk' location: 'westus' sku: { @@ -18,7 +18,7 @@ resource appServicePlan_zDVZJZSeJ 'Microsoft.Web/serverfarms@2021-02-01' = { } } -resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' = { +resource keyVault_sofGLX66Z 'Microsoft.KeyVault/vaults@2023-02-01' = { name: 'kv-mnash-cdk' location: 'westus' tags: { @@ -33,8 +33,8 @@ resource keyVault_n6Xn70PzJ 'Microsoft.KeyVault/vaults@2023-02-01' = { } } -resource keyVaultAddAccessPolicy_pzaknyGaJ 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = { - parent: keyVault_n6Xn70PzJ +resource keyVaultAddAccessPolicy_k8EvVNryo 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = { + parent: keyVault_sofGLX66Z name: 'add' properties: { accessPolicies: [ @@ -54,12 +54,12 @@ resource keyVaultAddAccessPolicy_pzaknyGaJ 'Microsoft.KeyVault/vaults/accessPoli module TestFrontEndWebSite './resources/TestFrontEndWebSite/TestFrontEndWebSite.bicep' = { name: 'TestFrontEndWebSite' - scope: resourceGroup_IABVtvgDt + scope: resourceGroup_I6QNkoPsb } module TestCommonSqlDatabase './resources/TestCommonSqlDatabase/TestCommonSqlDatabase.bicep' = { name: 'TestCommonSqlDatabase' - scope: resourceGroup_IABVtvgDt + scope: resourceGroup_I6QNkoPsb params: { sqlAdminPassword: sqlAdminPassword appUserPassword: appUserPassword @@ -68,7 +68,7 @@ module TestCommonSqlDatabase './resources/TestCommonSqlDatabase/TestCommonSqlDat module TestBackEndWebSite './resources/TestBackEndWebSite/TestBackEndWebSite.bicep' = { name: 'TestBackEndWebSite' - scope: resourceGroup_IABVtvgDt + scope: resourceGroup_I6QNkoPsb } output SERVICE_API_IDENTITY_PRINCIPAL_ID string = TestFrontEndWebSite.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID diff --git a/sdk/provisioning/Azure.Provisioning/tests/TestInfrastructure.cs b/sdk/provisioning/Azure.Provisioning/tests/TestInfrastructure.cs index 7e4368fc237de..5de0e0cfb7f60 100644 --- a/sdk/provisioning/Azure.Provisioning/tests/TestInfrastructure.cs +++ b/sdk/provisioning/Azure.Provisioning/tests/TestInfrastructure.cs @@ -8,7 +8,7 @@ namespace Azure.Provisioning.Tests internal class TestInfrastructure : Infrastructure { public TestInfrastructure() - : base(ConstructScope.Subscription, Guid.Empty, Guid.Empty) + : base(ConstructScope.Subscription, Guid.Empty, Guid.Empty, "TEST") { } }