diff --git a/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs b/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs +++ b/packages/autorest.typescript/src/generators/samples/sampleEnv.hbs @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env b/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env +++ b/packages/autorest.typescript/test/integration/generated/additionalProperties/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/integration/generated/datasearch/sample.env b/packages/autorest.typescript/test/integration/generated/datasearch/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/integration/generated/datasearch/sample.env +++ b/packages/autorest.typescript/test/integration/generated/datasearch/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/integration/generated/patterntest/sample.env b/packages/autorest.typescript/test/integration/generated/patterntest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/integration/generated/patterntest/sample.env +++ b/packages/autorest.typescript/test/integration/generated/patterntest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/bodyStringRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/dpgCustomization/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/headerRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/mediaTypesRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env b/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env +++ b/packages/autorest.typescript/test/rlcIntegration/generated/multipleInheritanceRest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env b/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env b/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/anomaly-detector-rest/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env b/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/arm-package-subscriptions-2019-06/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/compute-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/keyvault-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/msi-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/network-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/sql-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/storage-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env b/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env index 672847a3fe..508439fc7d 100644 --- a/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env +++ b/packages/autorest.typescript/test/smoke/generated/web-resource-manager/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/rlc-common/src/index.ts b/packages/rlc-common/src/index.ts index 8d96316807..8deff693b2 100644 --- a/packages/rlc-common/src/index.ts +++ b/packages/rlc-common/src/index.ts @@ -29,6 +29,7 @@ export * from "./metadata/buildTsConfig.js"; export * from "./metadata/buildESLintConfig.js"; export * from "./metadata/buildLicenseFile.js"; export * from "./metadata/buildVitestConfig.js"; +export * from "./metadata/buildSampleEnvFile.js"; export * from "./buildSerializeHelper.js"; export * from "./helpers/apiVersionUtil.js"; export * from "./buildLogger.js"; diff --git a/packages/rlc-common/src/metadata/buildSampleEnvFile.ts b/packages/rlc-common/src/metadata/buildSampleEnvFile.ts new file mode 100644 index 0000000000..e55ac377ed --- /dev/null +++ b/packages/rlc-common/src/metadata/buildSampleEnvFile.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { RLCModel } from "../interfaces.js"; + +const sampleEnvText = ` +# Feel free to add your own environment variables. +`; + +export function buildSampleEnvFile(model: RLCModel) { + if ( + (model.options?.generateMetadata === true || + model.options?.generateSample === true) && + model.options?.flavor === "azure" + ) { + const filePath = "sample.env"; + return { + path: filePath, + content: sampleEnvText.trim() + }; + } +} diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sample.env b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/sample.env b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/authoring/generated/typespec-ts/sample.env b/packages/typespec-test/test/authoring/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/authoring/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/batch_modular/generated/typespec-ts/sample.env b/packages/typespec-test/test/batch_modular/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/batch_modular/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/sample.env b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/sample.env b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/sample.env b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/faceai/generated/typespec-ts/sample.env b/packages/typespec-test/test/faceai/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/faceai/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/healthInsights_radiologyinsights/generated/typespec-ts/sample.env b/packages/typespec-test/test/healthInsights_radiologyinsights/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/healthInsights_radiologyinsights/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/sample.env b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/loadTest/generated/typespec-ts/sample.env b/packages/typespec-test/test/loadTest/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/loadTest/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/openai/generated/typespec-ts/sample.env b/packages/typespec-test/test/openai/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/openai/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/parametrizedHost/generated/typespec-ts/sample.env b/packages/typespec-test/test/parametrizedHost/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/parametrizedHost/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/schemaRegistry/generated/typespec-ts/sample.env b/packages/typespec-test/test/schemaRegistry/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/schemaRegistry/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/spread/generated/typespec-ts/sample.env b/packages/typespec-test/test/spread/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/spread/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/translator/generated/typespec-ts/sample.env b/packages/typespec-test/test/translator/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/translator/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sample.env b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-ts/src/index.ts b/packages/typespec-ts/src/index.ts index a5a3e7bc20..934bb3dd35 100644 --- a/packages/typespec-ts/src/index.ts +++ b/packages/typespec-ts/src/index.ts @@ -45,7 +45,8 @@ import { getClientName, hasUnexpectedHelper, isAzurePackage, - updatePackageFile + updatePackageFile, + buildSampleEnvFile } from "@azure-tools/rlc-common"; import { buildModels, buildModelsOptions } from "./modular/emitModels.js"; import { @@ -338,7 +339,8 @@ export async function $onEmit(context: EmitContext) { buildRollupConfig, buildApiExtractorConfig, buildReadmeFile, - buildLicenseFile + buildLicenseFile, + buildSampleEnvFile ]; if (option.moduleKind === "esm") { commonBuilders.push((model) => buildVitestConfig(model, "node"));