diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9a4120fa59ac..d8eadcda96bb 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14723,7 +14723,7 @@ packages: dev: false file:projects/arm-synapse.tgz: - resolution: {integrity: sha512-jweJRopzNOZvC2sEpiPUsUrcnVcTL8n2ywSNf/YzZb0Iu9vp8b10F0CEaJ+DpQ18pIjfmHXlFHySnuuhw8AMeA==, tarball: file:projects/arm-synapse.tgz} + resolution: {integrity: sha512-Hr69M835rmk5CBhOpM331KYs3qJKVtJe5ryZoNM6AV3MAWqSThH6tiyM0UFG6RiP+neZr8FyxfmOXOKUfgm/KA==, tarball: file:projects/arm-synapse.tgz} name: '@rush-temp/arm-synapse' version: 0.0.0 dependencies: @@ -14734,18 +14734,20 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.4 + '@types/node': 14.18.33 + chai: 4.3.7 cross-env: 7.0.3 + dotenv: 8.6.0 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 + rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/synapse/arm-synapse/CHANGELOG.md b/sdk/synapse/arm-synapse/CHANGELOG.md index 80b14fd80999..bfa8b11a890c 100644 --- a/sdk/synapse/arm-synapse/CHANGELOG.md +++ b/sdk/synapse/arm-synapse/CHANGELOG.md @@ -1,34 +1,110 @@ # Release History - -## 8.1.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 8.1.0-beta.1 (2022-04-20) + +## 8.1.0-beta.2 (2022-12-16) **Features** - Added operation group WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettings + - Added Interface AttachedDatabaseConfiguration + - Added Interface AzureADOnlyAuthentication + - Added Interface AzureEntityResource + - Added Interface BigDataPoolResourceInfo + - Added Interface ClusterPrincipalAssignment + - Added Interface CmdkeySetup + - Added Interface ComponentSetup + - Added Interface Database + - Added Interface DatabasePrincipalAssignment + - Added Interface DataConnection + - Added Interface DataMaskingPolicy + - Added Interface DataMaskingRule + - Added Interface DataWarehouseUserActivities + - Added Interface DedicatedSQLminimalTlsSettings - Added Interface DedicatedSQLminimalTlsSettingsListResult - Added Interface DedicatedSQLminimalTlsSettingsPatchInfo + - Added Interface EncryptionProtector + - Added Interface EnvironmentVariableSetup + - Added Interface EventGridDataConnection + - Added Interface EventHubDataConnection + - Added Interface ExtendedServerBlobAuditingPolicy + - Added Interface ExtendedSqlPoolBlobAuditingPolicy + - Added Interface GeoBackupPolicy + - Added Interface IntegrationRuntimeResource + - Added Interface IotHubDataConnection + - Added Interface IpFirewallRuleInfo + - Added Interface Key + - Added Interface KustoPool + - Added Interface KustoPoolUpdate + - Added Interface LibraryResource + - Added Interface LinkedIntegrationRuntimeKeyAuthorization + - Added Interface LinkedIntegrationRuntimeRbacAuthorization + - Added Interface MaintenanceWindowOptions + - Added Interface MaintenanceWindows + - Added Interface ManagedIdentitySqlControlSettingsModel + - Added Interface ManagedIntegrationRuntime + - Added Interface ManagedIntegrationRuntimeStatus + - Added Interface MetadataSyncConfig + - Added Interface PrivateEndpointConnection + - Added Interface PrivateEndpointConnectionForPrivateLinkHub + - Added Interface PrivateLinkHub + - Added Interface PrivateLinkResource + - Added Interface ProxyResource + - Added Interface ReadOnlyFollowingDatabase + - Added Interface ReadWriteDatabase + - Added Interface RecommendedSensitivityLabelUpdate + - Added Interface RecoverableSqlPool + - Added Interface ReplicationLink + - Added Interface RestorableDroppedSqlPool + - Added Interface RestorePoint + - Added Interface SecureString + - Added Interface SelfHostedIntegrationRuntime + - Added Interface SelfHostedIntegrationRuntimeStatus + - Added Interface SensitivityLabel + - Added Interface SensitivityLabelUpdate + - Added Interface ServerBlobAuditingPolicy + - Added Interface ServerSecurityAlertPolicy + - Added Interface ServerVulnerabilityAssessment + - Added Interface SparkConfigurationResource + - Added Interface SqlPool + - Added Interface SqlPoolBlobAuditingPolicy + - Added Interface SqlPoolColumn + - Added Interface SqlPoolConnectionPolicy + - Added Interface SqlPoolOperation + - Added Interface SqlPoolSchema + - Added Interface SqlPoolSecurityAlertPolicy + - Added Interface SqlPoolTable + - Added Interface SqlPoolVulnerabilityAssessment + - Added Interface SqlPoolVulnerabilityAssessmentRuleBaseline + - Added Interface SqlPoolVulnerabilityAssessmentScansExport + - Added Interface SsisEnvironment + - Added Interface SsisFolder + - Added Interface SsisPackage + - Added Interface SsisProject + - Added Interface SubResource + - Added Interface TrackedResource + - Added Interface TransparentDataEncryption + - Added Interface VulnerabilityAssessmentScanRecord + - Added Interface WorkloadClassifier + - Added Interface WorkloadGroup + - Added Interface Workspace + - Added Interface WorkspaceAadAdminInfo - Added Interface WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsGetOptionalParams - Added Interface WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListNextOptionalParams - Added Interface WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListOptionalParams - Added Interface WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsUpdateOptionalParams - - Added Type Alias DedicatedSQLminimalTlsSettings - Added Type Alias DedicatedSQLMinimalTlsSettingsName - Added Type Alias WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsGetResponse - Added Type Alias WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListNextResponse - Added Type Alias WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListResponse - Added Type Alias WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsUpdateResponse - - Class SynapseManagementClient has a new parameter workspaceManagedSqlServerDedicatedSQLMinimalTlsSettings - Added Enum KnownDedicatedSQLMinimalTlsSettingsName + - Added function getContinuationToken + - Interface SqlPoolSchemasListNextOptionalParams no longer has parameter filter + - Interface SqlPoolSensitivityLabelsListCurrentNextOptionalParams no longer has parameter filter + - Interface SqlPoolSensitivityLabelsListRecommendedNextOptionalParams no longer has parameter filter + - Interface SqlPoolSensitivityLabelsListRecommendedNextOptionalParams no longer has parameter includeDisabledRecommendations + - Interface SqlPoolSensitivityLabelsListRecommendedNextOptionalParams no longer has parameter skipToken + - Interface SqlPoolTableColumnsListByTableNameNextOptionalParams no longer has parameter filter + - Interface SqlPoolTablesListBySchemaNextOptionalParams no longer has parameter filter ## 8.0.0 (2022-01-13) diff --git a/sdk/synapse/arm-synapse/_meta.json b/sdk/synapse/arm-synapse/_meta.json index 8e5562d59969..2ec7eb7e03d8 100644 --- a/sdk/synapse/arm-synapse/_meta.json +++ b/sdk/synapse/arm-synapse/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8a9bd9c5b65e5c3e5a8536f3c5b2b15bf9920b5d", - "readme": "specification/synapse/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\synapse\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "fbaa815266eb087cb13f3e571dff03fddd8a48f0", + "readme": "specification\\synapse\\resource-manager\\readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\synapse\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.5.20221215.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", + "use": "@autorest/typescript@6.0.0-rc.5.20221215.1" } \ No newline at end of file diff --git a/sdk/synapse/arm-synapse/package.json b/sdk/synapse/arm-synapse/package.json index 29144a67b661..d8a1667414f9 100644 --- a/sdk/synapse/arm-synapse/package.json +++ b/sdk/synapse/arm-synapse/package.json @@ -11,7 +11,7 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -36,15 +36,20 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^8.2.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/synapse/arm-synapse", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -93,9 +98,8 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -107,6 +111,7 @@ ] }, "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/synapse/arm-synapse", "//sampleConfiguration": { "productName": "", "productSlugs": [ diff --git a/sdk/synapse/arm-synapse/recordings/node/my_test/recording_sample_test.js b/sdk/synapse/arm-synapse/recordings/node/my_test/recording_sample_test.js deleted file mode 100644 index 0f6ecb857acf..000000000000 --- a/sdk/synapse/arm-synapse/recordings/node/my_test/recording_sample_test.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/synapse/arm-synapse/recordings/node/synapse_test/recording_operations_checknameavailability_test.json b/sdk/synapse/arm-synapse/recordings/node/synapse_test/recording_operations_checknameavailability_test.json new file mode 100644 index 000000000000..46683be73125 --- /dev/null +++ b/sdk/synapse/arm-synapse/recordings/node/synapse_test/recording_operations_checknameavailability_test.json @@ -0,0 +1,45 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Synapse/checkNameAvailability?api-version=2021-06-01", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "61", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-arm-synapse/8.1.0-beta.2 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "bffa5837-8f9b-4b71-b0da-a34b4e8dbb00" + }, + "RequestBody": { + "name": "workspaceabc", + "type": "Microsoft.Synapse/workspaces" + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 16 Dec 2022 09:11:45 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "f496d12a-2724-4ef8-862e-8437baadc60a", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-request-id": "2b798bda-d85d-468b-b686-bda1545e3009", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221216T091146Z:f496d12a-2724-4ef8-862e-8437baadc60a" + }, + "ResponseBody": { + "available": true, + "name": "workspaceabc" + } + } + ], + "Variables": {} +} diff --git a/sdk/synapse/arm-synapse/review/arm-synapse.api.md b/sdk/synapse/arm-synapse/review/arm-synapse.api.md index 8c48adbf8f6e..de0cb63b3b9e 100644 --- a/sdk/synapse/arm-synapse/review/arm-synapse.api.md +++ b/sdk/synapse/arm-synapse/review/arm-synapse.api.md @@ -11,16 +11,16 @@ import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; // @public -export type AttachedDatabaseConfiguration = ProxyResource & { - location?: string; - readonly systemData?: SystemData; - readonly provisioningState?: ResourceProvisioningState; - databaseName?: string; - kustoPoolResourceId?: string; +export interface AttachedDatabaseConfiguration extends ProxyResource { readonly attachedDatabaseNames?: string[]; + databaseName?: string; defaultPrincipalsModificationKind?: DefaultPrincipalsModificationKind; + kustoPoolResourceId?: string; + location?: string; + readonly provisioningState?: ResourceProvisioningState; + readonly systemData?: SystemData; tableLevelSharingProperties?: TableLevelSharingProperties; -}; +} // @public export interface AttachedDatabaseConfigurationListResult { @@ -58,11 +58,11 @@ export interface AvailableRpOperationDisplayInfo { } // @public -export type AzureADOnlyAuthentication = ProxyResource & { +export interface AzureADOnlyAuthentication extends ProxyResource { azureADOnlyAuthentication?: boolean; - readonly state?: StateValue; readonly creationDate?: Date; -}; + readonly state?: StateValue; +} // @public export interface AzureADOnlyAuthenticationListResult { @@ -120,9 +120,9 @@ export interface AzureCapacity { } // @public -export type AzureEntityResource = Resource & { +export interface AzureEntityResource extends Resource { readonly etag?: string; -}; +} // @public export interface AzureResourceSku { @@ -149,26 +149,26 @@ export interface BigDataPoolPatchInfo { } // @public -export type BigDataPoolResourceInfo = TrackedResource & { - provisioningState?: string; - autoScale?: AutoScaleProperties; - readonly creationDate?: Date; +export interface BigDataPoolResourceInfo extends TrackedResource { autoPause?: AutoPauseProperties; - isComputeIsolationEnabled?: boolean; - sessionLevelPackagesEnabled?: boolean; + autoScale?: AutoScaleProperties; cacheSize?: number; - dynamicExecutorAllocation?: DynamicExecutorAllocation; - sparkEventsFolder?: string; - nodeCount?: number; - libraryRequirements?: LibraryRequirements; + readonly creationDate?: Date; customLibraries?: LibraryInfo[]; - sparkConfigProperties?: SparkConfigProperties; - sparkVersion?: string; defaultSparkLogFolder?: string; + dynamicExecutorAllocation?: DynamicExecutorAllocation; + isComputeIsolationEnabled?: boolean; + readonly lastSucceededTimestamp?: Date; + libraryRequirements?: LibraryRequirements; + nodeCount?: number; nodeSize?: NodeSize; nodeSizeFamily?: NodeSizeFamily; - readonly lastSucceededTimestamp?: Date; -}; + provisioningState?: string; + sessionLevelPackagesEnabled?: boolean; + sparkConfigProperties?: SparkConfigProperties; + sparkEventsFolder?: string; + sparkVersion?: string; +} // @public export interface BigDataPoolResourceInfoListResult { @@ -266,16 +266,16 @@ export interface CheckNameResult { } // @public -export type ClusterPrincipalAssignment = ProxyResource & { - readonly systemData?: SystemData; +export interface ClusterPrincipalAssignment extends ProxyResource { principalId?: string; + readonly principalName?: string; + principalType?: PrincipalType; + readonly provisioningState?: ResourceProvisioningState; role?: ClusterPrincipalRole; + readonly systemData?: SystemData; tenantId?: string; - principalType?: PrincipalType; readonly tenantName?: string; - readonly principalName?: string; - readonly provisioningState?: ResourceProvisioningState; -}; +} // @public export interface ClusterPrincipalAssignmentCheckNameRequest { @@ -292,22 +292,22 @@ export interface ClusterPrincipalAssignmentListResult { export type ClusterPrincipalRole = string; // @public -export type CmdkeySetup = CustomSetupBase & { - type: "CmdkeySetup"; +export interface CmdkeySetup extends CustomSetupBase { + password: SecretBaseUnion; targetName: Record; + type: "CmdkeySetup"; userName: Record; - password: SecretBaseUnion; -}; +} // @public export type ColumnDataType = string; // @public -export type ComponentSetup = CustomSetupBase & { - type: "ComponentSetup"; +export interface ComponentSetup extends CustomSetupBase { componentName: string; licenseKey?: SecretBaseUnion; -}; + type: "ComponentSetup"; +} // @public export type Compression = string; @@ -350,11 +350,11 @@ export interface CustomSetupBase { export type CustomSetupBaseUnion = CustomSetupBase | CmdkeySetup | EnvironmentVariableSetup | ComponentSetup; // @public -export type Database = ProxyResource & { - location?: string; +export interface Database extends ProxyResource { kind: Kind; + location?: string; readonly systemData?: SystemData; -}; +} // @public export interface DatabaseCheckNameRequest { @@ -368,16 +368,16 @@ export interface DatabaseListResult { } // @public -export type DatabasePrincipalAssignment = ProxyResource & { - readonly systemData?: SystemData; +export interface DatabasePrincipalAssignment extends ProxyResource { principalId?: string; + readonly principalName?: string; + principalType?: PrincipalType; + readonly provisioningState?: ResourceProvisioningState; role?: DatabasePrincipalRole; + readonly systemData?: SystemData; tenantId?: string; - principalType?: PrincipalType; readonly tenantName?: string; - readonly principalName?: string; - readonly provisioningState?: ResourceProvisioningState; -}; +} // @public export interface DatabasePrincipalAssignmentCheckNameRequest { @@ -402,11 +402,11 @@ export interface DatabaseStatistics { export type DatabaseUnion = Database | ReadWriteDatabase | ReadOnlyFollowingDatabase; // @public -export type DataConnection = ProxyResource & { - location?: string; +export interface DataConnection extends ProxyResource { kind: DataConnectionKind; + location?: string; readonly systemData?: SystemData; -}; +} // @public export interface DataConnectionCheckNameRequest { @@ -476,33 +476,33 @@ export interface DataMaskingPoliciesGetOptionalParams extends coreClient.Operati export type DataMaskingPoliciesGetResponse = DataMaskingPolicy; // @public (undocumented) -export type DataMaskingPolicy = ProxyResource & { - readonly location?: string; - readonly kind?: string; - readonly managedBy?: string; +export interface DataMaskingPolicy extends ProxyResource { + readonly applicationPrincipals?: string; dataMaskingState?: DataMaskingState; exemptPrincipals?: string; - readonly applicationPrincipals?: string; + readonly kind?: string; + readonly location?: string; + readonly managedBy?: string; readonly maskingLevel?: string; -}; +} // @public -export type DataMaskingRule = ProxyResource & { - readonly location?: string; - readonly kind?: string; - readonly idPropertiesId?: string; +export interface DataMaskingRule extends ProxyResource { aliasName?: string; - ruleState?: DataMaskingRuleState; - schemaName?: string; - tableName?: string; columnName?: string; + readonly idPropertiesId?: string; + readonly kind?: string; + readonly location?: string; maskingFunction?: DataMaskingFunction; numberFrom?: string; numberTo?: string; prefixSize?: string; - suffixSize?: string; replacementString?: string; -}; + ruleState?: DataMaskingRuleState; + schemaName?: string; + suffixSize?: string; + tableName?: string; +} // @public export interface DataMaskingRuleListResult { @@ -544,9 +544,9 @@ export type DataMaskingRuleState = "Disabled" | "Enabled"; export type DataMaskingState = "Disabled" | "Enabled"; // @public -export type DataWarehouseUserActivities = ProxyResource & { +export interface DataWarehouseUserActivities extends ProxyResource { readonly activeQueriesCount?: number; -}; +} // @public export type DataWarehouseUserActivityName = string; @@ -555,10 +555,10 @@ export type DataWarehouseUserActivityName = string; export type DayOfWeek = string; // @public -export type DedicatedSQLminimalTlsSettings = ProxyResource & { +export interface DedicatedSQLminimalTlsSettings extends ProxyResource { readonly location?: string; minimalTlsVersion?: string; -}; +} // @public export interface DedicatedSQLminimalTlsSettingsListResult { @@ -591,15 +591,15 @@ export interface EncryptionDetails { } // @public -export type EncryptionProtector = ProxyResource & { +export interface EncryptionProtector extends ProxyResource { readonly kind?: string; readonly location?: string; - readonly subregion?: string; serverKeyName?: string; serverKeyType?: ServerKeyType; - readonly uri?: string; + readonly subregion?: string; readonly thumbprint?: string; -}; + readonly uri?: string; +} // @public export interface EncryptionProtectorListResult { @@ -617,11 +617,11 @@ export interface EntityReference { } // @public -export type EnvironmentVariableSetup = CustomSetupBase & { +export interface EnvironmentVariableSetup extends CustomSetupBase { type: "EnvironmentVariableSetup"; variableName: string; variableValue: string; -}; +} // @public export interface ErrorAdditionalInfo { @@ -644,51 +644,53 @@ export interface ErrorResponse { } // @public -export type EventGridDataConnection = DataConnection & { - storageAccountResourceId?: string; - eventHubResourceId?: string; +export interface EventGridDataConnection extends DataConnection { + blobStorageEventType?: BlobStorageEventType; consumerGroup?: string; - tableName?: string; - mappingRuleName?: string; dataFormat?: EventGridDataFormat; + eventHubResourceId?: string; ignoreFirstRecord?: boolean; - blobStorageEventType?: BlobStorageEventType; + kind: "EventGrid"; + mappingRuleName?: string; readonly provisioningState?: ResourceProvisioningState; -}; + storageAccountResourceId?: string; + tableName?: string; +} // @public export type EventGridDataFormat = string; // @public -export type EventHubDataConnection = DataConnection & { - eventHubResourceId?: string; +export interface EventHubDataConnection extends DataConnection { + compression?: Compression; consumerGroup?: string; - tableName?: string; - mappingRuleName?: string; dataFormat?: EventHubDataFormat; + eventHubResourceId?: string; eventSystemProperties?: string[]; - compression?: Compression; - readonly provisioningState?: ResourceProvisioningState; + kind: "EventHub"; managedIdentityResourceId?: string; -}; + mappingRuleName?: string; + readonly provisioningState?: ResourceProvisioningState; + tableName?: string; +} // @public export type EventHubDataFormat = string; // @public -export type ExtendedServerBlobAuditingPolicy = ProxyResource & { +export interface ExtendedServerBlobAuditingPolicy extends ProxyResource { + auditActionsAndGroups?: string[]; + isAzureMonitorTargetEnabled?: boolean; + isDevopsAuditEnabled?: boolean; + isStorageSecondaryKeyInUse?: boolean; predicateExpression?: string; + queueDelayMs?: number; + retentionDays?: number; state?: BlobAuditingPolicyState; - storageEndpoint?: string; storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; - isAzureMonitorTargetEnabled?: boolean; - queueDelayMs?: number; - isDevopsAuditEnabled?: boolean; -}; + storageEndpoint?: string; +} // @public export interface ExtendedServerBlobAuditingPolicyListResult { @@ -732,18 +734,18 @@ export interface ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams export type ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolResponse = ExtendedSqlPoolBlobAuditingPolicyListResult; // @public -export type ExtendedSqlPoolBlobAuditingPolicy = ProxyResource & { +export interface ExtendedSqlPoolBlobAuditingPolicy extends ProxyResource { + auditActionsAndGroups?: string[]; + isAzureMonitorTargetEnabled?: boolean; + isStorageSecondaryKeyInUse?: boolean; predicateExpression?: string; + queueDelayMs?: number; + retentionDays?: number; state?: BlobAuditingPolicyState; - storageEndpoint?: string; storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; - isAzureMonitorTargetEnabled?: boolean; - queueDelayMs?: number; -}; + storageEndpoint?: string; +} // @public export interface ExtendedSqlPoolBlobAuditingPolicyListResult { @@ -764,12 +766,12 @@ export interface FollowerDatabaseListResult { } // @public -export type GeoBackupPolicy = ProxyResource & { +export interface GeoBackupPolicy extends ProxyResource { readonly kind?: string; readonly location?: string; state: GeoBackupPolicyState; readonly storageType?: string; -}; +} // @public export interface GeoBackupPolicyListResult { @@ -782,6 +784,9 @@ export type GeoBackupPolicyName = string; // @public export type GeoBackupPolicyState = "Disabled" | "Enabled"; +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export interface GetSsisObjectMetadataRequest { metadataPath?: string; @@ -1034,9 +1039,9 @@ export interface IntegrationRuntimeRegenerateKeyParameters { } // @public -export type IntegrationRuntimeResource = SubResource & { +export interface IntegrationRuntimeResource extends SubResource { properties: IntegrationRuntimeUnion; -}; +} // @public export interface IntegrationRuntimes { @@ -1216,26 +1221,27 @@ export interface IntegrationRuntimeVNetProperties { } // @public -export type IotHubDataConnection = DataConnection & { - iotHubResourceId?: string; +export interface IotHubDataConnection extends DataConnection { consumerGroup?: string; - tableName?: string; - mappingRuleName?: string; dataFormat?: IotHubDataFormat; eventSystemProperties?: string[]; - sharedAccessPolicyName?: string; + iotHubResourceId?: string; + kind: "IotHub"; + mappingRuleName?: string; readonly provisioningState?: ResourceProvisioningState; -}; + sharedAccessPolicyName?: string; + tableName?: string; +} // @public export type IotHubDataFormat = string; // @public -export type IpFirewallRuleInfo = ProxyResource & { +export interface IpFirewallRuleInfo extends ProxyResource { endIpAddress?: string; readonly provisioningState?: ProvisioningState; startIpAddress?: string; -}; +} // @public export interface IpFirewallRuleInfoListResult { @@ -1317,10 +1323,10 @@ export interface KekIdentityProperties { } // @public -export type Key = ProxyResource & { +export interface Key extends ProxyResource { isActiveCMK?: boolean; keyVaultUrl?: string; -}; +} // @public export interface KeyInfoListResult { @@ -1376,471 +1382,306 @@ export type Kind = string; // @public export enum KnownAzureADOnlyAuthenticationName { - // (undocumented) Default = "default" } // @public export enum KnownAzureScaleType { - // (undocumented) Automatic = "automatic", - // (undocumented) Manual = "manual", - // (undocumented) None = "none" } // @public export enum KnownBlobAuditingPolicyName { - // (undocumented) Default = "default" } // @public export enum KnownBlobStorageEventType { - // (undocumented) MicrosoftStorageBlobCreated = "Microsoft.Storage.BlobCreated", - // (undocumented) MicrosoftStorageBlobRenamed = "Microsoft.Storage.BlobRenamed" } // @public export enum KnownClusterPrincipalRole { - // (undocumented) AllDatabasesAdmin = "AllDatabasesAdmin", - // (undocumented) AllDatabasesViewer = "AllDatabasesViewer" } // @public export enum KnownColumnDataType { - // (undocumented) Bigint = "bigint", - // (undocumented) Binary = "binary", - // (undocumented) Bit = "bit", - // (undocumented) Char = "char", - // (undocumented) Date = "date", - // (undocumented) Datetime = "datetime", - // (undocumented) Datetime2 = "datetime2", - // (undocumented) Datetimeoffset = "datetimeoffset", - // (undocumented) Decimal = "decimal", - // (undocumented) Float = "float", - // (undocumented) Geography = "geography", - // (undocumented) Geometry = "geometry", - // (undocumented) Hierarchyid = "hierarchyid", - // (undocumented) Image = "image", - // (undocumented) Int = "int", - // (undocumented) Money = "money", - // (undocumented) Nchar = "nchar", - // (undocumented) Ntext = "ntext", - // (undocumented) Numeric = "numeric", - // (undocumented) Nvarchar = "nvarchar", - // (undocumented) Real = "real", - // (undocumented) Smalldatetime = "smalldatetime", - // (undocumented) Smallint = "smallint", - // (undocumented) Smallmoney = "smallmoney", - // (undocumented) SqlVariant = "sql_variant", - // (undocumented) Sysname = "sysname", - // (undocumented) Text = "text", - // (undocumented) Time = "time", - // (undocumented) Timestamp = "timestamp", - // (undocumented) Tinyint = "tinyint", - // (undocumented) Uniqueidentifier = "uniqueidentifier", - // (undocumented) Varbinary = "varbinary", - // (undocumented) Varchar = "varchar", - // (undocumented) Xml = "xml" } // @public export enum KnownCompression { - // (undocumented) GZip = "GZip", - // (undocumented) None = "None" } // @public export enum KnownConfigurationType { - // (undocumented) Artifact = "Artifact", - // (undocumented) File = "File" } // @public export enum KnownConnectionPolicyName { - // (undocumented) Default = "default" } // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownCreateMode { - // (undocumented) Default = "Default", - // (undocumented) PointInTimeRestore = "PointInTimeRestore", - // (undocumented) Recovery = "Recovery", - // (undocumented) Restore = "Restore" } // @public export enum KnownDatabasePrincipalRole { - // (undocumented) Admin = "Admin", - // (undocumented) Ingestor = "Ingestor", - // (undocumented) Monitor = "Monitor", - // (undocumented) UnrestrictedViewer = "UnrestrictedViewer", - // (undocumented) User = "User", - // (undocumented) Viewer = "Viewer" } // @public export enum KnownDataConnectionKind { - // (undocumented) EventGrid = "EventGrid", - // (undocumented) EventHub = "EventHub", - // (undocumented) IotHub = "IotHub" } // @public export enum KnownDataFlowComputeType { - // (undocumented) ComputeOptimized = "ComputeOptimized", - // (undocumented) General = "General", - // (undocumented) MemoryOptimized = "MemoryOptimized" } // @public export enum KnownDataWarehouseUserActivityName { - // (undocumented) Current = "current" } // @public export enum KnownDayOfWeek { - // (undocumented) Friday = "Friday", - // (undocumented) Monday = "Monday", - // (undocumented) Saturday = "Saturday", - // (undocumented) Sunday = "Sunday", - // (undocumented) Thursday = "Thursday", - // (undocumented) Tuesday = "Tuesday", - // (undocumented) Wednesday = "Wednesday" } // @public export enum KnownDedicatedSQLMinimalTlsSettingsName { - // (undocumented) Default = "default" } // @public export enum KnownDefaultPrincipalsModificationKind { - // (undocumented) None = "None", - // (undocumented) Replace = "Replace", - // (undocumented) Union = "Union" } // @public export enum KnownEncryptionProtectorName { - // (undocumented) Current = "current" } // @public export enum KnownEventGridDataFormat { - // (undocumented) Apacheavro = "APACHEAVRO", - // (undocumented) Avro = "AVRO", - // (undocumented) CSV = "CSV", - // (undocumented) Json = "JSON", - // (undocumented) Multijson = "MULTIJSON", - // (undocumented) ORC = "ORC", - // (undocumented) Parquet = "PARQUET", - // (undocumented) PSV = "PSV", - // (undocumented) RAW = "RAW", - // (undocumented) Scsv = "SCSV", - // (undocumented) Singlejson = "SINGLEJSON", - // (undocumented) Sohsv = "SOHSV", - // (undocumented) TSV = "TSV", - // (undocumented) Tsve = "TSVE", - // (undocumented) TXT = "TXT", - // (undocumented) W3Clogfile = "W3CLOGFILE" } // @public export enum KnownEventHubDataFormat { - // (undocumented) Apacheavro = "APACHEAVRO", - // (undocumented) Avro = "AVRO", - // (undocumented) CSV = "CSV", - // (undocumented) Json = "JSON", - // (undocumented) Multijson = "MULTIJSON", - // (undocumented) ORC = "ORC", - // (undocumented) Parquet = "PARQUET", - // (undocumented) PSV = "PSV", - // (undocumented) RAW = "RAW", - // (undocumented) Scsv = "SCSV", - // (undocumented) Singlejson = "SINGLEJSON", - // (undocumented) Sohsv = "SOHSV", - // (undocumented) TSV = "TSV", - // (undocumented) Tsve = "TSVE", - // (undocumented) TXT = "TXT", - // (undocumented) W3Clogfile = "W3CLOGFILE" } // @public export enum KnownGeoBackupPolicyName { - // (undocumented) Default = "Default" } // @public export enum KnownIntegrationRuntimeAuthKeyName { - // (undocumented) AuthKey1 = "authKey1", - // (undocumented) AuthKey2 = "authKey2" } // @public export enum KnownIntegrationRuntimeAutoUpdate { - // (undocumented) Off = "Off", - // (undocumented) On = "On" } // @public export enum KnownIntegrationRuntimeEdition { - // (undocumented) Enterprise = "Enterprise", - // (undocumented) Standard = "Standard" } // @public export enum KnownIntegrationRuntimeEntityReferenceType { - // (undocumented) IntegrationRuntimeReference = "IntegrationRuntimeReference", - // (undocumented) LinkedServiceReference = "LinkedServiceReference" } // @public export enum KnownIntegrationRuntimeInternalChannelEncryptionMode { - // (undocumented) NotEncrypted = "NotEncrypted", - // (undocumented) NotSet = "NotSet", - // (undocumented) SslEncrypted = "SslEncrypted" } // @public export enum KnownIntegrationRuntimeLicenseType { - // (undocumented) BasePrice = "BasePrice", - // (undocumented) LicenseIncluded = "LicenseIncluded" } // @public export enum KnownIntegrationRuntimeSsisCatalogPricingTier { - // (undocumented) Basic = "Basic", - // (undocumented) Premium = "Premium", - // (undocumented) PremiumRS = "PremiumRS", - // (undocumented) Standard = "Standard" } // @public export enum KnownIntegrationRuntimeState { - // (undocumented) AccessDenied = "AccessDenied", - // (undocumented) Initial = "Initial", - // (undocumented) Limited = "Limited", - // (undocumented) NeedRegistration = "NeedRegistration", - // (undocumented) Offline = "Offline", - // (undocumented) Online = "Online", - // (undocumented) Started = "Started", - // (undocumented) Starting = "Starting", - // (undocumented) Stopped = "Stopped", - // (undocumented) Stopping = "Stopping" } // @public export enum KnownIntegrationRuntimeType { - // (undocumented) Managed = "Managed", - // (undocumented) SelfHosted = "SelfHosted" } // @public export enum KnownIntegrationRuntimeUpdateResult { - // (undocumented) Fail = "Fail", - // (undocumented) None = "None", - // (undocumented) Succeed = "Succeed" } // @public export enum KnownIotHubDataFormat { - // (undocumented) Apacheavro = "APACHEAVRO", - // (undocumented) Avro = "AVRO", - // (undocumented) CSV = "CSV", - // (undocumented) Json = "JSON", - // (undocumented) Multijson = "MULTIJSON", - // (undocumented) ORC = "ORC", - // (undocumented) Parquet = "PARQUET", - // (undocumented) PSV = "PSV", - // (undocumented) RAW = "RAW", - // (undocumented) Scsv = "SCSV", - // (undocumented) Singlejson = "SINGLEJSON", - // (undocumented) Sohsv = "SOHSV", - // (undocumented) TSV = "TSV", - // (undocumented) Tsve = "TSVE", - // (undocumented) TXT = "TXT", - // (undocumented) W3Clogfile = "W3CLOGFILE" } // @public export enum KnownKind { - // (undocumented) ReadOnlyFollowing = "ReadOnlyFollowing", - // (undocumented) ReadWrite = "ReadWrite" } // @public export enum KnownLanguageExtensionName { - // (undocumented) Python = "PYTHON", // (undocumented) R = "R" @@ -1848,315 +1689,214 @@ export enum KnownLanguageExtensionName { // @public export enum KnownManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState { - // (undocumented) Disabled = "Disabled", - // (undocumented) Disabling = "Disabling", - // (undocumented) Enabled = "Enabled", - // (undocumented) Enabling = "Enabling", - // (undocumented) Unknown = "Unknown" } // @public export enum KnownManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownManagedIntegrationRuntimeNodeStatus { - // (undocumented) Available = "Available", - // (undocumented) Recycling = "Recycling", - // (undocumented) Starting = "Starting", - // (undocumented) Unavailable = "Unavailable" } // @public export enum KnownManagementOperationState { - // (undocumented) CancelInProgress = "CancelInProgress", - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Failed = "Failed", - // (undocumented) InProgress = "InProgress", - // (undocumented) Pending = "Pending", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownNodeSize { - // (undocumented) Large = "Large", - // (undocumented) Medium = "Medium", - // (undocumented) None = "None", - // (undocumented) Small = "Small", - // (undocumented) XLarge = "XLarge", - // (undocumented) XXLarge = "XXLarge", - // (undocumented) XXXLarge = "XXXLarge" } // @public export enum KnownNodeSizeFamily { - // (undocumented) HardwareAcceleratedFpga = "HardwareAcceleratedFPGA", - // (undocumented) HardwareAcceleratedGPU = "HardwareAcceleratedGPU", - // (undocumented) MemoryOptimized = "MemoryOptimized", - // (undocumented) None = "None" } // @public export enum KnownOperationStatus { - // (undocumented) Canceled = "Canceled", - // (undocumented) Failed = "Failed", - // (undocumented) InProgress = "InProgress", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownPrincipalsModificationKind { - // (undocumented) None = "None", - // (undocumented) Replace = "Replace", - // (undocumented) Union = "Union" } // @public export enum KnownPrincipalType { - // (undocumented) App = "App", - // (undocumented) Group = "Group", - // (undocumented) User = "User" } // @public export enum KnownProvisioningState { - // (undocumented) DeleteError = "DeleteError", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Provisioning = "Provisioning", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownReason { - // (undocumented) AlreadyExists = "AlreadyExists", - // (undocumented) Invalid = "Invalid" } // @public export enum KnownReplicationState { - // (undocumented) CatchUP = "CATCH_UP", - // (undocumented) Pending = "PENDING", - // (undocumented) Seeding = "SEEDING", - // (undocumented) Suspended = "SUSPENDED" } // @public export enum KnownResourceProvisioningState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Creating = "Creating", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Moving = "Moving", - // (undocumented) Running = "Running", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownSecurityAlertPolicyName { - // (undocumented) Default = "default" } // @public export enum KnownSecurityAlertPolicyNameAutoGenerated { - // (undocumented) Default = "Default" } // @public export enum KnownSelfHostedIntegrationRuntimeNodeStatus { - // (undocumented) InitializeFailed = "InitializeFailed", - // (undocumented) Initializing = "Initializing", - // (undocumented) Limited = "Limited", - // (undocumented) NeedRegistration = "NeedRegistration", - // (undocumented) Offline = "Offline", - // (undocumented) Online = "Online", - // (undocumented) Upgrading = "Upgrading" } // @public export enum KnownServerKeyType { - // (undocumented) AzureKeyVault = "AzureKeyVault", - // (undocumented) ServiceManaged = "ServiceManaged" } // @public export enum KnownSkuName { - // (undocumented) ComputeOptimized = "Compute optimized", - // (undocumented) StorageOptimized = "Storage optimized" } // @public export enum KnownSkuSize { - // (undocumented) ExtraSmall = "Extra small", - // (undocumented) Large = "Large", - // (undocumented) Medium = "Medium", - // (undocumented) Small = "Small" } // @public export enum KnownSsisObjectMetadataType { - // (undocumented) Environment = "Environment", - // (undocumented) Folder = "Folder", - // (undocumented) Package = "Package", - // (undocumented) Project = "Project" } // @public export enum KnownState { - // (undocumented) Creating = "Creating", - // (undocumented) Deleted = "Deleted", - // (undocumented) Deleting = "Deleting", - // (undocumented) Running = "Running", - // (undocumented) Starting = "Starting", - // (undocumented) Stopped = "Stopped", - // (undocumented) Stopping = "Stopping", - // (undocumented) Unavailable = "Unavailable", - // (undocumented) Updating = "Updating" } // @public export enum KnownStateValue { - // (undocumented) Consistent = "Consistent", - // (undocumented) InConsistent = "InConsistent", - // (undocumented) Updating = "Updating" } // @public export enum KnownStorageAccountType { - // (undocumented) GRS = "GRS", - // (undocumented) LRS = "LRS" } // @public export enum KnownTransparentDataEncryptionName { - // (undocumented) Current = "current" } // @public export enum KnownVulnerabilityAssessmentName { - // (undocumented) Default = "default" } // @public export enum KnownVulnerabilityAssessmentScanState { - // (undocumented) Failed = "Failed", - // (undocumented) FailedToRun = "FailedToRun", - // (undocumented) InProgress = "InProgress", - // (undocumented) Passed = "Passed" } // @public export enum KnownVulnerabilityAssessmentScanTriggerType { - // (undocumented) OnDemand = "OnDemand", - // (undocumented) Recurring = "Recurring" } // @public export enum KnownWorkspacePublicNetworkAccess { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } @@ -2180,21 +1920,21 @@ export interface KustoOperationsListOptionalParams extends coreClient.OperationO export type KustoOperationsListResponse = OperationListResult; // @public -export type KustoPool = TrackedResource & { - sku: AzureSku; - readonly etag?: string; - readonly systemData?: SystemData; - readonly state?: State; - readonly provisioningState?: ResourceProvisioningState; - readonly uri?: string; +export interface KustoPool extends TrackedResource { readonly dataIngestionUri?: string; - readonly stateReason?: string; - optimizedAutoscale?: OptimizedAutoscale; - enableStreamingIngest?: boolean; enablePurge?: boolean; + enableStreamingIngest?: boolean; + readonly etag?: string; readonly languageExtensions?: LanguageExtensionsList; + optimizedAutoscale?: OptimizedAutoscale; + readonly provisioningState?: ResourceProvisioningState; + sku: AzureSku; + readonly state?: State; + readonly stateReason?: string; + readonly systemData?: SystemData; + readonly uri?: string; workspaceUID?: string; -}; +} // @public export interface KustoPoolAttachedDatabaseConfigurations { @@ -2605,22 +2345,22 @@ export interface KustoPoolsUpdateOptionalParams extends coreClient.OperationOpti export type KustoPoolsUpdateResponse = KustoPool; // @public -export type KustoPoolUpdate = Resource & { +export interface KustoPoolUpdate extends Resource { + readonly dataIngestionUri?: string; + enablePurge?: boolean; + enableStreamingIngest?: boolean; + readonly languageExtensions?: LanguageExtensionsList; + optimizedAutoscale?: OptimizedAutoscale; + readonly provisioningState?: ResourceProvisioningState; + sku?: AzureSku; + readonly state?: State; + readonly stateReason?: string; tags?: { [propertyName: string]: string; }; - sku?: AzureSku; - readonly state?: State; - readonly provisioningState?: ResourceProvisioningState; readonly uri?: string; - readonly dataIngestionUri?: string; - readonly stateReason?: string; - optimizedAutoscale?: OptimizedAutoscale; - enableStreamingIngest?: boolean; - enablePurge?: boolean; - readonly languageExtensions?: LanguageExtensionsList; workspaceUID?: string; -}; +} // @public export interface LanguageExtension { @@ -2691,15 +2431,15 @@ export interface LibraryRequirements { } // @public -export type LibraryResource = SubResource & { +export interface LibraryResource extends SubResource { + containerName?: string; + readonly creatorId?: string; namePropertiesName?: string; path?: string; - containerName?: string; - uploadedTimestamp?: Date; - typePropertiesType?: string; readonly provisioningStatus?: string; - readonly creatorId?: string; -}; + typePropertiesType?: string; + uploadedTimestamp?: Date; +} // @public export interface LinkedIntegrationRuntime { @@ -2711,16 +2451,16 @@ export interface LinkedIntegrationRuntime { } // @public -export type LinkedIntegrationRuntimeKeyAuthorization = LinkedIntegrationRuntimeType & { +export interface LinkedIntegrationRuntimeKeyAuthorization extends LinkedIntegrationRuntimeType { authorizationType: "Key"; key: SecureString; -}; +} // @public -export type LinkedIntegrationRuntimeRbacAuthorization = LinkedIntegrationRuntimeType & { +export interface LinkedIntegrationRuntimeRbacAuthorization extends LinkedIntegrationRuntimeType { authorizationType: "RBAC"; resourceId: string; -}; +} // @public export interface LinkedIntegrationRuntimeType { @@ -2742,20 +2482,21 @@ export interface ListSqlPoolSecurityAlertPolicies { } // @public -export type MaintenanceWindowOptions = ProxyResource & { +export interface MaintenanceWindowOptions extends ProxyResource { + allowMultipleMaintenanceWindowsPerCycle?: boolean; + defaultDurationInMinutes?: number; isEnabled?: boolean; maintenanceWindowCycles?: MaintenanceWindowTimeRange[]; - minDurationInMinutes?: number; - defaultDurationInMinutes?: number; minCycles?: number; + minDurationInMinutes?: number; timeGranularityInMinutes?: number; - allowMultipleMaintenanceWindowsPerCycle?: boolean; -}; +} // @public -export type MaintenanceWindows = ProxyResource & { +export interface MaintenanceWindows extends ProxyResource { + // (undocumented) timeRanges?: MaintenanceWindowTimeRange[]; -}; +} // @public export interface MaintenanceWindowTimeRange { @@ -2775,9 +2516,9 @@ export interface ManagedIdentity { } // @public -export type ManagedIdentitySqlControlSettingsModel = ProxyResource & { +export interface ManagedIdentitySqlControlSettingsModel extends ProxyResource { grantSqlControlToManagedIdentity?: ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity; -}; +} // @public export interface ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity { @@ -2792,15 +2533,15 @@ export type ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToMan export type ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState = string; // @public -export type ManagedIntegrationRuntime = IntegrationRuntime & { - type: "Managed"; - readonly state?: IntegrationRuntimeState; - referenceName?: string; - typeManagedVirtualNetworkType?: string; - id?: string; +export interface ManagedIntegrationRuntime extends IntegrationRuntime { computeProperties?: IntegrationRuntimeComputeProperties; + id?: string; + referenceName?: string; ssisProperties?: IntegrationRuntimeSsisProperties; -}; + readonly state?: IntegrationRuntimeState; + type: "Managed"; + typeManagedVirtualNetworkType?: string; +} // @public export interface ManagedIntegrationRuntimeError { @@ -2834,13 +2575,13 @@ export interface ManagedIntegrationRuntimeOperationResult { } // @public -export type ManagedIntegrationRuntimeStatus = IntegrationRuntimeStatus & { - type: "Managed"; +export interface ManagedIntegrationRuntimeStatus extends IntegrationRuntimeStatus { readonly createTime?: Date; + readonly lastOperation?: ManagedIntegrationRuntimeOperationResult; readonly nodes?: ManagedIntegrationRuntimeNode[]; readonly otherErrors?: ManagedIntegrationRuntimeError[]; - readonly lastOperation?: ManagedIntegrationRuntimeOperationResult; -}; + type: "Managed"; +} // @public export interface ManagedVirtualNetworkSettings { @@ -2853,10 +2594,10 @@ export interface ManagedVirtualNetworkSettings { export type ManagementOperationState = string; // @public -export type MetadataSyncConfig = ProxyResource & { +export interface MetadataSyncConfig extends ProxyResource { enabled?: boolean; syncIntervalInMinutes?: number; -}; +} // @public export type NodeSize = string; @@ -2989,17 +2730,19 @@ export interface PrivateEndpoint { } // @public -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; readonly provisioningState?: string; -}; +} // @public (undocumented) -export type PrivateEndpointConnectionForPrivateLinkHub = PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated & { +export interface PrivateEndpointConnectionForPrivateLinkHub extends PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated { + // (undocumented) name?: string; + // (undocumented) type?: string; -}; +} // @public export interface PrivateEndpointConnectionForPrivateLinkHubBasic { @@ -3111,10 +2854,10 @@ export interface PrivateEndpointConnectionsPrivateLinkHubListOptionalParams exte export type PrivateEndpointConnectionsPrivateLinkHubListResponse = PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse; // @public -export type PrivateLinkHub = TrackedResource & { - provisioningState?: string; +export interface PrivateLinkHub extends TrackedResource { readonly privateEndpointConnections?: PrivateEndpointConnectionForPrivateLinkHubBasic[]; -}; + provisioningState?: string; +} // @public export interface PrivateLinkHubInfoListResult { @@ -3223,9 +2966,9 @@ export interface PrivateLinkHubsUpdateOptionalParams extends coreClient.Operatio export type PrivateLinkHubsUpdateResponse = PrivateLinkHub; // @public -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { readonly properties?: PrivateLinkResourceProperties; -}; +} // @public export interface PrivateLinkResourceListResult { @@ -3278,7 +3021,8 @@ export interface PrivateLinkServiceConnectionState { export type ProvisioningState = string; // @public -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource { +} // @public export interface PurviewConfiguration { @@ -3319,35 +3063,38 @@ export interface QueryStatistic { } // @public -export type ReadOnlyFollowingDatabase = Database & { - readonly provisioningState?: ResourceProvisioningState; - readonly softDeletePeriod?: string; +export interface ReadOnlyFollowingDatabase extends Database { + readonly attachedDatabaseConfigurationName?: string; hotCachePeriod?: string; - readonly statistics?: DatabaseStatistics; + kind: "ReadOnlyFollowing"; readonly leaderClusterResourceId?: string; - readonly attachedDatabaseConfigurationName?: string; readonly principalsModificationKind?: PrincipalsModificationKind; -}; + readonly provisioningState?: ResourceProvisioningState; + readonly softDeletePeriod?: string; + readonly statistics?: DatabaseStatistics; +} // @public -export type ReadWriteDatabase = Database & { +export interface ReadWriteDatabase extends Database { + hotCachePeriod?: string; + readonly isFollowed?: boolean; + kind: "ReadWrite"; readonly provisioningState?: ResourceProvisioningState; softDeletePeriod?: string; - hotCachePeriod?: string; readonly statistics?: DatabaseStatistics; - readonly isFollowed?: boolean; -}; +} // @public export type Reason = string; // @public -export type RecommendedSensitivityLabelUpdate = ProxyResource & { +export interface RecommendedSensitivityLabelUpdate extends ProxyResource { + column?: string; + // (undocumented) op?: RecommendedSensitivityLabelUpdateKind; schema?: string; table?: string; - column?: string; -}; +} // @public export type RecommendedSensitivityLabelUpdateKind = "enable" | "disable"; @@ -3359,12 +3106,12 @@ export interface RecommendedSensitivityLabelUpdateList { } // @public -export type RecoverableSqlPool = ProxyResource & { +export interface RecoverableSqlPool extends ProxyResource { readonly edition?: string; - readonly serviceLevelObjective?: string; readonly elasticPoolName?: string; readonly lastAvailableBackupDate?: Date; -}; + readonly serviceLevelObjective?: string; +} // @public export interface RecoverableSqlPoolListResult { @@ -3385,19 +3132,19 @@ export interface ReplaceAllIpFirewallRulesRequest { } // @public -export type ReplicationLink = ProxyResource & { - readonly location?: string; +export interface ReplicationLink extends ProxyResource { readonly isTerminationAllowed?: boolean; - readonly replicationMode?: string; - readonly partnerServer?: string; + readonly location?: string; readonly partnerDatabase?: string; readonly partnerLocation?: string; - readonly role?: ReplicationRole; readonly partnerRole?: ReplicationRole; - readonly startTime?: Date; + readonly partnerServer?: string; readonly percentComplete?: number; + readonly replicationMode?: string; readonly replicationState?: ReplicationState; -}; + readonly role?: ReplicationRole; + readonly startTime?: Date; +} // @public export interface ReplicationLinkListResult { @@ -3430,17 +3177,17 @@ export interface ResourceMoveDefinition { export type ResourceProvisioningState = string; // @public -export type RestorableDroppedSqlPool = ProxyResource & { - readonly location?: string; +export interface RestorableDroppedSqlPool extends ProxyResource { + readonly creationDate?: Date; readonly databaseName?: string; + readonly deletionDate?: Date; + readonly earliestRestoreDate?: Date; readonly edition?: string; + readonly elasticPoolName?: string; + readonly location?: string; readonly maxSizeBytes?: string; readonly serviceLevelObjective?: string; - readonly elasticPoolName?: string; - readonly creationDate?: Date; - readonly deletionDate?: Date; - readonly earliestRestoreDate?: Date; -}; +} // @public export interface RestorableDroppedSqlPoolListResult { @@ -3468,13 +3215,13 @@ export interface RestorableDroppedSqlPoolsListByWorkspaceOptionalParams extends export type RestorableDroppedSqlPoolsListByWorkspaceResponse = RestorableDroppedSqlPoolListResult; // @public -export type RestorePoint = ProxyResource & { - readonly location?: string; - readonly restorePointType?: RestorePointType; +export interface RestorePoint extends ProxyResource { readonly earliestRestoreDate?: Date; + readonly location?: string; readonly restorePointCreationDate?: Date; readonly restorePointLabel?: string; -}; + readonly restorePointType?: RestorePointType; +} // @public export interface RestorePointListResult { @@ -3494,10 +3241,10 @@ export interface SecretBase { export type SecretBaseUnion = SecretBase | SecureString; // @public -export type SecureString = SecretBase & { +export interface SecureString extends SecretBase { type: "SecureString"; value: string; -}; +} // @public export type SecurityAlertPolicyName = string; @@ -3509,10 +3256,10 @@ export type SecurityAlertPolicyNameAutoGenerated = string; export type SecurityAlertPolicyState = "New" | "Enabled" | "Disabled"; // @public -export type SelfHostedIntegrationRuntime = IntegrationRuntime & { - type: "SelfHosted"; +export interface SelfHostedIntegrationRuntime extends IntegrationRuntime { linkedInfo?: LinkedIntegrationRuntimeTypeUnion; -}; + type: "SelfHosted"; +} // @public export interface SelfHostedIntegrationRuntimeNode { @@ -3543,44 +3290,45 @@ export interface SelfHostedIntegrationRuntimeNode { export type SelfHostedIntegrationRuntimeNodeStatus = string; // @public -export type SelfHostedIntegrationRuntimeStatus = IntegrationRuntimeStatus & { - type: "SelfHosted"; - readonly createTime?: Date; - readonly taskQueueId?: string; - readonly nodeCommunicationChannelEncryptionMode?: string; - readonly internalChannelEncryption?: IntegrationRuntimeInternalChannelEncryptionMode; - readonly version?: string; - nodes?: SelfHostedIntegrationRuntimeNode[]; - readonly scheduledUpdateDate?: Date; - readonly updateDelayOffset?: string; - readonly localTimeZoneOffset?: string; +export interface SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeStatus { + readonly autoUpdate?: IntegrationRuntimeAutoUpdate; + readonly autoUpdateETA?: Date; readonly capabilities?: { [propertyName: string]: string; }; - readonly serviceUrls?: string[]; - readonly autoUpdate?: IntegrationRuntimeAutoUpdate; - readonly versionStatus?: string; + readonly createTime?: Date; + readonly internalChannelEncryption?: IntegrationRuntimeInternalChannelEncryptionMode; + readonly latestVersion?: string; links?: LinkedIntegrationRuntime[]; + readonly localTimeZoneOffset?: string; + newerVersions?: string[]; + readonly nodeCommunicationChannelEncryptionMode?: string; + nodes?: SelfHostedIntegrationRuntimeNode[]; readonly pushedVersion?: string; - readonly latestVersion?: string; - readonly autoUpdateETA?: Date; + readonly scheduledUpdateDate?: Date; serviceRegion?: string; - newerVersions?: string[]; -}; + readonly serviceUrls?: string[]; + readonly taskQueueId?: string; + type: "SelfHosted"; + readonly updateDelayOffset?: string; + readonly version?: string; + readonly versionStatus?: string; +} // @public -export type SensitivityLabel = ProxyResource & { - readonly managedBy?: string; - readonly schemaName?: string; - readonly tableName?: string; +export interface SensitivityLabel extends ProxyResource { readonly columnName?: string; - labelName?: string; - labelId?: string; informationType?: string; informationTypeId?: string; readonly isDisabled?: boolean; + labelId?: string; + labelName?: string; + readonly managedBy?: string; + // (undocumented) rank?: SensitivityLabelRank; -}; + readonly schemaName?: string; + readonly tableName?: string; +} // @public export interface SensitivityLabelListResult { @@ -3595,13 +3343,14 @@ export type SensitivityLabelRank = "None" | "Low" | "Medium" | "High" | "Critica export type SensitivityLabelSource = "current" | "recommended"; // @public -export type SensitivityLabelUpdate = ProxyResource & { +export interface SensitivityLabelUpdate extends ProxyResource { + column?: string; + // (undocumented) op?: SensitivityLabelUpdateKind; schema?: string; - table?: string; - column?: string; sensitivityLabel?: SensitivityLabel; -}; + table?: string; +} // @public export type SensitivityLabelUpdateKind = "set" | "remove"; @@ -3613,18 +3362,18 @@ export interface SensitivityLabelUpdateList { } // @public -export type ServerBlobAuditingPolicy = ProxyResource & { - state?: BlobAuditingPolicyState; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; +export interface ServerBlobAuditingPolicy extends ProxyResource { auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; isAzureMonitorTargetEnabled?: boolean; - queueDelayMs?: number; isDevopsAuditEnabled?: boolean; -}; + isStorageSecondaryKeyInUse?: boolean; + queueDelayMs?: number; + retentionDays?: number; + state?: BlobAuditingPolicyState; + storageAccountAccessKey?: string; + storageAccountSubscriptionId?: string; + storageEndpoint?: string; +} // @public export interface ServerBlobAuditingPolicyListResult { @@ -3636,16 +3385,16 @@ export interface ServerBlobAuditingPolicyListResult { export type ServerKeyType = string; // @public -export type ServerSecurityAlertPolicy = ProxyResource & { - state?: SecurityAlertPolicyState; +export interface ServerSecurityAlertPolicy extends ProxyResource { + readonly creationTime?: Date; disabledAlerts?: string[]; - emailAddresses?: string[]; emailAccountAdmins?: boolean; - storageEndpoint?: string; - storageAccountAccessKey?: string; + emailAddresses?: string[]; retentionDays?: number; - readonly creationTime?: Date; -}; + state?: SecurityAlertPolicyState; + storageAccountAccessKey?: string; + storageEndpoint?: string; +} // @public export interface ServerSecurityAlertPolicyListResult { @@ -3671,12 +3420,12 @@ export interface ServerUsageListResult { } // @public -export type ServerVulnerabilityAssessment = ProxyResource & { +export interface ServerVulnerabilityAssessment extends ProxyResource { + recurringScans?: VulnerabilityAssessmentRecurringScansProperties; + storageAccountAccessKey?: string; storageContainerPath?: string; storageContainerSasKey?: string; - storageAccountAccessKey?: string; - recurringScans?: VulnerabilityAssessmentRecurringScansProperties; -}; +} // @public export interface ServerVulnerabilityAssessmentListResult { @@ -3745,16 +3494,16 @@ export interface SparkConfigurationListResponse { } // @public -export type SparkConfigurationResource = SubResource & { - description?: string; +export interface SparkConfigurationResource extends SubResource { + annotations?: string[]; configs: { [propertyName: string]: string; }; - annotations?: string[]; - notes?: string; - createdBy?: string; created?: Date; -}; + createdBy?: string; + description?: string; + notes?: string; +} // @public export interface SparkConfigurations { @@ -3776,20 +3525,20 @@ export interface SparkConfigurationsListByWorkspaceOptionalParams extends coreCl export type SparkConfigurationsListByWorkspaceResponse = SparkConfigurationListResponse; // @public -export type SqlPool = TrackedResource & { - sku?: Sku; - maxSizeBytes?: number; +export interface SqlPool extends TrackedResource { collation?: string; - sourceDatabaseId?: string; - recoverableDatabaseId?: string; - provisioningState?: string; - readonly status?: string; - restorePointInTime?: Date; createMode?: CreateMode; readonly creationDate?: Date; - storageAccountType?: StorageAccountType; + maxSizeBytes?: number; + provisioningState?: string; + recoverableDatabaseId?: string; + restorePointInTime?: Date; + sku?: Sku; sourceDatabaseDeletionDate?: Date; -}; + sourceDatabaseId?: string; + readonly status?: string; + storageAccountType?: StorageAccountType; +} // @public export interface SqlPoolBlobAuditingPolicies { @@ -3827,17 +3576,17 @@ export interface SqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams extends export type SqlPoolBlobAuditingPoliciesListBySqlPoolResponse = SqlPoolBlobAuditingPolicyListResult; // @public -export type SqlPoolBlobAuditingPolicy = ProxyResource & { +export interface SqlPoolBlobAuditingPolicy extends ProxyResource { + auditActionsAndGroups?: string[]; + isAzureMonitorTargetEnabled?: boolean; + isStorageSecondaryKeyInUse?: boolean; readonly kind?: string; + retentionDays?: number; state?: BlobAuditingPolicyState; - storageEndpoint?: string; storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; - isAzureMonitorTargetEnabled?: boolean; -}; + storageEndpoint?: string; +} // @public export interface SqlPoolBlobAuditingPolicyListResult { @@ -3852,10 +3601,10 @@ export interface SqlPoolBlobAuditingPolicySqlPoolOperationListResult { } // @public -export type SqlPoolColumn = ProxyResource & { +export interface SqlPoolColumn extends ProxyResource { columnType?: ColumnDataType; readonly isComputed?: boolean; -}; +} // @public export interface SqlPoolColumnListResult { @@ -3888,17 +3637,17 @@ export interface SqlPoolConnectionPoliciesGetOptionalParams extends coreClient.O export type SqlPoolConnectionPoliciesGetResponse = SqlPoolConnectionPolicy; // @public -export type SqlPoolConnectionPolicy = ProxyResource & { +export interface SqlPoolConnectionPolicy extends ProxyResource { readonly kind?: string; readonly location?: string; - securityEnabledAccess?: string; proxyDnsName?: string; proxyPort?: string; - visibility?: string; - useServerDefault?: string; redirectionState?: string; + securityEnabledAccess?: string; state?: string; -}; + useServerDefault?: string; + visibility?: string; +} // @public export interface SqlPoolDataWarehouseUserActivities { @@ -3996,22 +3745,22 @@ export interface SqlPoolMetadataSyncConfigsGetOptionalParams extends coreClient. export type SqlPoolMetadataSyncConfigsGetResponse = MetadataSyncConfig; // @public -export type SqlPoolOperation = ProxyResource & { +export interface SqlPoolOperation extends ProxyResource { readonly databaseName?: string; + readonly description?: string; + readonly errorCode?: number; + readonly errorDescription?: string; + readonly errorSeverity?: number; + readonly estimatedCompletionTime?: Date; + readonly isCancellable?: boolean; + readonly isUserError?: boolean; readonly operation?: string; readonly operationFriendlyName?: string; readonly percentComplete?: number; readonly serverName?: string; readonly startTime?: Date; readonly state?: ManagementOperationState; - readonly errorCode?: number; - readonly errorDescription?: string; - readonly errorSeverity?: number; - readonly isUserError?: boolean; - readonly estimatedCompletionTime?: Date; - readonly description?: string; - readonly isCancellable?: boolean; -}; +} // @public export interface SqlPoolOperationResults { @@ -4160,7 +3909,8 @@ export interface SqlPools { } // @public -export type SqlPoolSchema = ProxyResource & {}; +export interface SqlPoolSchema extends ProxyResource { +} // @public export interface SqlPoolSchemaListResult { @@ -4183,7 +3933,6 @@ export type SqlPoolSchemasGetResponse = SqlPoolSchema; // @public export interface SqlPoolSchemasListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4251,16 +4000,16 @@ export interface SqlPoolSecurityAlertPoliciesListOptionalParams extends coreClie export type SqlPoolSecurityAlertPoliciesListResponse = ListSqlPoolSecurityAlertPolicies; // @public -export type SqlPoolSecurityAlertPolicy = ProxyResource & { - state?: SecurityAlertPolicyState; +export interface SqlPoolSecurityAlertPolicy extends ProxyResource { + readonly creationTime?: Date; disabledAlerts?: string[]; - emailAddresses?: string[]; emailAccountAdmins?: boolean; - storageEndpoint?: string; - storageAccountAccessKey?: string; + emailAddresses?: string[]; retentionDays?: number; - readonly creationTime?: Date; -}; + state?: SecurityAlertPolicyState; + storageAccountAccessKey?: string; + storageEndpoint?: string; +} // @public export interface SqlPoolSensitivityLabels { @@ -4302,7 +4051,6 @@ export type SqlPoolSensitivityLabelsGetResponse = SensitivityLabel; // @public export interface SqlPoolSensitivityLabelsListCurrentNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4318,9 +4066,6 @@ export type SqlPoolSensitivityLabelsListCurrentResponse = SensitivityLabelListRe // @public export interface SqlPoolSensitivityLabelsListRecommendedNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - includeDisabledRecommendations?: boolean; - skipToken?: string; } // @public @@ -4391,7 +4136,8 @@ export interface SqlPoolsUpdateOptionalParams extends coreClient.OperationOption export type SqlPoolsUpdateResponse = SqlPool; // @public -export type SqlPoolTable = ProxyResource & {}; +export interface SqlPoolTable extends ProxyResource { +} // @public export interface SqlPoolTableColumns { @@ -4400,7 +4146,6 @@ export interface SqlPoolTableColumns { // @public export interface SqlPoolTableColumnsListByTableNameNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4435,7 +4180,6 @@ export type SqlPoolTablesGetResponse = SqlPoolTable; // @public export interface SqlPoolTablesListBySchemaNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4521,12 +4265,12 @@ export interface SqlPoolUsagesListOptionalParams extends coreClient.OperationOpt export type SqlPoolUsagesListResponse = SqlPoolUsageListResult; // @public -export type SqlPoolVulnerabilityAssessment = ProxyResource & { +export interface SqlPoolVulnerabilityAssessment extends ProxyResource { + recurringScans?: VulnerabilityAssessmentRecurringScansProperties; + storageAccountAccessKey?: string; storageContainerPath?: string; storageContainerSasKey?: string; - storageAccountAccessKey?: string; - recurringScans?: VulnerabilityAssessmentRecurringScansProperties; -}; +} // @public export interface SqlPoolVulnerabilityAssessmentListResult { @@ -4535,9 +4279,9 @@ export interface SqlPoolVulnerabilityAssessmentListResult { } // @public -export type SqlPoolVulnerabilityAssessmentRuleBaseline = ProxyResource & { +export interface SqlPoolVulnerabilityAssessmentRuleBaseline extends ProxyResource { baselineResults?: SqlPoolVulnerabilityAssessmentRuleBaselineItem[]; -}; +} // @public export interface SqlPoolVulnerabilityAssessmentRuleBaselineItem { @@ -4587,9 +4331,9 @@ export interface SqlPoolVulnerabilityAssessmentScans { } // @public -export type SqlPoolVulnerabilityAssessmentScansExport = ProxyResource & { +export interface SqlPoolVulnerabilityAssessmentScansExport extends ProxyResource { readonly exportedReportLocation?: string; -}; +} // @public export interface SqlPoolVulnerabilityAssessmentScansExportOptionalParams extends coreClient.OperationOptions { @@ -4750,11 +4494,11 @@ export interface SqlPoolWorkloadGroupListOptionalParams extends coreClient.Opera export type SqlPoolWorkloadGroupListResponse = WorkloadGroupListResult; // @public -export type SsisEnvironment = SsisObjectMetadata & { - type: "Environment"; +export interface SsisEnvironment extends SsisObjectMetadata { folderId?: number; + type: "Environment"; variables?: SsisVariable[]; -}; +} // @public export interface SsisEnvironmentReference { @@ -4765,9 +4509,9 @@ export interface SsisEnvironmentReference { } // @public -export type SsisFolder = SsisObjectMetadata & { +export interface SsisFolder extends SsisObjectMetadata { type: "Folder"; -}; +} // @public export interface SsisObjectMetadata { @@ -4798,13 +4542,13 @@ export type SsisObjectMetadataType = string; export type SsisObjectMetadataUnion = SsisObjectMetadata | SsisFolder | SsisProject | SsisPackage | SsisEnvironment; // @public -export type SsisPackage = SsisObjectMetadata & { - type: "Package"; +export interface SsisPackage extends SsisObjectMetadata { folderId?: number; - projectVersion?: number; - projectId?: number; parameters?: SsisParameter[]; -}; + projectId?: number; + projectVersion?: number; + type: "Package"; +} // @public export interface SsisParameter { @@ -4823,13 +4567,13 @@ export interface SsisParameter { } // @public -export type SsisProject = SsisObjectMetadata & { - type: "Project"; - folderId?: number; - version?: number; +export interface SsisProject extends SsisObjectMetadata { environmentRefs?: SsisEnvironmentReference[]; + folderId?: number; parameters?: SsisParameter[]; -}; + type: "Project"; + version?: number; +} // @public export interface SsisVariable { @@ -4852,7 +4596,8 @@ export type StateValue = string; export type StorageAccountType = string; // @public -export type SubResource = AzureEntityResource & {}; +export interface SubResource extends AzureEntityResource { +} // @public (undocumented) export class SynapseManagementClient extends coreClient.ServiceClient { @@ -5053,18 +4798,18 @@ export interface TopQueriesListResult { } // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { + location: string; tags?: { [propertyName: string]: string; }; - location: string; -}; +} // @public -export type TransparentDataEncryption = ProxyResource & { +export interface TransparentDataEncryption extends ProxyResource { readonly location?: string; status?: TransparentDataEncryptionStatus; -}; +} // @public export interface TransparentDataEncryptionListResult { @@ -5123,16 +4868,16 @@ export interface VulnerabilityAssessmentScanError { } // @public -export type VulnerabilityAssessmentScanRecord = ProxyResource & { - readonly scanId?: string; - readonly triggerType?: VulnerabilityAssessmentScanTriggerType; - readonly state?: VulnerabilityAssessmentScanState; - readonly startTime?: Date; +export interface VulnerabilityAssessmentScanRecord extends ProxyResource { readonly endTime?: Date; readonly errors?: VulnerabilityAssessmentScanError[]; - readonly storageContainerPath?: string; readonly numberOfFailedSecurityChecks?: number; -}; + readonly scanId?: string; + readonly startTime?: Date; + readonly state?: VulnerabilityAssessmentScanState; + readonly storageContainerPath?: string; + readonly triggerType?: VulnerabilityAssessmentScanTriggerType; +} // @public export interface VulnerabilityAssessmentScanRecordListResult { @@ -5147,14 +4892,14 @@ export type VulnerabilityAssessmentScanState = string; export type VulnerabilityAssessmentScanTriggerType = string; // @public -export type WorkloadClassifier = ProxyResource & { - memberName?: string; - label?: string; +export interface WorkloadClassifier extends ProxyResource { context?: string; - startTime?: string; endTime?: string; importance?: string; -}; + label?: string; + memberName?: string; + startTime?: string; +} // @public export interface WorkloadClassifierListResult { @@ -5163,14 +4908,14 @@ export interface WorkloadClassifierListResult { } // @public -export type WorkloadGroup = ProxyResource & { - minResourcePercent?: number; +export interface WorkloadGroup extends ProxyResource { + importance?: string; maxResourcePercent?: number; - minResourcePercentPerRequest?: number; maxResourcePercentPerRequest?: number; - importance?: string; + minResourcePercent?: number; + minResourcePercentPerRequest?: number; queryExecutionTimeout?: number; -}; +} // @public export interface WorkloadGroupListResult { @@ -5179,44 +4924,44 @@ export interface WorkloadGroupListResult { } // @public -export type Workspace = TrackedResource & { - identity?: ManagedIdentity; - defaultDataLakeStorage?: DataLakeStorageAccountDetails; - sqlAdministratorLoginPassword?: string; - managedResourceGroupName?: string; - readonly provisioningState?: string; - sqlAdministratorLogin?: string; - virtualNetworkProfile?: VirtualNetworkProfile; +export interface Workspace extends TrackedResource { + readonly adlaResourceId?: string; + azureADOnlyAuthentication?: boolean; connectivityEndpoints?: { [propertyName: string]: string; }; - managedVirtualNetwork?: string; - privateEndpointConnections?: PrivateEndpointConnection[]; + cspWorkspaceAdminProperties?: CspWorkspaceAdminProperties; + defaultDataLakeStorage?: DataLakeStorageAccountDetails; encryption?: EncryptionDetails; - readonly workspaceUID?: string; readonly extraProperties?: { [propertyName: string]: Record; }; + identity?: ManagedIdentity; + managedResourceGroupName?: string; + managedVirtualNetwork?: string; managedVirtualNetworkSettings?: ManagedVirtualNetworkSettings; - workspaceRepositoryConfiguration?: WorkspaceRepositoryConfiguration; - purviewConfiguration?: PurviewConfiguration; - readonly adlaResourceId?: string; + privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: string; publicNetworkAccess?: WorkspacePublicNetworkAccess; - cspWorkspaceAdminProperties?: CspWorkspaceAdminProperties; + purviewConfiguration?: PurviewConfiguration; readonly settings?: { [propertyName: string]: Record; }; - azureADOnlyAuthentication?: boolean; + sqlAdministratorLogin?: string; + sqlAdministratorLoginPassword?: string; trustedServiceBypassEnabled?: boolean; -}; + virtualNetworkProfile?: VirtualNetworkProfile; + workspaceRepositoryConfiguration?: WorkspaceRepositoryConfiguration; + readonly workspaceUID?: string; +} // @public -export type WorkspaceAadAdminInfo = ProxyResource & { - tenantId?: string; - login?: string; +export interface WorkspaceAadAdminInfo extends ProxyResource { administratorType?: string; + login?: string; sid?: string; -}; + tenantId?: string; +} // @public export interface WorkspaceAadAdmins { diff --git a/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsCreateSample.ts b/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsCreateSample.ts index 5422b97df9cd..30773abbb5f4 100644 --- a/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a Azure Active Directory only authentication property for the workspaces @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateAzureADOnlyAuthentication.json */ async function createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const azureADOnlyAuthenticationName = "default"; const azureADOnlyAuthenticationInfo: AzureADOnlyAuthentication = { @@ -39,6 +45,8 @@ async function createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(result); } -createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty().catch( - console.error -); +async function main() { + createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsGetSample.ts index 0abe06051167..a030d8967c4b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Azure Active Directory only authentication property @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAzureADOnlyAuthentication.json */ async function getAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const azureADOnlyAuthenticationName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(result); } -getAzureActiveDirectoryOnlyAuthenticationProperty().catch(console.error); +async function main() { + getAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsListSample.ts index a228eb32e7e4..4723c3254206 100644 --- a/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/azureAdOnlyAuthenticationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of Azure Active Directory only authentication property for a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListAzureADOnlyAuthentication.json */ async function getAListOfAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getAListOfAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(resArray); } -getAListOfAzureActiveDirectoryOnlyAuthenticationProperty().catch(console.error); +async function main() { + getAListOfAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsCreateOrUpdateSample.ts index d9c1d755e938..c3869a8e9d80 100644 --- a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a new Big Data pool. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/CreateOrUpdateBigDataPool.json */ async function createOrUpdateABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const bigDataPoolInfo: BigDataPoolResourceInfo = { @@ -49,4 +55,8 @@ async function createOrUpdateABigDataPool() { console.log(result); } -createOrUpdateABigDataPool().catch(console.error); +async function main() { + createOrUpdateABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsDeleteSample.ts index bcb29559acb8..b82d393da42f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete a Big Data pool from the workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/DeleteBigDataPool.json */ async function deleteABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteABigDataPool() { console.log(result); } -deleteABigDataPool().catch(console.error); +async function main() { + deleteABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsGetSample.ts index 832ae971975d..e994d0d3a7fe 100644 --- a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Big Data pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/GetBigDataPool.json */ async function getABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getABigDataPool() { console.log(result); } -getABigDataPool().catch(console.error); +async function main() { + getABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsListByWorkspaceSample.ts index 141b6a9e3432..4ba14c89a749 100644 --- a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Big Data pools in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/ListBigDataPoolsInWorkspace.json */ async function listBigDataPoolsInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listBigDataPoolsInAWorkspace() { console.log(resArray); } -listBigDataPoolsInAWorkspace().catch(console.error); +async function main() { + listBigDataPoolsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsUpdateSample.ts index 37fb11be07b3..973594d2a3bb 100644 --- a/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/bigDataPoolsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Patch a Big Data pool. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/UpdateBigDataPool.json */ async function updateABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const bigDataPoolPatchInfo: BigDataPoolPatchInfo = { tags: { key: "value" } }; @@ -37,4 +43,8 @@ async function updateABigDataPool() { console.log(result); } -updateABigDataPool().catch(console.error); +async function main() { + updateABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesCreateOrUpdateSample.ts index d94492f1b8af..841b395c75b1 100644 --- a/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { DataMaskingPolicy, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool data masking policy @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyCreateOrUpdateMax.json */ async function createOrUpdateDataMaskingPolicyMax() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const parameters: DataMaskingPolicy = { @@ -37,8 +43,6 @@ async function createOrUpdateDataMaskingPolicyMax() { console.log(result); } -createOrUpdateDataMaskingPolicyMax().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking policy * @@ -46,8 +50,11 @@ createOrUpdateDataMaskingPolicyMax().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyCreateOrUpdateMin.json */ async function createOrUpdateDataMaskingPolicyMin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const parameters: DataMaskingPolicy = { dataMaskingState: "Enabled" }; @@ -62,4 +69,9 @@ async function createOrUpdateDataMaskingPolicyMin() { console.log(result); } -createOrUpdateDataMaskingPolicyMin().catch(console.error); +async function main() { + createOrUpdateDataMaskingPolicyMax(); + createOrUpdateDataMaskingPolicyMin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesGetSample.ts index 4dbea9f4b6b6..7af0dc91d96f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/dataMaskingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Sql pool data masking policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyGet.json */ async function getDataMaskingPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getDataMaskingPolicy() { console.log(result); } -getDataMaskingPolicy().catch(console.error); +async function main() { + getDataMaskingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesCreateOrUpdateSample.ts index ac21796d629b..c6f90784a015 100644 --- a/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { DataMaskingRule, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json */ async function createOrUpdateDataMaskingRuleForDefaultMax() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -43,8 +49,6 @@ async function createOrUpdateDataMaskingRuleForDefaultMax() { console.log(result); } -createOrUpdateDataMaskingRuleForDefaultMax().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -52,8 +56,11 @@ createOrUpdateDataMaskingRuleForDefaultMax().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json */ async function createOrUpdateDataMaskingRuleForDefaultMin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -75,8 +82,6 @@ async function createOrUpdateDataMaskingRuleForDefaultMin() { console.log(result); } -createOrUpdateDataMaskingRuleForDefaultMin().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -84,8 +89,11 @@ createOrUpdateDataMaskingRuleForDefaultMin().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateNumber.json */ async function createOrUpdateDataMaskingRuleForNumbers() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -109,8 +117,6 @@ async function createOrUpdateDataMaskingRuleForNumbers() { console.log(result); } -createOrUpdateDataMaskingRuleForNumbers().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -118,8 +124,11 @@ createOrUpdateDataMaskingRuleForNumbers().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateText.json */ async function createOrUpdateDataMaskingRuleForText() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -144,4 +153,11 @@ async function createOrUpdateDataMaskingRuleForText() { console.log(result); } -createOrUpdateDataMaskingRuleForText().catch(console.error); +async function main() { + createOrUpdateDataMaskingRuleForDefaultMax(); + createOrUpdateDataMaskingRuleForDefaultMin(); + createOrUpdateDataMaskingRuleForNumbers(); + createOrUpdateDataMaskingRuleForText(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesGetSample.ts index f96a92839c08..9bc94b666246 100644 --- a/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the specific Sql pool data masking rule. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleGet.json */ async function getDataMaskingRule() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -34,4 +40,8 @@ async function getDataMaskingRule() { console.log(result); } -getDataMaskingRule().catch(console.error); +async function main() { + getDataMaskingRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesListBySqlPoolSample.ts b/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesListBySqlPoolSample.ts index aa1bca5c4743..5e1b9aba464d 100644 --- a/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesListBySqlPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/dataMaskingRulesListBySqlPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of Sql pool data masking rules. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleList.json */ async function listDataMaskingRules() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listDataMaskingRules() { console.log(resArray); } -listDataMaskingRules().catch(console.error); +async function main() { + listDataMaskingRules(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts index cca5d12016ba..0b7dbf0bed72 100644 --- a/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolAzureMonitorAuditingCreateMin.json */ async function createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: ExtendedSqlPoolBlobAuditingPolicy = { @@ -40,10 +46,6 @@ async function createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMini console.log(result); } -createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. * @@ -51,8 +53,11 @@ createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters() * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingCreateMax.json */ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: ExtendedSqlPoolBlobAuditingPolicy = { @@ -82,10 +87,6 @@ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameter console.log(result); } -createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. * @@ -93,8 +94,11 @@ createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingCreateMin.json */ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: ExtendedSqlPoolBlobAuditingPolicy = { @@ -114,6 +118,10 @@ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParam console.log(result); } -createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters(); + createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters(); + createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesGetSample.ts index 7190ef4cb771..60eb054835d6 100644 --- a/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an extended Sql pool's blob auditing policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingGet.json */ async function getAnExtendedDatabaseBlobAuditingPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnExtendedDatabaseBlobAuditingPolicy() { console.log(result); } -getAnExtendedDatabaseBlobAuditingPolicy().catch(console.error); +async function main() { + getAnExtendedDatabaseBlobAuditingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts b/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts index c6696c2c6366..cbd6e4731893 100644 --- a/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists extended auditing settings of a Sql pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolExtendedAuditingSettingsList.json */ async function listExtendedAuditingSettingsOfADatabase() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listExtendedAuditingSettingsOfADatabase() { console.log(resArray); } -listExtendedAuditingSettingsOfADatabase().catch(console.error); +async function main() { + listExtendedAuditingSettingsOfADatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysListSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysListSample.ts index eaec8b377b9a..0d520eab24f0 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List authentication keys in an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListAuthKeys.json */ async function listAuthKeys() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listAuthKeys() { console.log(result); } -listAuthKeys().catch(console.error); +async function main() { + listAuthKeys(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysRegenerateSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysRegenerateSample.ts index 393fdc34e0e3..7383337eb016 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysRegenerateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeAuthKeysRegenerateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Regenerate the authentication key for an integration runtime @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_RegenerateAuthKey.json */ async function regenerateAuthKey() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const regenerateKeyParameters: IntegrationRuntimeRegenerateKeyParameters = { @@ -39,4 +45,8 @@ async function regenerateAuthKey() { console.log(result); } -regenerateAuthKey().catch(console.error); +async function main() { + regenerateAuthKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeConnectionInfosGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeConnectionInfosGetSample.ts index 12cdafcca006..018ab4c784d7 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeConnectionInfosGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeConnectionInfosGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get connection info for an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_GetConnectionInfo.json */ async function getConnectionInfo() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getConnectionInfo() { console.log(result); } -getConnectionInfo().catch(console.error); +async function main() { + getConnectionInfo(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeCredentialsSyncSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeCredentialsSyncSample.ts index c877de32c4ee..19fb91cdf1c9 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeCredentialsSyncSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeCredentialsSyncSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override the credentials across all worker nodes with those available on the dispatcher node. If you already have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime node than using this API directly. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_SyncCredentials.json */ async function syncCredentials() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function syncCredentials() { console.log(result); } -syncCredentials().catch(console.error); +async function main() { + syncCredentials(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeMonitoringDataListSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeMonitoringDataListSample.ts index 44af9c61358d..4651b05c29d2 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeMonitoringDataListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeMonitoringDataListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get monitoring data for an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeMonitoringData_List.json */ async function getMonitoringData() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getMonitoringData() { console.log(result); } -getMonitoringData().catch(console.error); +async function main() { + getMonitoringData(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodeIPAddressGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodeIPAddressGetSample.ts index 3cf292d322c2..830fc4fc5b37 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodeIPAddressGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodeIPAddressGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the IP address of an integration runtime node @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_GetIpAddress.json */ async function getIntegrationRuntimeNodeIPAddress() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +40,8 @@ async function getIntegrationRuntimeNodeIPAddress() { console.log(result); } -getIntegrationRuntimeNodeIPAddress().catch(console.error); +async function main() { + getIntegrationRuntimeNodeIPAddress(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesDeleteSample.ts index ffa56a592caf..d36f54e973ab 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete an integration runtime node @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Delete.json */ async function deleteIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +40,8 @@ async function deleteIntegrationRuntimeNode() { console.log(result); } -deleteIntegrationRuntimeNode().catch(console.error); +async function main() { + deleteIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesGetSample.ts index 6679f6adb43a..543982cc2119 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get an integration runtime node @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Get.json */ async function getIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +40,8 @@ async function getIntegrationRuntimeNode() { console.log(result); } -getIntegrationRuntimeNode().catch(console.error); +async function main() { + getIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesUpdateSample.ts index 46304530670b..a3a5dc67b568 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeNodesUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create an integration runtime node @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Update.json */ async function updateIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -41,4 +47,8 @@ async function updateIntegrationRuntimeNode() { console.log(result); } -updateIntegrationRuntimeNode().catch(console.error); +async function main() { + updateIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataListSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataListSample.ts index 4e02f91c82ef..7fda2d8ec3e9 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataListSample.ts @@ -14,6 +14,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get object metadata from an integration runtime @@ -22,8 +25,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeObjectMetadata_List.json */ async function getIntegrationRuntimeObjectMetadata() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "testactivityv2"; const getMetadataRequest: GetSsisObjectMetadataRequest = { @@ -43,4 +49,8 @@ async function getIntegrationRuntimeObjectMetadata() { console.log(result); } -getIntegrationRuntimeObjectMetadata().catch(console.error); +async function main() { + getIntegrationRuntimeObjectMetadata(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataRefreshSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataRefreshSample.ts index 5e73357af878..8521f7d0215c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataRefreshSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeObjectMetadataRefreshSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Refresh the object metadata in an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeObjectMetadata_Refresh.json */ async function refreshObjectMetadata() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "testactivityv2"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function refreshObjectMetadata() { console.log(result); } -refreshObjectMetadata().catch(console.error); +async function main() { + refreshObjectMetadata(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeStatusGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeStatusGetSample.ts index 3e5cdefa648e..1446e0084a01 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeStatusGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimeStatusGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the integration runtime status @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_GetStatus.json */ async function getStatus() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getStatus() { console.log(result); } -getStatus().catch(console.error); +async function main() { + getStatus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesCreateSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesCreateSample.ts index 057ce8f0bfea..2d6a57694172 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create an integration runtime @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Create.json */ async function createIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const integrationRuntime: IntegrationRuntimeResource = { @@ -42,4 +48,8 @@ async function createIntegrationRuntime() { console.log(result); } -createIntegrationRuntime().catch(console.error); +async function main() { + createIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDeleteSample.ts index 934b321e6c45..8fd232920433 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Delete.json */ async function deleteIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteIntegrationRuntime() { console.log(result); } -deleteIntegrationRuntime().catch(console.error); +async function main() { + deleteIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDisableInteractiveQuerySample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDisableInteractiveQuerySample.ts index 580204dcc4e4..67d717cf5e66 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDisableInteractiveQuerySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesDisableInteractiveQuerySample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Disable interactive query in integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_DisableInteractiveQuery.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesEnableInteractiveQuerySample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesEnableInteractiveQuerySample.ts index 61610ccda280..23a120183181 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesEnableInteractiveQuerySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesEnableInteractiveQuerySample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Enable interactive query in integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_EnableInteractiveQuery.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesGetSample.ts index 11e7def05081..bf682ca3bc19 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Get.json */ async function getIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getIntegrationRuntime() { console.log(result); } -getIntegrationRuntime().catch(console.error); +async function main() { + getIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListByWorkspaceSample.ts index 85e657d5a096..7dbd069e095b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all integration runtimes @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListByWorkspace.json */ async function listIntegrationRuntimes() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listIntegrationRuntimes() { console.log(resArray); } -listIntegrationRuntimes().catch(console.error); +async function main() { + listIntegrationRuntimes(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts index 4c51a9162c39..a6a40cd4c24f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the list of outbound network dependencies for a given Azure-SSIS integration runtime. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListOutboundNetworkDependenciesEndpoints.json */ async function getOutboundNetworkDependencyEndpoints() { - const subscriptionId = "ade9c2b6-c160-4305-9bb9-80342f6c1ae2"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "ade9c2b6-c160-4305-9bb9-80342f6c1ae2"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getOutboundNetworkDependencyEndpoints() { console.log(result); } -getOutboundNetworkDependencyEndpoints().catch(console.error); +async function main() { + getOutboundNetworkDependencyEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStartSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStartSample.ts index bc499dfa566e..b0728d1fefd5 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStartSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStartSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Start an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Start.json */ async function startIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function startIntegrationRuntime() { console.log(result); } -startIntegrationRuntime().catch(console.error); +async function main() { + startIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStopSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStopSample.ts index b36e16f1d48b..1efae09dae20 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStopSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesStopSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stop an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Stop.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpdateSample.ts index 4f7c9201cd10..0b7771a11589 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update an integration runtime @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Update.json */ async function updateIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const updateIntegrationRuntimeRequest: UpdateIntegrationRuntimeRequest = { @@ -40,4 +46,8 @@ async function updateIntegrationRuntime() { console.log(result); } -updateIntegrationRuntime().catch(console.error); +async function main() { + updateIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpgradeSample.ts b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpgradeSample.ts index 6616d067559e..5d94a4283e91 100644 --- a/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpgradeSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/integrationRuntimesUpgradeSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Upgrade an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Upgrade.json */ async function upgradeIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function upgradeIntegrationRuntime() { console.log(result); } -upgradeIntegrationRuntime().catch(console.error); +async function main() { + upgradeIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesCreateOrUpdateSample.ts index 7d612a1e2046..5c00a70add13 100644 --- a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a firewall rule @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateIpFirewallRule.json */ async function createAnIPFirewallRule() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const ipFirewallRuleInfo: IpFirewallRuleInfo = { @@ -40,4 +46,8 @@ async function createAnIPFirewallRule() { console.log(result); } -createAnIPFirewallRule().catch(console.error); +async function main() { + createAnIPFirewallRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesDeleteSample.ts index c3556d32e7d6..2c44e49b08e9 100644 --- a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a firewall rule @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteIpFirewallRule.json */ async function deleteAnIPFirewallRuleFromAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAnIPFirewallRuleFromAWorkspace() { console.log(result); } -deleteAnIPFirewallRuleFromAWorkspace().catch(console.error); +async function main() { + deleteAnIPFirewallRuleFromAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesGetSample.ts index 43995f6a208e..923a90d91741 100644 --- a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a firewall rule @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetIpFirewallRule.json */ async function createAnIPFirewallRule() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function createAnIPFirewallRule() { console.log(result); } -createAnIPFirewallRule().catch(console.error); +async function main() { + createAnIPFirewallRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesListByWorkspaceSample.ts index 525955f5dbbd..3b5c0b90f9c4 100644 --- a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of firewall rules @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListIpFirewallRules.json */ async function listIPFirewallRulesInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listIPFirewallRulesInAWorkspace() { console.log(resArray); } -listIPFirewallRulesInAWorkspace().catch(console.error); +async function main() { + listIPFirewallRulesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesReplaceAllSample.ts b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesReplaceAllSample.ts index 460193e8b39d..e905900b586c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesReplaceAllSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/ipFirewallRulesReplaceAllSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Replaces firewall rules @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ReplaceAllIpFirewallRules.json */ async function replaceAllIPFirewallRulesInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const request: ReplaceAllIpFirewallRulesRequest = { ipFirewallRules: { @@ -46,4 +52,8 @@ async function replaceAllIPFirewallRulesInAWorkspace() { console.log(result); } -replaceAllIPFirewallRulesInAWorkspace().catch(console.error); +async function main() { + replaceAllIPFirewallRulesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/keysCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/keysCreateOrUpdateSample.ts index 3cae86ef95a0..747339627a5a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/keysCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/keysCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { Key, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace key @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateKey.json */ async function createOrUpdateAWorkspaceKey() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const keyProperties: Key = { @@ -37,4 +43,8 @@ async function createOrUpdateAWorkspaceKey() { console.log(result); } -createOrUpdateAWorkspaceKey().catch(console.error); +async function main() { + createOrUpdateAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/keysDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/keysDeleteSample.ts index 4d4e25a13752..712d4906b359 100644 --- a/sdk/synapse/arm-synapse/samples-dev/keysDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/keysDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace key @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteKey.json */ async function deleteAWorkspaceKey() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAWorkspaceKey() { console.log(result); } -deleteAWorkspaceKey().catch(console.error); +async function main() { + deleteAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/keysGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/keysGetSample.ts index 3bbb6ab740eb..7f51d58c1761 100644 --- a/sdk/synapse/arm-synapse/samples-dev/keysGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/keysGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace key @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetKey.json */ async function getAWorkspaceKey() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAWorkspaceKey() { console.log(result); } -getAWorkspaceKey().catch(console.error); +async function main() { + getAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/keysListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/keysListByWorkspaceSample.ts index fe8c1baf4eea..b96b2dbcd816 100644 --- a/sdk/synapse/arm-synapse/samples-dev/keysListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/keysListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of keys in a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListKeysInWorkspace.json */ async function listKeysInWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listKeysInWorkspace() { console.log(resArray); } -listKeysInWorkspace().catch(console.error); +async function main() { + listKeysInWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoOperationsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoOperationsListSample.ts index 3766b958e95d..a5af16f3deec 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoOperationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoOperationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoOperationsList.json */ async function kustoOperationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function kustoOperationsList() { console.log(resArray); } -kustoOperationsList().catch(console.error); +async function main() { + kustoOperationsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts index 4b15bb4dc43c..60e5b757e98f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an attached database configuration. @@ -21,11 +24,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsCreateOrUpdate.json */ async function kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters: AttachedDatabaseConfiguration = { kustoPoolResourceId: "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Synapse/Workspaces/kustorptest/KustoPools/kustoclusterrptest4", @@ -53,4 +59,8 @@ async function kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts index c721d6095758..8c8240cc20fd 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the attached database configuration with the given name. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsDelete.json */ async function kustoPoolAttachedDatabaseConfigurationsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolAttachedDatabaseConfigurations.beginDeleteAndWait( @@ -34,4 +40,8 @@ async function kustoPoolAttachedDatabaseConfigurationsDelete() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsDelete().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsGetSample.ts index 0b43dc8f84a9..4baf4ee23719 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns an attached database configuration. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsGet.json */ async function kustoPoolAttachedDatabaseConfigurationsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolAttachedDatabaseConfigurations.get( @@ -34,4 +40,8 @@ async function kustoPoolAttachedDatabaseConfigurationsGet() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsGet().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts index b44a67778ada..66c441911249 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the list of attached database configurations of the given Kusto Pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsListByKustoPool.json */ async function kustoPoolAttachedDatabaseConfigurationsListByKustoPool() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolAttachedDatabaseConfigurationsListByKustoPool() { console.log(resArray); } -kustoPoolAttachedDatabaseConfigurationsListByKustoPool().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsListByKustoPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolChildResourceCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolChildResourceCheckNameAvailabilitySample.ts index 3eda8d7bba8f..14903f8c32fb 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolChildResourceCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolChildResourceCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the Kusto Pool child resource name is valid and is not already in use. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationCheckNameAvailability.json */ async function kustoPoolAttachedDatabaseConfigurationCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const resourceName: DatabaseCheckNameRequest = { name: "adc1", type: @@ -41,10 +47,6 @@ async function kustoPoolAttachedDatabaseConfigurationCheckNameAvailability() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationCheckNameAvailability().catch( - console.error -); - /** * This sample demonstrates how to Checks that the Kusto Pool child resource name is valid and is not already in use. * @@ -52,10 +54,13 @@ kustoPoolAttachedDatabaseConfigurationCheckNameAvailability().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesCheckNameAvailability.json */ async function kustoPoolDatabasesCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const resourceName: DatabaseCheckNameRequest = { name: "database1", type: "Microsoft.Synapse/workspaces/kustoPools/databases" @@ -71,4 +76,9 @@ async function kustoPoolDatabasesCheckNameAvailability() { console.log(result); } -kustoPoolDatabasesCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationCheckNameAvailability(); + kustoPoolDatabasesCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts index 30e265dedeca..cdc652351da5 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the data connection name is valid and is not already in use. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsCheckNameAvailability.json */ async function kustoPoolDataConnectionsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; @@ -42,4 +48,8 @@ async function kustoPoolDataConnectionsCheckNameAvailability() { console.log(result); } -kustoPoolDataConnectionsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolDataConnectionsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCreateOrUpdateSample.ts index a9bd1e6ad115..9fd82b78b06e 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a data connection. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsCreateOrUpdate.json */ async function kustoPoolDataConnectionsCreateOrUpdateJson() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -47,4 +53,8 @@ async function kustoPoolDataConnectionsCreateOrUpdateJson() { console.log(result); } -kustoPoolDataConnectionsCreateOrUpdateJson().catch(console.error); +async function main() { + kustoPoolDataConnectionsCreateOrUpdateJson(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDataConnectionValidationSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDataConnectionValidationSample.ts index 2adab41f33fa..a289d8904a6e 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDataConnectionValidationSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDataConnectionValidationSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the data connection parameters are valid. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionValidation.json */ async function kustoPoolDataConnectionValidation() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -42,4 +48,8 @@ async function kustoPoolDataConnectionValidation() { console.log(result); } -kustoPoolDataConnectionValidation().catch(console.error); +async function main() { + kustoPoolDataConnectionValidation(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDeleteSample.ts index 632a6e39a6f3..abbd8c81b668 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the data connection with the given name. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsDelete.json */ async function kustoPoolDataConnectionsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -36,4 +42,8 @@ async function kustoPoolDataConnectionsDelete() { console.log(result); } -kustoPoolDataConnectionsDelete().catch(console.error); +async function main() { + kustoPoolDataConnectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsGetSample.ts index f976932854e6..65b4e184b95c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a data connection. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsGet.json */ async function kustoPoolDataConnectionsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -36,4 +42,8 @@ async function kustoPoolDataConnectionsGet() { console.log(result); } -kustoPoolDataConnectionsGet().catch(console.error); +async function main() { + kustoPoolDataConnectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsListByDatabaseSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsListByDatabaseSample.ts index 3aecd22fbb2d..5b0ce55432e6 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsListByDatabaseSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsListByDatabaseSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the list of data connections of the given Kusto pool database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsListByDatabase.json */ async function kustoPoolDataConnectionsListByDatabase() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -37,4 +43,8 @@ async function kustoPoolDataConnectionsListByDatabase() { console.log(resArray); } -kustoPoolDataConnectionsListByDatabase().catch(console.error); +async function main() { + kustoPoolDataConnectionsListByDatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsUpdateSample.ts index d574d5e9180b..7dfde70ae34b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDataConnectionsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a data connection. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsUpdate.json */ async function kustoPoolDataConnectionsUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -47,4 +53,8 @@ async function kustoPoolDataConnectionsUpdate() { console.log(result); } -kustoPoolDataConnectionsUpdate().catch(console.error); +async function main() { + kustoPoolDataConnectionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts index d5ec02f6af8f..2aa23dc214ba 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the database principal assignment is valid and is not already in use. @@ -21,11 +24,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsCheckNameAvailability.json */ async function kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const principalAssignmentName: DatabasePrincipalAssignmentCheckNameRequest = { name: "kustoprincipal1", type: @@ -43,6 +49,8 @@ async function kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability().catch( - console.error -); +async function main() { + kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts index 4383527e6ee2..51f9bea19518 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a Kusto pool database principalAssignment. @@ -21,12 +24,15 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsCreateOrUpdate.json */ async function kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters: DatabasePrincipalAssignment = { principalId: "87654321-1234-1234-1234-123456789123", principalType: "App", @@ -46,4 +52,8 @@ async function kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts index 9167191d708b..eb8013d23b6c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Kusto pool principalAssignment. @@ -18,12 +21,15 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsDelete.json */ async function kustoPoolDatabasePrincipalAssignmentsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolDatabasePrincipalAssignments.beginDeleteAndWait( @@ -36,4 +42,8 @@ async function kustoPoolDatabasePrincipalAssignmentsDelete() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsDelete().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsGetSample.ts index 31504b943340..487c50035e0a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Kusto pool database principalAssignment. @@ -18,12 +21,15 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsGet.json */ async function kustoPoolDatabasePrincipalAssignmentsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolDatabasePrincipalAssignments.get( @@ -36,4 +42,8 @@ async function kustoPoolDatabasePrincipalAssignmentsGet() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsGet().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsListSample.ts index d74fd7620cdb..b38a74a2eb57 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasePrincipalAssignmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all Kusto pool database principalAssignments. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsList.json */ async function kustoPoolDatabasePrincipalAssignmentsList() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -37,4 +43,8 @@ async function kustoPoolDatabasePrincipalAssignmentsList() { console.log(resArray); } -kustoPoolDatabasePrincipalAssignmentsList().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesCreateOrUpdateSample.ts index 9d6f0def9e61..3d184f095660 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { ReadWriteDatabase, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesCreateOrUpdate.json */ async function kustoPoolDatabasesCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -40,4 +46,8 @@ async function kustoPoolDatabasesCreateOrUpdate() { console.log(result); } -kustoPoolDatabasesCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolDatabasesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesDeleteSample.ts index 949053c93d6d..4a8dfab20631 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the database with the given name. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesDelete.json */ async function kustoPoolDatabasesDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -34,4 +40,8 @@ async function kustoPoolDatabasesDelete() { console.log(result); } -kustoPoolDatabasesDelete().catch(console.error); +async function main() { + kustoPoolDatabasesDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesGetSample.ts index 5a6440963697..280b3d4c4c0b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesGet.json */ async function kustoPoolDatabasesGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -34,4 +40,8 @@ async function kustoPoolDatabasesGet() { console.log(result); } -kustoPoolDatabasesGet().catch(console.error); +async function main() { + kustoPoolDatabasesGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesListByKustoPoolSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesListByKustoPoolSample.ts index 4c7fc3b6f481..33db51a68c2c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesListByKustoPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesListByKustoPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the list of databases of the given Kusto pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoDatabasesListByKustoPool.json */ async function kustoDatabasesListByKustoPool() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function kustoDatabasesListByKustoPool() { console.log(resArray); } -kustoDatabasesListByKustoPool().catch(console.error); +async function main() { + kustoDatabasesListByKustoPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesUpdateSample.ts index a3c3fc7b6917..d0ff4caf64bb 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolDatabasesUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { ReadWriteDatabase, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesUpdate.json */ async function kustoPoolDatabasesUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -39,4 +45,8 @@ async function kustoPoolDatabasesUpdate() { console.log(result); } -kustoPoolDatabasesUpdate().catch(console.error); +async function main() { + kustoPoolDatabasesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts index cc53824d68f4..2087e271029d 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the principal assignment name is valid and is not already in use. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsCheckNameAvailability.json */ async function kustoPoolPrincipalAssignmentsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const principalAssignmentName: ClusterPrincipalAssignmentCheckNameRequest = { name: "kustoprincipal1", type: "Microsoft.Synapse/workspaces/kustoPools/principalAssignments" @@ -40,4 +46,8 @@ async function kustoPoolPrincipalAssignmentsCheckNameAvailability() { console.log(result); } -kustoPoolPrincipalAssignmentsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts index 5850f8951730..d515f625e1fa 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a Kusto pool principalAssignment. @@ -21,11 +24,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsCreateOrUpdate.json */ async function kustoPoolPrincipalAssignmentsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters: ClusterPrincipalAssignment = { principalId: "87654321-1234-1234-1234-123456789123", principalType: "App", @@ -44,4 +50,8 @@ async function kustoPoolPrincipalAssignmentsCreateOrUpdate() { console.log(result); } -kustoPoolPrincipalAssignmentsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsDeleteSample.ts index 548899117dae..99ba062dedfd 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Kusto pool principalAssignment. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsDelete.json */ async function kustoPoolPrincipalAssignmentsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolPrincipalAssignments.beginDeleteAndWait( @@ -34,4 +40,8 @@ async function kustoPoolPrincipalAssignmentsDelete() { console.log(result); } -kustoPoolPrincipalAssignmentsDelete().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsGetSample.ts index 19d2b1ec2d90..9fff8887f561 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Kusto pool principalAssignment. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsGet.json */ async function kustoPoolPrincipalAssignmentsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolPrincipalAssignments.get( @@ -34,4 +40,8 @@ async function kustoPoolPrincipalAssignmentsGet() { console.log(result); } -kustoPoolPrincipalAssignmentsGet().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsListSample.ts index e0a9bcdbec89..ab78113c3299 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolPrincipalAssignmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all Kusto pool principalAssignments. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsList.json */ async function kustoPoolPrincipalAssignmentsList() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolPrincipalAssignmentsList() { console.log(resArray); } -kustoPoolPrincipalAssignmentsList().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsAddLanguageExtensionsSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsAddLanguageExtensionsSample.ts index b9c087848467..cac7f9ffc26f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsAddLanguageExtensionsSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsAddLanguageExtensionsSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Add a list of language extensions that can run within KQL queries. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsAdd.json */ async function kustoPoolAddLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const languageExtensionsToAdd: LanguageExtensionsList = { value: [{ languageExtensionName: "PYTHON" }, { languageExtensionName: "R" }] }; @@ -39,4 +45,8 @@ async function kustoPoolAddLanguageExtensions() { console.log(result); } -kustoPoolAddLanguageExtensions().catch(console.error); +async function main() { + kustoPoolAddLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCheckNameAvailabilitySample.ts index 75773e16bd37..7b30ec39dc1c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the kusto pool name is valid and is not already in use. @@ -21,7 +24,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCheckNameAvailability.json */ async function kustoPoolsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const location = "westus"; const kustoPoolName: KustoPoolCheckNameRequest = { name: "kustoclusterrptest4", @@ -36,4 +41,8 @@ async function kustoPoolsCheckNameAvailability() { console.log(result); } -kustoPoolsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCreateOrUpdateSample.ts index c1bcf6c142bc..acee1f516ce5 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { KustoPool, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Kusto pool. @@ -18,9 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCreateOrUpdate.json */ async function kustoPoolsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const parameters: KustoPool = { enablePurge: true, @@ -40,4 +46,8 @@ async function kustoPoolsCreateOrUpdate() { console.log(result); } -kustoPoolsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDeleteSample.ts index dbbb7e9ba7d1..81d437fc634b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Kusto pool. @@ -18,9 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsDelete.json */ async function kustoPoolsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -32,4 +38,8 @@ async function kustoPoolsDelete() { console.log(result); } -kustoPoolsDelete().catch(console.error); +async function main() { + kustoPoolsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDetachFollowerDatabasesSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDetachFollowerDatabasesSample.ts index b59359fa8ff8..dc75c6e813b4 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDetachFollowerDatabasesSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsDetachFollowerDatabasesSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Detaches all followers of a database owned by this Kusto Pool. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesDetach.json */ async function kustoPoolDetachFollowerDatabases() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const followerDatabaseToRemove: FollowerDatabaseDefinition = { attachedDatabaseConfigurationName: "myAttachedDatabaseConfiguration", kustoPoolResourceId: @@ -41,4 +47,8 @@ async function kustoPoolDetachFollowerDatabases() { console.log(result); } -kustoPoolDetachFollowerDatabases().catch(console.error); +async function main() { + kustoPoolDetachFollowerDatabases(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsGetSample.ts index ba3e23aa0acd..25fbc28c0272 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Kusto pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsGet.json */ async function kustoPoolsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.get( @@ -32,4 +38,8 @@ async function kustoPoolsGet() { console.log(result); } -kustoPoolsGet().catch(console.error); +async function main() { + kustoPoolsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListByWorkspaceSample.ts index 1469989cec44..194366dfc618 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all Kusto pools @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListByWorkspace.json */ async function listKustoPoolsInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function listKustoPoolsInAWorkspace() { console.log(result); } -listKustoPoolsInAWorkspace().catch(console.error); +async function main() { + listKustoPoolsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListFollowerDatabasesSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListFollowerDatabasesSample.ts index fad70fc5fe08..6258dfe32183 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListFollowerDatabasesSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListFollowerDatabasesSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesList.json */ async function kustoPoolListFollowerDatabases() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolListFollowerDatabases() { console.log(resArray); } -kustoPoolListFollowerDatabases().catch(console.error); +async function main() { + kustoPoolListFollowerDatabases(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListLanguageExtensionsSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListLanguageExtensionsSample.ts index 611d8a12474c..0cfa76097f0b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListLanguageExtensionsSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListLanguageExtensionsSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of language extensions that can run within KQL queries. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsList.json */ async function kustoPoolListLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolListLanguageExtensions() { console.log(resArray); } -kustoPoolListLanguageExtensions().catch(console.error); +async function main() { + kustoPoolListLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusByResourceSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusByResourceSample.ts index 2358952bfb6c..5a71fbb6cbda 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusByResourceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusByResourceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the SKUs available for the provided resource. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListResourceSkus.json */ async function kustoPoolsListResourceSkus() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolsListResourceSkus() { console.log(resArray); } -kustoPoolsListResourceSkus().catch(console.error); +async function main() { + kustoPoolsListResourceSkus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusSample.ts index 8ee18749a750..6a1b363f0a90 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsListSkusSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists eligible SKUs for Kusto Pool resource. @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListSkus.json */ async function kustoPoolsListSkus() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function kustoPoolsListSkus() { console.log(resArray); } -kustoPoolsListSkus().catch(console.error); +async function main() { + kustoPoolsListSkus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsRemoveLanguageExtensionsSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsRemoveLanguageExtensionsSample.ts index fa37275ff7e4..b8e27ee8fee4 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsRemoveLanguageExtensionsSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsRemoveLanguageExtensionsSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove a list of language extensions that can run within KQL queries. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsRemove.json */ async function kustoPoolRemoveLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const languageExtensionsToRemove: LanguageExtensionsList = { value: [{ languageExtensionName: "PYTHON" }, { languageExtensionName: "R" }] }; @@ -39,4 +45,8 @@ async function kustoPoolRemoveLanguageExtensions() { console.log(result); } -kustoPoolRemoveLanguageExtensions().catch(console.error); +async function main() { + kustoPoolRemoveLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStartSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStartSample.ts index a867b1e930d3..e0cc99364c78 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStartSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStartSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Starts a Kusto pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStart.json */ async function kustoPoolsStop() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.beginStartAndWait( @@ -32,4 +38,8 @@ async function kustoPoolsStop() { console.log(result); } -kustoPoolsStop().catch(console.error); +async function main() { + kustoPoolsStop(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStopSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStopSample.ts index 9062c2cf594b..774727547728 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStopSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsStopSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stops a Kusto pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStop.json */ async function kustoPoolsStop() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.beginStopAndWait( @@ -32,4 +38,8 @@ async function kustoPoolsStop() { console.log(result); } -kustoPoolsStop().catch(console.error); +async function main() { + kustoPoolsStop(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsUpdateSample.ts index e4b1a722e4d3..651872e0e184 100644 --- a/sdk/synapse/arm-synapse/samples-dev/kustoPoolsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/kustoPoolsUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { KustoPoolUpdate, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update a Kusto Kusto Pool. @@ -18,9 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsUpdate.json */ async function kustoPoolsUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const parameters: KustoPoolUpdate = { enablePurge: true, @@ -39,4 +45,8 @@ async function kustoPoolsUpdate() { console.log(result); } -kustoPoolsUpdate().catch(console.error); +async function main() { + kustoPoolsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/librariesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/librariesListByWorkspaceSample.ts index d339c2973a11..e8c15c7ba169 100644 --- a/sdk/synapse/arm-synapse/samples-dev/librariesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/librariesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List libraries in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/Libraries_ListByWorkspace.json */ async function listLibrariesInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listLibrariesInAWorkspace() { console.log(resArray); } -listLibrariesInAWorkspace().catch(console.error); +async function main() { + listLibrariesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/libraryGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/libraryGetSample.ts index f9b946973e8c..26629acc6fd6 100644 --- a/sdk/synapse/arm-synapse/samples-dev/libraryGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/libraryGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get library by name in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/Library_Get.json */ async function getLibraryByName() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const libraryName = "exampleLibraryName.jar"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getLibraryByName() { console.log(result); } -getLibraryByName().catch(console.error); +async function main() { + getLibraryByName(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/operationsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples-dev/operationsCheckNameAvailabilitySample.ts index b4e06c211298..d4b0d59b3790 100644 --- a/sdk/synapse/arm-synapse/samples-dev/operationsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/operationsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Check whether a workspace name is available @@ -21,7 +24,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CheckNameAvailabilityWorkspaceAlreadyExists.json */ async function checkForAWorkspaceNameThatAlreadyExists() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const request: CheckNameAvailabilityRequest = { name: "workspace1", type: "Microsoft.Synapse/workspaces" @@ -32,8 +37,6 @@ async function checkForAWorkspaceNameThatAlreadyExists() { console.log(result); } -checkForAWorkspaceNameThatAlreadyExists().catch(console.error); - /** * This sample demonstrates how to Check whether a workspace name is available * @@ -41,7 +44,9 @@ checkForAWorkspaceNameThatAlreadyExists().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CheckNameAvailabilityWorkspaceAvailable.json */ async function checkForAWorkspaceNameThatIsAvailable() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const request: CheckNameAvailabilityRequest = { name: "workspace1", type: "Microsoft.ProjectArcadia/workspaces" @@ -52,4 +57,9 @@ async function checkForAWorkspaceNameThatIsAvailable() { console.log(result); } -checkForAWorkspaceNameThatIsAvailable().catch(console.error); +async function main() { + checkForAWorkspaceNameThatAlreadyExists(); + checkForAWorkspaceNameThatIsAvailable(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/operationsGetAzureAsyncHeaderResultSample.ts b/sdk/synapse/arm-synapse/samples-dev/operationsGetAzureAsyncHeaderResultSample.ts index 2b22930d0d9b..03fb3a360db3 100644 --- a/sdk/synapse/arm-synapse/samples-dev/operationsGetAzureAsyncHeaderResultSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/operationsGetAzureAsyncHeaderResultSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the status of an operation @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAzureAsyncOperationHeader.json */ async function getAzureAsyncOperationHeaderResult() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const operationId = "01234567-89ab-4def-0123-456789abcdef"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAzureAsyncOperationHeaderResult() { console.log(result); } -getAzureAsyncOperationHeaderResult().catch(console.error); +async function main() { + getAzureAsyncOperationHeaderResult(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/operationsGetLocationHeaderResultSample.ts b/sdk/synapse/arm-synapse/samples-dev/operationsGetLocationHeaderResultSample.ts index c213eb0eb8f4..234636cabefd 100644 --- a/sdk/synapse/arm-synapse/samples-dev/operationsGetLocationHeaderResultSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/operationsGetLocationHeaderResultSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the result of an operation @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetLocationHeader.json */ async function getLocationHeaderResult() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const operationId = "01234567-89ab-4def-0123-456789abcdef"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getLocationHeaderResult() { console.log(result); } -getLocationHeaderResult().catch(console.error); +async function main() { + getLocationHeaderResult(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/operationsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/operationsListSample.ts index 8b9300da6a3f..80e3c10c8622 100644 --- a/sdk/synapse/arm-synapse/samples-dev/operationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/operationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all available operations @@ -18,11 +21,17 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAvailableOperations.json */ async function getAvailableOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.operations.list(); console.log(result); } -getAvailableOperations().catch(console.error); +async function main() { + getAvailableOperations(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsCreateSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsCreateSample.ts index b98d7c6628b1..deebb3ef5966 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Approve or reject a private endpoint connection. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ApprovePrivateEndpointConnection.json */ async function approvePrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const request: PrivateEndpointConnection = { @@ -42,4 +48,8 @@ async function approvePrivateEndpointConnection() { console.log(result); } -approvePrivateEndpointConnection().catch(console.error); +async function main() { + approvePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsDeleteSample.ts index d963e74b3f23..03f434ff4899 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete a private endpoint connection. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeletePrivateEndpointConnection.json */ async function deletePrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deletePrivateEndpointConnection() { console.log(result); } -deletePrivateEndpointConnection().catch(console.error); +async function main() { + deletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsGetSample.ts index 87d489d09b57..0a9c46d786e6 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a private endpoint connection. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateEndpointConnection.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsListSample.ts index a54aa8103d24..ab99cc14f4f2 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists private endpoint connection in workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateEndpointConnections.json */ async function listPrivateEndpointConnectionsInWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listPrivateEndpointConnectionsInWorkspace() { console.log(resArray); } -listPrivateEndpointConnectionsInWorkspace().catch(console.error); +async function main() { + listPrivateEndpointConnectionsInWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubGetSample.ts index 2528c9de7dee..cd3c899203b2 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all PrivateEndpointConnection in the PrivateLinkHub by name @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PrivateEndpointConnectionsPrivateLinkHub_Get.json */ async function getAPrivateLinkHub() { - const subscriptionId = "48b08652-d7a1-4d52-b13f-5a2471dce57b"; - const resourceGroupName = "gh-res-grp"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "48b08652-d7a1-4d52-b13f-5a2471dce57b"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "gh-res-grp"; const privateLinkHubName = "pe0"; const privateEndpointConnectionName = "pe0-f3ed30f5-338c-4855-a542-24a403694ad2"; @@ -33,4 +39,8 @@ async function getAPrivateLinkHub() { console.log(result); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubListSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubListSample.ts index 6a8c09829f48..5cc81f2efe9c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateEndpointConnectionsPrivateLinkHubListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all PrivateEndpointConnections in the PrivateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PrivateEndpointConnectionsPrivateLinkHub_List.json */ async function getAPrivateLinkHub() { - const subscriptionId = "48b08652-d7a1-4d52-b13f-5a2471dce57b"; - const resourceGroupName = "gh-res-grp"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "48b08652-d7a1-4d52-b13f-5a2471dce57b"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "gh-res-grp"; const privateLinkHubName = "pe0"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getAPrivateLinkHub() { console.log(resArray); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesGetSample.ts index 5946366e6943..981045fa9914 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get private link resource in private link hub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkHubPrivateLinkResource.json */ async function getPrivateLinkResourcesForPrivateLinkHub() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const privateLinkHubName = "ExamplePrivateLinkHub"; const privateLinkResourceName = "sql"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateLinkResourcesForPrivateLinkHub() { console.log(result); } -getPrivateLinkResourcesForPrivateLinkHub().catch(console.error); +async function main() { + getPrivateLinkResourcesForPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesListSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesListSample.ts index 4749b83ae328..b8b99ca20578 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubPrivateLinkResourcesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all private link resources for a private link hub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubPrivateLinkResources.json */ async function getPrivateLinkResourcesForPrivateLinkHub() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const privateLinkHubName = "ExamplePrivateLinkHub"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getPrivateLinkResourcesForPrivateLinkHub() { console.log(resArray); } -getPrivateLinkResourcesForPrivateLinkHub().catch(console.error); +async function main() { + getPrivateLinkResourcesForPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsCreateOrUpdateSample.ts index 9874d3cdd948..48d7a53482d3 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { PrivateLinkHub, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a privateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdatePrivateLinkHub.json */ async function createOrUpdateAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const privateLinkHubInfo: PrivateLinkHub = { location: "East US", @@ -35,4 +41,8 @@ async function createOrUpdateAPrivateLinkHub() { console.log(result); } -createOrUpdateAPrivateLinkHub().catch(console.error); +async function main() { + createOrUpdateAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsDeleteSample.ts index 0fd508660a10..2bba04da87a8 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a privateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeletePrivateLinkHub.json */ async function deleteAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteAPrivateLinkHub() { console.log(result); } -deleteAPrivateLinkHub().catch(console.error); +async function main() { + deleteAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsGetSample.ts index 6ab0fa17bb15..bebde1041842 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a privateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkHub.json */ async function getAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getAPrivateLinkHub() { console.log(result); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListByResourceGroupSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListByResourceGroupSample.ts index 3e207eef2d3c..578d3102c14e 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListByResourceGroupSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListByResourceGroupSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of privateLinkHubs in a resource group @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubsInResourceGroup.json */ async function listPrivateLinkHubsInResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -31,4 +37,8 @@ async function listPrivateLinkHubsInResourceGroup() { console.log(resArray); } -listPrivateLinkHubsInResourceGroup().catch(console.error); +async function main() { + listPrivateLinkHubsInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListSample.ts index f98d8aff62d4..5e131322732a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of privateLinkHubs in a subscription @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubsInSubscription.json */ async function listPrivateLinkHubsInSubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function listPrivateLinkHubsInSubscription() { console.log(resArray); } -listPrivateLinkHubsInSubscription().catch(console.error); +async function main() { + listPrivateLinkHubsInSubscription(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsUpdateSample.ts index 2aaaf352c653..741f090d503e 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkHubsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a privateLinkHub @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdatePrivateLinkHub.json */ async function updateAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const privateLinkHubPatchInfo: PrivateLinkHubPatchInfo = { tags: { key: "value" } @@ -37,4 +43,8 @@ async function updateAPrivateLinkHub() { console.log(result); } -updateAPrivateLinkHub().catch(console.error); +async function main() { + updateAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesGetSample.ts index 9ecb001ec8ef..fa087d7b3297 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get private link resource in workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkResource.json */ async function getPrivateLinkResourcesForWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateLinkResourceName = "sql"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateLinkResourcesForWorkspace() { console.log(result); } -getPrivateLinkResourcesForWorkspace().catch(console.error); +async function main() { + getPrivateLinkResourcesForWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesListSample.ts b/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesListSample.ts index 1c8cd1ab5c41..7780db65e70c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/privateLinkResourcesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all private link resources for a workspaces @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkResources.json */ async function getPrivateLinkResourcesForWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getPrivateLinkResourcesForWorkspace() { console.log(resArray); } -getPrivateLinkResourcesForWorkspace().catch(console.error); +async function main() { + getPrivateLinkResourcesForWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsGetSample.ts index e2335389311a..c7bc4af2b6d4 100644 --- a/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a deleted sql pool that can be restored @@ -18,8 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RestorableDroppedSqlPoolGet.json */ async function getARestorableDroppedSqlPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "restorabledroppeddatabasetest-1257"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || + "restorabledroppeddatabasetest-1257"; const workspaceName = "restorabledroppeddatabasetest-2389"; const restorableDroppedSqlPoolId = "restorabledroppeddatabasetest-7654,131403269876900000"; @@ -33,4 +40,8 @@ async function getARestorableDroppedSqlPool() { console.log(result); } -getARestorableDroppedSqlPool().catch(console.error); +async function main() { + getARestorableDroppedSqlPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsListByWorkspaceSample.ts index 021d7ed37aba..ed4399447467 100644 --- a/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/restorableDroppedSqlPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of deleted Sql pools that can be restored @@ -18,8 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RestorableDroppedSqlpoolList.json */ async function getListOfRestorableDroppedSqlPools() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "restorabledroppeddatabasetest-1349"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || + "restorabledroppeddatabasetest-1349"; const workspaceName = "restorabledroppeddatabasetest-1840"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +40,8 @@ async function getListOfRestorableDroppedSqlPools() { console.log(resArray); } -getListOfRestorableDroppedSqlPools().catch(console.error); +async function main() { + getListOfRestorableDroppedSqlPools(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationGetSample.ts index acb963ff77cd..e88cae187a8f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SparkConfiguration by name in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/SparkConfiguration_Get.json */ async function getSparkConfigurationByName() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const sparkConfigurationName = "exampleSparkConfigurationName"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getSparkConfigurationByName() { console.log(result); } -getSparkConfigurationByName().catch(console.error); +async function main() { + getSparkConfigurationByName(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationsListByWorkspaceSample.ts index b67cb1e55901..244c74d04d33 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sparkConfigurationsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List sparkConfigurations in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/SparkConfigurations_ListByWorkspace.json */ async function listSparkConfigurationsInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listSparkConfigurationsInAWorkspace() { console.log(resArray); } -listSparkConfigurationsInAWorkspace().catch(console.error); +async function main() { + listSparkConfigurationsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts index 737aa1bcaf30..8f2118d0fac5 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a SQL pool's blob auditing policy. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolBlobAuditingWithAllParameters.json */ async function createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: SqlPoolBlobAuditingPolicy = { @@ -51,10 +57,6 @@ async function createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters() { console.log(result); } -createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates a SQL pool's blob auditing policy. * @@ -62,8 +64,11 @@ createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolBlobAuditingWithMinParameters.json */ async function createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: SqlPoolBlobAuditingPolicy = { @@ -83,6 +88,9 @@ async function createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters() console.log(result); } -createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters(); + createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesGetSample.ts index ba5d52d3a8f0..e1e65a47e164 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a SQL pool's blob auditing policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolBlobAuditing.json */ async function getBlobAuditingPolicyOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getBlobAuditingPolicyOfASqlAnalyticsPool() { console.log(result); } -getBlobAuditingPolicyOfASqlAnalyticsPool().catch(console.error); +async function main() { + getBlobAuditingPolicyOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts index 3f1fe327a369..3e35014a292e 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists auditing settings of a Sql pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolAuditingSettingsList.json */ async function listAuditSettingsOfADatabase() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listAuditSettingsOfADatabase() { console.log(resArray); } -listAuditSettingsOfADatabase().catch(console.error); +async function main() { + listAuditSettingsOfADatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolColumnsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolColumnsGetSample.ts index ce533032dfbc..20c0b2f615e8 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolColumnsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolColumnsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Sql pool column @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolColumnGet.json */ async function getDatabaseColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function getDatabaseColumn() { console.log(result); } -getDatabaseColumn().catch(console.error); +async function main() { + getDatabaseColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolConnectionPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolConnectionPoliciesGetSample.ts index 95167b1b7ba3..c63ff055b755 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolConnectionPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolConnectionPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Sql pool's connection policy, which is used with table auditing. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolConnectionPolicy.json */ async function getAConnectionPolicyOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const connectionPolicyName = "default"; @@ -34,4 +40,8 @@ async function getAConnectionPolicyOfASqlAnalyticsPool() { console.log(result); } -getAConnectionPolicyOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAConnectionPolicyOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolDataWarehouseUserActivitiesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolDataWarehouseUserActivitiesGetSample.ts index eb3a3cdcd0a8..68247922630a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolDataWarehouseUserActivitiesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolDataWarehouseUserActivitiesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the user activities of a SQL pool which includes running and suspended queries @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolUserActivity.json */ async function getASqlAnalyticsPoolUserActivity() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdb"; const dataWarehouseUserActivityName = "current"; @@ -34,4 +40,8 @@ async function getASqlAnalyticsPoolUserActivity() { console.log(result); } -getASqlAnalyticsPoolUserActivity().catch(console.error); +async function main() { + getASqlAnalyticsPoolUserActivity(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts index 767865111a31..9900b995df62 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { GeoBackupPolicy, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a SQL Pool geo backup policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateGeoBackupPolicies.json */ async function createGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "testrg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "testrg"; const workspaceName = "testws"; const sqlPoolName = "testdw"; const geoBackupPolicyName = "Default"; @@ -36,4 +41,8 @@ async function createGeoBackupPolicy() { console.log(result); } -createGeoBackupPolicy().catch(console.error); +async function main() { + createGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesGetSample.ts index 61acd59bc0e1..68d0ac2d93f2 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the specified SQL pool geo backup policy @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolGeoBackupPolicy.json */ async function getSqlPoolGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-5961"; const sqlPoolName = "testdw"; const geoBackupPolicyName = "Default"; @@ -34,4 +40,8 @@ async function getSqlPoolGeoBackupPolicy() { console.log(result); } -getSqlPoolGeoBackupPolicy().catch(console.error); +async function main() { + getSqlPoolGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesListSample.ts index e295a8ed4f7a..1931dbc6210a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolGeoBackupPoliciesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of SQL pool geo backup policies @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolGeoBackupPolicies_List.json */ async function getSqlPoolGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-5961"; const sqlPoolName = "testdw"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getSqlPoolGeoBackupPolicy() { console.log(resArray); } -getSqlPoolGeoBackupPolicy().catch(console.error); +async function main() { + getSqlPoolGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowOptionsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowOptionsGetSample.ts index ce39dd4ed5b9..a56c352069c8 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowOptionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowOptionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of SQL pool's available maintenance windows. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetMaintenanceWindowOptions.json */ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowOptionsName = "current"; @@ -34,6 +39,8 @@ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPo console.log(result); } -getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool().catch( - console.error -); +async function main() { + getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts index 614cea0e31cb..7c2265a805a9 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool's maintenance windows settings. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateMaintenanceWindows.json */ async function setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowName = "current"; @@ -43,6 +48,8 @@ async function setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { console.log(result); } -setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool().catch( - console.error -); +async function main() { + setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsGetSample.ts index 6bba65cbb718..973182d8b0cb 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMaintenanceWindowsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a SQL pool's Maintenance Windows. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetMaintenanceWindows.json */ async function getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowName = "current"; @@ -34,6 +39,8 @@ async function getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { console.log(result); } -getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool().catch( - console.error -); +async function main() { + getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsCreateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsCreateSample.ts index 16811c76239b..a7821272e6fe 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Set the metadata sync configuration for a SQL pool @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPoolMetadataSyncConfig.json */ async function setMetadataSyncConfigForASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const metadataSyncConfiguration: MetadataSyncConfig = { enabled: true }; @@ -37,4 +43,8 @@ async function setMetadataSyncConfigForASqlAnalyticsPool() { console.log(result); } -setMetadataSyncConfigForASqlAnalyticsPool().catch(console.error); +async function main() { + setMetadataSyncConfigForASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsGetSample.ts index a1688ddeb7f8..e0ac273204f5 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolMetadataSyncConfigsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the metadata sync configuration for a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolMetadataSyncConfig.json */ async function getMetadataSyncConfigForASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getMetadataSyncConfigForASqlAnalyticsPool() { console.log(result); } -getMetadataSyncConfigForASqlAnalyticsPool().catch(console.error); +async function main() { + getMetadataSyncConfigForASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationResultsGetLocationHeaderResultSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationResultsGetLocationHeaderResultSample.ts index c57ad7c6fad5..e7442233d6a8 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationResultsGetLocationHeaderResultSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationResultsGetLocationHeaderResultSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the status of a SQL pool operation @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetLocationHeaderResultWithSqlPool.json */ async function getTheResultOfAnOperationOnASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const operationId = "fedcba98-7654-4210-fedc-ba9876543210"; @@ -34,4 +40,8 @@ async function getTheResultOfAnOperationOnASqlAnalyticsPool() { console.log(result); } -getTheResultOfAnOperationOnASqlAnalyticsPool().catch(console.error); +async function main() { + getTheResultOfAnOperationOnASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationsListSample.ts index 49404ff42bdf..69a4a821c385 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolOperationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of operations performed on the SQL pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolOperations.json */ async function listTheSqlAnalyticsPoolManagementOperations() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-7398"; const workspaceName = "sqlcrudtest-4645"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listTheSqlAnalyticsPoolManagementOperations() { console.log(resArray); } -listTheSqlAnalyticsPoolManagementOperations().catch(console.error); +async function main() { + listTheSqlAnalyticsPoolManagementOperations(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts index 48401ff59845..7efad9400374 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update recommended sensitivity labels states of a given SQL Pool using an operations batch. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SensitivityLabelsRecommendedUpdate.json */ async function updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myWorkspace"; const sqlPoolName = "mySqlPool"; const parameters: RecommendedSensitivityLabelUpdateList = { @@ -43,6 +48,8 @@ async function updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperation console.log(result); } -updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch().catch( - console.error -); +async function main() { + updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksGetByNameSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksGetByNameSample.ts index 957caf422c81..a511e59363db 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksGetByNameSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksGetByNameSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SQL pool replication link by name. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolReplicationLinks_GetByName.json */ async function listsASqlAnalyticPoolReplicationLinks() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-6440"; const sqlPoolName = "testdb"; const linkId = "5b301b68-03f6-4b26-b0f4-73ebb8634238"; @@ -34,4 +40,8 @@ async function listsASqlAnalyticPoolReplicationLinks() { console.log(result); } -listsASqlAnalyticPoolReplicationLinks().catch(console.error); +async function main() { + listsASqlAnalyticPoolReplicationLinks(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksListSample.ts index 3b5abd26e2d3..0a74f0e28d6d 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolReplicationLinksListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists a Sql pool's replication links. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolReplicationLinks.json */ async function listsASqlAnalyticPoolReplicationLinks() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-6440"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listsASqlAnalyticPoolReplicationLinks() { console.log(resArray); } -listsASqlAnalyticPoolReplicationLinks().catch(console.error); +async function main() { + listsASqlAnalyticPoolReplicationLinks(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsCreateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsCreateSample.ts index 690ad8066072..a7f0c24c0bac 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a restore point for a data warehouse. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPoolRestorePoints.json */ async function createsSqlPoolRestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testserver"; const sqlPoolName = "testDatabase"; const parameters: CreateSqlPoolRestorePointDefinition = { @@ -39,4 +45,8 @@ async function createsSqlPoolRestorePoint() { console.log(result); } -createsSqlPoolRestorePoint().catch(console.error); +async function main() { + createsSqlPoolRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsDeleteSample.ts index bdfd9b5dac92..8320014a0e4f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a restore point. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolRestorePointsDelete.json */ async function deletesARestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testws"; const sqlPoolName = "testpool"; const restorePointName = "131546477590000000"; @@ -34,4 +40,8 @@ async function deletesARestorePoint() { console.log(result); } -deletesARestorePoint().catch(console.error); +async function main() { + deletesARestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsGetSample.ts index 94758a1282ea..3d6166c19ee8 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a restore point. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolRestorePointsGet.json */ async function getsASqlPoolRestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testws"; const sqlPoolName = "testpool"; const restorePointName = "131546477590000000"; @@ -34,4 +40,8 @@ async function getsASqlPoolRestorePoint() { console.log(result); } -getsASqlPoolRestorePoint().catch(console.error); +async function main() { + getsASqlPoolRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsListSample.ts index ee0ef0910027..674cfbcc48f4 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolRestorePointsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SQL pool backup information @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolRestorePoints.json */ async function getAListOfRestorePointsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testserver"; const sqlPoolName = "testDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getAListOfRestorePointsOfASqlAnalyticsPool() { console.log(resArray); } -getAListOfRestorePointsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAListOfRestorePointsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasGetSample.ts index 7d448b59742f..2f74997457cc 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Sql Pool schema @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolSchemaGet.json */ async function getDatabaseSchema() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -34,4 +39,8 @@ async function getDatabaseSchema() { console.log(result); } -getDatabaseSchema().catch(console.error); +async function main() { + getDatabaseSchema(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasListSample.ts index 3b057eafbeac..b955c81d7905 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSchemasListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets schemas of a given SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolSchema.json */ async function listTheSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +40,8 @@ async function listTheSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts index 16115e650a5a..d87d4992d60a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Sql pool's security alert policy. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolSecurityAlertWithAllParameters.json */ async function updateASqlPoolThreatDetectionPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-4799"; const workspaceName = "securityalert-6440"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -48,8 +54,6 @@ async function updateASqlPoolThreatDetectionPolicyWithAllParameters() { console.log(result); } -updateASqlPoolThreatDetectionPolicyWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Create or update a Sql pool's security alert policy. * @@ -57,8 +61,11 @@ updateASqlPoolThreatDetectionPolicyWithAllParameters().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolSecurityAlertWithMinParameters.json */ async function updateASqlPoolThreatDetectionPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-4799"; const workspaceName = "securityalert-6440"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -75,4 +82,9 @@ async function updateASqlPoolThreatDetectionPolicyWithMinimalParameters() { console.log(result); } -updateASqlPoolThreatDetectionPolicyWithMinimalParameters().catch(console.error); +async function main() { + updateASqlPoolThreatDetectionPolicyWithAllParameters(); + updateASqlPoolThreatDetectionPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesGetSample.ts index f0ce5be529aa..9d63b85ac30e 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Sql pool's security alert policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolSecurityAlert.json */ async function getASecurityAlertOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-6852"; const workspaceName = "securityalert-2080"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -34,4 +40,8 @@ async function getASecurityAlertOfASqlAnalyticsPool() { console.log(result); } -getASecurityAlertOfASqlAnalyticsPool().catch(console.error); +async function main() { + getASecurityAlertOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesListSample.ts index 1e7cba0d152b..3cf6b97bc6e5 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSecurityAlertPoliciesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a list of Sql pool's security alert policies. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolSecurityAlertPolicies_List.json */ async function getASecurityAlertOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-6852"; const workspaceName = "securityalert-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getASecurityAlertOfASqlAnalyticsPool() { console.log(resArray); } -getASecurityAlertOfASqlAnalyticsPool().catch(console.error); +async function main() { + getASecurityAlertOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts index d8f66d3ddb6d..31142907dc73 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SensitivityLabel, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates the sensitivity label of a given column in a Sql pool @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolColumnSensitivityLabelWithAllParameters.json */ async function updatesTheSensitivityLabelOfAGivenColumnWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -45,6 +50,8 @@ async function updatesTheSensitivityLabelOfAGivenColumnWithAllParameters() { console.log(result); } -updatesTheSensitivityLabelOfAGivenColumnWithAllParameters().catch( - console.error -); +async function main() { + updatesTheSensitivityLabelOfAGivenColumnWithAllParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDeleteSample.ts index 29029c74e033..f2c713de9c1c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the sensitivity label of a given column in a Sql pool @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolColumnSensitivityLabel.json */ async function deletesTheSensitivityLabelOfAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function deletesTheSensitivityLabelOfAGivenColumn() { console.log(result); } -deletesTheSensitivityLabelOfAGivenColumn().catch(console.error); +async function main() { + deletesTheSensitivityLabelOfAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDisableRecommendationSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDisableRecommendationSample.ts index c7d746296518..bc5d3858c7de 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDisableRecommendationSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsDisableRecommendationSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Disables sensitivity recommendations on a given column @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RecommendedColumnSensitivityLabelDisable.json */ async function disablesSensitivityRecommendationsOnAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function disablesSensitivityRecommendationsOnAGivenColumn() { console.log(result); } -disablesSensitivityRecommendationsOnAGivenColumn().catch(console.error); +async function main() { + disablesSensitivityRecommendationsOnAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsEnableRecommendationSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsEnableRecommendationSample.ts index d089d586a46d..cb1b1a907230 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsEnableRecommendationSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsEnableRecommendationSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns) @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RecommendedColumnSensitivityLabelEnable.json */ async function enablesSensitivityRecommendationsOnAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function enablesSensitivityRecommendationsOnAGivenColumn() { console.log(result); } -enablesSensitivityRecommendationsOnAGivenColumn().catch(console.error); +async function main() { + enablesSensitivityRecommendationsOnAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsGetSample.ts index 251bb39faa95..49efa427da34 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the sensitivity label of a given column @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolColumnSensitivityLabelGet.json */ async function getsTheSensitivityLabelOfAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -40,4 +45,8 @@ async function getsTheSensitivityLabelOfAGivenColumn() { console.log(result); } -getsTheSensitivityLabelOfAGivenColumn().catch(console.error); +async function main() { + getsTheSensitivityLabelOfAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListCurrentSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListCurrentSample.ts index f6c62201c9b0..bb06bb6ec3c3 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListCurrentSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListCurrentSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets SQL pool sensitivity labels. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsSensitivityLabelsWithSourceCurrent.json */ async function getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +40,8 @@ async function getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool() { console.log(resArray); } -getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool().catch(console.error); +async function main() { + getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListRecommendedSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListRecommendedSample.ts index 3eda71720fc0..4bec09889a68 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListRecommendedSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsListRecommendedSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets sensitivity labels of a given SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolSensitivityLabelsWithSourceRecommended.json */ async function getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,6 +40,8 @@ async function getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool() { console.log(resArray); } -getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool().catch( - console.error -); +async function main() { + getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsUpdateSample.ts index 8c074c8f461c..8b9c8305e537 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolSensitivityLabelsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update sensitivity labels of a given SQL Pool using an operations batch. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SensitivityLabelsCurrentUpdate.json */ async function updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myWorkspace"; const sqlPoolName = "mySqlPool"; const parameters: SensitivityLabelUpdateList = { @@ -67,6 +72,8 @@ async function updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch() { console.log(result); } -updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch().catch( - console.error -); +async function main() { + updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTableColumnsListByTableNameSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTableColumnsListByTableNameSample.ts index fa3b1abe8fd4..873429da42eb 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTableColumnsListByTableNameSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTableColumnsListByTableNameSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets columns in a given table in a SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolColumns.json */ async function listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -39,4 +44,8 @@ async function listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesGetSample.ts index 68b5712da66d..03abcc1980d1 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Sql pool table @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolTableGet.json */ async function getDatabaseTable() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -36,4 +41,8 @@ async function getDatabaseTable() { console.log(result); } -getDatabaseTable().catch(console.error); +async function main() { + getDatabaseTable(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesListBySchemaSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesListBySchemaSample.ts index 9cebb8c6f545..1eb3996c869c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesListBySchemaSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTablesListBySchemaSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets tables of a given schema in a SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolTables.json */ async function listTheTablesOfAGivenSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -37,4 +42,8 @@ async function listTheTablesOfAGivenSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheTablesOfAGivenSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheTablesOfAGivenSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts index 77f418174f46..62539f71224a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool's transparent data encryption configuration. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolTransparentDataEncryption.json */ async function createOrUpdateASqlPoolTransparentDataEncryptionConfiguration() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const transparentDataEncryptionName = "current"; @@ -39,6 +45,8 @@ async function createOrUpdateASqlPoolTransparentDataEncryptionConfiguration() { console.log(result); } -createOrUpdateASqlPoolTransparentDataEncryptionConfiguration().catch( - console.error -); +async function main() { + createOrUpdateASqlPoolTransparentDataEncryptionConfiguration(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsGetSample.ts index 2741fbe4f626..6e03bb0e9a8d 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a SQL pool's transparent data encryption configuration. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolTransparentDataEncryption.json */ async function getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const transparentDataEncryptionName = "current"; @@ -34,6 +40,8 @@ async function getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool() { console.log(result); } -getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool().catch( - console.error -); +async function main() { + getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsListSample.ts index 5dca01402231..78611ebc4e17 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolTransparentDataEncryptionsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of SQL pool's transparent data encryption configurations. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolTransparentDataEncryptionList.json */ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -35,6 +41,8 @@ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPo console.log(resArray); } -getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool().catch( - console.error -); +async function main() { + getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolUsagesListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolUsagesListSample.ts index 0456062fd157..639cb6020023 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolUsagesListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolUsagesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets SQL pool usages. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolUsageMetricsList.json */ async function listTheUsagesOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6730"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6730"; const workspaceName = "sqlcrudtest-9007"; const sqlPoolName = "3481"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listTheUsagesOfASqlAnalyticsPool() { console.log(resArray); } -listTheUsagesOfASqlAnalyticsPool().catch(console.error); +async function main() { + listTheUsagesOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts index 292c9e705f10..823fe7bbcca1 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool's vulnerability assessment rule baseline. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentRuleBaseline.json */ async function createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -49,6 +55,8 @@ async function createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline() { console.log(result); } -createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline().catch( - console.error -); +async function main() { + createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts index 742b96b29207..31c56068996a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Removes the database's vulnerability assessment rule baseline. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolVulnerabilityAssessmentRuleBaseline.json */ async function removesADatabaseVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -38,4 +44,8 @@ async function removesADatabaseVulnerabilityAssessmentRuleBaseline() { console.log(result); } -removesADatabaseVulnerabilityAssessmentRuleBaseline().catch(console.error); +async function main() { + removesADatabaseVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts index a2e4d458fc89..7416ce3d8faf 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a SqlPool's vulnerability assessment rule baseline. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolVulnerabilityAssessmentRuleBaselineGet.json */ async function getsASqlPoolVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4711"; const workspaceName = "vulnerabilityaseessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -38,4 +44,8 @@ async function getsASqlPoolVulnerabilityAssessmentRuleBaseline() { console.log(result); } -getsASqlPoolVulnerabilityAssessmentRuleBaseline().catch(console.error); +async function main() { + getsASqlPoolVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansExportSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansExportSample.ts index 5037e9f608f0..02418a94522f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansExportSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansExportSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Convert an existing scan result to a human readable format. If already exists nothing happens @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExportSqlPoolVulnerabilityAssessmentScan.json */ async function exportADatabaseVulnerabilityAssessmentScanResults() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4799"; const workspaceName = "vulnerabilityassessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +42,8 @@ async function exportADatabaseVulnerabilityAssessmentScanResults() { console.log(result); } -exportADatabaseVulnerabilityAssessmentScanResults().catch(console.error); +async function main() { + exportADatabaseVulnerabilityAssessmentScanResults(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansGetSample.ts index 436a77c551c1..c131f068f668 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a vulnerability assessment scan record of a Sql pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolVulnerabilityAssessmentScanRecordsGet.json */ async function getsADatabaseVulnerabilityAssessmentScanRecordByScanId() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +42,8 @@ async function getsADatabaseVulnerabilityAssessmentScanRecordByScanId() { console.log(result); } -getsADatabaseVulnerabilityAssessmentScanRecordByScanId().catch(console.error); +async function main() { + getsADatabaseVulnerabilityAssessmentScanRecordByScanId(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts index 25479fe69bbc..bc25bad90e10 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Executes a Vulnerability Assessment database scan. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExecuteSqlPoolVulnerabilityAssessmentScans.json */ async function executesASqlPoolVulnerabilityAssessmentScan() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +42,8 @@ async function executesASqlPoolVulnerabilityAssessmentScan() { console.log(result); } -executesASqlPoolVulnerabilityAssessmentScan().catch(console.error); +async function main() { + executesASqlPoolVulnerabilityAssessmentScan(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansListSample.ts index 715be5de9090..974314d1e831 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentScansListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the vulnerability assessment scans of a SQL pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolVulnerabilityAssessmentScanRecords.json */ async function getAVulnerabilityScanRecordOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -37,4 +43,8 @@ async function getAVulnerabilityScanRecordOfASqlAnalyticsPool() { console.log(resArray); } -getAVulnerabilityScanRecordOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAVulnerabilityScanRecordOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts index 72fd3b99533d..3a0ba5d5552c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithAllParameters.json */ async function createADatabaseVulnerabilityAssessmentWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -51,8 +57,6 @@ async function createADatabaseVulnerabilityAssessmentWithAllParameters() { console.log(result); } -createADatabaseVulnerabilityAssessmentWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. * @@ -60,8 +64,11 @@ createADatabaseVulnerabilityAssessmentWithAllParameters().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateVulnerabilityAssessmentWithStorageAccessKeyAndMinParameters.json */ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -83,10 +90,6 @@ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenSt console.log(result); } -createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. * @@ -94,8 +97,11 @@ createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAcc * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithContainerSasKeyAndMinParameters.json */ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -117,6 +123,10 @@ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenSt console.log(result); } -createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified().catch( - console.error -); +async function main() { + createADatabaseVulnerabilityAssessmentWithAllParameters(); + createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified(); + createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsDeleteSample.ts index 83c11bb13190..290673780594 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Removes the database's vulnerability assessment. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolVulnerabilityAssessment.json */ async function removeADatabaseVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -34,4 +40,8 @@ async function removeADatabaseVulnerabilityAssessment() { console.log(result); } -removeADatabaseVulnerabilityAssessment().catch(console.error); +async function main() { + removeADatabaseVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsGetSample.ts index cf62e032365f..f6d16d8a081b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Sql pool's vulnerability assessment. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolVulnerabilityAssessment.json */ async function getASqlPoolVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -34,4 +40,8 @@ async function getASqlPoolVulnerabilityAssessment() { console.log(result); } -getASqlPoolVulnerabilityAssessment().catch(console.error); +async function main() { + getASqlPoolVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsListSample.ts index 26a339768f57..3405098a3184 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolVulnerabilityAssessmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the vulnerability assessment policies associated with a SQL pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolVulnerabilityAssessments.json */ async function getAVulnerabilityAssessmentOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getAVulnerabilityAssessmentOfASqlAnalyticsPool() { console.log(resArray); } -getAVulnerabilityAssessmentOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAVulnerabilityAssessmentOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts index 8834c50a651b..03a4014a85b3 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create Or Update workload classifier for a Sql pool's workload group. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadClassifierMax.json */ async function createAWorkloadClassifierWithAllPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -48,8 +54,6 @@ async function createAWorkloadClassifierWithAllPropertiesSpecified() { console.log(result); } -createAWorkloadClassifierWithAllPropertiesSpecified().catch(console.error); - /** * This sample demonstrates how to Create Or Update workload classifier for a Sql pool's workload group. * @@ -57,8 +61,11 @@ createAWorkloadClassifierWithAllPropertiesSpecified().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadClassifierMin.json */ async function createAWorkloadClassifierWithTheRequiredPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -77,6 +84,9 @@ async function createAWorkloadClassifierWithTheRequiredPropertiesSpecified() { console.log(result); } -createAWorkloadClassifierWithTheRequiredPropertiesSpecified().catch( - console.error -); +async function main() { + createAWorkloadClassifierWithAllPropertiesSpecified(); + createAWorkloadClassifierWithTheRequiredPropertiesSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierDeleteSample.ts index 1cdae621f294..cc6c8fedcacd 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove workload classifier of a Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolWorkloadGroupWorkloadClassifer.json */ async function deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -36,6 +42,8 @@ async function deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup() { console.log(result); } -deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup().catch( - console.error -); +async function main() { + deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierGetSample.ts index bb4930303b9a..edf3cb520044 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workload classifier of Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupWorkloadClassifier.json */ async function getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -36,4 +42,8 @@ async function getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup() { console.log(result); } -getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup().catch(console.error); +async function main() { + getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierListSample.ts index b2cdf905217b..84e45e353236 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadClassifierListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of Sql pool's workload classifier for workload groups. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupWorkloadClassifierList.json */ async function getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -37,6 +43,8 @@ async function getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup() console.log(resArray); } -getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup().catch( - console.error -); +async function main() { + getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupCreateOrUpdateSample.ts index a8fe11a95a2c..8ca5216d8883 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { WorkloadGroup, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create Or Update a Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadGroupMax.json */ async function createAWorkloadGroupWithAllPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -43,8 +49,6 @@ async function createAWorkloadGroupWithAllPropertiesSpecified() { console.log(result); } -createAWorkloadGroupWithAllPropertiesSpecified().catch(console.error); - /** * This sample demonstrates how to Create Or Update a Sql pool's workload group. * @@ -52,8 +56,11 @@ createAWorkloadGroupWithAllPropertiesSpecified().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadGroupMin.json */ async function createAWorkloadGroupWithTheRequiredPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -74,4 +81,9 @@ async function createAWorkloadGroupWithTheRequiredPropertiesSpecified() { console.log(result); } -createAWorkloadGroupWithTheRequiredPropertiesSpecified().catch(console.error); +async function main() { + createAWorkloadGroupWithAllPropertiesSpecified(); + createAWorkloadGroupWithTheRequiredPropertiesSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupDeleteSample.ts index 526c96cbd28d..ca1d1bba660c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolWorkloadGroup.json */ async function deleteAWorkloadGroupOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -34,4 +40,8 @@ async function deleteAWorkloadGroupOfASqlAnalyticsPool() { console.log(result); } -deleteAWorkloadGroupOfASqlAnalyticsPool().catch(console.error); +async function main() { + deleteAWorkloadGroupOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupGetSample.ts index efd46ac69ff2..f9d8124531a9 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroup.json */ async function getAWorkloadGroupOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -34,4 +40,8 @@ async function getAWorkloadGroupOfASqlAnalyticsPool() { console.log(result); } -getAWorkloadGroupOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAWorkloadGroupOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupListSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupListSample.ts index baa18245ce91..e413e59245e7 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolWorkloadGroupListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of Sql pool's workload groups. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupList.json */ async function getTheListOfWorkloadGroupsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getTheListOfWorkloadGroupsOfASqlAnalyticsPool() { console.log(resArray); } -getTheListOfWorkloadGroupsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getTheListOfWorkloadGroupsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsCreateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsCreateSample.ts index 7c9736841eb4..0ff9956ca4f0 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsCreateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SqlPool, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPool.json */ async function createASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const sqlPoolInfo: SqlPool = { @@ -44,4 +50,8 @@ async function createASqlAnalyticsPool() { console.log(result); } -createASqlAnalyticsPool().catch(console.error); +async function main() { + createASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsDeleteSample.ts index f020c73b40a7..b60cfe89b620 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPool.json */ async function deleteASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteASqlAnalyticsPool() { console.log(result); } -deleteASqlAnalyticsPool().catch(console.error); +async function main() { + deleteASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsGetSample.ts index e9afec21e93e..8fe2f1106bdf 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SQL pool properties @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPool.json */ async function getASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getASqlAnalyticsPool() { console.log(result); } -getASqlAnalyticsPool().catch(console.error); +async function main() { + getASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsListByWorkspaceSample.ts index 728c95a3c807..e2febe6bccde 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all SQL pools @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspace.json */ async function listSqlAnalyticsPoolsInAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6845"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6845"; const workspaceName = "sqlcrudtest-7177"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,8 +39,6 @@ async function listSqlAnalyticsPoolsInAWorkspace() { console.log(resArray); } -listSqlAnalyticsPoolsInAWorkspace().catch(console.error); - /** * This sample demonstrates how to List all SQL pools * @@ -42,8 +46,11 @@ listSqlAnalyticsPoolsInAWorkspace().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspaceWithFilter.json */ async function listSqlAnalyticsPoolsInAWorkspaceWithFilter() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6845"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6845"; const workspaceName = "sqlcrudtest-7177"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -57,4 +64,9 @@ async function listSqlAnalyticsPoolsInAWorkspaceWithFilter() { console.log(resArray); } -listSqlAnalyticsPoolsInAWorkspaceWithFilter().catch(console.error); +async function main() { + listSqlAnalyticsPoolsInAWorkspace(); + listSqlAnalyticsPoolsInAWorkspaceWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsPauseSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsPauseSample.ts index fbb98f3d8922..9ff9ec96a524 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsPauseSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsPauseSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Pause a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PauseSqlPool.json */ async function pauseASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdwdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function pauseASqlAnalyticsPool() { console.log(result); } -pauseASqlAnalyticsPool().catch(console.error); +async function main() { + pauseASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsRenameSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsRenameSample.ts index 34a0fc20aa90..26982b9c2d06 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsRenameSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsRenameSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Rename a SQL pool. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RenameSqlPool.json */ async function renameASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdb"; const parameters: ResourceMoveDefinition = { @@ -40,4 +46,8 @@ async function renameASqlAnalyticsPool() { console.log(result); } -renameASqlAnalyticsPool().catch(console.error); +async function main() { + renameASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsResumeSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsResumeSample.ts index 87c84e80b8fd..3a170722290b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsResumeSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsResumeSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Resume a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ResumeSqlPool.json */ async function resumeASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function resumeASqlAnalyticsPool() { console.log(result); } -resumeASqlAnalyticsPool().catch(console.error); +async function main() { + resumeASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsUpdateSample.ts index e08fa20c092b..63bca6e04e90 100644 --- a/sdk/synapse/arm-synapse/samples-dev/sqlPoolsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/sqlPoolsUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SqlPoolPatchInfo, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Apply a partial update to a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateSqlPool.json */ async function updateASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const sqlPoolInfo: SqlPoolPatchInfo = { @@ -41,4 +47,8 @@ async function updateASqlAnalyticsPool() { console.log(result); } -updateASqlAnalyticsPool().catch(console.error); +async function main() { + updateASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsCreateOrUpdateSample.ts index 7f04121a4943..8b6903ef09f8 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace active directory admin @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspaceAadAdmin.json */ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const aadAdminInfo: WorkspaceAadAdminInfo = { administratorType: "ActiveDirectory", @@ -40,4 +46,8 @@ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { console.log(result); } -createOrUpdateWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + createOrUpdateWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsDeleteSample.ts index 2a7bfc56d18d..1b859823aec7 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceAadAdmin.json */ async function deleteWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteWorkspaceActiveDirectoryAdmin() { console.log(result); } -deleteWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + deleteWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsGetSample.ts index 14a63f486e63..973c0259bef6 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceAadAdminsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceAadAdmin.json */ async function getWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getWorkspaceActiveDirectoryAdmin() { console.log(result); } -getWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + getWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts index 24904ac13c1b..214c98136df1 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update Managed Identity Sql Control Settings @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateManagedIdentitySqlControlSettings.json */ async function createOrUpdateManagedIdentitySqlControlSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const managedIdentitySqlControlSettings: ManagedIdentitySqlControlSettingsModel = { grantSqlControlToManagedIdentity: { desiredState: "Enabled" } @@ -37,4 +43,8 @@ async function createOrUpdateManagedIdentitySqlControlSettings() { console.log(result); } -createOrUpdateManagedIdentitySqlControlSettings().catch(console.error); +async function main() { + createOrUpdateManagedIdentitySqlControlSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsGetSample.ts index b1d682ebe831..8c7b584de562 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedIdentitySqlControlSettingsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Managed Identity Sql Control Settings @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetManagedIdentitySqlControlSettings.json */ async function getManagedIdentitySqlControlSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getManagedIdentitySqlControlSettings() { console.log(result); } -getManagedIdentitySqlControlSettings().catch(console.error); +async function main() { + getManagedIdentitySqlControlSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts index 992b0c7a62e2..fbd6a818d6c8 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's blob auditing policy. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerBlobAuditingSettingsWithAllParameters.json */ async function createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ServerBlobAuditingPolicy = { @@ -52,10 +57,6 @@ async function createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParame console.log(result); } -createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's blob auditing policy. * @@ -63,8 +64,10 @@ createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerBlobAuditingSettingsWithMinParameters.json */ async function createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ServerBlobAuditingPolicy = { @@ -84,6 +87,9 @@ async function createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMi console.log(result); } -createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters(); + createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts index d922308c0659..3d03c0e74292 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workspace managed sql server's blob auditing policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerBlobAuditingSettings.json */ async function getBlobAuditingSettingOfWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getBlobAuditingSettingOfWorkspaceManagedSqlServer() { console.log(result); } -getBlobAuditingSettingOfWorkspaceManagedSqlServer().catch(console.error); +async function main() { + getBlobAuditingSettingOfWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts index 91ae32fe55a8..4c539c33bc21 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List workspace managed sql server's blob auditing policies. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerBlobAuditingSettings.json */ async function getBlobAuditingPolicyOfWorkspaceMangedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getBlobAuditingPolicyOfWorkspaceMangedSqlServer() { console.log(resArray); } -getBlobAuditingPolicyOfWorkspaceMangedSqlServer().catch(console.error); +async function main() { + getBlobAuditingPolicyOfWorkspaceMangedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts index bdebdc9dab93..c836a75126a9 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's minimal tls settings. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const dedicatedSQLminimalTlsSettingsName = "default"; const credential = new DefaultAzureCredential(); @@ -32,6 +38,8 @@ async function getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings() { console.log(result); } -getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings().catch( - console.error -); +async function main() { + getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts index 56d3650c56e0..00e4dc915e94 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List workspace managed sql server's minimal tls settings. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,6 +39,8 @@ async function listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer( console.log(resArray); } -listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer().catch( - console.error -); +async function main() { + listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts index 4f21be3fe423..959062e4e613 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update workspace managed sql server's minimal tls settings. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function updateTlsVersionOfTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const dedicatedSQLminimalTlsSettingsName = "default"; const parameters: DedicatedSQLminimalTlsSettings = { @@ -39,4 +45,8 @@ async function updateTlsVersionOfTheWorkspaceManagedSqlServer() { console.log(result); } -updateTlsVersionOfTheWorkspaceManagedSqlServer().catch(console.error); +async function main() { + updateTlsVersionOfTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts index 176dc883904f..2bff22c7c2ff 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates workspace managed sql server's encryption protector. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateKeyVault.json */ async function updateTheEncryptionProtectorToKeyVault() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const parameters: EncryptionProtector = { @@ -40,8 +45,6 @@ async function updateTheEncryptionProtectorToKeyVault() { console.log(result); } -updateTheEncryptionProtectorToKeyVault().catch(console.error); - /** * This sample demonstrates how to Updates workspace managed sql server's encryption protector. * @@ -49,8 +52,10 @@ updateTheEncryptionProtectorToKeyVault().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateServiceManaged.json */ async function updateTheEncryptionProtectorToServiceManaged() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const parameters: EncryptionProtector = { @@ -68,4 +73,9 @@ async function updateTheEncryptionProtectorToServiceManaged() { console.log(result); } -updateTheEncryptionProtectorToServiceManaged().catch(console.error); +async function main() { + updateTheEncryptionProtectorToKeyVault(); + updateTheEncryptionProtectorToServiceManaged(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorGetSample.ts index 21d2b5f22e1c..02f292ef4603 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's encryption protector. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerEncryptionProtector.json */ async function getWorkspaceManagedSqlServerEncryptionProtector() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getWorkspaceManagedSqlServerEncryptionProtector() { console.log(result); } -getWorkspaceManagedSqlServerEncryptionProtector().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerEncryptionProtector(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorListSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorListSample.ts index d86baf9b4550..1b443d8a7ccd 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of encryption protectors for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerEncryptionProtectorList.json */ async function getWorkspaceManagedSqlServerEncryptionProtectors() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getWorkspaceManagedSqlServerEncryptionProtectors() { console.log(resArray); } -getWorkspaceManagedSqlServerEncryptionProtectors().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerEncryptionProtectors(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts index d9eab0e8f19c..824cc12e010a 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Revalidates workspace managed sql server's existing encryption protector. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorRevalidate.json */ async function revalidatesTheEncryptionProtector() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function revalidatesTheEncryptionProtector() { console.log(result); } -revalidatesTheEncryptionProtector().catch(console.error); +async function main() { + revalidatesTheEncryptionProtector(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts index 6532123e6b35..67b17eeafca9 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's extended blob auditing policy. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerExtendedBlobAuditingSettingsWithAllParameters.json */ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ExtendedServerBlobAuditingPolicy = { @@ -52,10 +57,6 @@ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicy console.log(result); } -createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's extended blob auditing policy. * @@ -63,8 +64,10 @@ createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParame * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerExetendedBlobAuditingSettingsWithMinParameters.json */ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ExtendedServerBlobAuditingPolicy = { @@ -84,6 +87,9 @@ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicy console.log(result); } -createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters(); + createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts index c6aa7d85c1f7..1e8b6efefb23 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workspace SQL server's extended blob auditing policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlExtendedServerBlobAuditingSettings.json */ async function getWorkspaceManagedSqlServersExtendedBlobAuditingSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const credential = new DefaultAzureCredential(); @@ -32,6 +37,8 @@ async function getWorkspaceManagedSqlServersExtendedBlobAuditingSettings() { console.log(result); } -getWorkspaceManagedSqlServersExtendedBlobAuditingSettings().catch( - console.error -); +async function main() { + getWorkspaceManagedSqlServersExtendedBlobAuditingSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts index ef78998b189f..a29c3bda0aaa 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List workspace managed sql server's extended blob auditing policies. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerExtendedBlobAuditingSettings.json */ async function getWorkspaceManagedSqlServerExtendedBlobAuditingSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getWorkspaceManagedSqlServerExtendedBlobAuditingSettings() { console.log(resArray); } -getWorkspaceManagedSqlServerExtendedBlobAuditingSettings().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerExtendedBlobAuditingSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts index 460ccc9b4689..6fe4522f7204 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get recoverable sql pools for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerRecoverableSqlPool.json */ async function getRecoverableSqlPoolsForTheServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const sqlPoolName = "recoverableSqlpools-1235"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getRecoverableSqlPoolsForTheServer() { console.log(result); } -getRecoverableSqlPoolsForTheServer().catch(console.error); +async function main() { + getRecoverableSqlPoolsForTheServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts index e44f6830d8cd..65f40e25493f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of recoverable sql pools for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerRecoverableSqlPool.json */ async function listRecoverableSqlPoolsForTheServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function listRecoverableSqlPoolsForTheServer() { console.log(resArray); } -listRecoverableSqlPoolsForTheServer().catch(console.error); +async function main() { + listRecoverableSqlPoolsForTheServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts index c5c134a01b52..8ccbf2b3cc7d 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's threat detection policy. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerSecurityAlertWithAllParameters.json */ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const parameters: ServerSecurityAlertPolicy = { @@ -46,10 +51,6 @@ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParam console.log(result); } -updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's threat detection policy. * @@ -57,8 +58,10 @@ updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerSecurityAlertCreateWithMinParameters.json */ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const parameters: ServerSecurityAlertPolicy = { @@ -79,6 +82,9 @@ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalP console.log(result); } -updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters().catch( - console.error -); +async function main() { + updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters(); + updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts index 874e11f6f51f..3bbac0337557 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workspace managed sql server's security alert policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerSecurityAlertPolicy.json */ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { console.log(result); } -getWorkspaceManagedSqlServerSecurityAlertPolicy().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerSecurityAlertPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts index 9a60229583d0..c07a3aab2ac2 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's threat detection policies. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerSecurityAlertPolicies.json */ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { console.log(resArray); } -getWorkspaceManagedSqlServerSecurityAlertPolicy().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerSecurityAlertPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerUsagesListSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerUsagesListSample.ts index 24027d35dd7f..59e128b218f6 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerUsagesListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerUsagesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of server usages metric for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerUsages.json */ async function listUsagesMetricForTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function listUsagesMetricForTheWorkspaceManagedSqlServer() { console.log(resArray); } -listUsagesMetricForTheWorkspaceManagedSqlServer().catch(console.error); +async function main() { + listUsagesMetricForTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts index 3ab42e6f33d7..1ebe9576053e 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters: ServerVulnerabilityAssessment = { @@ -49,10 +54,6 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. * @@ -60,8 +61,10 @@ createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceMangedSqlServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters: ServerVulnerabilityAssessment = { @@ -81,10 +84,6 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified().catch( - console.error -); - /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. * @@ -92,8 +91,10 @@ createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParame * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceMangedSqlServerVulnerabilityAssessmentCreateContainerSasKeyMin.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters: ServerVulnerabilityAssessment = { @@ -113,6 +114,10 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified().catch( - console.error -); +async function main() { + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters(); + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified(); + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts index 82343123db26..40a782b105f2 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove workspace managed sql server's vulnerability assessment. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceManagedSqlServerVulnerabilityAssessment.json */ async function removeWorkspaceManagedSqlServerVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function removeWorkspaceManagedSqlServerVulnerabilityAssessment() { console.log(result); } -removeWorkspaceManagedSqlServerVulnerabilityAssessment().catch(console.error); +async function main() { + removeWorkspaceManagedSqlServerVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts index 055defecc219..c75fe3e3795c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's vulnerability assessment. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerVulnerabilityAssessment.json */ async function getWorkspaceManagedSqlServerVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getWorkspaceManagedSqlServerVulnerabilityAssessment() { console.log(result); } -getWorkspaceManagedSqlServerVulnerabilityAssessment().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts index d1527110dbee..7ca85110d579 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the vulnerability assessment policies associated with a workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies.json */ async function getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,6 +38,8 @@ async function getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies() { console.log(resArray); } -getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies().catch( - console.error -); +async function main() { + getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsCreateOrUpdateSample.ts index ea6cad8fca78..39072a162ff3 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace SQL active directory admin @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspaceAadAdmin.json */ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const aadAdminInfo: WorkspaceAadAdminInfo = { administratorType: "ActiveDirectory", @@ -40,4 +46,8 @@ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { console.log(result); } -createOrUpdateWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + createOrUpdateWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsDeleteSample.ts index 7c3d3defb27b..333cfa7f8841 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace SQL active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceAadAdmin.json */ async function deleteWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteWorkspaceActiveDirectoryAdmin() { console.log(result); } -deleteWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + deleteWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsGetSample.ts index 29a8187d5be5..91a88f7b0165 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspaceSqlAadAdminsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace SQL active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceAadAdmin.json */ async function getWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getWorkspaceActiveDirectoryAdmin() { console.log(result); } -getWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + getWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspacesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspacesCreateOrUpdateSample.ts index f8eccb1a35fa..aae2e02c8b7b 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspacesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspacesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { Workspace, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspace.json */ async function createOrUpdateAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const workspaceInfo: Workspace = { cspWorkspaceAdminProperties: { @@ -84,4 +90,8 @@ async function createOrUpdateAWorkspace() { console.log(result); } -createOrUpdateAWorkspace().catch(console.error); +async function main() { + createOrUpdateAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspacesDeleteSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspacesDeleteSample.ts index f98ba939f221..b5353d17b90c 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspacesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspacesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspace.json */ async function deleteAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteAWorkspace() { console.log(result); } -deleteAWorkspace().catch(console.error); +async function main() { + deleteAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspacesGetSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspacesGetSample.ts index 5c05cf76292e..0dbf4a1ce5bd 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspacesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspacesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspace.json */ async function getAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +33,8 @@ async function getAWorkspace() { console.log(result); } -getAWorkspace().catch(console.error); +async function main() { + getAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspacesListByResourceGroupSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspacesListByResourceGroupSample.ts index 77719faf9548..30e50e4dd24f 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspacesListByResourceGroupSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspacesListByResourceGroupSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of workspaces in a resource group @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspacesInResourceGroup.json */ async function listWorkspacesInResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -31,4 +37,8 @@ async function listWorkspacesInResourceGroup() { console.log(resArray); } -listWorkspacesInResourceGroup().catch(console.error); +async function main() { + listWorkspacesInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspacesListSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspacesListSample.ts index 40e7d9fc392e..5a25acf2e394 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspacesListSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspacesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of workspaces in a subscription @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspacesInSubscription.json */ async function listWorkspacesInSubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function listWorkspacesInSubscription() { console.log(resArray); } -listWorkspacesInSubscription().catch(console.error); +async function main() { + listWorkspacesInSubscription(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples-dev/workspacesUpdateSample.ts b/sdk/synapse/arm-synapse/samples-dev/workspacesUpdateSample.ts index 4aa5401a5ab9..da5b99ca7a91 100644 --- a/sdk/synapse/arm-synapse/samples-dev/workspacesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples-dev/workspacesUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a workspace @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateWorkspace.json */ async function updateAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const workspacePatchInfo: WorkspacePatchInfo = { encryption: { @@ -66,4 +72,8 @@ async function updateAWorkspace() { console.log(result); } -updateAWorkspace().catch(console.error); +async function main() { + updateAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/README.md b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/README.md index 49310cfbf97f..0ab0c3215da4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/README.md +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/README.md @@ -260,7 +260,7 @@ node azureAdOnlyAuthenticationsCreateSample.js Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env node azureAdOnlyAuthenticationsCreateSample.js +npx cross-env SYNAPSE_SUBSCRIPTION_ID="" SYNAPSE_RESOURCE_GROUP="" node azureAdOnlyAuthenticationsCreateSample.js ``` ## Next Steps diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsCreateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsCreateSample.js index 57cc4c481a15..ff8ee35768b9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsCreateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsCreateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or Update a Azure Active Directory only authentication property for the workspaces @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateAzureADOnlyAuthentication.json */ async function createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const azureADOnlyAuthenticationName = "default"; const azureADOnlyAuthenticationInfo = { @@ -36,4 +38,8 @@ async function createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(result); } -createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty().catch(console.error); +async function main() { + createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsGetSample.js index 0fbc83b9bdd7..e6fbdea7b002 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a Azure Active Directory only authentication property @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAzureADOnlyAuthentication.json */ async function getAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const azureADOnlyAuthenticationName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(result); } -getAzureActiveDirectoryOnlyAuthenticationProperty().catch(console.error); +async function main() { + getAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsListSample.js index 8c2604b95fa4..93841f8d3642 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/azureAdOnlyAuthenticationsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a list of Azure Active Directory only authentication property for a workspace @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListAzureADOnlyAuthentication.json */ async function getAListOfAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function getAListOfAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(resArray); } -getAListOfAzureActiveDirectoryOnlyAuthenticationProperty().catch(console.error); +async function main() { + getAListOfAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsCreateOrUpdateSample.js index 143c1c88e80e..e1e04547826a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create a new Big Data pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/CreateOrUpdateBigDataPool.json */ async function createOrUpdateABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const bigDataPoolInfo = { @@ -46,4 +48,8 @@ async function createOrUpdateABigDataPool() { console.log(result); } -createOrUpdateABigDataPool().catch(console.error); +async function main() { + createOrUpdateABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsDeleteSample.js index 99965f8b65b7..aa6b069ac8cb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Delete a Big Data pool from the workspace. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/DeleteBigDataPool.json */ async function deleteABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteABigDataPool() { console.log(result); } -deleteABigDataPool().catch(console.error); +async function main() { + deleteABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsGetSample.js index 584c02a12bf9..29c7bb42f061 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a Big Data pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/GetBigDataPool.json */ async function getABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getABigDataPool() { console.log(result); } -getABigDataPool().catch(console.error); +async function main() { + getABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsListByWorkspaceSample.js index 8688cf97df6f..ad03a9964e64 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Big Data pools in a workspace. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/ListBigDataPoolsInWorkspace.json */ async function listBigDataPoolsInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listBigDataPoolsInAWorkspace() { console.log(resArray); } -listBigDataPoolsInAWorkspace().catch(console.error); +async function main() { + listBigDataPoolsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsUpdateSample.js index b00c81ce21b9..889e61de3194 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/bigDataPoolsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Patch a Big Data pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/UpdateBigDataPool.json */ async function updateABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const bigDataPoolPatchInfo = { tags: { key: "value" } }; @@ -34,4 +36,8 @@ async function updateABigDataPool() { console.log(result); } -updateABigDataPool().catch(console.error); +async function main() { + updateABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesCreateOrUpdateSample.js index 7396591f80b4..e641854c52bb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a Sql pool data masking policy @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyCreateOrUpdateMax.json */ async function createOrUpdateDataMaskingPolicyMax() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const parameters = { @@ -37,8 +39,6 @@ async function createOrUpdateDataMaskingPolicyMax() { console.log(result); } -createOrUpdateDataMaskingPolicyMax().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking policy * @@ -46,8 +46,9 @@ createOrUpdateDataMaskingPolicyMax().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyCreateOrUpdateMin.json */ async function createOrUpdateDataMaskingPolicyMin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const parameters = { dataMaskingState: "Enabled" }; @@ -62,4 +63,9 @@ async function createOrUpdateDataMaskingPolicyMin() { console.log(result); } -createOrUpdateDataMaskingPolicyMin().catch(console.error); +async function main() { + createOrUpdateDataMaskingPolicyMax(); + createOrUpdateDataMaskingPolicyMin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesGetSample.js index a2dc2d7cb9da..666fe7ef6c10 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a Sql pool data masking policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyGet.json */ async function getDataMaskingPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getDataMaskingPolicy() { console.log(result); } -getDataMaskingPolicy().catch(console.error); +async function main() { + getDataMaskingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesCreateOrUpdateSample.js index 24c9670219ea..48d11187734c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json */ async function createOrUpdateDataMaskingRuleForDefaultMax() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -43,8 +45,6 @@ async function createOrUpdateDataMaskingRuleForDefaultMax() { console.log(result); } -createOrUpdateDataMaskingRuleForDefaultMax().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -52,8 +52,9 @@ createOrUpdateDataMaskingRuleForDefaultMax().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json */ async function createOrUpdateDataMaskingRuleForDefaultMin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -75,8 +76,6 @@ async function createOrUpdateDataMaskingRuleForDefaultMin() { console.log(result); } -createOrUpdateDataMaskingRuleForDefaultMin().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -84,8 +83,9 @@ createOrUpdateDataMaskingRuleForDefaultMin().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateNumber.json */ async function createOrUpdateDataMaskingRuleForNumbers() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -109,8 +109,6 @@ async function createOrUpdateDataMaskingRuleForNumbers() { console.log(result); } -createOrUpdateDataMaskingRuleForNumbers().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -118,8 +116,9 @@ createOrUpdateDataMaskingRuleForNumbers().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateText.json */ async function createOrUpdateDataMaskingRuleForText() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -144,4 +143,11 @@ async function createOrUpdateDataMaskingRuleForText() { console.log(result); } -createOrUpdateDataMaskingRuleForText().catch(console.error); +async function main() { + createOrUpdateDataMaskingRuleForDefaultMax(); + createOrUpdateDataMaskingRuleForDefaultMin(); + createOrUpdateDataMaskingRuleForNumbers(); + createOrUpdateDataMaskingRuleForText(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesGetSample.js index bc3bdc9fc1f1..3f1886345630 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the specific Sql pool data masking rule. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleGet.json */ async function getDataMaskingRule() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -34,4 +36,8 @@ async function getDataMaskingRule() { console.log(result); } -getDataMaskingRule().catch(console.error); +async function main() { + getDataMaskingRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesListBySqlPoolSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesListBySqlPoolSample.js index e0cba799d3bb..cd6c0483fae5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesListBySqlPoolSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/dataMaskingRulesListBySqlPoolSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a list of Sql pool data masking rules. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleList.json */ async function listDataMaskingRules() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function listDataMaskingRules() { console.log(resArray); } -listDataMaskingRules().catch(console.error); +async function main() { + listDataMaskingRules(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js index 06ba837d5c5e..9b3616482df9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolAzureMonitorAuditingCreateMin.json */ async function createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters = { @@ -37,10 +39,6 @@ async function createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMini console.log(result); } -createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. * @@ -48,8 +46,9 @@ createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters() * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingCreateMax.json */ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters = { @@ -79,8 +78,6 @@ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameter console.log(result); } -createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. * @@ -88,8 +85,9 @@ createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters().catch(conso * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingCreateMin.json */ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters = { @@ -109,4 +107,10 @@ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParam console.log(result); } -createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters().catch(console.error); +async function main() { + createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters(); + createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters(); + createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesGetSample.js index b78db7c263ff..4b1c116d6098 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets an extended Sql pool's blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingGet.json */ async function getAnExtendedDatabaseBlobAuditingPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAnExtendedDatabaseBlobAuditingPolicy() { console.log(result); } -getAnExtendedDatabaseBlobAuditingPolicy().catch(console.error); +async function main() { + getAnExtendedDatabaseBlobAuditingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.js index 7411f07b734b..4a1c66b19ea8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists extended auditing settings of a Sql pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolExtendedAuditingSettingsList.json */ async function listExtendedAuditingSettingsOfADatabase() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function listExtendedAuditingSettingsOfADatabase() { console.log(resArray); } -listExtendedAuditingSettingsOfADatabase().catch(console.error); +async function main() { + listExtendedAuditingSettingsOfADatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysListSample.js index 0e76d132b3e4..4ddf71e095d3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List authentication keys in an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListAuthKeys.json */ async function listAuthKeys() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function listAuthKeys() { console.log(result); } -listAuthKeys().catch(console.error); +async function main() { + listAuthKeys(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysRegenerateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysRegenerateSample.js index 5f2a90870e36..e392ec9aa77e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysRegenerateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeAuthKeysRegenerateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Regenerate the authentication key for an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_RegenerateAuthKey.json */ async function regenerateAuthKey() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const regenerateKeyParameters = { @@ -36,4 +38,8 @@ async function regenerateAuthKey() { console.log(result); } -regenerateAuthKey().catch(console.error); +async function main() { + regenerateAuthKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeConnectionInfosGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeConnectionInfosGetSample.js index 7effcb89c001..b67706f08693 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeConnectionInfosGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeConnectionInfosGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get connection info for an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_GetConnectionInfo.json */ async function getConnectionInfo() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getConnectionInfo() { console.log(result); } -getConnectionInfo().catch(console.error); +async function main() { + getConnectionInfo(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeCredentialsSyncSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeCredentialsSyncSample.js index e2b74bef2326..ac77f663c659 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeCredentialsSyncSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeCredentialsSyncSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override the credentials across all worker nodes with those available on the dispatcher node. If you already have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime node than using this API directly. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_SyncCredentials.json */ async function syncCredentials() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function syncCredentials() { console.log(result); } -syncCredentials().catch(console.error); +async function main() { + syncCredentials(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeMonitoringDataListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeMonitoringDataListSample.js index 5601367bac5c..964578103833 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeMonitoringDataListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeMonitoringDataListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get monitoring data for an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeMonitoringData_List.json */ async function getMonitoringData() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getMonitoringData() { console.log(result); } -getMonitoringData().catch(console.error); +async function main() { + getMonitoringData(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodeIPAddressGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodeIPAddressGetSample.js index f65290b11089..e26316296207 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodeIPAddressGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodeIPAddressGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the IP address of an integration runtime node @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_GetIpAddress.json */ async function getIntegrationRuntimeNodeIPAddress() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +36,8 @@ async function getIntegrationRuntimeNodeIPAddress() { console.log(result); } -getIntegrationRuntimeNodeIPAddress().catch(console.error); +async function main() { + getIntegrationRuntimeNodeIPAddress(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesDeleteSample.js index 6b1c02ca2491..a34acbc72d34 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Delete an integration runtime node @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Delete.json */ async function deleteIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +36,8 @@ async function deleteIntegrationRuntimeNode() { console.log(result); } -deleteIntegrationRuntimeNode().catch(console.error); +async function main() { + deleteIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesGetSample.js index 7a5d479ef7de..7e47040c7de7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get an integration runtime node @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Get.json */ async function getIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +36,8 @@ async function getIntegrationRuntimeNode() { console.log(result); } -getIntegrationRuntimeNode().catch(console.error); +async function main() { + getIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesUpdateSample.js index a926f59acec2..bc8873e103fc 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeNodesUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create an integration runtime node @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Update.json */ async function updateIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -38,4 +40,8 @@ async function updateIntegrationRuntimeNode() { console.log(result); } -updateIntegrationRuntimeNode().catch(console.error); +async function main() { + updateIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataListSample.js index feb3ef725526..06c2e7ba6814 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get object metadata from an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeObjectMetadata_List.json */ async function getIntegrationRuntimeObjectMetadata() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "testactivityv2"; const getMetadataRequest = { @@ -39,4 +41,8 @@ async function getIntegrationRuntimeObjectMetadata() { console.log(result); } -getIntegrationRuntimeObjectMetadata().catch(console.error); +async function main() { + getIntegrationRuntimeObjectMetadata(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataRefreshSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataRefreshSample.js index d588c76d3d8b..9b489d1d88ed 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataRefreshSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeObjectMetadataRefreshSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Refresh the object metadata in an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeObjectMetadata_Refresh.json */ async function refreshObjectMetadata() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "testactivityv2"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function refreshObjectMetadata() { console.log(result); } -refreshObjectMetadata().catch(console.error); +async function main() { + refreshObjectMetadata(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeStatusGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeStatusGetSample.js index 239bb3340993..b860ee294918 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeStatusGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimeStatusGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the integration runtime status @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_GetStatus.json */ async function getStatus() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getStatus() { console.log(result); } -getStatus().catch(console.error); +async function main() { + getStatus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesCreateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesCreateSample.js index 3e0618876375..fee83b6ad719 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesCreateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesCreateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Create.json */ async function createIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const integrationRuntime = { @@ -39,4 +41,8 @@ async function createIntegrationRuntime() { console.log(result); } -createIntegrationRuntime().catch(console.error); +async function main() { + createIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDeleteSample.js index f92be4e4d73f..127f843789ca 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Delete an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Delete.json */ async function deleteIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteIntegrationRuntime() { console.log(result); } -deleteIntegrationRuntime().catch(console.error); +async function main() { + deleteIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDisableInteractiveQuerySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDisableInteractiveQuerySample.js index fbd4f9b63163..49da55723b22 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDisableInteractiveQuerySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesDisableInteractiveQuerySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Disable interactive query in integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_DisableInteractiveQuery.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesEnableInteractiveQuerySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesEnableInteractiveQuerySample.js index 93394b11ca91..bdd696098280 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesEnableInteractiveQuerySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesEnableInteractiveQuerySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Enable interactive query in integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_EnableInteractiveQuery.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesGetSample.js index a06b0729ad94..4d0d1e2c4c5a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Get.json */ async function getIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getIntegrationRuntime() { console.log(result); } -getIntegrationRuntime().catch(console.error); +async function main() { + getIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListByWorkspaceSample.js index 27fcc4ea9a96..0aa29b9522e8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List all integration runtimes @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListByWorkspace.json */ async function listIntegrationRuntimes() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function listIntegrationRuntimes() { console.log(resArray); } -listIntegrationRuntimes().catch(console.error); +async function main() { + listIntegrationRuntimes(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.js index 8813d2411aea..b7d968ec87d8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the list of outbound network dependencies for a given Azure-SSIS integration runtime. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListOutboundNetworkDependenciesEndpoints.json */ async function getOutboundNetworkDependencyEndpoints() { - const subscriptionId = "ade9c2b6-c160-4305-9bb9-80342f6c1ae2"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "ade9c2b6-c160-4305-9bb9-80342f6c1ae2"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getOutboundNetworkDependencyEndpoints() { console.log(result); } -getOutboundNetworkDependencyEndpoints().catch(console.error); +async function main() { + getOutboundNetworkDependencyEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStartSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStartSample.js index 9ea1bc1dbaca..c673d029bdf8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStartSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStartSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Start an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Start.json */ async function startIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function startIntegrationRuntime() { console.log(result); } -startIntegrationRuntime().catch(console.error); +async function main() { + startIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStopSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStopSample.js index 255efec06228..87df1aa06360 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStopSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesStopSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Stop an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Stop.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpdateSample.js index dc47191cd90e..f8d654504c19 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Update.json */ async function updateIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const updateIntegrationRuntimeRequest = { @@ -37,4 +39,8 @@ async function updateIntegrationRuntime() { console.log(result); } -updateIntegrationRuntime().catch(console.error); +async function main() { + updateIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpgradeSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpgradeSample.js index 568e964231d7..7463fcc65bbf 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpgradeSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/integrationRuntimesUpgradeSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Upgrade an integration runtime @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Upgrade.json */ async function upgradeIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function upgradeIntegrationRuntime() { console.log(result); } -upgradeIntegrationRuntime().catch(console.error); +async function main() { + upgradeIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesCreateOrUpdateSample.js index de1ab392c27f..c00e4b2e6aaa 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a firewall rule @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateIpFirewallRule.json */ async function createAnIPFirewallRule() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const ipFirewallRuleInfo = { @@ -37,4 +39,8 @@ async function createAnIPFirewallRule() { console.log(result); } -createAnIPFirewallRule().catch(console.error); +async function main() { + createAnIPFirewallRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesDeleteSample.js index 79192b5f21a3..d139346762ed 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a firewall rule @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteIpFirewallRule.json */ async function deleteAnIPFirewallRuleFromAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteAnIPFirewallRuleFromAWorkspace() { console.log(result); } -deleteAnIPFirewallRuleFromAWorkspace().catch(console.error); +async function main() { + deleteAnIPFirewallRuleFromAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesGetSample.js index 8ade430ff3b2..58b7431133d5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a firewall rule @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetIpFirewallRule.json */ async function createAnIPFirewallRule() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function createAnIPFirewallRule() { console.log(result); } -createAnIPFirewallRule().catch(console.error); +async function main() { + createAnIPFirewallRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesListByWorkspaceSample.js index 0299e79cfc47..8439c71a4bc2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of firewall rules @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListIpFirewallRules.json */ async function listIPFirewallRulesInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listIPFirewallRulesInAWorkspace() { console.log(resArray); } -listIPFirewallRulesInAWorkspace().catch(console.error); +async function main() { + listIPFirewallRulesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesReplaceAllSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesReplaceAllSample.js index a7ae668d5053..07f01f97256e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesReplaceAllSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/ipFirewallRulesReplaceAllSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Replaces firewall rules @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ReplaceAllIpFirewallRules.json */ async function replaceAllIPFirewallRulesInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const request = { ipFirewallRules: { @@ -43,4 +45,8 @@ async function replaceAllIPFirewallRulesInAWorkspace() { console.log(result); } -replaceAllIPFirewallRulesInAWorkspace().catch(console.error); +async function main() { + replaceAllIPFirewallRulesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysCreateOrUpdateSample.js index a129c6e42dae..32ca68369e23 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a workspace key @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateKey.json */ async function createOrUpdateAWorkspaceKey() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const keyProperties = { @@ -37,4 +39,8 @@ async function createOrUpdateAWorkspaceKey() { console.log(result); } -createOrUpdateAWorkspaceKey().catch(console.error); +async function main() { + createOrUpdateAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysDeleteSample.js index 8b727a17264e..aedd37429aaa 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a workspace key @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteKey.json */ async function deleteAWorkspaceKey() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function deleteAWorkspaceKey() { console.log(result); } -deleteAWorkspaceKey().catch(console.error); +async function main() { + deleteAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysGetSample.js index 44ab408d2809..271f05171187 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a workspace key @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetKey.json */ async function getAWorkspaceKey() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getAWorkspaceKey() { console.log(result); } -getAWorkspaceKey().catch(console.error); +async function main() { + getAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysListByWorkspaceSample.js index 99ebf5e7efd4..4ee751e0610f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/keysListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of keys in a workspace @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListKeysInWorkspace.json */ async function listKeysInWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listKeysInWorkspace() { console.log(resArray); } -listKeysInWorkspace().catch(console.error); +async function main() { + listKeysInWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoOperationsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoOperationsListSample.js index f1e125b8f721..9b4829f1f237 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoOperationsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoOperationsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. @@ -18,7 +19,8 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoOperationsList.json */ async function kustoOperationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function kustoOperationsList() { console.log(resArray); } -kustoOperationsList().catch(console.error); +async function main() { + kustoOperationsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.js index d3f6b806fc4d..d157f080d3f6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates an attached database configuration. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsCreateOrUpdate.json */ async function kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters = { kustoPoolResourceId: "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Synapse/Workspaces/kustorptest/KustoPools/kustoclusterrptest4", @@ -50,4 +52,8 @@ async function kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsDeleteSample.js index 6aa9780d0960..2e4be8f9096d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes the attached database configuration with the given name. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsDelete.json */ async function kustoPoolAttachedDatabaseConfigurationsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolAttachedDatabaseConfigurations.beginDeleteAndWait( @@ -34,4 +36,8 @@ async function kustoPoolAttachedDatabaseConfigurationsDelete() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsDelete().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsGetSample.js index 934db62a0e12..91618e4ced76 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns an attached database configuration. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsGet.json */ async function kustoPoolAttachedDatabaseConfigurationsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolAttachedDatabaseConfigurations.get( @@ -34,4 +36,8 @@ async function kustoPoolAttachedDatabaseConfigurationsGet() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsGet().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.js index 5f5f51492328..1cdeca29ed47 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns the list of attached database configurations of the given Kusto Pool. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsListByKustoPool.json */ async function kustoPoolAttachedDatabaseConfigurationsListByKustoPool() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +37,8 @@ async function kustoPoolAttachedDatabaseConfigurationsListByKustoPool() { console.log(resArray); } -kustoPoolAttachedDatabaseConfigurationsListByKustoPool().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsListByKustoPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolChildResourceCheckNameAvailabilitySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolChildResourceCheckNameAvailabilitySample.js index 1b6153d5831c..211b86a83140 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolChildResourceCheckNameAvailabilitySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolChildResourceCheckNameAvailabilitySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks that the Kusto Pool child resource name is valid and is not already in use. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationCheckNameAvailability.json */ async function kustoPoolAttachedDatabaseConfigurationCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const resourceName = { name: "adc1", type: "Microsoft.Synapse/workspaces/kustoPools/attachedDatabaseConfigurations", @@ -37,8 +39,6 @@ async function kustoPoolAttachedDatabaseConfigurationCheckNameAvailability() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationCheckNameAvailability().catch(console.error); - /** * This sample demonstrates how to Checks that the Kusto Pool child resource name is valid and is not already in use. * @@ -46,10 +46,11 @@ kustoPoolAttachedDatabaseConfigurationCheckNameAvailability().catch(console.erro * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesCheckNameAvailability.json */ async function kustoPoolDatabasesCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const resourceName = { name: "database1", type: "Microsoft.Synapse/workspaces/kustoPools/databases", @@ -65,4 +66,9 @@ async function kustoPoolDatabasesCheckNameAvailability() { console.log(result); } -kustoPoolDatabasesCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationCheckNameAvailability(); + kustoPoolDatabasesCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCheckNameAvailabilitySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCheckNameAvailabilitySample.js index 372088005d07..1ff66ba5a752 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCheckNameAvailabilitySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCheckNameAvailabilitySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks that the data connection name is valid and is not already in use. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsCheckNameAvailability.json */ async function kustoPoolDataConnectionsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; @@ -39,4 +41,8 @@ async function kustoPoolDataConnectionsCheckNameAvailability() { console.log(result); } -kustoPoolDataConnectionsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolDataConnectionsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCreateOrUpdateSample.js index c7359734b8cd..41e95556904f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a data connection. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsCreateOrUpdate.json */ async function kustoPoolDataConnectionsCreateOrUpdateJson() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -44,4 +46,8 @@ async function kustoPoolDataConnectionsCreateOrUpdateJson() { console.log(result); } -kustoPoolDataConnectionsCreateOrUpdateJson().catch(console.error); +async function main() { + kustoPoolDataConnectionsCreateOrUpdateJson(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDataConnectionValidationSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDataConnectionValidationSample.js index 2a517be11f6a..b0c93919ced2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDataConnectionValidationSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDataConnectionValidationSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks that the data connection parameters are valid. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionValidation.json */ async function kustoPoolDataConnectionValidation() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -39,4 +41,8 @@ async function kustoPoolDataConnectionValidation() { console.log(result); } -kustoPoolDataConnectionValidation().catch(console.error); +async function main() { + kustoPoolDataConnectionValidation(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDeleteSample.js index b1068a537691..23af3a6045c1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes the data connection with the given name. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsDelete.json */ async function kustoPoolDataConnectionsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -36,4 +38,8 @@ async function kustoPoolDataConnectionsDelete() { console.log(result); } -kustoPoolDataConnectionsDelete().catch(console.error); +async function main() { + kustoPoolDataConnectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsGetSample.js index e2141c0c6ee9..159bf77257b0 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a data connection. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsGet.json */ async function kustoPoolDataConnectionsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -36,4 +38,8 @@ async function kustoPoolDataConnectionsGet() { console.log(result); } -kustoPoolDataConnectionsGet().catch(console.error); +async function main() { + kustoPoolDataConnectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsListByDatabaseSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsListByDatabaseSample.js index 356880334b05..c2f370e655cc 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsListByDatabaseSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsListByDatabaseSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns the list of data connections of the given Kusto pool database. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsListByDatabase.json */ async function kustoPoolDataConnectionsListByDatabase() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -37,4 +39,8 @@ async function kustoPoolDataConnectionsListByDatabase() { console.log(resArray); } -kustoPoolDataConnectionsListByDatabase().catch(console.error); +async function main() { + kustoPoolDataConnectionsListByDatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsUpdateSample.js index 312b2c8b9a6f..5f2dbcdf35b6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDataConnectionsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates a data connection. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsUpdate.json */ async function kustoPoolDataConnectionsUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -44,4 +46,8 @@ async function kustoPoolDataConnectionsUpdate() { console.log(result); } -kustoPoolDataConnectionsUpdate().catch(console.error); +async function main() { + kustoPoolDataConnectionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.js index 265e2378b38f..e601f78763d9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks that the database principal assignment is valid and is not already in use. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsCheckNameAvailability.json */ async function kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const principalAssignmentName = { name: "kustoprincipal1", type: "Microsoft.Synapse/workspaces/kustoPools/databases/principalAssignments", @@ -39,4 +41,8 @@ async function kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.js index 54179e2cef1b..e5d4ba6a66c1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a Kusto pool database principalAssignment. @@ -18,12 +19,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsCreateOrUpdate.json */ async function kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters = { principalId: "87654321-1234-1234-1234-123456789123", principalType: "App", @@ -43,4 +45,8 @@ async function kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsDeleteSample.js index ec61001932d1..3ffe9c3e36f4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Kusto pool principalAssignment. @@ -18,12 +19,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsDelete.json */ async function kustoPoolDatabasePrincipalAssignmentsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolDatabasePrincipalAssignments.beginDeleteAndWait( @@ -36,4 +38,8 @@ async function kustoPoolDatabasePrincipalAssignmentsDelete() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsDelete().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsGetSample.js index a2df708baebe..0fc6c0b1169d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a Kusto pool database principalAssignment. @@ -18,12 +19,13 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsGet.json */ async function kustoPoolDatabasePrincipalAssignmentsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolDatabasePrincipalAssignments.get( @@ -36,4 +38,8 @@ async function kustoPoolDatabasePrincipalAssignmentsGet() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsGet().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsListSample.js index c95954157fe6..df4097c2b5db 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasePrincipalAssignmentsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all Kusto pool database principalAssignments. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsList.json */ async function kustoPoolDatabasePrincipalAssignmentsList() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -37,4 +39,8 @@ async function kustoPoolDatabasePrincipalAssignmentsList() { console.log(resArray); } -kustoPoolDatabasePrincipalAssignmentsList().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesCreateOrUpdateSample.js index 8b4d19fff89d..8f5021c563eb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a database. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesCreateOrUpdate.json */ async function kustoPoolDatabasesCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -40,4 +42,8 @@ async function kustoPoolDatabasesCreateOrUpdate() { console.log(result); } -kustoPoolDatabasesCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolDatabasesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesDeleteSample.js index 8f7411c17d3b..a0b9933e03aa 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes the database with the given name. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesDelete.json */ async function kustoPoolDatabasesDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -34,4 +36,8 @@ async function kustoPoolDatabasesDelete() { console.log(result); } -kustoPoolDatabasesDelete().catch(console.error); +async function main() { + kustoPoolDatabasesDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesGetSample.js index 723f5c25ca8f..2ac751b12ea7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a database. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesGet.json */ async function kustoPoolDatabasesGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -34,4 +36,8 @@ async function kustoPoolDatabasesGet() { console.log(result); } -kustoPoolDatabasesGet().catch(console.error); +async function main() { + kustoPoolDatabasesGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesListByKustoPoolSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesListByKustoPoolSample.js index 61b85ee3e067..8615e647b904 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesListByKustoPoolSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesListByKustoPoolSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns the list of databases of the given Kusto pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoDatabasesListByKustoPool.json */ async function kustoDatabasesListByKustoPool() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function kustoDatabasesListByKustoPool() { console.log(resArray); } -kustoDatabasesListByKustoPool().catch(console.error); +async function main() { + kustoDatabasesListByKustoPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesUpdateSample.js index 89903936d4fe..79ee4bc0d1e9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolDatabasesUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates a database. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesUpdate.json */ async function kustoPoolDatabasesUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -39,4 +41,8 @@ async function kustoPoolDatabasesUpdate() { console.log(result); } -kustoPoolDatabasesUpdate().catch(console.error); +async function main() { + kustoPoolDatabasesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.js index dd563b348675..2b4c66946e0d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks that the principal assignment name is valid and is not already in use. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsCheckNameAvailability.json */ async function kustoPoolPrincipalAssignmentsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const principalAssignmentName = { name: "kustoprincipal1", type: "Microsoft.Synapse/workspaces/kustoPools/principalAssignments", @@ -37,4 +39,8 @@ async function kustoPoolPrincipalAssignmentsCheckNameAvailability() { console.log(result); } -kustoPoolPrincipalAssignmentsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.js index 1153dd331bf2..b7d134031cdc 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create a Kusto pool principalAssignment. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsCreateOrUpdate.json */ async function kustoPoolPrincipalAssignmentsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters = { principalId: "87654321-1234-1234-1234-123456789123", principalType: "App", @@ -41,4 +43,8 @@ async function kustoPoolPrincipalAssignmentsCreateOrUpdate() { console.log(result); } -kustoPoolPrincipalAssignmentsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsDeleteSample.js index e58fc9dbd423..098dea04f4a5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Kusto pool principalAssignment. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsDelete.json */ async function kustoPoolPrincipalAssignmentsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolPrincipalAssignments.beginDeleteAndWait( @@ -34,4 +36,8 @@ async function kustoPoolPrincipalAssignmentsDelete() { console.log(result); } -kustoPoolPrincipalAssignmentsDelete().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsGetSample.js index 86893080db3e..0545ac91b4c1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a Kusto pool principalAssignment. @@ -18,11 +19,12 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsGet.json */ async function kustoPoolPrincipalAssignmentsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolPrincipalAssignments.get( @@ -34,4 +36,8 @@ async function kustoPoolPrincipalAssignmentsGet() { console.log(result); } -kustoPoolPrincipalAssignmentsGet().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsListSample.js index 01da75102d48..c0ecebae316e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolPrincipalAssignmentsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all Kusto pool principalAssignments. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsList.json */ async function kustoPoolPrincipalAssignmentsList() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +37,8 @@ async function kustoPoolPrincipalAssignmentsList() { console.log(resArray); } -kustoPoolPrincipalAssignmentsList().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsAddLanguageExtensionsSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsAddLanguageExtensionsSample.js index b82820043c13..6492268ef6a7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsAddLanguageExtensionsSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsAddLanguageExtensionsSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Add a list of language extensions that can run within KQL queries. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsAdd.json */ async function kustoPoolAddLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const languageExtensionsToAdd = { value: [{ languageExtensionName: "PYTHON" }, { languageExtensionName: "R" }], }; @@ -36,4 +38,8 @@ async function kustoPoolAddLanguageExtensions() { console.log(result); } -kustoPoolAddLanguageExtensions().catch(console.error); +async function main() { + kustoPoolAddLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCheckNameAvailabilitySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCheckNameAvailabilitySample.js index 39ea189fc34f..8f70c57ea41e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCheckNameAvailabilitySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCheckNameAvailabilitySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks that the kusto pool name is valid and is not already in use. @@ -18,7 +19,8 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCheckNameAvailability.json */ async function kustoPoolsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const location = "westus"; const kustoPoolName = { name: "kustoclusterrptest4", @@ -30,4 +32,8 @@ async function kustoPoolsCheckNameAvailability() { console.log(result); } -kustoPoolsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCreateOrUpdateSample.js index c7ba598f96c3..0b791553e430 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or update a Kusto pool. @@ -18,9 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCreateOrUpdate.json */ async function kustoPoolsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const parameters = { enablePurge: true, @@ -40,4 +42,8 @@ async function kustoPoolsCreateOrUpdate() { console.log(result); } -kustoPoolsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDeleteSample.js index 09955f6ec6f9..365afb58602e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Kusto pool. @@ -18,9 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsDelete.json */ async function kustoPoolsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -32,4 +34,8 @@ async function kustoPoolsDelete() { console.log(result); } -kustoPoolsDelete().catch(console.error); +async function main() { + kustoPoolsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDetachFollowerDatabasesSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDetachFollowerDatabasesSample.js index b0a087210e2c..c9e04b2edbed 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDetachFollowerDatabasesSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsDetachFollowerDatabasesSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Detaches all followers of a database owned by this Kusto Pool. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesDetach.json */ async function kustoPoolDetachFollowerDatabases() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const followerDatabaseToRemove = { attachedDatabaseConfigurationName: "myAttachedDatabaseConfiguration", kustoPoolResourceId: @@ -38,4 +40,8 @@ async function kustoPoolDetachFollowerDatabases() { console.log(result); } -kustoPoolDetachFollowerDatabases().catch(console.error); +async function main() { + kustoPoolDetachFollowerDatabases(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsGetSample.js index 416139901983..1f3c0470539f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a Kusto pool. @@ -18,14 +19,19 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsGet.json */ async function kustoPoolsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.get(workspaceName, kustoPoolName, resourceGroupName); console.log(result); } -kustoPoolsGet().catch(console.error); +async function main() { + kustoPoolsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListByWorkspaceSample.js index 630687005af8..60f5bb2814ff 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List all Kusto pools @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListByWorkspace.json */ async function listKustoPoolsInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +29,8 @@ async function listKustoPoolsInAWorkspace() { console.log(result); } -listKustoPoolsInAWorkspace().catch(console.error); +async function main() { + listKustoPoolsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListFollowerDatabasesSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListFollowerDatabasesSample.js index 9d7ec9098c8b..1e0729b03e99 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListFollowerDatabasesSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListFollowerDatabasesSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesList.json */ async function kustoPoolListFollowerDatabases() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +37,8 @@ async function kustoPoolListFollowerDatabases() { console.log(resArray); } -kustoPoolListFollowerDatabases().catch(console.error); +async function main() { + kustoPoolListFollowerDatabases(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListLanguageExtensionsSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListLanguageExtensionsSample.js index c361426c1184..fd29417fe9de 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListLanguageExtensionsSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListLanguageExtensionsSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of language extensions that can run within KQL queries. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsList.json */ async function kustoPoolListLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +37,8 @@ async function kustoPoolListLanguageExtensions() { console.log(resArray); } -kustoPoolListLanguageExtensions().catch(console.error); +async function main() { + kustoPoolListLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusByResourceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusByResourceSample.js index efc56b78296c..bf3eae81db89 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusByResourceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusByResourceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns the SKUs available for the provided resource. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListResourceSkus.json */ async function kustoPoolsListResourceSkus() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +37,8 @@ async function kustoPoolsListResourceSkus() { console.log(resArray); } -kustoPoolsListResourceSkus().catch(console.error); +async function main() { + kustoPoolsListResourceSkus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusSample.js index fad3b936ab8a..23536cc78b2b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsListSkusSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists eligible SKUs for Kusto Pool resource. @@ -18,7 +19,8 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListSkus.json */ async function kustoPoolsListSkus() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function kustoPoolsListSkus() { console.log(resArray); } -kustoPoolsListSkus().catch(console.error); +async function main() { + kustoPoolsListSkus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsRemoveLanguageExtensionsSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsRemoveLanguageExtensionsSample.js index 99cd0b6b0970..a2d09c58e088 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsRemoveLanguageExtensionsSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsRemoveLanguageExtensionsSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Remove a list of language extensions that can run within KQL queries. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsRemove.json */ async function kustoPoolRemoveLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const languageExtensionsToRemove = { value: [{ languageExtensionName: "PYTHON" }, { languageExtensionName: "R" }], }; @@ -36,4 +38,8 @@ async function kustoPoolRemoveLanguageExtensions() { console.log(result); } -kustoPoolRemoveLanguageExtensions().catch(console.error); +async function main() { + kustoPoolRemoveLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStartSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStartSample.js index fb4e9735273d..62acfe029bbf 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStartSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStartSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Starts a Kusto pool. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStart.json */ async function kustoPoolsStop() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.beginStartAndWait( @@ -32,4 +34,8 @@ async function kustoPoolsStop() { console.log(result); } -kustoPoolsStop().catch(console.error); +async function main() { + kustoPoolsStop(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStopSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStopSample.js index dab6749d9355..42386dacac94 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStopSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsStopSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Stops a Kusto pool. @@ -18,10 +19,11 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStop.json */ async function kustoPoolsStop() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.beginStopAndWait( @@ -32,4 +34,8 @@ async function kustoPoolsStop() { console.log(result); } -kustoPoolsStop().catch(console.error); +async function main() { + kustoPoolsStop(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsUpdateSample.js index 9a31df73a470..192473491cfa 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/kustoPoolsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update a Kusto Kusto Pool. @@ -18,9 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsUpdate.json */ async function kustoPoolsUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const parameters = { enablePurge: true, @@ -39,4 +41,8 @@ async function kustoPoolsUpdate() { console.log(result); } -kustoPoolsUpdate().catch(console.error); +async function main() { + kustoPoolsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/librariesListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/librariesListByWorkspaceSample.js index 29d2c36f4cd4..ffe6ccbbddf9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/librariesListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/librariesListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List libraries in a workspace. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/Libraries_ListByWorkspace.json */ async function listLibrariesInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listLibrariesInAWorkspace() { console.log(resArray); } -listLibrariesInAWorkspace().catch(console.error); +async function main() { + listLibrariesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/libraryGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/libraryGetSample.js index d67078ad3e18..ff4a2c168d91 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/libraryGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/libraryGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get library by name in a workspace. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/Library_Get.json */ async function getLibraryByName() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const libraryName = "exampleLibraryName.jar"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getLibraryByName() { console.log(result); } -getLibraryByName().catch(console.error); +async function main() { + getLibraryByName(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsCheckNameAvailabilitySample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsCheckNameAvailabilitySample.js index 0c70de79d103..2bb1698b6794 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsCheckNameAvailabilitySample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsCheckNameAvailabilitySample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Check whether a workspace name is available @@ -18,7 +19,8 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CheckNameAvailabilityWorkspaceAlreadyExists.json */ async function checkForAWorkspaceNameThatAlreadyExists() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; const request = { name: "workspace1", type: "Microsoft.Synapse/workspaces", @@ -29,8 +31,6 @@ async function checkForAWorkspaceNameThatAlreadyExists() { console.log(result); } -checkForAWorkspaceNameThatAlreadyExists().catch(console.error); - /** * This sample demonstrates how to Check whether a workspace name is available * @@ -38,7 +38,8 @@ checkForAWorkspaceNameThatAlreadyExists().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CheckNameAvailabilityWorkspaceAvailable.json */ async function checkForAWorkspaceNameThatIsAvailable() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; const request = { name: "workspace1", type: "Microsoft.ProjectArcadia/workspaces", @@ -49,4 +50,9 @@ async function checkForAWorkspaceNameThatIsAvailable() { console.log(result); } -checkForAWorkspaceNameThatIsAvailable().catch(console.error); +async function main() { + checkForAWorkspaceNameThatAlreadyExists(); + checkForAWorkspaceNameThatIsAvailable(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetAzureAsyncHeaderResultSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetAzureAsyncHeaderResultSample.js index 0f1ca823b4be..b13d6cc1df27 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetAzureAsyncHeaderResultSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetAzureAsyncHeaderResultSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the status of an operation @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAzureAsyncOperationHeader.json */ async function getAzureAsyncOperationHeaderResult() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const operationId = "01234567-89ab-4def-0123-456789abcdef"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAzureAsyncOperationHeaderResult() { console.log(result); } -getAzureAsyncOperationHeaderResult().catch(console.error); +async function main() { + getAzureAsyncOperationHeaderResult(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetLocationHeaderResultSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetLocationHeaderResultSample.js index 0deb01e1a37f..78737afbb079 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetLocationHeaderResultSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsGetLocationHeaderResultSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the result of an operation @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetLocationHeader.json */ async function getLocationHeaderResult() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const operationId = "01234567-89ab-4def-0123-456789abcdef"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getLocationHeaderResult() { console.log(result); } -getLocationHeaderResult().catch(console.error); +async function main() { + getLocationHeaderResult(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsListSample.js index 28953793f8be..926b5477cfdf 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/operationsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get all available operations @@ -18,11 +19,16 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAvailableOperations.json */ async function getAvailableOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.operations.list(); console.log(result); } -getAvailableOperations().catch(console.error); +async function main() { + getAvailableOperations(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsCreateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsCreateSample.js index 07c59b988689..18cd6cfeb617 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsCreateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsCreateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Approve or reject a private endpoint connection. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ApprovePrivateEndpointConnection.json */ async function approvePrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const request = { @@ -39,4 +41,8 @@ async function approvePrivateEndpointConnection() { console.log(result); } -approvePrivateEndpointConnection().catch(console.error); +async function main() { + approvePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js index c67b42494191..920189808022 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Delete a private endpoint connection. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeletePrivateEndpointConnection.json */ async function deletePrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deletePrivateEndpointConnection() { console.log(result); } -deletePrivateEndpointConnection().catch(console.error); +async function main() { + deletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js index 2fed3c6bfa21..e6d42801efa2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a private endpoint connection. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateEndpointConnection.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsListSample.js index e11e20dd0a67..60159ee1f174 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists private endpoint connection in workspace. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateEndpointConnections.json */ async function listPrivateEndpointConnectionsInWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listPrivateEndpointConnectionsInWorkspace() { console.log(resArray); } -listPrivateEndpointConnectionsInWorkspace().catch(console.error); +async function main() { + listPrivateEndpointConnectionsInWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubGetSample.js index ff67cb62e54e..fe16eebe71be 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get all PrivateEndpointConnection in the PrivateLinkHub by name @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PrivateEndpointConnectionsPrivateLinkHub_Get.json */ async function getAPrivateLinkHub() { - const subscriptionId = "48b08652-d7a1-4d52-b13f-5a2471dce57b"; - const resourceGroupName = "gh-res-grp"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "48b08652-d7a1-4d52-b13f-5a2471dce57b"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "gh-res-grp"; const privateLinkHubName = "pe0"; const privateEndpointConnectionName = "pe0-f3ed30f5-338c-4855-a542-24a403694ad2"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAPrivateLinkHub() { console.log(result); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubListSample.js index 9cefeaeaa251..43240eeed65f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateEndpointConnectionsPrivateLinkHubListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get all PrivateEndpointConnections in the PrivateLinkHub @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PrivateEndpointConnectionsPrivateLinkHub_List.json */ async function getAPrivateLinkHub() { - const subscriptionId = "48b08652-d7a1-4d52-b13f-5a2471dce57b"; - const resourceGroupName = "gh-res-grp"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "48b08652-d7a1-4d52-b13f-5a2471dce57b"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "gh-res-grp"; const privateLinkHubName = "pe0"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function getAPrivateLinkHub() { console.log(resArray); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesGetSample.js index 65fa2fef3efb..99736de2ac0b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get private link resource in private link hub @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkHubPrivateLinkResource.json */ async function getPrivateLinkResourcesForPrivateLinkHub() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const privateLinkHubName = "ExamplePrivateLinkHub"; const privateLinkResourceName = "sql"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getPrivateLinkResourcesForPrivateLinkHub() { console.log(result); } -getPrivateLinkResourcesForPrivateLinkHub().catch(console.error); +async function main() { + getPrivateLinkResourcesForPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesListSample.js index d3cd49a796a4..9dd90ab63000 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubPrivateLinkResourcesListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get all private link resources for a private link hub @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubPrivateLinkResources.json */ async function getPrivateLinkResourcesForPrivateLinkHub() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const privateLinkHubName = "ExamplePrivateLinkHub"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function getPrivateLinkResourcesForPrivateLinkHub() { console.log(resArray); } -getPrivateLinkResourcesForPrivateLinkHub().catch(console.error); +async function main() { + getPrivateLinkResourcesForPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsCreateOrUpdateSample.js index 03eb35e818e6..1c7dae9d5408 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a privateLinkHub @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdatePrivateLinkHub.json */ async function createOrUpdateAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const privateLinkHubInfo = { location: "East US", @@ -35,4 +37,8 @@ async function createOrUpdateAPrivateLinkHub() { console.log(result); } -createOrUpdateAPrivateLinkHub().catch(console.error); +async function main() { + createOrUpdateAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsDeleteSample.js index 217bc26da239..c1c044a1cb6c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a privateLinkHub @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeletePrivateLinkHub.json */ async function deleteAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function deleteAPrivateLinkHub() { console.log(result); } -deleteAPrivateLinkHub().catch(console.error); +async function main() { + deleteAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsGetSample.js index da3877000382..174af5a3bbc9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a privateLinkHub @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkHub.json */ async function getAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +29,8 @@ async function getAPrivateLinkHub() { console.log(result); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListByResourceGroupSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListByResourceGroupSample.js index 00f75276a49f..8a3b4d45d1ec 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListByResourceGroupSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListByResourceGroupSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of privateLinkHubs in a resource group @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubsInResourceGroup.json */ async function listPrivateLinkHubsInResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -29,4 +31,8 @@ async function listPrivateLinkHubsInResourceGroup() { console.log(resArray); } -listPrivateLinkHubsInResourceGroup().catch(console.error); +async function main() { + listPrivateLinkHubsInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListSample.js index 5d078cc90fa8..f1bbb6ae71ec 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of privateLinkHubs in a subscription @@ -18,7 +19,8 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubsInSubscription.json */ async function listPrivateLinkHubsInSubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function listPrivateLinkHubsInSubscription() { console.log(resArray); } -listPrivateLinkHubsInSubscription().catch(console.error); +async function main() { + listPrivateLinkHubsInSubscription(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsUpdateSample.js index 3618de9dc810..509f0cbebee1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkHubsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates a privateLinkHub @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdatePrivateLinkHub.json */ async function updateAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const privateLinkHubPatchInfo = { tags: { key: "value" }, @@ -34,4 +36,8 @@ async function updateAPrivateLinkHub() { console.log(result); } -updateAPrivateLinkHub().catch(console.error); +async function main() { + updateAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesGetSample.js index 795b3a2d1034..fc6892d83d84 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get private link resource in workspace @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkResource.json */ async function getPrivateLinkResourcesForWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateLinkResourceName = "sql"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getPrivateLinkResourcesForWorkspace() { console.log(result); } -getPrivateLinkResourcesForWorkspace().catch(console.error); +async function main() { + getPrivateLinkResourcesForWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesListSample.js index a1e1fcaaeb93..c8e0b3f8cc96 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/privateLinkResourcesListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get all private link resources for a workspaces @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkResources.json */ async function getPrivateLinkResourcesForWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function getPrivateLinkResourcesForWorkspace() { console.log(resArray); } -getPrivateLinkResourcesForWorkspace().catch(console.error); +async function main() { + getPrivateLinkResourcesForWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsGetSample.js index adc79dada5bf..6a084afd7455 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a deleted sql pool that can be restored @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RestorableDroppedSqlPoolGet.json */ async function getARestorableDroppedSqlPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "restorabledroppeddatabasetest-1257"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "restorabledroppeddatabasetest-1257"; const workspaceName = "restorabledroppeddatabasetest-2389"; const restorableDroppedSqlPoolId = "restorabledroppeddatabasetest-7654,131403269876900000"; const credential = new DefaultAzureCredential(); @@ -32,4 +35,8 @@ async function getARestorableDroppedSqlPool() { console.log(result); } -getARestorableDroppedSqlPool().catch(console.error); +async function main() { + getARestorableDroppedSqlPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsListByWorkspaceSample.js index bc3e17166676..a336d0f4d0e5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/restorableDroppedSqlPoolsListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a list of deleted Sql pools that can be restored @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RestorableDroppedSqlpoolList.json */ async function getListOfRestorableDroppedSqlPools() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "restorabledroppeddatabasetest-1349"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "restorabledroppeddatabasetest-1349"; const workspaceName = "restorabledroppeddatabasetest-1840"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +36,8 @@ async function getListOfRestorableDroppedSqlPools() { console.log(resArray); } -getListOfRestorableDroppedSqlPools().catch(console.error); +async function main() { + getListOfRestorableDroppedSqlPools(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationGetSample.js index 68263325350f..10f02b45810e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get SparkConfiguration by name in a workspace. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/SparkConfiguration_Get.json */ async function getSparkConfigurationByName() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const sparkConfigurationName = "exampleSparkConfigurationName"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getSparkConfigurationByName() { console.log(result); } -getSparkConfigurationByName().catch(console.error); +async function main() { + getSparkConfigurationByName(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationsListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationsListByWorkspaceSample.js index 92fa62ea131f..a700c21ed81c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationsListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sparkConfigurationsListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List sparkConfigurations in a workspace. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/SparkConfigurations_ListByWorkspace.json */ async function listSparkConfigurationsInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function listSparkConfigurationsInAWorkspace() { console.log(resArray); } -listSparkConfigurationsInAWorkspace().catch(console.error); +async function main() { + listSparkConfigurationsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js index f2afc4c98f51..f1524fde8a21 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a SQL pool's blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolBlobAuditingWithAllParameters.json */ async function createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters = { @@ -48,8 +50,6 @@ async function createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters() { console.log(result); } -createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Creates or updates a SQL pool's blob auditing policy. * @@ -57,8 +57,9 @@ createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters().catch(console.error * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolBlobAuditingWithMinParameters.json */ async function createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters = { @@ -78,4 +79,9 @@ async function createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters() console.log(result); } -createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters().catch(console.error); +async function main() { + createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters(); + createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesGetSample.js index 7707551881f6..46cf88ccf05e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a SQL pool's blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolBlobAuditing.json */ async function getBlobAuditingPolicyOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getBlobAuditingPolicyOfASqlAnalyticsPool() { console.log(result); } -getBlobAuditingPolicyOfASqlAnalyticsPool().catch(console.error); +async function main() { + getBlobAuditingPolicyOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.js index 847d89d6d8c7..a55cf985f6c8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists auditing settings of a Sql pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolAuditingSettingsList.json */ async function listAuditSettingsOfADatabase() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function listAuditSettingsOfADatabase() { console.log(resArray); } -listAuditSettingsOfADatabase().catch(console.error); +async function main() { + listAuditSettingsOfADatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolColumnsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolColumnsGetSample.js index 2fc294eecfda..772d78ea1ee0 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolColumnsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolColumnsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get Sql pool column @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolColumnGet.json */ async function getDatabaseColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +40,8 @@ async function getDatabaseColumn() { console.log(result); } -getDatabaseColumn().catch(console.error); +async function main() { + getDatabaseColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolConnectionPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolConnectionPoliciesGetSample.js index 0990149cdb16..75e8d0a48c88 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolConnectionPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolConnectionPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a Sql pool's connection policy, which is used with table auditing. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolConnectionPolicy.json */ async function getAConnectionPolicyOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const connectionPolicyName = "default"; @@ -34,4 +36,8 @@ async function getAConnectionPolicyOfASqlAnalyticsPool() { console.log(result); } -getAConnectionPolicyOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAConnectionPolicyOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolDataWarehouseUserActivitiesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolDataWarehouseUserActivitiesGetSample.js index d8d3fa39a170..d0bac0fa8604 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolDataWarehouseUserActivitiesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolDataWarehouseUserActivitiesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the user activities of a SQL pool which includes running and suspended queries @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolUserActivity.json */ async function getASqlAnalyticsPoolUserActivity() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdb"; const dataWarehouseUserActivityName = "current"; @@ -34,4 +36,8 @@ async function getASqlAnalyticsPoolUserActivity() { console.log(result); } -getASqlAnalyticsPoolUserActivity().catch(console.error); +async function main() { + getASqlAnalyticsPoolUserActivity(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.js index 46897ce0766d..90ecddbdb464 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates a SQL Pool geo backup policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateGeoBackupPolicies.json */ async function createGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "testrg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "testrg"; const workspaceName = "testws"; const sqlPoolName = "testdw"; const geoBackupPolicyName = "Default"; @@ -36,4 +38,8 @@ async function createGeoBackupPolicy() { console.log(result); } -createGeoBackupPolicy().catch(console.error); +async function main() { + createGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesGetSample.js index e65469a7377f..4dcfa1f4bcd7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the specified SQL pool geo backup policy @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolGeoBackupPolicy.json */ async function getSqlPoolGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-5961"; const sqlPoolName = "testdw"; const geoBackupPolicyName = "Default"; @@ -34,4 +36,8 @@ async function getSqlPoolGeoBackupPolicy() { console.log(result); } -getSqlPoolGeoBackupPolicy().catch(console.error); +async function main() { + getSqlPoolGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesListSample.js index 657bebfc9d50..7168340e5bc8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolGeoBackupPoliciesListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of SQL pool geo backup policies @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolGeoBackupPolicies_List.json */ async function getSqlPoolGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-5961"; const sqlPoolName = "testdw"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function getSqlPoolGeoBackupPolicy() { console.log(resArray); } -getSqlPoolGeoBackupPolicy().catch(console.error); +async function main() { + getSqlPoolGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowOptionsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowOptionsGetSample.js index c708b9345e4a..654ca8022810 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowOptionsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowOptionsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of SQL pool's available maintenance windows. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetMaintenanceWindowOptions.json */ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowOptionsName = "current"; @@ -34,4 +36,8 @@ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPo console.log(result); } -getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsCreateOrUpdateSample.js index c2114fc71054..0436e508c649 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a Sql pool's maintenance windows settings. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateMaintenanceWindows.json */ async function setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowName = "current"; @@ -38,4 +40,8 @@ async function setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { console.log(result); } -setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool().catch(console.error); +async function main() { + setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsGetSample.js index 54fb0f8fe259..633962e1adae 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMaintenanceWindowsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a SQL pool's Maintenance Windows. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetMaintenanceWindows.json */ async function getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowName = "current"; @@ -34,4 +36,8 @@ async function getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { console.log(result); } -getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool().catch(console.error); +async function main() { + getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsCreateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsCreateSample.js index f942726e84ff..8940ac69c263 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsCreateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsCreateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Set the metadata sync configuration for a SQL pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPoolMetadataSyncConfig.json */ async function setMetadataSyncConfigForASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const metadataSyncConfiguration = { enabled: true }; @@ -34,4 +36,8 @@ async function setMetadataSyncConfigForASqlAnalyticsPool() { console.log(result); } -setMetadataSyncConfigForASqlAnalyticsPool().catch(console.error); +async function main() { + setMetadataSyncConfigForASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsGetSample.js index e44539ce6493..2f8e837d76bb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolMetadataSyncConfigsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the metadata sync configuration for a SQL pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolMetadataSyncConfig.json */ async function getMetadataSyncConfigForASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getMetadataSyncConfigForASqlAnalyticsPool() { console.log(result); } -getMetadataSyncConfigForASqlAnalyticsPool().catch(console.error); +async function main() { + getMetadataSyncConfigForASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationResultsGetLocationHeaderResultSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationResultsGetLocationHeaderResultSample.js index df457019b035..45a2d814b487 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationResultsGetLocationHeaderResultSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationResultsGetLocationHeaderResultSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the status of a SQL pool operation @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetLocationHeaderResultWithSqlPool.json */ async function getTheResultOfAnOperationOnASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const operationId = "fedcba98-7654-4210-fedc-ba9876543210"; @@ -34,4 +36,8 @@ async function getTheResultOfAnOperationOnASqlAnalyticsPool() { console.log(result); } -getTheResultOfAnOperationOnASqlAnalyticsPool().catch(console.error); +async function main() { + getTheResultOfAnOperationOnASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationsListSample.js index b967826e86bb..f61ad5bf08e2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolOperationsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a list of operations performed on the SQL pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolOperations.json */ async function listTheSqlAnalyticsPoolManagementOperations() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-7398"; const workspaceName = "sqlcrudtest-4645"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function listTheSqlAnalyticsPoolManagementOperations() { console.log(resArray); } -listTheSqlAnalyticsPoolManagementOperations().catch(console.error); +async function main() { + listTheSqlAnalyticsPoolManagementOperations(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRecommendedSensitivityLabelsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRecommendedSensitivityLabelsUpdateSample.js index ee3db10e3b90..1aa18d9626ec 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRecommendedSensitivityLabelsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRecommendedSensitivityLabelsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update recommended sensitivity labels states of a given SQL Pool using an operations batch. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SensitivityLabelsRecommendedUpdate.json */ async function updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myWorkspace"; const sqlPoolName = "mySqlPool"; const parameters = { @@ -40,4 +42,8 @@ async function updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperation console.log(result); } -updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch().catch(console.error); +async function main() { + updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksGetByNameSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksGetByNameSample.js index 1c57ef4ab36e..94ea921dbe59 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksGetByNameSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksGetByNameSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get SQL pool replication link by name. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolReplicationLinks_GetByName.json */ async function listsASqlAnalyticPoolReplicationLinks() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-6440"; const sqlPoolName = "testdb"; const linkId = "5b301b68-03f6-4b26-b0f4-73ebb8634238"; @@ -34,4 +36,8 @@ async function listsASqlAnalyticPoolReplicationLinks() { console.log(result); } -listsASqlAnalyticPoolReplicationLinks().catch(console.error); +async function main() { + listsASqlAnalyticPoolReplicationLinks(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksListSample.js index 4800bb045194..114d5123a5f1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolReplicationLinksListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists a Sql pool's replication links. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolReplicationLinks.json */ async function listsASqlAnalyticPoolReplicationLinks() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-6440"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function listsASqlAnalyticPoolReplicationLinks() { console.log(resArray); } -listsASqlAnalyticPoolReplicationLinks().catch(console.error); +async function main() { + listsASqlAnalyticPoolReplicationLinks(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsCreateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsCreateSample.js index fb9f6d8bdfb1..203f70128c97 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsCreateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsCreateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a restore point for a data warehouse. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPoolRestorePoints.json */ async function createsSqlPoolRestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testserver"; const sqlPoolName = "testDatabase"; const parameters = { @@ -36,4 +38,8 @@ async function createsSqlPoolRestorePoint() { console.log(result); } -createsSqlPoolRestorePoint().catch(console.error); +async function main() { + createsSqlPoolRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsDeleteSample.js index 5340540980e7..da407cb45d1e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a restore point. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolRestorePointsDelete.json */ async function deletesARestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testws"; const sqlPoolName = "testpool"; const restorePointName = "131546477590000000"; @@ -34,4 +36,8 @@ async function deletesARestorePoint() { console.log(result); } -deletesARestorePoint().catch(console.error); +async function main() { + deletesARestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsGetSample.js index 756d8ec294fa..284ba09c01d8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a restore point. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolRestorePointsGet.json */ async function getsASqlPoolRestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testws"; const sqlPoolName = "testpool"; const restorePointName = "131546477590000000"; @@ -34,4 +36,8 @@ async function getsASqlPoolRestorePoint() { console.log(result); } -getsASqlPoolRestorePoint().catch(console.error); +async function main() { + getsASqlPoolRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsListSample.js index b1721de6a33f..8903f69b0dcf 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolRestorePointsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get SQL pool backup information @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolRestorePoints.json */ async function getAListOfRestorePointsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testserver"; const sqlPoolName = "testDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function getAListOfRestorePointsOfASqlAnalyticsPool() { console.log(resArray); } -getAListOfRestorePointsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAListOfRestorePointsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasGetSample.js index 3ce07c1207b8..3cde428f5836 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get Sql Pool schema @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolSchemaGet.json */ async function getDatabaseSchema() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -34,4 +36,8 @@ async function getDatabaseSchema() { console.log(result); } -getDatabaseSchema().catch(console.error); +async function main() { + getDatabaseSchema(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasListSample.js index 4e3191c128df..aa83a25a4611 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSchemasListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets schemas of a given SQL pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolSchema.json */ async function listTheSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function listTheSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.js index 57d486ebb45b..66a6eba329b7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or update a Sql pool's security alert policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolSecurityAlertWithAllParameters.json */ async function updateASqlPoolThreatDetectionPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-4799"; const workspaceName = "securityalert-6440"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -45,8 +47,6 @@ async function updateASqlPoolThreatDetectionPolicyWithAllParameters() { console.log(result); } -updateASqlPoolThreatDetectionPolicyWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Create or update a Sql pool's security alert policy. * @@ -54,8 +54,9 @@ updateASqlPoolThreatDetectionPolicyWithAllParameters().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolSecurityAlertWithMinParameters.json */ async function updateASqlPoolThreatDetectionPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-4799"; const workspaceName = "securityalert-6440"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -72,4 +73,9 @@ async function updateASqlPoolThreatDetectionPolicyWithMinimalParameters() { console.log(result); } -updateASqlPoolThreatDetectionPolicyWithMinimalParameters().catch(console.error); +async function main() { + updateASqlPoolThreatDetectionPolicyWithAllParameters(); + updateASqlPoolThreatDetectionPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesGetSample.js index c24ce3f6d895..0213dc4eb676 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a Sql pool's security alert policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolSecurityAlert.json */ async function getASecurityAlertOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-6852"; const workspaceName = "securityalert-2080"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -34,4 +36,8 @@ async function getASecurityAlertOfASqlAnalyticsPool() { console.log(result); } -getASecurityAlertOfASqlAnalyticsPool().catch(console.error); +async function main() { + getASecurityAlertOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesListSample.js index 66a3301995fc..94b4bfb02b89 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSecurityAlertPoliciesListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a list of Sql pool's security alert policies. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolSecurityAlertPolicies_List.json */ async function getASecurityAlertOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-6852"; const workspaceName = "securityalert-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function getASecurityAlertOfASqlAnalyticsPool() { console.log(resArray); } -getASecurityAlertOfASqlAnalyticsPool().catch(console.error); +async function main() { + getASecurityAlertOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsCreateOrUpdateSample.js index c3bb042bb083..1f75bb61de4b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates the sensitivity label of a given column in a Sql pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolColumnSensitivityLabelWithAllParameters.json */ async function updatesTheSensitivityLabelOfAGivenColumnWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -45,4 +47,8 @@ async function updatesTheSensitivityLabelOfAGivenColumnWithAllParameters() { console.log(result); } -updatesTheSensitivityLabelOfAGivenColumnWithAllParameters().catch(console.error); +async function main() { + updatesTheSensitivityLabelOfAGivenColumnWithAllParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDeleteSample.js index 5bd7f70d24df..5e79cdfad5d2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes the sensitivity label of a given column in a Sql pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolColumnSensitivityLabel.json */ async function deletesTheSensitivityLabelOfAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +40,8 @@ async function deletesTheSensitivityLabelOfAGivenColumn() { console.log(result); } -deletesTheSensitivityLabelOfAGivenColumn().catch(console.error); +async function main() { + deletesTheSensitivityLabelOfAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDisableRecommendationSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDisableRecommendationSample.js index e96ac89b00c1..487282c6037d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDisableRecommendationSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsDisableRecommendationSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Disables sensitivity recommendations on a given column @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RecommendedColumnSensitivityLabelDisable.json */ async function disablesSensitivityRecommendationsOnAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +40,8 @@ async function disablesSensitivityRecommendationsOnAGivenColumn() { console.log(result); } -disablesSensitivityRecommendationsOnAGivenColumn().catch(console.error); +async function main() { + disablesSensitivityRecommendationsOnAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsEnableRecommendationSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsEnableRecommendationSample.js index 94bb3e7e5f10..5533a31a213f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsEnableRecommendationSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsEnableRecommendationSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns) @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RecommendedColumnSensitivityLabelEnable.json */ async function enablesSensitivityRecommendationsOnAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +40,8 @@ async function enablesSensitivityRecommendationsOnAGivenColumn() { console.log(result); } -enablesSensitivityRecommendationsOnAGivenColumn().catch(console.error); +async function main() { + enablesSensitivityRecommendationsOnAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsGetSample.js index 8b5fa0f0e339..a2125a0133cb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the sensitivity label of a given column @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolColumnSensitivityLabelGet.json */ async function getsTheSensitivityLabelOfAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -40,4 +42,8 @@ async function getsTheSensitivityLabelOfAGivenColumn() { console.log(result); } -getsTheSensitivityLabelOfAGivenColumn().catch(console.error); +async function main() { + getsTheSensitivityLabelOfAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListCurrentSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListCurrentSample.js index 7a525c86b399..4ea74219264f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListCurrentSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListCurrentSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets SQL pool sensitivity labels. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsSensitivityLabelsWithSourceCurrent.json */ async function getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool() { console.log(resArray); } -getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool().catch(console.error); +async function main() { + getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListRecommendedSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListRecommendedSample.js index b4ec2d62850c..4c7cd42b8c0c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListRecommendedSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsListRecommendedSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets sensitivity labels of a given SQL pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolSensitivityLabelsWithSourceRecommended.json */ async function getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool() { console.log(resArray); } -getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool().catch(console.error); +async function main() { + getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsUpdateSample.js index eec4e059c06f..19fdac355950 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolSensitivityLabelsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update sensitivity labels of a given SQL Pool using an operations batch. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SensitivityLabelsCurrentUpdate.json */ async function updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myWorkspace"; const sqlPoolName = "mySqlPool"; const parameters = { @@ -64,4 +66,8 @@ async function updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch() { console.log(result); } -updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch().catch(console.error); +async function main() { + updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTableColumnsListByTableNameSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTableColumnsListByTableNameSample.js index 12b631660f4f..c82e803c1ebe 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTableColumnsListByTableNameSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTableColumnsListByTableNameSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets columns in a given table in a SQL pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolColumns.json */ async function listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -39,4 +41,8 @@ async function listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesGetSample.js index 75fd8c702f12..1cf3290e2c98 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get Sql pool table @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolTableGet.json */ async function getDatabaseTable() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -36,4 +38,8 @@ async function getDatabaseTable() { console.log(result); } -getDatabaseTable().catch(console.error); +async function main() { + getDatabaseTable(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesListBySchemaSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesListBySchemaSample.js index 65ab22014aa3..e78eeabc04fe 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesListBySchemaSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTablesListBySchemaSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets tables of a given schema in a SQL pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolTables.json */ async function listTheTablesOfAGivenSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -37,4 +39,8 @@ async function listTheTablesOfAGivenSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheTablesOfAGivenSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheTablesOfAGivenSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.js index e4187ba11ea1..f78f7b1e3579 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a Sql pool's transparent data encryption configuration. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolTransparentDataEncryption.json */ async function createOrUpdateASqlPoolTransparentDataEncryptionConfiguration() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const transparentDataEncryptionName = "current"; @@ -36,4 +38,8 @@ async function createOrUpdateASqlPoolTransparentDataEncryptionConfiguration() { console.log(result); } -createOrUpdateASqlPoolTransparentDataEncryptionConfiguration().catch(console.error); +async function main() { + createOrUpdateASqlPoolTransparentDataEncryptionConfiguration(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsGetSample.js index 818d263934d6..87952a1cd0f4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a SQL pool's transparent data encryption configuration. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolTransparentDataEncryption.json */ async function getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const transparentDataEncryptionName = "current"; @@ -34,4 +36,8 @@ async function getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool() { console.log(result); } -getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool().catch(console.error); +async function main() { + getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsListSample.js index 2df9128ef445..2c95209eee0d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolTransparentDataEncryptionsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of SQL pool's transparent data encryption configurations. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolTransparentDataEncryptionList.json */ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPo console.log(resArray); } -getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolUsagesListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolUsagesListSample.js index 4972241b4b75..0b0868fa791d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolUsagesListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolUsagesListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets SQL pool usages. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolUsageMetricsList.json */ async function listTheUsagesOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6730"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6730"; const workspaceName = "sqlcrudtest-9007"; const sqlPoolName = "3481"; const credential = new DefaultAzureCredential(); @@ -31,4 +33,8 @@ async function listTheUsagesOfASqlAnalyticsPool() { console.log(resArray); } -listTheUsagesOfASqlAnalyticsPool().catch(console.error); +async function main() { + listTheUsagesOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.js index 1627b6141158..f6666b73098a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a Sql pool's vulnerability assessment rule baseline. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentRuleBaseline.json */ async function createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -46,4 +49,8 @@ async function createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline() { console.log(result); } -createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline().catch(console.error); +async function main() { + createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.js index 165958278bdf..6a4a515772ed 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Removes the database's vulnerability assessment rule baseline. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolVulnerabilityAssessmentRuleBaseline.json */ async function removesADatabaseVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -38,4 +41,8 @@ async function removesADatabaseVulnerabilityAssessmentRuleBaseline() { console.log(result); } -removesADatabaseVulnerabilityAssessmentRuleBaseline().catch(console.error); +async function main() { + removesADatabaseVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.js index 93402af94abb..48b2f6103447 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a SqlPool's vulnerability assessment rule baseline. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolVulnerabilityAssessmentRuleBaselineGet.json */ async function getsASqlPoolVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4711"; const workspaceName = "vulnerabilityaseessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -38,4 +41,8 @@ async function getsASqlPoolVulnerabilityAssessmentRuleBaseline() { console.log(result); } -getsASqlPoolVulnerabilityAssessmentRuleBaseline().catch(console.error); +async function main() { + getsASqlPoolVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansExportSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansExportSample.js index ec6355dedeae..51455dc1be5e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansExportSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansExportSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Convert an existing scan result to a human readable format. If already exists nothing happens @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExportSqlPoolVulnerabilityAssessmentScan.json */ async function exportADatabaseVulnerabilityAssessmentScanResults() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4799"; const workspaceName = "vulnerabilityassessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +39,8 @@ async function exportADatabaseVulnerabilityAssessmentScanResults() { console.log(result); } -exportADatabaseVulnerabilityAssessmentScanResults().catch(console.error); +async function main() { + exportADatabaseVulnerabilityAssessmentScanResults(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansGetSample.js index 5956c89febe8..b9b37066af02 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a vulnerability assessment scan record of a Sql pool. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolVulnerabilityAssessmentScanRecordsGet.json */ async function getsADatabaseVulnerabilityAssessmentScanRecordByScanId() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +39,8 @@ async function getsADatabaseVulnerabilityAssessmentScanRecordByScanId() { console.log(result); } -getsADatabaseVulnerabilityAssessmentScanRecordByScanId().catch(console.error); +async function main() { + getsADatabaseVulnerabilityAssessmentScanRecordByScanId(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.js index 1e2ee2b83d30..021b1fd14d2a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Executes a Vulnerability Assessment database scan. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExecuteSqlPoolVulnerabilityAssessmentScans.json */ async function executesASqlPoolVulnerabilityAssessmentScan() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +39,8 @@ async function executesASqlPoolVulnerabilityAssessmentScan() { console.log(result); } -executesASqlPoolVulnerabilityAssessmentScan().catch(console.error); +async function main() { + executesASqlPoolVulnerabilityAssessmentScan(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansListSample.js index 275f2299805e..d2088ae733d3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentScansListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the vulnerability assessment scans of a SQL pool. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolVulnerabilityAssessmentScanRecords.json */ async function getAVulnerabilityScanRecordOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -37,4 +40,8 @@ async function getAVulnerabilityScanRecordOfASqlAnalyticsPool() { console.log(resArray); } -getAVulnerabilityScanRecordOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAVulnerabilityScanRecordOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.js index 4a752805426f..a4d6845616e9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithAllParameters.json */ async function createADatabaseVulnerabilityAssessmentWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -45,8 +48,6 @@ async function createADatabaseVulnerabilityAssessmentWithAllParameters() { console.log(result); } -createADatabaseVulnerabilityAssessmentWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. * @@ -54,8 +55,10 @@ createADatabaseVulnerabilityAssessmentWithAllParameters().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateVulnerabilityAssessmentWithStorageAccessKeyAndMinParameters.json */ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -75,10 +78,6 @@ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenSt console.log(result); } -createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. * @@ -86,8 +85,10 @@ createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAcc * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithContainerSasKeyAndMinParameters.json */ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -107,6 +108,10 @@ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenSt console.log(result); } -createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified().catch( - console.error -); +async function main() { + createADatabaseVulnerabilityAssessmentWithAllParameters(); + createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified(); + createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsDeleteSample.js index 4e8f189d2a38..ccf5e02b0660 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Removes the database's vulnerability assessment. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolVulnerabilityAssessment.json */ async function removeADatabaseVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -34,4 +37,8 @@ async function removeADatabaseVulnerabilityAssessment() { console.log(result); } -removeADatabaseVulnerabilityAssessment().catch(console.error); +async function main() { + removeADatabaseVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsGetSample.js index 9cf857087561..2c9b7476e3fe 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the Sql pool's vulnerability assessment. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolVulnerabilityAssessment.json */ async function getASqlPoolVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -34,4 +37,8 @@ async function getASqlPoolVulnerabilityAssessment() { console.log(result); } -getASqlPoolVulnerabilityAssessment().catch(console.error); +async function main() { + getASqlPoolVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsListSample.js index cc68415bd502..86cb895bea4c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolVulnerabilityAssessmentsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the vulnerability assessment policies associated with a SQL pool. @@ -18,8 +19,10 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolVulnerabilityAssessments.json */ async function getAVulnerabilityAssessmentOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +38,8 @@ async function getAVulnerabilityAssessmentOfASqlAnalyticsPool() { console.log(resArray); } -getAVulnerabilityAssessmentOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAVulnerabilityAssessmentOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierCreateOrUpdateSample.js index 227acebe1139..6dd6be8dda4f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create Or Update workload classifier for a Sql pool's workload group. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadClassifierMax.json */ async function createAWorkloadClassifierWithAllPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -45,8 +47,6 @@ async function createAWorkloadClassifierWithAllPropertiesSpecified() { console.log(result); } -createAWorkloadClassifierWithAllPropertiesSpecified().catch(console.error); - /** * This sample demonstrates how to Create Or Update workload classifier for a Sql pool's workload group. * @@ -54,8 +54,9 @@ createAWorkloadClassifierWithAllPropertiesSpecified().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadClassifierMin.json */ async function createAWorkloadClassifierWithTheRequiredPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -74,4 +75,9 @@ async function createAWorkloadClassifierWithTheRequiredPropertiesSpecified() { console.log(result); } -createAWorkloadClassifierWithTheRequiredPropertiesSpecified().catch(console.error); +async function main() { + createAWorkloadClassifierWithAllPropertiesSpecified(); + createAWorkloadClassifierWithTheRequiredPropertiesSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierDeleteSample.js index 8792585bb873..30484673f3c2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Remove workload classifier of a Sql pool's workload group. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolWorkloadGroupWorkloadClassifer.json */ async function deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -36,4 +38,8 @@ async function deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup() { console.log(result); } -deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup().catch(console.error); +async function main() { + deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierGetSample.js index 1ce2ccd17733..3bef82168087 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a workload classifier of Sql pool's workload group. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupWorkloadClassifier.json */ async function getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -36,4 +38,8 @@ async function getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup() { console.log(result); } -getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup().catch(console.error); +async function main() { + getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierListSample.js index 6dcc269d5850..11062ae7bdc5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadClassifierListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of Sql pool's workload classifier for workload groups. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupWorkloadClassifierList.json */ async function getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -37,4 +39,8 @@ async function getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup() console.log(resArray); } -getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup().catch(console.error); +async function main() { + getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupCreateOrUpdateSample.js index 6ee2bfeb6038..71170168b30d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create Or Update a Sql pool's workload group. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadGroupMax.json */ async function createAWorkloadGroupWithAllPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -43,8 +45,6 @@ async function createAWorkloadGroupWithAllPropertiesSpecified() { console.log(result); } -createAWorkloadGroupWithAllPropertiesSpecified().catch(console.error); - /** * This sample demonstrates how to Create Or Update a Sql pool's workload group. * @@ -52,8 +52,9 @@ createAWorkloadGroupWithAllPropertiesSpecified().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadGroupMin.json */ async function createAWorkloadGroupWithTheRequiredPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -74,4 +75,9 @@ async function createAWorkloadGroupWithTheRequiredPropertiesSpecified() { console.log(result); } -createAWorkloadGroupWithTheRequiredPropertiesSpecified().catch(console.error); +async function main() { + createAWorkloadGroupWithAllPropertiesSpecified(); + createAWorkloadGroupWithTheRequiredPropertiesSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupDeleteSample.js index 10fe68a2cdce..1050ccb6c94b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Remove Sql pool's workload group. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolWorkloadGroup.json */ async function deleteAWorkloadGroupOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -34,4 +36,8 @@ async function deleteAWorkloadGroupOfASqlAnalyticsPool() { console.log(result); } -deleteAWorkloadGroupOfASqlAnalyticsPool().catch(console.error); +async function main() { + deleteAWorkloadGroupOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupGetSample.js index 5f40a10bacd6..d3f034894390 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a Sql pool's workload group. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroup.json */ async function getAWorkloadGroupOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -34,4 +36,8 @@ async function getAWorkloadGroupOfASqlAnalyticsPool() { console.log(result); } -getAWorkloadGroupOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAWorkloadGroupOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupListSample.js index 07ab68a7f03c..80f274aca6fc 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolWorkloadGroupListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of Sql pool's workload groups. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupList.json */ async function getTheListOfWorkloadGroupsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -35,4 +37,8 @@ async function getTheListOfWorkloadGroupsOfASqlAnalyticsPool() { console.log(resArray); } -getTheListOfWorkloadGroupsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getTheListOfWorkloadGroupsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsCreateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsCreateSample.js index 26954042eb92..1985e37ea0b3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsCreateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsCreateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create a SQL pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPool.json */ async function createASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const sqlPoolInfo = { @@ -44,4 +46,8 @@ async function createASqlAnalyticsPool() { console.log(result); } -createASqlAnalyticsPool().catch(console.error); +async function main() { + createASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsDeleteSample.js index 70ff2b35fe3b..7cb80bcba606 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Delete a SQL pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPool.json */ async function deleteASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteASqlAnalyticsPool() { console.log(result); } -deleteASqlAnalyticsPool().catch(console.error); +async function main() { + deleteASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsGetSample.js index f6d6241bf74d..be550b0c46c2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get SQL pool properties @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPool.json */ async function getASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getASqlAnalyticsPool() { console.log(result); } -getASqlAnalyticsPool().catch(console.error); +async function main() { + getASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsListByWorkspaceSample.js index 18b154e6391f..02f56357cb40 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List all SQL pools @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspace.json */ async function listSqlAnalyticsPoolsInAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6845"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6845"; const workspaceName = "sqlcrudtest-7177"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,8 +32,6 @@ async function listSqlAnalyticsPoolsInAWorkspace() { console.log(resArray); } -listSqlAnalyticsPoolsInAWorkspace().catch(console.error); - /** * This sample demonstrates how to List all SQL pools * @@ -39,8 +39,9 @@ listSqlAnalyticsPoolsInAWorkspace().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspaceWithFilter.json */ async function listSqlAnalyticsPoolsInAWorkspaceWithFilter() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6845"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6845"; const workspaceName = "sqlcrudtest-7177"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -51,4 +52,9 @@ async function listSqlAnalyticsPoolsInAWorkspaceWithFilter() { console.log(resArray); } -listSqlAnalyticsPoolsInAWorkspaceWithFilter().catch(console.error); +async function main() { + listSqlAnalyticsPoolsInAWorkspace(); + listSqlAnalyticsPoolsInAWorkspaceWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsPauseSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsPauseSample.js index 645eb77e9d62..23a325c7dba1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsPauseSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsPauseSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Pause a SQL pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PauseSqlPool.json */ async function pauseASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdwdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function pauseASqlAnalyticsPool() { console.log(result); } -pauseASqlAnalyticsPool().catch(console.error); +async function main() { + pauseASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsRenameSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsRenameSample.js index cbc88c8b764e..09cd258e4d91 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsRenameSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsRenameSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Rename a SQL pool. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RenameSqlPool.json */ async function renameASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdb"; const parameters = { @@ -36,4 +38,8 @@ async function renameASqlAnalyticsPool() { console.log(result); } -renameASqlAnalyticsPool().catch(console.error); +async function main() { + renameASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsResumeSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsResumeSample.js index 753ba2c8c491..9762cb95b964 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsResumeSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsResumeSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Resume a SQL pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ResumeSqlPool.json */ async function resumeASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function resumeASqlAnalyticsPool() { console.log(result); } -resumeASqlAnalyticsPool().catch(console.error); +async function main() { + resumeASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsUpdateSample.js index c06d0ad612c7..cb0d30486aaa 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/sqlPoolsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Apply a partial update to a SQL pool @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateSqlPool.json */ async function updateASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const sqlPoolInfo = { @@ -41,4 +43,8 @@ async function updateASqlAnalyticsPool() { console.log(result); } -updateASqlAnalyticsPool().catch(console.error); +async function main() { + updateASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsCreateOrUpdateSample.js index 6d777e62de42..f538368ab5b4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a workspace active directory admin @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspaceAadAdmin.json */ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const aadAdminInfo = { administratorType: "ActiveDirectory", @@ -37,4 +39,8 @@ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { console.log(result); } -createOrUpdateWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + createOrUpdateWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsDeleteSample.js index fb4b484010a6..af4b484977e0 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a workspace active directory admin @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceAadAdmin.json */ async function deleteWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function deleteWorkspaceActiveDirectoryAdmin() { console.log(result); } -deleteWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + deleteWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsGetSample.js index 50f290615000..4717c5341060 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceAadAdminsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a workspace active directory admin @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceAadAdmin.json */ async function getWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +29,8 @@ async function getWorkspaceActiveDirectoryAdmin() { console.log(result); } -getWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + getWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.js index 3940d9977db3..ba0505165684 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or update Managed Identity Sql Control Settings @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateManagedIdentitySqlControlSettings.json */ async function createOrUpdateManagedIdentitySqlControlSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const managedIdentitySqlControlSettings = { grantSqlControlToManagedIdentity: { desiredState: "Enabled" }, @@ -34,4 +36,8 @@ async function createOrUpdateManagedIdentitySqlControlSettings() { console.log(result); } -createOrUpdateManagedIdentitySqlControlSettings().catch(console.error); +async function main() { + createOrUpdateManagedIdentitySqlControlSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsGetSample.js index f66da061f626..f18cdfd5ef76 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedIdentitySqlControlSettingsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get Managed Identity Sql Control Settings @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetManagedIdentitySqlControlSettings.json */ async function getManagedIdentitySqlControlSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function getManagedIdentitySqlControlSettings() { console.log(result); } -getManagedIdentitySqlControlSettings().catch(console.error); +async function main() { + getManagedIdentitySqlControlSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.js index 15b4aabde6fa..0a185e085276 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerBlobAuditingSettingsWithAllParameters.json */ async function createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters = { @@ -50,8 +52,6 @@ async function createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParame console.log(result); } -createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's blob auditing policy. * @@ -59,8 +59,9 @@ createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters().catch(co * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerBlobAuditingSettingsWithMinParameters.json */ async function createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters = { @@ -81,6 +82,9 @@ async function createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMi console.log(result); } -createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters(); + createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.js index 2089a52320d5..d666e962f427 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a workspace managed sql server's blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerBlobAuditingSettings.json */ async function getBlobAuditingSettingOfWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getBlobAuditingSettingOfWorkspaceManagedSqlServer() { console.log(result); } -getBlobAuditingSettingOfWorkspaceManagedSqlServer().catch(console.error); +async function main() { + getBlobAuditingSettingOfWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.js index f8c5ee5e426e..14179c0d6b20 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List workspace managed sql server's blob auditing policies. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerBlobAuditingSettings.json */ async function getBlobAuditingPolicyOfWorkspaceMangedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function getBlobAuditingPolicyOfWorkspaceMangedSqlServer() { console.log(resArray); } -getBlobAuditingPolicyOfWorkspaceMangedSqlServer().catch(console.error); +async function main() { + getBlobAuditingPolicyOfWorkspaceMangedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.js index 2c8611f77c97..7d3f9fefc860 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get workspace managed sql server's minimal tls settings. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const dedicatedSQLminimalTlsSettingsName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings() { console.log(result); } -getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.js index b483974e6cbc..4665e02e0244 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List workspace managed sql server's minimal tls settings. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer( console.log(resArray); } -listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer().catch(console.error); +async function main() { + listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.js index 7d7ddec98138..899631d615e5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update workspace managed sql server's minimal tls settings. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function updateTlsVersionOfTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const dedicatedSQLminimalTlsSettingsName = "default"; const parameters = { @@ -37,4 +39,8 @@ async function updateTlsVersionOfTheWorkspaceManagedSqlServer() { console.log(result); } -updateTlsVersionOfTheWorkspaceManagedSqlServer().catch(console.error); +async function main() { + updateTlsVersionOfTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.js index 9fa20756f3c7..ea611183479a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates workspace managed sql server's encryption protector. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateKeyVault.json */ async function updateTheEncryptionProtectorToKeyVault() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const parameters = { @@ -38,8 +40,6 @@ async function updateTheEncryptionProtectorToKeyVault() { console.log(result); } -updateTheEncryptionProtectorToKeyVault().catch(console.error); - /** * This sample demonstrates how to Updates workspace managed sql server's encryption protector. * @@ -47,8 +47,9 @@ updateTheEncryptionProtectorToKeyVault().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateServiceManaged.json */ async function updateTheEncryptionProtectorToServiceManaged() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const parameters = { @@ -67,4 +68,9 @@ async function updateTheEncryptionProtectorToServiceManaged() { console.log(result); } -updateTheEncryptionProtectorToServiceManaged().catch(console.error); +async function main() { + updateTheEncryptionProtectorToKeyVault(); + updateTheEncryptionProtectorToServiceManaged(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorGetSample.js index f64fdb88f1aa..f2c0ead0976b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get workspace managed sql server's encryption protector. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerEncryptionProtector.json */ async function getWorkspaceManagedSqlServerEncryptionProtector() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getWorkspaceManagedSqlServerEncryptionProtector() { console.log(result); } -getWorkspaceManagedSqlServerEncryptionProtector().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerEncryptionProtector(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorListSample.js index ec358d674e2a..b4404ae384c1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of encryption protectors for workspace managed sql server. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerEncryptionProtectorList.json */ async function getWorkspaceManagedSqlServerEncryptionProtectors() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function getWorkspaceManagedSqlServerEncryptionProtectors() { console.log(resArray); } -getWorkspaceManagedSqlServerEncryptionProtectors().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerEncryptionProtectors(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.js index b873f009cfb0..4e48ee8dcd1f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Revalidates workspace managed sql server's existing encryption protector. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorRevalidate.json */ async function revalidatesTheEncryptionProtector() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function revalidatesTheEncryptionProtector() { console.log(result); } -revalidatesTheEncryptionProtector().catch(console.error); +async function main() { + revalidatesTheEncryptionProtector(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.js index 3b8a9fdeba47..125330274de9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's extended blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerExtendedBlobAuditingSettingsWithAllParameters.json */ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters = { @@ -50,10 +52,6 @@ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicy console.log(result); } -createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's extended blob auditing policy. * @@ -61,8 +59,9 @@ createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParame * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerExetendedBlobAuditingSettingsWithMinParameters.json */ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters = { @@ -83,6 +82,9 @@ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicy console.log(result); } -createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters(); + createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.js index 2414ea868990..308d1634a514 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a workspace SQL server's extended blob auditing policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlExtendedServerBlobAuditingSettings.json */ async function getWorkspaceManagedSqlServersExtendedBlobAuditingSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getWorkspaceManagedSqlServersExtendedBlobAuditingSettings() { console.log(result); } -getWorkspaceManagedSqlServersExtendedBlobAuditingSettings().catch(console.error); +async function main() { + getWorkspaceManagedSqlServersExtendedBlobAuditingSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.js index 68eacfecae2e..094c1813998f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List workspace managed sql server's extended blob auditing policies. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerExtendedBlobAuditingSettings.json */ async function getWorkspaceManagedSqlServerExtendedBlobAuditingSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function getWorkspaceManagedSqlServerExtendedBlobAuditingSettings() { console.log(resArray); } -getWorkspaceManagedSqlServerExtendedBlobAuditingSettings().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerExtendedBlobAuditingSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.js index 47e68ecf176c..6d5cca68c453 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get recoverable sql pools for workspace managed sql server. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerRecoverableSqlPool.json */ async function getRecoverableSqlPoolsForTheServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const sqlPoolName = "recoverableSqlpools-1235"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getRecoverableSqlPoolsForTheServer() { console.log(result); } -getRecoverableSqlPoolsForTheServer().catch(console.error); +async function main() { + getRecoverableSqlPoolsForTheServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsListSample.js index 2ed639b4dbd8..7d9e685b21d2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerRecoverableSqlPoolsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of recoverable sql pools for workspace managed sql server. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerRecoverableSqlPool.json */ async function listRecoverableSqlPoolsForTheServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function listRecoverableSqlPoolsForTheServer() { console.log(resArray); } -listRecoverableSqlPoolsForTheServer().catch(console.error); +async function main() { + listRecoverableSqlPoolsForTheServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.js index 8ca33a2cdbcb..df8236f7f037 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's threat detection policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerSecurityAlertWithAllParameters.json */ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const parameters = { @@ -44,8 +46,6 @@ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParam console.log(result); } -updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's threat detection policy. * @@ -53,8 +53,9 @@ updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters().catch(c * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerSecurityAlertCreateWithMinParameters.json */ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const parameters = { @@ -76,4 +77,9 @@ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalP console.log(result); } -updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters().catch(console.error); +async function main() { + updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters(); + updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyGetSample.js index 5a20f34ba59c..ea6362954c9d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a workspace managed sql server's security alert policy. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerSecurityAlertPolicy.json */ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { console.log(result); } -getWorkspaceManagedSqlServerSecurityAlertPolicy().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerSecurityAlertPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyListSample.js index 81579c84e8f8..16bc670099c7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerSecurityAlertPolicyListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get workspace managed sql server's threat detection policies. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerSecurityAlertPolicies.json */ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { console.log(resArray); } -getWorkspaceManagedSqlServerSecurityAlertPolicy().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerSecurityAlertPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerUsagesListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerUsagesListSample.js index 9b7550cf782b..0ba259a1ebe2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerUsagesListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerUsagesListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get list of server usages metric for workspace managed sql server. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerUsages.json */ async function listUsagesMetricForTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function listUsagesMetricForTheWorkspaceManagedSqlServer() { console.log(resArray); } -listUsagesMetricForTheWorkspaceManagedSqlServer().catch(console.error); +async function main() { + listUsagesMetricForTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.js index 23f6b6db8f5d..e2b74c46d3c7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters = { @@ -43,10 +45,6 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. * @@ -54,8 +52,9 @@ createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceMangedSqlServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters = { @@ -73,10 +72,6 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified().catch( - console.error -); - /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. * @@ -84,8 +79,9 @@ createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParame * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceMangedSqlServerVulnerabilityAssessmentCreateContainerSasKeyMin.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters = { @@ -103,6 +99,10 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified().catch( - console.error -); +async function main() { + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters(); + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified(); + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.js index fe3247b13eb1..b523654990d7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Remove workspace managed sql server's vulnerability assessment. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceManagedSqlServerVulnerabilityAssessment.json */ async function removeWorkspaceManagedSqlServerVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function removeWorkspaceManagedSqlServerVulnerabilityAssessment() { console.log(result); } -removeWorkspaceManagedSqlServerVulnerabilityAssessment().catch(console.error); +async function main() { + removeWorkspaceManagedSqlServerVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.js index 8b6db52d11ba..43f04d0ee86b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get workspace managed sql server's vulnerability assessment. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerVulnerabilityAssessment.json */ async function getWorkspaceManagedSqlServerVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getWorkspaceManagedSqlServerVulnerabilityAssessment() { console.log(result); } -getWorkspaceManagedSqlServerVulnerabilityAssessment().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.js index 1000de4f10d8..aaee7c825075 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the vulnerability assessment policies associated with a workspace managed sql server. @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies.json */ async function getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +35,8 @@ async function getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies() { console.log(resArray); } -getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsCreateOrUpdateSample.js index 80dc7edbf1d3..db912f706633 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a workspace SQL active directory admin @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspaceAadAdmin.json */ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const aadAdminInfo = { administratorType: "ActiveDirectory", @@ -37,4 +39,8 @@ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { console.log(result); } -createOrUpdateWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + createOrUpdateWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsDeleteSample.js index ebce3e8e9667..e1e3029ec134 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a workspace SQL active directory admin @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceAadAdmin.json */ async function deleteWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +32,8 @@ async function deleteWorkspaceActiveDirectoryAdmin() { console.log(result); } -deleteWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + deleteWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsGetSample.js index e1d65bfdec7f..89ee103620d0 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspaceSqlAadAdminsGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a workspace SQL active directory admin @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceAadAdmin.json */ async function getWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +29,8 @@ async function getWorkspaceActiveDirectoryAdmin() { console.log(result); } -getWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + getWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesCreateOrUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesCreateOrUpdateSample.js index a3bc5ae5204f..05fa567f5b80 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesCreateOrUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesCreateOrUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a workspace @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspace.json */ async function createOrUpdateAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const workspaceInfo = { cspWorkspaceAdminProperties: { @@ -85,4 +87,8 @@ async function createOrUpdateAWorkspace() { console.log(result); } -createOrUpdateAWorkspace().catch(console.error); +async function main() { + createOrUpdateAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesDeleteSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesDeleteSample.js index 32298bae31dd..f2b93ee0c407 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesDeleteSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesDeleteSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a workspace @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspace.json */ async function deleteAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +29,8 @@ async function deleteAWorkspace() { console.log(result); } -deleteAWorkspace().catch(console.error); +async function main() { + deleteAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesGetSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesGetSample.js index 51ba20b6056f..34b5d4e9d742 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesGetSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesGetSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a workspace @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspace.json */ async function getAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +29,8 @@ async function getAWorkspace() { console.log(result); } -getAWorkspace().catch(console.error); +async function main() { + getAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListByResourceGroupSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListByResourceGroupSample.js index fdbafe9f1ece..a7cfdfae4c27 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListByResourceGroupSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListByResourceGroupSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of workspaces in a resource group @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspacesInResourceGroup.json */ async function listWorkspacesInResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -29,4 +31,8 @@ async function listWorkspacesInResourceGroup() { console.log(resArray); } -listWorkspacesInResourceGroup().catch(console.error); +async function main() { + listWorkspacesInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListSample.js index 5c8230635754..fe127c0685ce 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesListSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Returns a list of workspaces in a subscription @@ -18,7 +19,8 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspacesInSubscription.json */ async function listWorkspacesInSubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function listWorkspacesInSubscription() { console.log(resArray); } -listWorkspacesInSubscription().catch(console.error); +async function main() { + listWorkspacesInSubscription(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesUpdateSample.js b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesUpdateSample.js index e8815e245ca5..e32818df9b74 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesUpdateSample.js +++ b/sdk/synapse/arm-synapse/samples/v8-beta/javascript/workspacesUpdateSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { SynapseManagementClient } = require("@azure/arm-synapse"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates a workspace @@ -18,8 +19,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateWorkspace.json */ async function updateAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const workspacePatchInfo = { encryption: { @@ -63,4 +65,8 @@ async function updateAWorkspace() { console.log(result); } -updateAWorkspace().catch(console.error); +async function main() { + updateAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/README.md b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/README.md index 28203862e45b..2bc739f8b47d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/README.md +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/README.md @@ -272,7 +272,7 @@ node dist/azureAdOnlyAuthenticationsCreateSample.js Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env node dist/azureAdOnlyAuthenticationsCreateSample.js +npx cross-env SYNAPSE_SUBSCRIPTION_ID="" SYNAPSE_RESOURCE_GROUP="" node dist/azureAdOnlyAuthenticationsCreateSample.js ``` ## Next Steps diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/package.json b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/package.json index d5db5c2b236f..66711e634e02 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/package.json +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/node": "^14.0.0", - "typescript": "~4.4.0", + "typescript": "~4.8.0", "rimraf": "latest" } } diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsCreateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsCreateSample.ts index 5422b97df9cd..30773abbb5f4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a Azure Active Directory only authentication property for the workspaces @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateAzureADOnlyAuthentication.json */ async function createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const azureADOnlyAuthenticationName = "default"; const azureADOnlyAuthenticationInfo: AzureADOnlyAuthentication = { @@ -39,6 +45,8 @@ async function createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(result); } -createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty().catch( - console.error -); +async function main() { + createOrUpdateAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsGetSample.ts index 0abe06051167..a030d8967c4b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Azure Active Directory only authentication property @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAzureADOnlyAuthentication.json */ async function getAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const azureADOnlyAuthenticationName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(result); } -getAzureActiveDirectoryOnlyAuthenticationProperty().catch(console.error); +async function main() { + getAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsListSample.ts index a228eb32e7e4..4723c3254206 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/azureAdOnlyAuthenticationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of Azure Active Directory only authentication property for a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListAzureADOnlyAuthentication.json */ async function getAListOfAzureActiveDirectoryOnlyAuthenticationProperty() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getAListOfAzureActiveDirectoryOnlyAuthenticationProperty() { console.log(resArray); } -getAListOfAzureActiveDirectoryOnlyAuthenticationProperty().catch(console.error); +async function main() { + getAListOfAzureActiveDirectoryOnlyAuthenticationProperty(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsCreateOrUpdateSample.ts index d9c1d755e938..c3869a8e9d80 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a new Big Data pool. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/CreateOrUpdateBigDataPool.json */ async function createOrUpdateABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const bigDataPoolInfo: BigDataPoolResourceInfo = { @@ -49,4 +55,8 @@ async function createOrUpdateABigDataPool() { console.log(result); } -createOrUpdateABigDataPool().catch(console.error); +async function main() { + createOrUpdateABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsDeleteSample.ts index bcb29559acb8..b82d393da42f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete a Big Data pool from the workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/DeleteBigDataPool.json */ async function deleteABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteABigDataPool() { console.log(result); } -deleteABigDataPool().catch(console.error); +async function main() { + deleteABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsGetSample.ts index 832ae971975d..e994d0d3a7fe 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Big Data pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/GetBigDataPool.json */ async function getABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getABigDataPool() { console.log(result); } -getABigDataPool().catch(console.error); +async function main() { + getABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsListByWorkspaceSample.ts index 141b6a9e3432..4ba14c89a749 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Big Data pools in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/ListBigDataPoolsInWorkspace.json */ async function listBigDataPoolsInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listBigDataPoolsInAWorkspace() { console.log(resArray); } -listBigDataPoolsInAWorkspace().catch(console.error); +async function main() { + listBigDataPoolsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsUpdateSample.ts index 37fb11be07b3..973594d2a3bb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/bigDataPoolsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Patch a Big Data pool. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/UpdateBigDataPool.json */ async function updateABigDataPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const bigDataPoolName = "ExamplePool"; const bigDataPoolPatchInfo: BigDataPoolPatchInfo = { tags: { key: "value" } }; @@ -37,4 +43,8 @@ async function updateABigDataPool() { console.log(result); } -updateABigDataPool().catch(console.error); +async function main() { + updateABigDataPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesCreateOrUpdateSample.ts index d94492f1b8af..841b395c75b1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { DataMaskingPolicy, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool data masking policy @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyCreateOrUpdateMax.json */ async function createOrUpdateDataMaskingPolicyMax() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const parameters: DataMaskingPolicy = { @@ -37,8 +43,6 @@ async function createOrUpdateDataMaskingPolicyMax() { console.log(result); } -createOrUpdateDataMaskingPolicyMax().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking policy * @@ -46,8 +50,11 @@ createOrUpdateDataMaskingPolicyMax().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyCreateOrUpdateMin.json */ async function createOrUpdateDataMaskingPolicyMin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const parameters: DataMaskingPolicy = { dataMaskingState: "Enabled" }; @@ -62,4 +69,9 @@ async function createOrUpdateDataMaskingPolicyMin() { console.log(result); } -createOrUpdateDataMaskingPolicyMin().catch(console.error); +async function main() { + createOrUpdateDataMaskingPolicyMax(); + createOrUpdateDataMaskingPolicyMin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesGetSample.ts index 4dbea9f4b6b6..7af0dc91d96f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Sql pool data masking policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingPolicyGet.json */ async function getDataMaskingPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getDataMaskingPolicy() { console.log(result); } -getDataMaskingPolicy().catch(console.error); +async function main() { + getDataMaskingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesCreateOrUpdateSample.ts index ac21796d629b..c6f90784a015 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { DataMaskingRule, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json */ async function createOrUpdateDataMaskingRuleForDefaultMax() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -43,8 +49,6 @@ async function createOrUpdateDataMaskingRuleForDefaultMax() { console.log(result); } -createOrUpdateDataMaskingRuleForDefaultMax().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -52,8 +56,11 @@ createOrUpdateDataMaskingRuleForDefaultMax().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json */ async function createOrUpdateDataMaskingRuleForDefaultMin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -75,8 +82,6 @@ async function createOrUpdateDataMaskingRuleForDefaultMin() { console.log(result); } -createOrUpdateDataMaskingRuleForDefaultMin().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -84,8 +89,11 @@ createOrUpdateDataMaskingRuleForDefaultMin().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateNumber.json */ async function createOrUpdateDataMaskingRuleForNumbers() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -109,8 +117,6 @@ async function createOrUpdateDataMaskingRuleForNumbers() { console.log(result); } -createOrUpdateDataMaskingRuleForNumbers().catch(console.error); - /** * This sample demonstrates how to Creates or updates a Sql pool data masking rule. * @@ -118,8 +124,11 @@ createOrUpdateDataMaskingRuleForNumbers().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleCreateOrUpdateText.json */ async function createOrUpdateDataMaskingRuleForText() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -144,4 +153,11 @@ async function createOrUpdateDataMaskingRuleForText() { console.log(result); } -createOrUpdateDataMaskingRuleForText().catch(console.error); +async function main() { + createOrUpdateDataMaskingRuleForDefaultMax(); + createOrUpdateDataMaskingRuleForDefaultMin(); + createOrUpdateDataMaskingRuleForNumbers(); + createOrUpdateDataMaskingRuleForText(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesGetSample.ts index f96a92839c08..9bc94b666246 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the specific Sql pool data masking rule. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleGet.json */ async function getDataMaskingRule() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const dataMaskingRuleName = "rule1"; @@ -34,4 +40,8 @@ async function getDataMaskingRule() { console.log(result); } -getDataMaskingRule().catch(console.error); +async function main() { + getDataMaskingRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesListBySqlPoolSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesListBySqlPoolSample.ts index aa1bca5c4743..5e1b9aba464d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesListBySqlPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/dataMaskingRulesListBySqlPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of Sql pool data masking rules. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DataMaskingRuleList.json */ async function listDataMaskingRules() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-331"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listDataMaskingRules() { console.log(resArray); } -listDataMaskingRules().catch(console.error); +async function main() { + listDataMaskingRules(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts index cca5d12016ba..0b7dbf0bed72 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolAzureMonitorAuditingCreateMin.json */ async function createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: ExtendedSqlPoolBlobAuditingPolicy = { @@ -40,10 +46,6 @@ async function createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMini console.log(result); } -createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. * @@ -51,8 +53,11 @@ createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters() * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingCreateMax.json */ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: ExtendedSqlPoolBlobAuditingPolicy = { @@ -82,10 +87,6 @@ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameter console.log(result); } -createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates an extended Sql pool's blob auditing policy. * @@ -93,8 +94,11 @@ createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingCreateMin.json */ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: ExtendedSqlPoolBlobAuditingPolicy = { @@ -114,6 +118,10 @@ async function createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParam console.log(result); } -createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateAnExtendedSqlPoolAzureMonitorAuditingPolicyWithMinimalParameters(); + createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithAllParameters(); + createOrUpdateAnExtendedSqlPoolBlobAuditingPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesGetSample.ts index 7190ef4cb771..60eb054835d6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an extended Sql pool's blob auditing policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExtendedSqlPoolBlobAuditingGet.json */ async function getAnExtendedDatabaseBlobAuditingPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnExtendedDatabaseBlobAuditingPolicy() { console.log(result); } -getAnExtendedDatabaseBlobAuditingPolicy().catch(console.error); +async function main() { + getAnExtendedDatabaseBlobAuditingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts index c6696c2c6366..cbd6e4731893 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/extendedSqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists extended auditing settings of a Sql pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolExtendedAuditingSettingsList.json */ async function listExtendedAuditingSettingsOfADatabase() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listExtendedAuditingSettingsOfADatabase() { console.log(resArray); } -listExtendedAuditingSettingsOfADatabase().catch(console.error); +async function main() { + listExtendedAuditingSettingsOfADatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysListSample.ts index eaec8b377b9a..0d520eab24f0 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List authentication keys in an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListAuthKeys.json */ async function listAuthKeys() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listAuthKeys() { console.log(result); } -listAuthKeys().catch(console.error); +async function main() { + listAuthKeys(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysRegenerateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysRegenerateSample.ts index 393fdc34e0e3..7383337eb016 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysRegenerateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeAuthKeysRegenerateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Regenerate the authentication key for an integration runtime @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_RegenerateAuthKey.json */ async function regenerateAuthKey() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const regenerateKeyParameters: IntegrationRuntimeRegenerateKeyParameters = { @@ -39,4 +45,8 @@ async function regenerateAuthKey() { console.log(result); } -regenerateAuthKey().catch(console.error); +async function main() { + regenerateAuthKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeConnectionInfosGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeConnectionInfosGetSample.ts index 12cdafcca006..018ab4c784d7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeConnectionInfosGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeConnectionInfosGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get connection info for an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_GetConnectionInfo.json */ async function getConnectionInfo() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getConnectionInfo() { console.log(result); } -getConnectionInfo().catch(console.error); +async function main() { + getConnectionInfo(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeCredentialsSyncSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeCredentialsSyncSample.ts index c877de32c4ee..19fb91cdf1c9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeCredentialsSyncSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeCredentialsSyncSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override the credentials across all worker nodes with those available on the dispatcher node. If you already have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime node than using this API directly. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_SyncCredentials.json */ async function syncCredentials() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function syncCredentials() { console.log(result); } -syncCredentials().catch(console.error); +async function main() { + syncCredentials(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeMonitoringDataListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeMonitoringDataListSample.ts index 44af9c61358d..4651b05c29d2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeMonitoringDataListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeMonitoringDataListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get monitoring data for an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeMonitoringData_List.json */ async function getMonitoringData() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getMonitoringData() { console.log(result); } -getMonitoringData().catch(console.error); +async function main() { + getMonitoringData(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodeIPAddressGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodeIPAddressGetSample.ts index 3cf292d322c2..830fc4fc5b37 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodeIPAddressGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodeIPAddressGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the IP address of an integration runtime node @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_GetIpAddress.json */ async function getIntegrationRuntimeNodeIPAddress() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +40,8 @@ async function getIntegrationRuntimeNodeIPAddress() { console.log(result); } -getIntegrationRuntimeNodeIPAddress().catch(console.error); +async function main() { + getIntegrationRuntimeNodeIPAddress(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesDeleteSample.ts index ffa56a592caf..d36f54e973ab 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete an integration runtime node @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Delete.json */ async function deleteIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +40,8 @@ async function deleteIntegrationRuntimeNode() { console.log(result); } -deleteIntegrationRuntimeNode().catch(console.error); +async function main() { + deleteIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesGetSample.ts index 6679f6adb43a..543982cc2119 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get an integration runtime node @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Get.json */ async function getIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -34,4 +40,8 @@ async function getIntegrationRuntimeNode() { console.log(result); } -getIntegrationRuntimeNode().catch(console.error); +async function main() { + getIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesUpdateSample.ts index 46304530670b..a3a5dc67b568 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeNodesUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create an integration runtime node @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeNodes_Update.json */ async function updateIntegrationRuntimeNode() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const nodeName = "Node_1"; @@ -41,4 +47,8 @@ async function updateIntegrationRuntimeNode() { console.log(result); } -updateIntegrationRuntimeNode().catch(console.error); +async function main() { + updateIntegrationRuntimeNode(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataListSample.ts index 4e02f91c82ef..7fda2d8ec3e9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataListSample.ts @@ -14,6 +14,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get object metadata from an integration runtime @@ -22,8 +25,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeObjectMetadata_List.json */ async function getIntegrationRuntimeObjectMetadata() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "testactivityv2"; const getMetadataRequest: GetSsisObjectMetadataRequest = { @@ -43,4 +49,8 @@ async function getIntegrationRuntimeObjectMetadata() { console.log(result); } -getIntegrationRuntimeObjectMetadata().catch(console.error); +async function main() { + getIntegrationRuntimeObjectMetadata(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataRefreshSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataRefreshSample.ts index 5e73357af878..8521f7d0215c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataRefreshSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeObjectMetadataRefreshSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Refresh the object metadata in an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimeObjectMetadata_Refresh.json */ async function refreshObjectMetadata() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "testactivityv2"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function refreshObjectMetadata() { console.log(result); } -refreshObjectMetadata().catch(console.error); +async function main() { + refreshObjectMetadata(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeStatusGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeStatusGetSample.ts index 3e5cdefa648e..1446e0084a01 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeStatusGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimeStatusGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the integration runtime status @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_GetStatus.json */ async function getStatus() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getStatus() { console.log(result); } -getStatus().catch(console.error); +async function main() { + getStatus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesCreateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesCreateSample.ts index 057ce8f0bfea..2d6a57694172 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create an integration runtime @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Create.json */ async function createIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const integrationRuntime: IntegrationRuntimeResource = { @@ -42,4 +48,8 @@ async function createIntegrationRuntime() { console.log(result); } -createIntegrationRuntime().catch(console.error); +async function main() { + createIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDeleteSample.ts index 934b321e6c45..8fd232920433 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Delete.json */ async function deleteIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteIntegrationRuntime() { console.log(result); } -deleteIntegrationRuntime().catch(console.error); +async function main() { + deleteIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDisableInteractiveQuerySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDisableInteractiveQuerySample.ts index 580204dcc4e4..67d717cf5e66 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDisableInteractiveQuerySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesDisableInteractiveQuerySample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Disable interactive query in integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_DisableInteractiveQuery.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesEnableInteractiveQuerySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesEnableInteractiveQuerySample.ts index 61610ccda280..23a120183181 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesEnableInteractiveQuerySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesEnableInteractiveQuerySample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Enable interactive query in integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_EnableInteractiveQuery.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesGetSample.ts index 11e7def05081..bf682ca3bc19 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Get.json */ async function getIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getIntegrationRuntime() { console.log(result); } -getIntegrationRuntime().catch(console.error); +async function main() { + getIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListByWorkspaceSample.ts index 85e657d5a096..7dbd069e095b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all integration runtimes @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListByWorkspace.json */ async function listIntegrationRuntimes() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listIntegrationRuntimes() { console.log(resArray); } -listIntegrationRuntimes().catch(console.error); +async function main() { + listIntegrationRuntimes(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts index 4c51a9162c39..a6a40cd4c24f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesListOutboundNetworkDependenciesEndpointsSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the list of outbound network dependencies for a given Azure-SSIS integration runtime. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_ListOutboundNetworkDependenciesEndpoints.json */ async function getOutboundNetworkDependencyEndpoints() { - const subscriptionId = "ade9c2b6-c160-4305-9bb9-80342f6c1ae2"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "ade9c2b6-c160-4305-9bb9-80342f6c1ae2"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getOutboundNetworkDependencyEndpoints() { console.log(result); } -getOutboundNetworkDependencyEndpoints().catch(console.error); +async function main() { + getOutboundNetworkDependencyEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStartSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStartSample.ts index bc499dfa566e..b0728d1fefd5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStartSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStartSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Start an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Start.json */ async function startIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function startIntegrationRuntime() { console.log(result); } -startIntegrationRuntime().catch(console.error); +async function main() { + startIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStopSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStopSample.ts index b36e16f1d48b..1efae09dae20 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStopSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesStopSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stop an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Stop.json */ async function stopIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleManagedIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopIntegrationRuntime() { console.log(result); } -stopIntegrationRuntime().catch(console.error); +async function main() { + stopIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpdateSample.ts index 4f7c9201cd10..0b7771a11589 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update an integration runtime @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Update.json */ async function updateIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const updateIntegrationRuntimeRequest: UpdateIntegrationRuntimeRequest = { @@ -40,4 +46,8 @@ async function updateIntegrationRuntime() { console.log(result); } -updateIntegrationRuntime().catch(console.error); +async function main() { + updateIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpgradeSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpgradeSample.ts index 6616d067559e..5d94a4283e91 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpgradeSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/integrationRuntimesUpgradeSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Upgrade an integration runtime @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/IntegrationRuntimes_Upgrade.json */ async function upgradeIntegrationRuntime() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const integrationRuntimeName = "exampleIntegrationRuntime"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function upgradeIntegrationRuntime() { console.log(result); } -upgradeIntegrationRuntime().catch(console.error); +async function main() { + upgradeIntegrationRuntime(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesCreateOrUpdateSample.ts index 7d612a1e2046..5c00a70add13 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a firewall rule @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateIpFirewallRule.json */ async function createAnIPFirewallRule() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const ipFirewallRuleInfo: IpFirewallRuleInfo = { @@ -40,4 +46,8 @@ async function createAnIPFirewallRule() { console.log(result); } -createAnIPFirewallRule().catch(console.error); +async function main() { + createAnIPFirewallRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesDeleteSample.ts index c3556d32e7d6..2c44e49b08e9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a firewall rule @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteIpFirewallRule.json */ async function deleteAnIPFirewallRuleFromAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAnIPFirewallRuleFromAWorkspace() { console.log(result); } -deleteAnIPFirewallRuleFromAWorkspace().catch(console.error); +async function main() { + deleteAnIPFirewallRuleFromAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesGetSample.ts index 43995f6a208e..923a90d91741 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a firewall rule @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetIpFirewallRule.json */ async function createAnIPFirewallRule() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const ruleName = "ExampleIpFirewallRule"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function createAnIPFirewallRule() { console.log(result); } -createAnIPFirewallRule().catch(console.error); +async function main() { + createAnIPFirewallRule(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesListByWorkspaceSample.ts index 525955f5dbbd..3b5c0b90f9c4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of firewall rules @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListIpFirewallRules.json */ async function listIPFirewallRulesInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listIPFirewallRulesInAWorkspace() { console.log(resArray); } -listIPFirewallRulesInAWorkspace().catch(console.error); +async function main() { + listIPFirewallRulesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesReplaceAllSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesReplaceAllSample.ts index 460193e8b39d..e905900b586c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesReplaceAllSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/ipFirewallRulesReplaceAllSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Replaces firewall rules @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ReplaceAllIpFirewallRules.json */ async function replaceAllIPFirewallRulesInAWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const request: ReplaceAllIpFirewallRulesRequest = { ipFirewallRules: { @@ -46,4 +52,8 @@ async function replaceAllIPFirewallRulesInAWorkspace() { console.log(result); } -replaceAllIPFirewallRulesInAWorkspace().catch(console.error); +async function main() { + replaceAllIPFirewallRulesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysCreateOrUpdateSample.ts index 3cae86ef95a0..747339627a5a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { Key, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace key @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateKey.json */ async function createOrUpdateAWorkspaceKey() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const keyProperties: Key = { @@ -37,4 +43,8 @@ async function createOrUpdateAWorkspaceKey() { console.log(result); } -createOrUpdateAWorkspaceKey().catch(console.error); +async function main() { + createOrUpdateAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysDeleteSample.ts index 4d4e25a13752..712d4906b359 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace key @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteKey.json */ async function deleteAWorkspaceKey() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAWorkspaceKey() { console.log(result); } -deleteAWorkspaceKey().catch(console.error); +async function main() { + deleteAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysGetSample.ts index 3bbb6ab740eb..7f51d58c1761 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace key @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetKey.json */ async function getAWorkspaceKey() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const keyName = "somekey"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAWorkspaceKey() { console.log(result); } -getAWorkspaceKey().catch(console.error); +async function main() { + getAWorkspaceKey(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysListByWorkspaceSample.ts index fe8c1baf4eea..b96b2dbcd816 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/keysListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of keys in a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListKeysInWorkspace.json */ async function listKeysInWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listKeysInWorkspace() { console.log(resArray); } -listKeysInWorkspace().catch(console.error); +async function main() { + listKeysInWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoOperationsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoOperationsListSample.ts index 3766b958e95d..a5af16f3deec 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoOperationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoOperationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoOperationsList.json */ async function kustoOperationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function kustoOperationsList() { console.log(resArray); } -kustoOperationsList().catch(console.error); +async function main() { + kustoOperationsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts index 4b15bb4dc43c..60e5b757e98f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an attached database configuration. @@ -21,11 +24,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsCreateOrUpdate.json */ async function kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters: AttachedDatabaseConfiguration = { kustoPoolResourceId: "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Synapse/Workspaces/kustorptest/KustoPools/kustoclusterrptest4", @@ -53,4 +59,8 @@ async function kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts index c721d6095758..8c8240cc20fd 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the attached database configuration with the given name. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsDelete.json */ async function kustoPoolAttachedDatabaseConfigurationsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolAttachedDatabaseConfigurations.beginDeleteAndWait( @@ -34,4 +40,8 @@ async function kustoPoolAttachedDatabaseConfigurationsDelete() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsDelete().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsGetSample.ts index 0b43dc8f84a9..4baf4ee23719 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns an attached database configuration. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsGet.json */ async function kustoPoolAttachedDatabaseConfigurationsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const attachedDatabaseConfigurationName = "attachedDatabaseConfigurations1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolAttachedDatabaseConfigurations.get( @@ -34,4 +40,8 @@ async function kustoPoolAttachedDatabaseConfigurationsGet() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationsGet().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts index b44a67778ada..66c441911249 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolAttachedDatabaseConfigurationsListByKustoPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the list of attached database configurations of the given Kusto Pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationsListByKustoPool.json */ async function kustoPoolAttachedDatabaseConfigurationsListByKustoPool() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolAttachedDatabaseConfigurationsListByKustoPool() { console.log(resArray); } -kustoPoolAttachedDatabaseConfigurationsListByKustoPool().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationsListByKustoPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolChildResourceCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolChildResourceCheckNameAvailabilitySample.ts index 3eda8d7bba8f..14903f8c32fb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolChildResourceCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolChildResourceCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the Kusto Pool child resource name is valid and is not already in use. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolAttachedDatabaseConfigurationCheckNameAvailability.json */ async function kustoPoolAttachedDatabaseConfigurationCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const resourceName: DatabaseCheckNameRequest = { name: "adc1", type: @@ -41,10 +47,6 @@ async function kustoPoolAttachedDatabaseConfigurationCheckNameAvailability() { console.log(result); } -kustoPoolAttachedDatabaseConfigurationCheckNameAvailability().catch( - console.error -); - /** * This sample demonstrates how to Checks that the Kusto Pool child resource name is valid and is not already in use. * @@ -52,10 +54,13 @@ kustoPoolAttachedDatabaseConfigurationCheckNameAvailability().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesCheckNameAvailability.json */ async function kustoPoolDatabasesCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const resourceName: DatabaseCheckNameRequest = { name: "database1", type: "Microsoft.Synapse/workspaces/kustoPools/databases" @@ -71,4 +76,9 @@ async function kustoPoolDatabasesCheckNameAvailability() { console.log(result); } -kustoPoolDatabasesCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolAttachedDatabaseConfigurationCheckNameAvailability(); + kustoPoolDatabasesCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts index 30e265dedeca..cdc652351da5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the data connection name is valid and is not already in use. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsCheckNameAvailability.json */ async function kustoPoolDataConnectionsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; @@ -42,4 +48,8 @@ async function kustoPoolDataConnectionsCheckNameAvailability() { console.log(result); } -kustoPoolDataConnectionsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolDataConnectionsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCreateOrUpdateSample.ts index a9bd1e6ad115..9fd82b78b06e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a data connection. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsCreateOrUpdate.json */ async function kustoPoolDataConnectionsCreateOrUpdateJson() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -47,4 +53,8 @@ async function kustoPoolDataConnectionsCreateOrUpdateJson() { console.log(result); } -kustoPoolDataConnectionsCreateOrUpdateJson().catch(console.error); +async function main() { + kustoPoolDataConnectionsCreateOrUpdateJson(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDataConnectionValidationSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDataConnectionValidationSample.ts index 2adab41f33fa..a289d8904a6e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDataConnectionValidationSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDataConnectionValidationSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the data connection parameters are valid. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionValidation.json */ async function kustoPoolDataConnectionValidation() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -42,4 +48,8 @@ async function kustoPoolDataConnectionValidation() { console.log(result); } -kustoPoolDataConnectionValidation().catch(console.error); +async function main() { + kustoPoolDataConnectionValidation(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDeleteSample.ts index 632a6e39a6f3..abbd8c81b668 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the data connection with the given name. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsDelete.json */ async function kustoPoolDataConnectionsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -36,4 +42,8 @@ async function kustoPoolDataConnectionsDelete() { console.log(result); } -kustoPoolDataConnectionsDelete().catch(console.error); +async function main() { + kustoPoolDataConnectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsGetSample.ts index f976932854e6..65b4e184b95c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a data connection. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsGet.json */ async function kustoPoolDataConnectionsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -36,4 +42,8 @@ async function kustoPoolDataConnectionsGet() { console.log(result); } -kustoPoolDataConnectionsGet().catch(console.error); +async function main() { + kustoPoolDataConnectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsListByDatabaseSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsListByDatabaseSample.ts index 3aecd22fbb2d..5b0ce55432e6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsListByDatabaseSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsListByDatabaseSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the list of data connections of the given Kusto pool database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsListByDatabase.json */ async function kustoPoolDataConnectionsListByDatabase() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -37,4 +43,8 @@ async function kustoPoolDataConnectionsListByDatabase() { console.log(resArray); } -kustoPoolDataConnectionsListByDatabase().catch(console.error); +async function main() { + kustoPoolDataConnectionsListByDatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsUpdateSample.ts index d574d5e9180b..7dfde70ae34b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDataConnectionsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a data connection. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDataConnectionsUpdate.json */ async function kustoPoolDataConnectionsUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -47,4 +53,8 @@ async function kustoPoolDataConnectionsUpdate() { console.log(result); } -kustoPoolDataConnectionsUpdate().catch(console.error); +async function main() { + kustoPoolDataConnectionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts index d5ec02f6af8f..2aa23dc214ba 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the database principal assignment is valid and is not already in use. @@ -21,11 +24,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsCheckNameAvailability.json */ async function kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const principalAssignmentName: DatabasePrincipalAssignmentCheckNameRequest = { name: "kustoprincipal1", type: @@ -43,6 +49,8 @@ async function kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability().catch( - console.error -); +async function main() { + kustoPoolDatabasePrincipalAssignmentsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts index 4383527e6ee2..51f9bea19518 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a Kusto pool database principalAssignment. @@ -21,12 +24,15 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsCreateOrUpdate.json */ async function kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters: DatabasePrincipalAssignment = { principalId: "87654321-1234-1234-1234-123456789123", principalType: "App", @@ -46,4 +52,8 @@ async function kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts index 9167191d708b..eb8013d23b6c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Kusto pool principalAssignment. @@ -18,12 +21,15 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsDelete.json */ async function kustoPoolDatabasePrincipalAssignmentsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolDatabasePrincipalAssignments.beginDeleteAndWait( @@ -36,4 +42,8 @@ async function kustoPoolDatabasePrincipalAssignmentsDelete() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsDelete().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsGetSample.ts index 31504b943340..487c50035e0a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Kusto pool database principalAssignment. @@ -18,12 +21,15 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsGet.json */ async function kustoPoolDatabasePrincipalAssignmentsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolDatabasePrincipalAssignments.get( @@ -36,4 +42,8 @@ async function kustoPoolDatabasePrincipalAssignmentsGet() { console.log(result); } -kustoPoolDatabasePrincipalAssignmentsGet().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsListSample.ts index d74fd7620cdb..b38a74a2eb57 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasePrincipalAssignmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all Kusto pool database principalAssignments. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasePrincipalAssignmentsList.json */ async function kustoPoolDatabasePrincipalAssignmentsList() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "Kustodatabase8"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -37,4 +43,8 @@ async function kustoPoolDatabasePrincipalAssignmentsList() { console.log(resArray); } -kustoPoolDatabasePrincipalAssignmentsList().catch(console.error); +async function main() { + kustoPoolDatabasePrincipalAssignmentsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesCreateOrUpdateSample.ts index 9d6f0def9e61..3d184f095660 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { ReadWriteDatabase, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesCreateOrUpdate.json */ async function kustoPoolDatabasesCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -40,4 +46,8 @@ async function kustoPoolDatabasesCreateOrUpdate() { console.log(result); } -kustoPoolDatabasesCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolDatabasesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesDeleteSample.ts index 949053c93d6d..4a8dfab20631 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the database with the given name. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesDelete.json */ async function kustoPoolDatabasesDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -34,4 +40,8 @@ async function kustoPoolDatabasesDelete() { console.log(result); } -kustoPoolDatabasesDelete().catch(console.error); +async function main() { + kustoPoolDatabasesDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesGetSample.ts index 5a6440963697..280b3d4c4c0b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesGet.json */ async function kustoPoolDatabasesGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -34,4 +40,8 @@ async function kustoPoolDatabasesGet() { console.log(result); } -kustoPoolDatabasesGet().catch(console.error); +async function main() { + kustoPoolDatabasesGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesListByKustoPoolSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesListByKustoPoolSample.ts index 4c7fc3b6f481..33db51a68c2c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesListByKustoPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesListByKustoPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the list of databases of the given Kusto pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoDatabasesListByKustoPool.json */ async function kustoDatabasesListByKustoPool() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function kustoDatabasesListByKustoPool() { console.log(resArray); } -kustoDatabasesListByKustoPool().catch(console.error); +async function main() { + kustoDatabasesListByKustoPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesUpdateSample.ts index a3c3fc7b6917..d0ff4caf64bb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolDatabasesUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { ReadWriteDatabase, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a database. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolDatabasesUpdate.json */ async function kustoPoolDatabasesUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const databaseName = "KustoDatabase8"; @@ -39,4 +45,8 @@ async function kustoPoolDatabasesUpdate() { console.log(result); } -kustoPoolDatabasesUpdate().catch(console.error); +async function main() { + kustoPoolDatabasesUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts index cc53824d68f4..2087e271029d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the principal assignment name is valid and is not already in use. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsCheckNameAvailability.json */ async function kustoPoolPrincipalAssignmentsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const principalAssignmentName: ClusterPrincipalAssignmentCheckNameRequest = { name: "kustoprincipal1", type: "Microsoft.Synapse/workspaces/kustoPools/principalAssignments" @@ -40,4 +46,8 @@ async function kustoPoolPrincipalAssignmentsCheckNameAvailability() { console.log(result); } -kustoPoolPrincipalAssignmentsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts index 5850f8951730..d515f625e1fa 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a Kusto pool principalAssignment. @@ -21,11 +24,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsCreateOrUpdate.json */ async function kustoPoolPrincipalAssignmentsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const parameters: ClusterPrincipalAssignment = { principalId: "87654321-1234-1234-1234-123456789123", principalType: "App", @@ -44,4 +50,8 @@ async function kustoPoolPrincipalAssignmentsCreateOrUpdate() { console.log(result); } -kustoPoolPrincipalAssignmentsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsDeleteSample.ts index 548899117dae..99ba062dedfd 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Kusto pool principalAssignment. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsDelete.json */ async function kustoPoolPrincipalAssignmentsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolPrincipalAssignments.beginDeleteAndWait( @@ -34,4 +40,8 @@ async function kustoPoolPrincipalAssignmentsDelete() { console.log(result); } -kustoPoolPrincipalAssignmentsDelete().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsGetSample.ts index 19d2b1ec2d90..9fff8887f561 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Kusto pool principalAssignment. @@ -18,11 +21,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsGet.json */ async function kustoPoolPrincipalAssignmentsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; const principalAssignmentName = "kustoprincipal1"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPoolPrincipalAssignments.get( @@ -34,4 +40,8 @@ async function kustoPoolPrincipalAssignmentsGet() { console.log(result); } -kustoPoolPrincipalAssignmentsGet().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsListSample.ts index e0a9bcdbec89..ab78113c3299 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolPrincipalAssignmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all Kusto pool principalAssignments. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolPrincipalAssignmentsList.json */ async function kustoPoolPrincipalAssignmentsList() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolPrincipalAssignmentsList() { console.log(resArray); } -kustoPoolPrincipalAssignmentsList().catch(console.error); +async function main() { + kustoPoolPrincipalAssignmentsList(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsAddLanguageExtensionsSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsAddLanguageExtensionsSample.ts index b9c087848467..cac7f9ffc26f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsAddLanguageExtensionsSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsAddLanguageExtensionsSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Add a list of language extensions that can run within KQL queries. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsAdd.json */ async function kustoPoolAddLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const languageExtensionsToAdd: LanguageExtensionsList = { value: [{ languageExtensionName: "PYTHON" }, { languageExtensionName: "R" }] }; @@ -39,4 +45,8 @@ async function kustoPoolAddLanguageExtensions() { console.log(result); } -kustoPoolAddLanguageExtensions().catch(console.error); +async function main() { + kustoPoolAddLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCheckNameAvailabilitySample.ts index 75773e16bd37..7b30ec39dc1c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks that the kusto pool name is valid and is not already in use. @@ -21,7 +24,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCheckNameAvailability.json */ async function kustoPoolsCheckNameAvailability() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const location = "westus"; const kustoPoolName: KustoPoolCheckNameRequest = { name: "kustoclusterrptest4", @@ -36,4 +41,8 @@ async function kustoPoolsCheckNameAvailability() { console.log(result); } -kustoPoolsCheckNameAvailability().catch(console.error); +async function main() { + kustoPoolsCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCreateOrUpdateSample.ts index c1bcf6c142bc..acee1f516ce5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { KustoPool, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Kusto pool. @@ -18,9 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCreateOrUpdate.json */ async function kustoPoolsCreateOrUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const parameters: KustoPool = { enablePurge: true, @@ -40,4 +46,8 @@ async function kustoPoolsCreateOrUpdate() { console.log(result); } -kustoPoolsCreateOrUpdate().catch(console.error); +async function main() { + kustoPoolsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDeleteSample.ts index dbbb7e9ba7d1..81d437fc634b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Kusto pool. @@ -18,9 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsDelete.json */ async function kustoPoolsDelete() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -32,4 +38,8 @@ async function kustoPoolsDelete() { console.log(result); } -kustoPoolsDelete().catch(console.error); +async function main() { + kustoPoolsDelete(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDetachFollowerDatabasesSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDetachFollowerDatabasesSample.ts index b59359fa8ff8..dc75c6e813b4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDetachFollowerDatabasesSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsDetachFollowerDatabasesSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Detaches all followers of a database owned by this Kusto Pool. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesDetach.json */ async function kustoPoolDetachFollowerDatabases() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const followerDatabaseToRemove: FollowerDatabaseDefinition = { attachedDatabaseConfigurationName: "myAttachedDatabaseConfiguration", kustoPoolResourceId: @@ -41,4 +47,8 @@ async function kustoPoolDetachFollowerDatabases() { console.log(result); } -kustoPoolDetachFollowerDatabases().catch(console.error); +async function main() { + kustoPoolDetachFollowerDatabases(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsGetSample.ts index ba3e23aa0acd..25fbc28c0272 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Kusto pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsGet.json */ async function kustoPoolsGet() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.get( @@ -32,4 +38,8 @@ async function kustoPoolsGet() { console.log(result); } -kustoPoolsGet().catch(console.error); +async function main() { + kustoPoolsGet(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListByWorkspaceSample.ts index 1469989cec44..194366dfc618 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all Kusto pools @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListByWorkspace.json */ async function listKustoPoolsInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; - const resourceGroupName = "kustorptest"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const workspaceName = "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function listKustoPoolsInAWorkspace() { console.log(result); } -listKustoPoolsInAWorkspace().catch(console.error); +async function main() { + listKustoPoolsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListFollowerDatabasesSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListFollowerDatabasesSample.ts index fad70fc5fe08..6258dfe32183 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListFollowerDatabasesSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListFollowerDatabasesSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesList.json */ async function kustoPoolListFollowerDatabases() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolListFollowerDatabases() { console.log(resArray); } -kustoPoolListFollowerDatabases().catch(console.error); +async function main() { + kustoPoolListFollowerDatabases(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListLanguageExtensionsSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListLanguageExtensionsSample.ts index 611d8a12474c..0cfa76097f0b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListLanguageExtensionsSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListLanguageExtensionsSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of language extensions that can run within KQL queries. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsList.json */ async function kustoPoolListLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolListLanguageExtensions() { console.log(resArray); } -kustoPoolListLanguageExtensions().catch(console.error); +async function main() { + kustoPoolListLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusByResourceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusByResourceSample.ts index 2358952bfb6c..5a71fbb6cbda 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusByResourceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusByResourceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns the SKUs available for the provided resource. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListResourceSkus.json */ async function kustoPoolsListResourceSkus() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -35,4 +41,8 @@ async function kustoPoolsListResourceSkus() { console.log(resArray); } -kustoPoolsListResourceSkus().catch(console.error); +async function main() { + kustoPoolsListResourceSkus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusSample.ts index 8ee18749a750..6a1b363f0a90 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsListSkusSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists eligible SKUs for Kusto Pool resource. @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListSkus.json */ async function kustoPoolsListSkus() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function kustoPoolsListSkus() { console.log(resArray); } -kustoPoolsListSkus().catch(console.error); +async function main() { + kustoPoolsListSkus(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsRemoveLanguageExtensionsSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsRemoveLanguageExtensionsSample.ts index fa37275ff7e4..b8e27ee8fee4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsRemoveLanguageExtensionsSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsRemoveLanguageExtensionsSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove a list of language extensions that can run within KQL queries. @@ -21,10 +24,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsRemove.json */ async function kustoPoolRemoveLanguageExtensions() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const languageExtensionsToRemove: LanguageExtensionsList = { value: [{ languageExtensionName: "PYTHON" }, { languageExtensionName: "R" }] }; @@ -39,4 +45,8 @@ async function kustoPoolRemoveLanguageExtensions() { console.log(result); } -kustoPoolRemoveLanguageExtensions().catch(console.error); +async function main() { + kustoPoolRemoveLanguageExtensions(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStartSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStartSample.ts index a867b1e930d3..e0cc99364c78 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStartSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStartSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Starts a Kusto pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStart.json */ async function kustoPoolsStop() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.beginStartAndWait( @@ -32,4 +38,8 @@ async function kustoPoolsStop() { console.log(result); } -kustoPoolsStop().catch(console.error); +async function main() { + kustoPoolsStop(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStopSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStopSample.ts index 9062c2cf594b..774727547728 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStopSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsStopSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stops a Kusto pool. @@ -18,10 +21,13 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStop.json */ async function kustoPoolsStop() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.kustoPools.beginStopAndWait( @@ -32,4 +38,8 @@ async function kustoPoolsStop() { console.log(result); } -kustoPoolsStop().catch(console.error); +async function main() { + kustoPoolsStop(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsUpdateSample.ts index e4b1a722e4d3..651872e0e184 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/kustoPoolsUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { KustoPoolUpdate, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update a Kusto Kusto Pool. @@ -18,9 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsUpdate.json */ async function kustoPoolsUpdate() { - const subscriptionId = "12345678-1234-1234-1234-123456789098"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-123456789098"; const workspaceName = "synapseWorkspaceName"; - const resourceGroupName = "kustorptest"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "kustorptest"; const kustoPoolName = "kustoclusterrptest4"; const parameters: KustoPoolUpdate = { enablePurge: true, @@ -39,4 +45,8 @@ async function kustoPoolsUpdate() { console.log(result); } -kustoPoolsUpdate().catch(console.error); +async function main() { + kustoPoolsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/librariesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/librariesListByWorkspaceSample.ts index d339c2973a11..e8c15c7ba169 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/librariesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/librariesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List libraries in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/Libraries_ListByWorkspace.json */ async function listLibrariesInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listLibrariesInAWorkspace() { console.log(resArray); } -listLibrariesInAWorkspace().catch(console.error); +async function main() { + listLibrariesInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/libraryGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/libraryGetSample.ts index f9b946973e8c..26629acc6fd6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/libraryGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/libraryGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get library by name in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/Library_Get.json */ async function getLibraryByName() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const libraryName = "exampleLibraryName.jar"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getLibraryByName() { console.log(result); } -getLibraryByName().catch(console.error); +async function main() { + getLibraryByName(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsCheckNameAvailabilitySample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsCheckNameAvailabilitySample.ts index b4e06c211298..d4b0d59b3790 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsCheckNameAvailabilitySample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsCheckNameAvailabilitySample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Check whether a workspace name is available @@ -21,7 +24,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CheckNameAvailabilityWorkspaceAlreadyExists.json */ async function checkForAWorkspaceNameThatAlreadyExists() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const request: CheckNameAvailabilityRequest = { name: "workspace1", type: "Microsoft.Synapse/workspaces" @@ -32,8 +37,6 @@ async function checkForAWorkspaceNameThatAlreadyExists() { console.log(result); } -checkForAWorkspaceNameThatAlreadyExists().catch(console.error); - /** * This sample demonstrates how to Check whether a workspace name is available * @@ -41,7 +44,9 @@ checkForAWorkspaceNameThatAlreadyExists().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CheckNameAvailabilityWorkspaceAvailable.json */ async function checkForAWorkspaceNameThatIsAvailable() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const request: CheckNameAvailabilityRequest = { name: "workspace1", type: "Microsoft.ProjectArcadia/workspaces" @@ -52,4 +57,9 @@ async function checkForAWorkspaceNameThatIsAvailable() { console.log(result); } -checkForAWorkspaceNameThatIsAvailable().catch(console.error); +async function main() { + checkForAWorkspaceNameThatAlreadyExists(); + checkForAWorkspaceNameThatIsAvailable(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetAzureAsyncHeaderResultSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetAzureAsyncHeaderResultSample.ts index 2b22930d0d9b..03fb3a360db3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetAzureAsyncHeaderResultSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetAzureAsyncHeaderResultSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the status of an operation @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAzureAsyncOperationHeader.json */ async function getAzureAsyncOperationHeaderResult() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const operationId = "01234567-89ab-4def-0123-456789abcdef"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAzureAsyncOperationHeaderResult() { console.log(result); } -getAzureAsyncOperationHeaderResult().catch(console.error); +async function main() { + getAzureAsyncOperationHeaderResult(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetLocationHeaderResultSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetLocationHeaderResultSample.ts index c213eb0eb8f4..234636cabefd 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetLocationHeaderResultSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsGetLocationHeaderResultSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the result of an operation @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetLocationHeader.json */ async function getLocationHeaderResult() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const operationId = "01234567-89ab-4def-0123-456789abcdef"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getLocationHeaderResult() { console.log(result); } -getLocationHeaderResult().catch(console.error); +async function main() { + getLocationHeaderResult(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsListSample.ts index 8b9300da6a3f..80e3c10c8622 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/operationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all available operations @@ -18,11 +21,17 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetAvailableOperations.json */ async function getAvailableOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const result = await client.operations.list(); console.log(result); } -getAvailableOperations().catch(console.error); +async function main() { + getAvailableOperations(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateSample.ts index b98d7c6628b1..deebb3ef5966 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Approve or reject a private endpoint connection. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ApprovePrivateEndpointConnection.json */ async function approvePrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const request: PrivateEndpointConnection = { @@ -42,4 +48,8 @@ async function approvePrivateEndpointConnection() { console.log(result); } -approvePrivateEndpointConnection().catch(console.error); +async function main() { + approvePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts index d963e74b3f23..03f434ff4899 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete a private endpoint connection. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeletePrivateEndpointConnection.json */ async function deletePrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deletePrivateEndpointConnection() { console.log(result); } -deletePrivateEndpointConnection().catch(console.error); +async function main() { + deletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts index 87d489d09b57..0a9c46d786e6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a private endpoint connection. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateEndpointConnection.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateEndpointConnectionName = "ExamplePrivateEndpointConnection"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsListSample.ts index a54aa8103d24..ab99cc14f4f2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists private endpoint connection in workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateEndpointConnections.json */ async function listPrivateEndpointConnectionsInWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listPrivateEndpointConnectionsInWorkspace() { console.log(resArray); } -listPrivateEndpointConnectionsInWorkspace().catch(console.error); +async function main() { + listPrivateEndpointConnectionsInWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubGetSample.ts index 2528c9de7dee..cd3c899203b2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all PrivateEndpointConnection in the PrivateLinkHub by name @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PrivateEndpointConnectionsPrivateLinkHub_Get.json */ async function getAPrivateLinkHub() { - const subscriptionId = "48b08652-d7a1-4d52-b13f-5a2471dce57b"; - const resourceGroupName = "gh-res-grp"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "48b08652-d7a1-4d52-b13f-5a2471dce57b"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "gh-res-grp"; const privateLinkHubName = "pe0"; const privateEndpointConnectionName = "pe0-f3ed30f5-338c-4855-a542-24a403694ad2"; @@ -33,4 +39,8 @@ async function getAPrivateLinkHub() { console.log(result); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubListSample.ts index 6a8c09829f48..5cc81f2efe9c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateEndpointConnectionsPrivateLinkHubListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all PrivateEndpointConnections in the PrivateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PrivateEndpointConnectionsPrivateLinkHub_List.json */ async function getAPrivateLinkHub() { - const subscriptionId = "48b08652-d7a1-4d52-b13f-5a2471dce57b"; - const resourceGroupName = "gh-res-grp"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "48b08652-d7a1-4d52-b13f-5a2471dce57b"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "gh-res-grp"; const privateLinkHubName = "pe0"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getAPrivateLinkHub() { console.log(resArray); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesGetSample.ts index 5946366e6943..981045fa9914 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get private link resource in private link hub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkHubPrivateLinkResource.json */ async function getPrivateLinkResourcesForPrivateLinkHub() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const privateLinkHubName = "ExamplePrivateLinkHub"; const privateLinkResourceName = "sql"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateLinkResourcesForPrivateLinkHub() { console.log(result); } -getPrivateLinkResourcesForPrivateLinkHub().catch(console.error); +async function main() { + getPrivateLinkResourcesForPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesListSample.ts index 4749b83ae328..b8b99ca20578 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubPrivateLinkResourcesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all private link resources for a private link hub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubPrivateLinkResources.json */ async function getPrivateLinkResourcesForPrivateLinkHub() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const privateLinkHubName = "ExamplePrivateLinkHub"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getPrivateLinkResourcesForPrivateLinkHub() { console.log(resArray); } -getPrivateLinkResourcesForPrivateLinkHub().catch(console.error); +async function main() { + getPrivateLinkResourcesForPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsCreateOrUpdateSample.ts index 9874d3cdd948..48d7a53482d3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { PrivateLinkHub, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a privateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdatePrivateLinkHub.json */ async function createOrUpdateAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const privateLinkHubInfo: PrivateLinkHub = { location: "East US", @@ -35,4 +41,8 @@ async function createOrUpdateAPrivateLinkHub() { console.log(result); } -createOrUpdateAPrivateLinkHub().catch(console.error); +async function main() { + createOrUpdateAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsDeleteSample.ts index 0fd508660a10..2bba04da87a8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a privateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeletePrivateLinkHub.json */ async function deleteAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteAPrivateLinkHub() { console.log(result); } -deleteAPrivateLinkHub().catch(console.error); +async function main() { + deleteAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsGetSample.ts index 6ab0fa17bb15..bebde1041842 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a privateLinkHub @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkHub.json */ async function getAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getAPrivateLinkHub() { console.log(result); } -getAPrivateLinkHub().catch(console.error); +async function main() { + getAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListByResourceGroupSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListByResourceGroupSample.ts index 3e207eef2d3c..578d3102c14e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListByResourceGroupSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListByResourceGroupSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of privateLinkHubs in a resource group @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubsInResourceGroup.json */ async function listPrivateLinkHubsInResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -31,4 +37,8 @@ async function listPrivateLinkHubsInResourceGroup() { console.log(resArray); } -listPrivateLinkHubsInResourceGroup().catch(console.error); +async function main() { + listPrivateLinkHubsInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListSample.ts index f98d8aff62d4..5e131322732a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of privateLinkHubs in a subscription @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkHubsInSubscription.json */ async function listPrivateLinkHubsInSubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function listPrivateLinkHubsInSubscription() { console.log(resArray); } -listPrivateLinkHubsInSubscription().catch(console.error); +async function main() { + listPrivateLinkHubsInSubscription(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsUpdateSample.ts index 2aaaf352c653..741f090d503e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkHubsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a privateLinkHub @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdatePrivateLinkHub.json */ async function updateAPrivateLinkHub() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const privateLinkHubName = "privateLinkHub1"; const privateLinkHubPatchInfo: PrivateLinkHubPatchInfo = { tags: { key: "value" } @@ -37,4 +43,8 @@ async function updateAPrivateLinkHub() { console.log(result); } -updateAPrivateLinkHub().catch(console.error); +async function main() { + updateAPrivateLinkHub(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts index 9ecb001ec8ef..fa087d7b3297 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get private link resource in workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetPrivateLinkResource.json */ async function getPrivateLinkResourcesForWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const privateLinkResourceName = "sql"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateLinkResourcesForWorkspace() { console.log(result); } -getPrivateLinkResourcesForWorkspace().catch(console.error); +async function main() { + getPrivateLinkResourcesForWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesListSample.ts index 1c8cd1ab5c41..7780db65e70c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/privateLinkResourcesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get all private link resources for a workspaces @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListPrivateLinkResources.json */ async function getPrivateLinkResourcesForWorkspace() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function getPrivateLinkResourcesForWorkspace() { console.log(resArray); } -getPrivateLinkResourcesForWorkspace().catch(console.error); +async function main() { + getPrivateLinkResourcesForWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsGetSample.ts index e2335389311a..c7bc4af2b6d4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a deleted sql pool that can be restored @@ -18,8 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RestorableDroppedSqlPoolGet.json */ async function getARestorableDroppedSqlPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "restorabledroppeddatabasetest-1257"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || + "restorabledroppeddatabasetest-1257"; const workspaceName = "restorabledroppeddatabasetest-2389"; const restorableDroppedSqlPoolId = "restorabledroppeddatabasetest-7654,131403269876900000"; @@ -33,4 +40,8 @@ async function getARestorableDroppedSqlPool() { console.log(result); } -getARestorableDroppedSqlPool().catch(console.error); +async function main() { + getARestorableDroppedSqlPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsListByWorkspaceSample.ts index 021d7ed37aba..ed4399447467 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/restorableDroppedSqlPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of deleted Sql pools that can be restored @@ -18,8 +21,12 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RestorableDroppedSqlpoolList.json */ async function getListOfRestorableDroppedSqlPools() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "restorabledroppeddatabasetest-1349"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || + "restorabledroppeddatabasetest-1349"; const workspaceName = "restorabledroppeddatabasetest-1840"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +40,8 @@ async function getListOfRestorableDroppedSqlPools() { console.log(resArray); } -getListOfRestorableDroppedSqlPools().catch(console.error); +async function main() { + getListOfRestorableDroppedSqlPools(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationGetSample.ts index acb963ff77cd..e88cae187a8f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SparkConfiguration by name in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/SparkConfiguration_Get.json */ async function getSparkConfigurationByName() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const sparkConfigurationName = "exampleSparkConfigurationName"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getSparkConfigurationByName() { console.log(result); } -getSparkConfigurationByName().catch(console.error); +async function main() { + getSparkConfigurationByName(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationsListByWorkspaceSample.ts index b67cb1e55901..244c74d04d33 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sparkConfigurationsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List sparkConfigurations in a workspace. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/SparkConfigurations_ListByWorkspace.json */ async function listSparkConfigurationsInAWorkspace() { - const subscriptionId = "12345678-1234-1234-1234-12345678abc"; - const resourceGroupName = "exampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "12345678-1234-1234-1234-12345678abc"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "exampleResourceGroup"; const workspaceName = "exampleWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listSparkConfigurationsInAWorkspace() { console.log(resArray); } -listSparkConfigurationsInAWorkspace().catch(console.error); +async function main() { + listSparkConfigurationsInAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts index 737aa1bcaf30..8f2118d0fac5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a SQL pool's blob auditing policy. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolBlobAuditingWithAllParameters.json */ async function createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: SqlPoolBlobAuditingPolicy = { @@ -51,10 +57,6 @@ async function createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters() { console.log(result); } -createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates a SQL pool's blob auditing policy. * @@ -62,8 +64,11 @@ createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolBlobAuditingWithMinParameters.json */ async function createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-4799"; const workspaceName = "blobauditingtest-6440"; const sqlPoolName = "testdb"; const parameters: SqlPoolBlobAuditingPolicy = { @@ -83,6 +88,9 @@ async function createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters() console.log(result); } -createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateADatabaseBlobAuditingPolicyWithAllParameters(); + createOrUpdateADatabaseBlobAuditingPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesGetSample.ts index ba5d52d3a8f0..e1e65a47e164 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a SQL pool's blob auditing policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolBlobAuditing.json */ async function getBlobAuditingPolicyOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getBlobAuditingPolicyOfASqlAnalyticsPool() { console.log(result); } -getBlobAuditingPolicyOfASqlAnalyticsPool().catch(console.error); +async function main() { + getBlobAuditingPolicyOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts index 3f1fe327a369..3e35014a292e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolBlobAuditingPoliciesListBySqlPoolSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists auditing settings of a Sql pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolAuditingSettingsList.json */ async function listAuditSettingsOfADatabase() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listAuditSettingsOfADatabase() { console.log(resArray); } -listAuditSettingsOfADatabase().catch(console.error); +async function main() { + listAuditSettingsOfADatabase(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolColumnsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolColumnsGetSample.ts index ce533032dfbc..20c0b2f615e8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolColumnsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolColumnsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Sql pool column @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolColumnGet.json */ async function getDatabaseColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function getDatabaseColumn() { console.log(result); } -getDatabaseColumn().catch(console.error); +async function main() { + getDatabaseColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolConnectionPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolConnectionPoliciesGetSample.ts index 95167b1b7ba3..c63ff055b755 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolConnectionPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolConnectionPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Sql pool's connection policy, which is used with table auditing. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolConnectionPolicy.json */ async function getAConnectionPolicyOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "blobauditingtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "blobauditingtest-6852"; const workspaceName = "blobauditingtest-2080"; const sqlPoolName = "testdb"; const connectionPolicyName = "default"; @@ -34,4 +40,8 @@ async function getAConnectionPolicyOfASqlAnalyticsPool() { console.log(result); } -getAConnectionPolicyOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAConnectionPolicyOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolDataWarehouseUserActivitiesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolDataWarehouseUserActivitiesGetSample.ts index eb3a3cdcd0a8..68247922630a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolDataWarehouseUserActivitiesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolDataWarehouseUserActivitiesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the user activities of a SQL pool which includes running and suspended queries @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolUserActivity.json */ async function getASqlAnalyticsPoolUserActivity() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdb"; const dataWarehouseUserActivityName = "current"; @@ -34,4 +40,8 @@ async function getASqlAnalyticsPoolUserActivity() { console.log(result); } -getASqlAnalyticsPoolUserActivity().catch(console.error); +async function main() { + getASqlAnalyticsPoolUserActivity(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts index 767865111a31..9900b995df62 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { GeoBackupPolicy, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a SQL Pool geo backup policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateGeoBackupPolicies.json */ async function createGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "testrg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "testrg"; const workspaceName = "testws"; const sqlPoolName = "testdw"; const geoBackupPolicyName = "Default"; @@ -36,4 +41,8 @@ async function createGeoBackupPolicy() { console.log(result); } -createGeoBackupPolicy().catch(console.error); +async function main() { + createGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesGetSample.ts index 61acd59bc0e1..68d0ac2d93f2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the specified SQL pool geo backup policy @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolGeoBackupPolicy.json */ async function getSqlPoolGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-5961"; const sqlPoolName = "testdw"; const geoBackupPolicyName = "Default"; @@ -34,4 +40,8 @@ async function getSqlPoolGeoBackupPolicy() { console.log(result); } -getSqlPoolGeoBackupPolicy().catch(console.error); +async function main() { + getSqlPoolGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesListSample.ts index e295a8ed4f7a..1931dbc6210a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolGeoBackupPoliciesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of SQL pool geo backup policies @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolGeoBackupPolicies_List.json */ async function getSqlPoolGeoBackupPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-5961"; const sqlPoolName = "testdw"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getSqlPoolGeoBackupPolicy() { console.log(resArray); } -getSqlPoolGeoBackupPolicy().catch(console.error); +async function main() { + getSqlPoolGeoBackupPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowOptionsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowOptionsGetSample.ts index ce39dd4ed5b9..a56c352069c8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowOptionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowOptionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of SQL pool's available maintenance windows. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetMaintenanceWindowOptions.json */ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowOptionsName = "current"; @@ -34,6 +39,8 @@ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPo console.log(result); } -getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool().catch( - console.error -); +async function main() { + getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts index 614cea0e31cb..7c2265a805a9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool's maintenance windows settings. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateMaintenanceWindows.json */ async function setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowName = "current"; @@ -43,6 +48,8 @@ async function setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { console.log(result); } -setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool().catch( - console.error -); +async function main() { + setsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsGetSample.ts index 6bba65cbb718..973182d8b0cb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMaintenanceWindowsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a SQL pool's Maintenance Windows. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetMaintenanceWindows.json */ async function getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "samplerg"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "samplerg"; const workspaceName = "testworkspace"; const sqlPoolName = "testsp"; const maintenanceWindowName = "current"; @@ -34,6 +39,8 @@ async function getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool() { console.log(result); } -getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool().catch( - console.error -); +async function main() { + getsMaintenanceWindowSettingsForASelectedSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsCreateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsCreateSample.ts index 16811c76239b..a7821272e6fe 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Set the metadata sync configuration for a SQL pool @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPoolMetadataSyncConfig.json */ async function setMetadataSyncConfigForASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const metadataSyncConfiguration: MetadataSyncConfig = { enabled: true }; @@ -37,4 +43,8 @@ async function setMetadataSyncConfigForASqlAnalyticsPool() { console.log(result); } -setMetadataSyncConfigForASqlAnalyticsPool().catch(console.error); +async function main() { + setMetadataSyncConfigForASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsGetSample.ts index a1688ddeb7f8..e0ac273204f5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolMetadataSyncConfigsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the metadata sync configuration for a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolMetadataSyncConfig.json */ async function getMetadataSyncConfigForASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getMetadataSyncConfigForASqlAnalyticsPool() { console.log(result); } -getMetadataSyncConfigForASqlAnalyticsPool().catch(console.error); +async function main() { + getMetadataSyncConfigForASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationResultsGetLocationHeaderResultSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationResultsGetLocationHeaderResultSample.ts index c57ad7c6fad5..e7442233d6a8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationResultsGetLocationHeaderResultSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationResultsGetLocationHeaderResultSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the status of a SQL pool operation @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetLocationHeaderResultWithSqlPool.json */ async function getTheResultOfAnOperationOnASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const operationId = "fedcba98-7654-4210-fedc-ba9876543210"; @@ -34,4 +40,8 @@ async function getTheResultOfAnOperationOnASqlAnalyticsPool() { console.log(result); } -getTheResultOfAnOperationOnASqlAnalyticsPool().catch(console.error); +async function main() { + getTheResultOfAnOperationOnASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationsListSample.ts index 49404ff42bdf..69a4a821c385 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolOperationsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a list of operations performed on the SQL pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolOperations.json */ async function listTheSqlAnalyticsPoolManagementOperations() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-7398"; const workspaceName = "sqlcrudtest-4645"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listTheSqlAnalyticsPoolManagementOperations() { console.log(resArray); } -listTheSqlAnalyticsPoolManagementOperations().catch(console.error); +async function main() { + listTheSqlAnalyticsPoolManagementOperations(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts index 48401ff59845..7efad9400374 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRecommendedSensitivityLabelsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update recommended sensitivity labels states of a given SQL Pool using an operations batch. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SensitivityLabelsRecommendedUpdate.json */ async function updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myWorkspace"; const sqlPoolName = "mySqlPool"; const parameters: RecommendedSensitivityLabelUpdateList = { @@ -43,6 +48,8 @@ async function updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperation console.log(result); } -updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch().catch( - console.error -); +async function main() { + updateRecommendedSensitivityLabelsOfAGivenSqlPoolUsingAnOperationsBatch(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksGetByNameSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksGetByNameSample.ts index 957caf422c81..a511e59363db 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksGetByNameSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksGetByNameSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SQL pool replication link by name. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolReplicationLinks_GetByName.json */ async function listsASqlAnalyticPoolReplicationLinks() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-6440"; const sqlPoolName = "testdb"; const linkId = "5b301b68-03f6-4b26-b0f4-73ebb8634238"; @@ -34,4 +40,8 @@ async function listsASqlAnalyticPoolReplicationLinks() { console.log(result); } -listsASqlAnalyticPoolReplicationLinks().catch(console.error); +async function main() { + listsASqlAnalyticPoolReplicationLinks(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksListSample.ts index 3b5abd26e2d3..0a74f0e28d6d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolReplicationLinksListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists a Sql pool's replication links. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolReplicationLinks.json */ async function listsASqlAnalyticPoolReplicationLinks() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-4799"; const workspaceName = "sqlcrudtest-6440"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listsASqlAnalyticPoolReplicationLinks() { console.log(resArray); } -listsASqlAnalyticPoolReplicationLinks().catch(console.error); +async function main() { + listsASqlAnalyticPoolReplicationLinks(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsCreateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsCreateSample.ts index 690ad8066072..a7f0c24c0bac 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsCreateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a restore point for a data warehouse. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPoolRestorePoints.json */ async function createsSqlPoolRestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testserver"; const sqlPoolName = "testDatabase"; const parameters: CreateSqlPoolRestorePointDefinition = { @@ -39,4 +45,8 @@ async function createsSqlPoolRestorePoint() { console.log(result); } -createsSqlPoolRestorePoint().catch(console.error); +async function main() { + createsSqlPoolRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsDeleteSample.ts index bdfd9b5dac92..8320014a0e4f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a restore point. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolRestorePointsDelete.json */ async function deletesARestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testws"; const sqlPoolName = "testpool"; const restorePointName = "131546477590000000"; @@ -34,4 +40,8 @@ async function deletesARestorePoint() { console.log(result); } -deletesARestorePoint().catch(console.error); +async function main() { + deletesARestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsGetSample.ts index 94758a1282ea..3d6166c19ee8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a restore point. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolRestorePointsGet.json */ async function getsASqlPoolRestorePoint() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testws"; const sqlPoolName = "testpool"; const restorePointName = "131546477590000000"; @@ -34,4 +40,8 @@ async function getsASqlPoolRestorePoint() { console.log(result); } -getsASqlPoolRestorePoint().catch(console.error); +async function main() { + getsASqlPoolRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsListSample.ts index ee0ef0910027..674cfbcc48f4 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolRestorePointsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SQL pool backup information @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolRestorePoints.json */ async function getAListOfRestorePointsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testserver"; const sqlPoolName = "testDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getAListOfRestorePointsOfASqlAnalyticsPool() { console.log(resArray); } -getAListOfRestorePointsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAListOfRestorePointsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasGetSample.ts index 7d448b59742f..2f74997457cc 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Sql Pool schema @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolSchemaGet.json */ async function getDatabaseSchema() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -34,4 +39,8 @@ async function getDatabaseSchema() { console.log(result); } -getDatabaseSchema().catch(console.error); +async function main() { + getDatabaseSchema(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasListSample.ts index 3b057eafbeac..b955c81d7905 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSchemasListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets schemas of a given SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolSchema.json */ async function listTheSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +40,8 @@ async function listTheSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts index 16115e650a5a..d87d4992d60a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Sql pool's security alert policy. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolSecurityAlertWithAllParameters.json */ async function updateASqlPoolThreatDetectionPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-4799"; const workspaceName = "securityalert-6440"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -48,8 +54,6 @@ async function updateASqlPoolThreatDetectionPolicyWithAllParameters() { console.log(result); } -updateASqlPoolThreatDetectionPolicyWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Create or update a Sql pool's security alert policy. * @@ -57,8 +61,11 @@ updateASqlPoolThreatDetectionPolicyWithAllParameters().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolSecurityAlertWithMinParameters.json */ async function updateASqlPoolThreatDetectionPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-4799"; const workspaceName = "securityalert-6440"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -75,4 +82,9 @@ async function updateASqlPoolThreatDetectionPolicyWithMinimalParameters() { console.log(result); } -updateASqlPoolThreatDetectionPolicyWithMinimalParameters().catch(console.error); +async function main() { + updateASqlPoolThreatDetectionPolicyWithAllParameters(); + updateASqlPoolThreatDetectionPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesGetSample.ts index f0ce5be529aa..9d63b85ac30e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Sql pool's security alert policy. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolSecurityAlert.json */ async function getASecurityAlertOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-6852"; const workspaceName = "securityalert-2080"; const sqlPoolName = "testdb"; const securityAlertPolicyName = "default"; @@ -34,4 +40,8 @@ async function getASecurityAlertOfASqlAnalyticsPool() { console.log(result); } -getASecurityAlertOfASqlAnalyticsPool().catch(console.error); +async function main() { + getASecurityAlertOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesListSample.ts index 1e7cba0d152b..3cf6b97bc6e5 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSecurityAlertPoliciesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a list of Sql pool's security alert policies. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolSecurityAlertPolicies_List.json */ async function getASecurityAlertOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "securityalert-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "securityalert-6852"; const workspaceName = "securityalert-2080"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getASecurityAlertOfASqlAnalyticsPool() { console.log(resArray); } -getASecurityAlertOfASqlAnalyticsPool().catch(console.error); +async function main() { + getASecurityAlertOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts index d8f66d3ddb6d..31142907dc73 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SensitivityLabel, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates the sensitivity label of a given column in a Sql pool @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolColumnSensitivityLabelWithAllParameters.json */ async function updatesTheSensitivityLabelOfAGivenColumnWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -45,6 +50,8 @@ async function updatesTheSensitivityLabelOfAGivenColumnWithAllParameters() { console.log(result); } -updatesTheSensitivityLabelOfAGivenColumnWithAllParameters().catch( - console.error -); +async function main() { + updatesTheSensitivityLabelOfAGivenColumnWithAllParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDeleteSample.ts index 29029c74e033..f2c713de9c1c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the sensitivity label of a given column in a Sql pool @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolColumnSensitivityLabel.json */ async function deletesTheSensitivityLabelOfAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function deletesTheSensitivityLabelOfAGivenColumn() { console.log(result); } -deletesTheSensitivityLabelOfAGivenColumn().catch(console.error); +async function main() { + deletesTheSensitivityLabelOfAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDisableRecommendationSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDisableRecommendationSample.ts index c7d746296518..bc5d3858c7de 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDisableRecommendationSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsDisableRecommendationSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Disables sensitivity recommendations on a given column @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RecommendedColumnSensitivityLabelDisable.json */ async function disablesSensitivityRecommendationsOnAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function disablesSensitivityRecommendationsOnAGivenColumn() { console.log(result); } -disablesSensitivityRecommendationsOnAGivenColumn().catch(console.error); +async function main() { + disablesSensitivityRecommendationsOnAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsEnableRecommendationSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsEnableRecommendationSample.ts index d089d586a46d..cb1b1a907230 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsEnableRecommendationSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsEnableRecommendationSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns) @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RecommendedColumnSensitivityLabelEnable.json */ async function enablesSensitivityRecommendationsOnAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -38,4 +43,8 @@ async function enablesSensitivityRecommendationsOnAGivenColumn() { console.log(result); } -enablesSensitivityRecommendationsOnAGivenColumn().catch(console.error); +async function main() { + enablesSensitivityRecommendationsOnAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsGetSample.ts index 251bb39faa95..49efa427da34 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the sensitivity label of a given column @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolColumnSensitivityLabelGet.json */ async function getsTheSensitivityLabelOfAGivenColumn() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -40,4 +45,8 @@ async function getsTheSensitivityLabelOfAGivenColumn() { console.log(result); } -getsTheSensitivityLabelOfAGivenColumn().catch(console.error); +async function main() { + getsTheSensitivityLabelOfAGivenColumn(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListCurrentSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListCurrentSample.ts index f6c62201c9b0..bb06bb6ec3c3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListCurrentSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListCurrentSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets SQL pool sensitivity labels. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsSensitivityLabelsWithSourceCurrent.json */ async function getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,4 +40,8 @@ async function getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool() { console.log(resArray); } -getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool().catch(console.error); +async function main() { + getsTheCurrentSensitivityLabelsOfAGivenSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListRecommendedSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListRecommendedSample.ts index 3eda71720fc0..4bec09889a68 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListRecommendedSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsListRecommendedSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets sensitivity labels of a given SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolSensitivityLabelsWithSourceRecommended.json */ async function getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myServer"; const sqlPoolName = "myDatabase"; const credential = new DefaultAzureCredential(); @@ -35,6 +40,8 @@ async function getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool() { console.log(resArray); } -getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool().catch( - console.error -); +async function main() { + getsTheRecommendedSensitivityLabelsOfAGivenSqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsUpdateSample.ts index 8c074c8f461c..8b9c8305e537 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolSensitivityLabelsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update sensitivity labels of a given SQL Pool using an operations batch. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SensitivityLabelsCurrentUpdate.json */ async function updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "myWorkspace"; const sqlPoolName = "mySqlPool"; const parameters: SensitivityLabelUpdateList = { @@ -67,6 +72,8 @@ async function updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch() { console.log(result); } -updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch().catch( - console.error -); +async function main() { + updateSensitivityLabelsOfAGivenDatabaseUsingAnOperationsBatch(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTableColumnsListByTableNameSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTableColumnsListByTableNameSample.ts index fa3b1abe8fd4..873429da42eb 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTableColumnsListByTableNameSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTableColumnsListByTableNameSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets columns in a given table in a SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolColumns.json */ async function listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -39,4 +44,8 @@ async function listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheColumnsInATableOfAGivenSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesGetSample.ts index 68b5712da66d..03abcc1980d1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Sql pool table @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolTableGet.json */ async function getDatabaseTable() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -36,4 +41,8 @@ async function getDatabaseTable() { console.log(result); } -getDatabaseTable().catch(console.error); +async function main() { + getDatabaseTable(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesListBySchemaSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesListBySchemaSample.ts index 9cebb8c6f545..1eb3996c869c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesListBySchemaSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTablesListBySchemaSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets tables of a given schema in a SQL pool. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolTables.json */ async function listTheTablesOfAGivenSchemaInASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myRG"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "myRG"; const workspaceName = "serverName"; const sqlPoolName = "myDatabase"; const schemaName = "dbo"; @@ -37,4 +42,8 @@ async function listTheTablesOfAGivenSchemaInASqlAnalyticsPool() { console.log(resArray); } -listTheTablesOfAGivenSchemaInASqlAnalyticsPool().catch(console.error); +async function main() { + listTheTablesOfAGivenSchemaInASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts index 77f418174f46..62539f71224a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool's transparent data encryption configuration. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolTransparentDataEncryption.json */ async function createOrUpdateASqlPoolTransparentDataEncryptionConfiguration() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const transparentDataEncryptionName = "current"; @@ -39,6 +45,8 @@ async function createOrUpdateASqlPoolTransparentDataEncryptionConfiguration() { console.log(result); } -createOrUpdateASqlPoolTransparentDataEncryptionConfiguration().catch( - console.error -); +async function main() { + createOrUpdateASqlPoolTransparentDataEncryptionConfiguration(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsGetSample.ts index 2741fbe4f626..6e03bb0e9a8d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a SQL pool's transparent data encryption configuration. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolTransparentDataEncryption.json */ async function getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const transparentDataEncryptionName = "current"; @@ -34,6 +40,8 @@ async function getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool() { console.log(result); } -getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool().catch( - console.error -); +async function main() { + getTransparentDataEncryptionConfigurationOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsListSample.ts index 5dca01402231..78611ebc4e17 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolTransparentDataEncryptionsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of SQL pool's transparent data encryption configurations. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolTransparentDataEncryptionList.json */ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -35,6 +41,8 @@ async function getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPo console.log(resArray); } -getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool().catch( - console.error -); +async function main() { + getListOfTransparentDataEncryptionConfigurationsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolUsagesListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolUsagesListSample.ts index 0456062fd157..639cb6020023 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolUsagesListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolUsagesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets SQL pool usages. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolUsageMetricsList.json */ async function listTheUsagesOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6730"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6730"; const workspaceName = "sqlcrudtest-9007"; const sqlPoolName = "3481"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listTheUsagesOfASqlAnalyticsPool() { console.log(resArray); } -listTheUsagesOfASqlAnalyticsPool().catch(console.error); +async function main() { + listTheUsagesOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts index 292c9e705f10..823fe7bbcca1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Sql pool's vulnerability assessment rule baseline. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentRuleBaseline.json */ async function createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -49,6 +55,8 @@ async function createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline() { console.log(result); } -createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline().catch( - console.error -); +async function main() { + createsOrUpdatesADatabaseVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts index 742b96b29207..31c56068996a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Removes the database's vulnerability assessment rule baseline. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolVulnerabilityAssessmentRuleBaseline.json */ async function removesADatabaseVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -38,4 +44,8 @@ async function removesADatabaseVulnerabilityAssessmentRuleBaseline() { console.log(result); } -removesADatabaseVulnerabilityAssessmentRuleBaseline().catch(console.error); +async function main() { + removesADatabaseVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts index a2e4d458fc89..7416ce3d8faf 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentRuleBaselinesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a SqlPool's vulnerability assessment rule baseline. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolVulnerabilityAssessmentRuleBaselineGet.json */ async function getsASqlPoolVulnerabilityAssessmentRuleBaseline() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4711"; const workspaceName = "vulnerabilityaseessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -38,4 +44,8 @@ async function getsASqlPoolVulnerabilityAssessmentRuleBaseline() { console.log(result); } -getsASqlPoolVulnerabilityAssessmentRuleBaseline().catch(console.error); +async function main() { + getsASqlPoolVulnerabilityAssessmentRuleBaseline(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansExportSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansExportSample.ts index 5037e9f608f0..02418a94522f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansExportSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansExportSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Convert an existing scan result to a human readable format. If already exists nothing happens @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExportSqlPoolVulnerabilityAssessmentScan.json */ async function exportADatabaseVulnerabilityAssessmentScanResults() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4799"; const workspaceName = "vulnerabilityassessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +42,8 @@ async function exportADatabaseVulnerabilityAssessmentScanResults() { console.log(result); } -exportADatabaseVulnerabilityAssessmentScanResults().catch(console.error); +async function main() { + exportADatabaseVulnerabilityAssessmentScanResults(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansGetSample.ts index 436a77c551c1..c131f068f668 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a vulnerability assessment scan record of a Sql pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolVulnerabilityAssessmentScanRecordsGet.json */ async function getsADatabaseVulnerabilityAssessmentScanRecordByScanId() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +42,8 @@ async function getsADatabaseVulnerabilityAssessmentScanRecordByScanId() { console.log(result); } -getsADatabaseVulnerabilityAssessmentScanRecordByScanId().catch(console.error); +async function main() { + getsADatabaseVulnerabilityAssessmentScanRecordByScanId(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts index 25479fe69bbc..bc25bad90e10 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansInitiateScanSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Executes a Vulnerability Assessment database scan. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ExecuteSqlPoolVulnerabilityAssessmentScans.json */ async function executesASqlPoolVulnerabilityAssessmentScan() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -36,4 +42,8 @@ async function executesASqlPoolVulnerabilityAssessmentScan() { console.log(result); } -executesASqlPoolVulnerabilityAssessmentScan().catch(console.error); +async function main() { + executesASqlPoolVulnerabilityAssessmentScan(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansListSample.ts index 715be5de9090..974314d1e831 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentScansListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the vulnerability assessment scans of a SQL pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolVulnerabilityAssessmentScanRecords.json */ async function getAVulnerabilityScanRecordOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityassessmenttest-4711"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityassessmenttest-4711"; const workspaceName = "vulnerabilityassessmenttest-6411"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -37,4 +43,8 @@ async function getAVulnerabilityScanRecordOfASqlAnalyticsPool() { console.log(resArray); } -getAVulnerabilityScanRecordOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAVulnerabilityScanRecordOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts index 72fd3b99533d..3a0ba5d5552c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithAllParameters.json */ async function createADatabaseVulnerabilityAssessmentWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -51,8 +57,6 @@ async function createADatabaseVulnerabilityAssessmentWithAllParameters() { console.log(result); } -createADatabaseVulnerabilityAssessmentWithAllParameters().catch(console.error); - /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. * @@ -60,8 +64,11 @@ createADatabaseVulnerabilityAssessmentWithAllParameters().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateVulnerabilityAssessmentWithStorageAccessKeyAndMinParameters.json */ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -83,10 +90,6 @@ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenSt console.log(result); } -createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified().catch( - console.error -); - /** * This sample demonstrates how to Creates or updates the Sql pool vulnerability assessment. * @@ -94,8 +97,11 @@ createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAcc * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithContainerSasKeyAndMinParameters.json */ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -117,6 +123,10 @@ async function createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenSt console.log(result); } -createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified().catch( - console.error -); +async function main() { + createADatabaseVulnerabilityAssessmentWithAllParameters(); + createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified(); + createADatabaseVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsDeleteSample.ts index 83c11bb13190..290673780594 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Removes the database's vulnerability assessment. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolVulnerabilityAssessment.json */ async function removeADatabaseVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -34,4 +40,8 @@ async function removeADatabaseVulnerabilityAssessment() { console.log(result); } -removeADatabaseVulnerabilityAssessment().catch(console.error); +async function main() { + removeADatabaseVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsGetSample.ts index cf62e032365f..f6d16d8a081b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Sql pool's vulnerability assessment. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolVulnerabilityAssessment.json */ async function getASqlPoolVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const vulnerabilityAssessmentName = "default"; @@ -34,4 +40,8 @@ async function getASqlPoolVulnerabilityAssessment() { console.log(result); } -getASqlPoolVulnerabilityAssessment().catch(console.error); +async function main() { + getASqlPoolVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsListSample.ts index 26a339768f57..3405098a3184 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolVulnerabilityAssessmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the vulnerability assessment policies associated with a SQL pool. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolVulnerabilityAssessments.json */ async function getAVulnerabilityAssessmentOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "vulnerabilityaseessmenttest-4799"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "vulnerabilityaseessmenttest-4799"; const workspaceName = "vulnerabilityaseessmenttest-6440"; const sqlPoolName = "testdb"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getAVulnerabilityAssessmentOfASqlAnalyticsPool() { console.log(resArray); } -getAVulnerabilityAssessmentOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAVulnerabilityAssessmentOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts index 8834c50a651b..03a4014a85b3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create Or Update workload classifier for a Sql pool's workload group. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadClassifierMax.json */ async function createAWorkloadClassifierWithAllPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -48,8 +54,6 @@ async function createAWorkloadClassifierWithAllPropertiesSpecified() { console.log(result); } -createAWorkloadClassifierWithAllPropertiesSpecified().catch(console.error); - /** * This sample demonstrates how to Create Or Update workload classifier for a Sql pool's workload group. * @@ -57,8 +61,11 @@ createAWorkloadClassifierWithAllPropertiesSpecified().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadClassifierMin.json */ async function createAWorkloadClassifierWithTheRequiredPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -77,6 +84,9 @@ async function createAWorkloadClassifierWithTheRequiredPropertiesSpecified() { console.log(result); } -createAWorkloadClassifierWithTheRequiredPropertiesSpecified().catch( - console.error -); +async function main() { + createAWorkloadClassifierWithAllPropertiesSpecified(); + createAWorkloadClassifierWithTheRequiredPropertiesSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierDeleteSample.ts index 1cdae621f294..cc6c8fedcacd 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove workload classifier of a Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolWorkloadGroupWorkloadClassifer.json */ async function deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -36,6 +42,8 @@ async function deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup() { console.log(result); } -deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup().catch( - console.error -); +async function main() { + deleteAWorkloadClassifierOfASqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierGetSample.ts index bb4930303b9a..edf3cb520044 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workload classifier of Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupWorkloadClassifier.json */ async function getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -36,4 +42,8 @@ async function getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup() { console.log(result); } -getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup().catch(console.error); +async function main() { + getAWorkloadClassifierForSqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierListSample.ts index b2cdf905217b..84e45e353236 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadClassifierListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of Sql pool's workload classifier for workload groups. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupWorkloadClassifierList.json */ async function getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -37,6 +43,8 @@ async function getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup() console.log(resArray); } -getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup().catch( - console.error -); +async function main() { + getTheListOfWorkloadClassifiersOfASqlAnalyticsPoolWorkloadGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupCreateOrUpdateSample.ts index a8fe11a95a2c..8ca5216d8883 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { WorkloadGroup, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create Or Update a Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadGroupMax.json */ async function createAWorkloadGroupWithAllPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -43,8 +49,6 @@ async function createAWorkloadGroupWithAllPropertiesSpecified() { console.log(result); } -createAWorkloadGroupWithAllPropertiesSpecified().catch(console.error); - /** * This sample demonstrates how to Create Or Update a Sql pool's workload group. * @@ -52,8 +56,11 @@ createAWorkloadGroupWithAllPropertiesSpecified().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolWorkloadGroupMin.json */ async function createAWorkloadGroupWithTheRequiredPropertiesSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -74,4 +81,9 @@ async function createAWorkloadGroupWithTheRequiredPropertiesSpecified() { console.log(result); } -createAWorkloadGroupWithTheRequiredPropertiesSpecified().catch(console.error); +async function main() { + createAWorkloadGroupWithAllPropertiesSpecified(); + createAWorkloadGroupWithTheRequiredPropertiesSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupDeleteSample.ts index 526c96cbd28d..ca1d1bba660c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPoolWorkloadGroup.json */ async function deleteAWorkloadGroupOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "wlm_workloadgroup"; @@ -34,4 +40,8 @@ async function deleteAWorkloadGroupOfASqlAnalyticsPool() { console.log(result); } -deleteAWorkloadGroupOfASqlAnalyticsPool().catch(console.error); +async function main() { + deleteAWorkloadGroupOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupGetSample.ts index efd46ac69ff2..f9d8124531a9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Sql pool's workload group. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroup.json */ async function getAWorkloadGroupOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const workloadGroupName = "smallrc"; @@ -34,4 +40,8 @@ async function getAWorkloadGroupOfASqlAnalyticsPool() { console.log(result); } -getAWorkloadGroupOfASqlAnalyticsPool().catch(console.error); +async function main() { + getAWorkloadGroupOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupListSample.ts index baa18245ce91..e413e59245e7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolWorkloadGroupListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of Sql pool's workload groups. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPoolWorkloadGroupList.json */ async function getTheListOfWorkloadGroupsOfASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function getTheListOfWorkloadGroupsOfASqlAnalyticsPool() { console.log(resArray); } -getTheListOfWorkloadGroupsOfASqlAnalyticsPool().catch(console.error); +async function main() { + getTheListOfWorkloadGroupsOfASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsCreateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsCreateSample.ts index 7c9736841eb4..0ff9956ca4f0 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsCreateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsCreateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SqlPool, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateSqlPool.json */ async function createASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const sqlPoolInfo: SqlPool = { @@ -44,4 +50,8 @@ async function createASqlAnalyticsPool() { console.log(result); } -createASqlAnalyticsPool().catch(console.error); +async function main() { + createASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsDeleteSample.ts index f020c73b40a7..b60cfe89b620 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Delete a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteSqlPool.json */ async function deleteASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteASqlAnalyticsPool() { console.log(result); } -deleteASqlAnalyticsPool().catch(console.error); +async function main() { + deleteASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsGetSample.ts index e9afec21e93e..8fe2f1106bdf 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get SQL pool properties @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetSqlPool.json */ async function getASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getASqlAnalyticsPool() { console.log(result); } -getASqlAnalyticsPool().catch(console.error); +async function main() { + getASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsListByWorkspaceSample.ts index 728c95a3c807..e2febe6bccde 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all SQL pools @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspace.json */ async function listSqlAnalyticsPoolsInAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6845"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6845"; const workspaceName = "sqlcrudtest-7177"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,8 +39,6 @@ async function listSqlAnalyticsPoolsInAWorkspace() { console.log(resArray); } -listSqlAnalyticsPoolsInAWorkspace().catch(console.error); - /** * This sample demonstrates how to List all SQL pools * @@ -42,8 +46,11 @@ listSqlAnalyticsPoolsInAWorkspace().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspaceWithFilter.json */ async function listSqlAnalyticsPoolsInAWorkspaceWithFilter() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "sqlcrudtest-6845"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6845"; const workspaceName = "sqlcrudtest-7177"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -57,4 +64,9 @@ async function listSqlAnalyticsPoolsInAWorkspaceWithFilter() { console.log(resArray); } -listSqlAnalyticsPoolsInAWorkspaceWithFilter().catch(console.error); +async function main() { + listSqlAnalyticsPoolsInAWorkspace(); + listSqlAnalyticsPoolsInAWorkspaceWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsPauseSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsPauseSample.ts index fbb98f3d8922..9ff9ec96a524 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsPauseSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsPauseSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Pause a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PauseSqlPool.json */ async function pauseASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdwdb"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function pauseASqlAnalyticsPool() { console.log(result); } -pauseASqlAnalyticsPool().catch(console.error); +async function main() { + pauseASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsRenameSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsRenameSample.ts index 34a0fc20aa90..26982b9c2d06 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsRenameSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsRenameSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Rename a SQL pool. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RenameSqlPool.json */ async function renameASqlAnalyticsPool() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "Default-SQL-SouthEastAsia"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "Default-SQL-SouthEastAsia"; const workspaceName = "testsvr"; const sqlPoolName = "testdb"; const parameters: ResourceMoveDefinition = { @@ -40,4 +46,8 @@ async function renameASqlAnalyticsPool() { console.log(result); } -renameASqlAnalyticsPool().catch(console.error); +async function main() { + renameASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsResumeSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsResumeSample.ts index 87c84e80b8fd..3a170722290b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsResumeSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsResumeSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Resume a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ResumeSqlPool.json */ async function resumeASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "sqlcrudtest-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "sqlcrudtest-6852"; const workspaceName = "sqlcrudtest-2080"; const sqlPoolName = "sqlcrudtest-9187"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function resumeASqlAnalyticsPool() { console.log(result); } -resumeASqlAnalyticsPool().catch(console.error); +async function main() { + resumeASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsUpdateSample.ts index e08fa20c092b..63bca6e04e90 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/sqlPoolsUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SqlPoolPatchInfo, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Apply a partial update to a SQL pool @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateSqlPool.json */ async function updateASqlAnalyticsPool() { - const subscriptionId = "01234567-89ab-4def-0123-456789abcdef"; - const resourceGroupName = "ExampleResourceGroup"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "01234567-89ab-4def-0123-456789abcdef"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "ExampleResourceGroup"; const workspaceName = "ExampleWorkspace"; const sqlPoolName = "ExampleSqlPool"; const sqlPoolInfo: SqlPoolPatchInfo = { @@ -41,4 +47,8 @@ async function updateASqlAnalyticsPool() { console.log(result); } -updateASqlAnalyticsPool().catch(console.error); +async function main() { + updateASqlAnalyticsPool(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsCreateOrUpdateSample.ts index 7f04121a4943..8b6903ef09f8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace active directory admin @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspaceAadAdmin.json */ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const aadAdminInfo: WorkspaceAadAdminInfo = { administratorType: "ActiveDirectory", @@ -40,4 +46,8 @@ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { console.log(result); } -createOrUpdateWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + createOrUpdateWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsDeleteSample.ts index 2a7bfc56d18d..1b859823aec7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceAadAdmin.json */ async function deleteWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteWorkspaceActiveDirectoryAdmin() { console.log(result); } -deleteWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + deleteWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsGetSample.ts index 14a63f486e63..973c0259bef6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceAadAdminsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceAadAdmin.json */ async function getWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getWorkspaceActiveDirectoryAdmin() { console.log(result); } -getWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + getWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts index 24904ac13c1b..214c98136df1 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update Managed Identity Sql Control Settings @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateManagedIdentitySqlControlSettings.json */ async function createOrUpdateManagedIdentitySqlControlSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const managedIdentitySqlControlSettings: ManagedIdentitySqlControlSettingsModel = { grantSqlControlToManagedIdentity: { desiredState: "Enabled" } @@ -37,4 +43,8 @@ async function createOrUpdateManagedIdentitySqlControlSettings() { console.log(result); } -createOrUpdateManagedIdentitySqlControlSettings().catch(console.error); +async function main() { + createOrUpdateManagedIdentitySqlControlSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsGetSample.ts index b1d682ebe831..8c7b584de562 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedIdentitySqlControlSettingsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get Managed Identity Sql Control Settings @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetManagedIdentitySqlControlSettings.json */ async function getManagedIdentitySqlControlSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getManagedIdentitySqlControlSettings() { console.log(result); } -getManagedIdentitySqlControlSettings().catch(console.error); +async function main() { + getManagedIdentitySqlControlSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts index 992b0c7a62e2..fbd6a818d6c8 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's blob auditing policy. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerBlobAuditingSettingsWithAllParameters.json */ async function createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ServerBlobAuditingPolicy = { @@ -52,10 +57,6 @@ async function createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParame console.log(result); } -createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's blob auditing policy. * @@ -63,8 +64,10 @@ createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerBlobAuditingSettingsWithMinParameters.json */ async function createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ServerBlobAuditingPolicy = { @@ -84,6 +87,9 @@ async function createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMi console.log(result); } -createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateBlobAuditingPolicyOfWorkspaceSqlServerWithAllParameters(); + createOrUpdateBlobAuditingPolicyOfWorkspaceManagedSqlServerWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts index d922308c0659..3d03c0e74292 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workspace managed sql server's blob auditing policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerBlobAuditingSettings.json */ async function getBlobAuditingSettingOfWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getBlobAuditingSettingOfWorkspaceManagedSqlServer() { console.log(result); } -getBlobAuditingSettingOfWorkspaceManagedSqlServer().catch(console.error); +async function main() { + getBlobAuditingSettingOfWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts index 91ae32fe55a8..4c539c33bc21 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List workspace managed sql server's blob auditing policies. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerBlobAuditingSettings.json */ async function getBlobAuditingPolicyOfWorkspaceMangedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getBlobAuditingPolicyOfWorkspaceMangedSqlServer() { console.log(resArray); } -getBlobAuditingPolicyOfWorkspaceMangedSqlServer().catch(console.error); +async function main() { + getBlobAuditingPolicyOfWorkspaceMangedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts index bdebdc9dab93..c836a75126a9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's minimal tls settings. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const dedicatedSQLminimalTlsSettingsName = "default"; const credential = new DefaultAzureCredential(); @@ -32,6 +38,8 @@ async function getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings() { console.log(result); } -getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings().catch( - console.error -); +async function main() { + getWorkspaceManagedSqlServerDedicatedSqlMinimalTlsSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts index 56d3650c56e0..00e4dc915e94 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List workspace managed sql server's minimal tls settings. @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,6 +39,8 @@ async function listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer( console.log(resArray); } -listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer().catch( - console.error -); +async function main() { + listDedicatedSqlMinimalTlsSettingsOfTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts index 4f21be3fe423..959062e4e613 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerDedicatedSqlMinimalTlsSettingsUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update workspace managed sql server's minimal tls settings. @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateWorkspaceManagedSqlServerDedicatedSQLminimalTlsSettings.json */ async function updateTlsVersionOfTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "workspace-6852"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "workspace-6852"; const workspaceName = "workspace-2080"; const dedicatedSQLminimalTlsSettingsName = "default"; const parameters: DedicatedSQLminimalTlsSettings = { @@ -39,4 +45,8 @@ async function updateTlsVersionOfTheWorkspaceManagedSqlServer() { console.log(result); } -updateTlsVersionOfTheWorkspaceManagedSqlServer().catch(console.error); +async function main() { + updateTlsVersionOfTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts index 176dc883904f..2bff22c7c2ff 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates workspace managed sql server's encryption protector. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateKeyVault.json */ async function updateTheEncryptionProtectorToKeyVault() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const parameters: EncryptionProtector = { @@ -40,8 +45,6 @@ async function updateTheEncryptionProtectorToKeyVault() { console.log(result); } -updateTheEncryptionProtectorToKeyVault().catch(console.error); - /** * This sample demonstrates how to Updates workspace managed sql server's encryption protector. * @@ -49,8 +52,10 @@ updateTheEncryptionProtectorToKeyVault().catch(console.error); * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateServiceManaged.json */ async function updateTheEncryptionProtectorToServiceManaged() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const parameters: EncryptionProtector = { @@ -68,4 +73,9 @@ async function updateTheEncryptionProtectorToServiceManaged() { console.log(result); } -updateTheEncryptionProtectorToServiceManaged().catch(console.error); +async function main() { + updateTheEncryptionProtectorToKeyVault(); + updateTheEncryptionProtectorToServiceManaged(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorGetSample.ts index 21d2b5f22e1c..02f292ef4603 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's encryption protector. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerEncryptionProtector.json */ async function getWorkspaceManagedSqlServerEncryptionProtector() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getWorkspaceManagedSqlServerEncryptionProtector() { console.log(result); } -getWorkspaceManagedSqlServerEncryptionProtector().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerEncryptionProtector(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorListSample.ts index d86baf9b4550..1b443d8a7ccd 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of encryption protectors for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerEncryptionProtectorList.json */ async function getWorkspaceManagedSqlServerEncryptionProtectors() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getWorkspaceManagedSqlServerEncryptionProtectors() { console.log(resArray); } -getWorkspaceManagedSqlServerEncryptionProtectors().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerEncryptionProtectors(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts index d9eab0e8f19c..824cc12e010a 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerEncryptionProtectorRevalidateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Revalidates workspace managed sql server's existing encryption protector. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerEncryptionProtectorRevalidate.json */ async function revalidatesTheEncryptionProtector() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const encryptionProtectorName = "current"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function revalidatesTheEncryptionProtector() { console.log(result); } -revalidatesTheEncryptionProtector().catch(console.error); +async function main() { + revalidatesTheEncryptionProtector(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts index 6532123e6b35..67b17eeafca9 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's extended blob auditing policy. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerExtendedBlobAuditingSettingsWithAllParameters.json */ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ExtendedServerBlobAuditingPolicy = { @@ -52,10 +57,6 @@ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicy console.log(result); } -createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's extended blob auditing policy. * @@ -63,8 +64,10 @@ createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParame * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateWorkspaceManagedSqlServerExetendedBlobAuditingSettingsWithMinParameters.json */ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const parameters: ExtendedServerBlobAuditingPolicy = { @@ -84,6 +87,9 @@ async function createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicy console.log(result); } -createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters().catch( - console.error -); +async function main() { + createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithAllParameters(); + createOrUpdateWorkspaceManagedSqlServerExtendedBlobAuditingPolicyOfWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts index c6aa7d85c1f7..1e8b6efefb23 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workspace SQL server's extended blob auditing policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlExtendedServerBlobAuditingSettings.json */ async function getWorkspaceManagedSqlServersExtendedBlobAuditingSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const blobAuditingPolicyName = "default"; const credential = new DefaultAzureCredential(); @@ -32,6 +37,8 @@ async function getWorkspaceManagedSqlServersExtendedBlobAuditingSettings() { console.log(result); } -getWorkspaceManagedSqlServersExtendedBlobAuditingSettings().catch( - console.error -); +async function main() { + getWorkspaceManagedSqlServersExtendedBlobAuditingSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts index ef78998b189f..a29c3bda0aaa 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List workspace managed sql server's extended blob auditing policies. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerExtendedBlobAuditingSettings.json */ async function getWorkspaceManagedSqlServerExtendedBlobAuditingSettings() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getWorkspaceManagedSqlServerExtendedBlobAuditingSettings() { console.log(resArray); } -getWorkspaceManagedSqlServerExtendedBlobAuditingSettings().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerExtendedBlobAuditingSettings(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts index 460ccc9b4689..6fe4522f7204 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get recoverable sql pools for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerRecoverableSqlPool.json */ async function getRecoverableSqlPoolsForTheServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const sqlPoolName = "recoverableSqlpools-1235"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getRecoverableSqlPoolsForTheServer() { console.log(result); } -getRecoverableSqlPoolsForTheServer().catch(console.error); +async function main() { + getRecoverableSqlPoolsForTheServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts index e44f6830d8cd..65f40e25493f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerRecoverableSqlPoolsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of recoverable sql pools for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerRecoverableSqlPool.json */ async function listRecoverableSqlPoolsForTheServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function listRecoverableSqlPoolsForTheServer() { console.log(resArray); } -listRecoverableSqlPoolsForTheServer().catch(console.error); +async function main() { + listRecoverableSqlPoolsForTheServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts index c5c134a01b52..8ccbf2b3cc7d 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update a workspace managed sql server's threat detection policy. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerSecurityAlertWithAllParameters.json */ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const parameters: ServerSecurityAlertPolicy = { @@ -46,10 +51,6 @@ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParam console.log(result); } -updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update a workspace managed sql server's threat detection policy. * @@ -57,8 +58,10 @@ updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters().catch( * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/WorkspaceManagedSqlServerSecurityAlertCreateWithMinParameters.json */ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const parameters: ServerSecurityAlertPolicy = { @@ -79,6 +82,9 @@ async function updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalP console.log(result); } -updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters().catch( - console.error -); +async function main() { + updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithAllParameters(); + updateAWorkspaceManagedSqlServerThreatDetectionPolicyWithMinimalParameters(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts index 874e11f6f51f..3bbac0337557 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a workspace managed sql server's security alert policy. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerSecurityAlertPolicy.json */ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const securityAlertPolicyName = "Default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { console.log(result); } -getWorkspaceManagedSqlServerSecurityAlertPolicy().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerSecurityAlertPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts index 9a60229583d0..c07a3aab2ac2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerSecurityAlertPolicyListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's threat detection policies. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerSecurityAlertPolicies.json */ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function getWorkspaceManagedSqlServerSecurityAlertPolicy() { console.log(resArray); } -getWorkspaceManagedSqlServerSecurityAlertPolicy().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerSecurityAlertPolicy(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerUsagesListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerUsagesListSample.ts index 24027d35dd7f..59e128b218f6 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerUsagesListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerUsagesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get list of server usages metric for workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerUsages.json */ async function listUsagesMetricForTheWorkspaceManagedSqlServer() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,4 +38,8 @@ async function listUsagesMetricForTheWorkspaceManagedSqlServer() { console.log(resArray); } -listUsagesMetricForTheWorkspaceManagedSqlServer().catch(console.error); +async function main() { + listUsagesMetricForTheWorkspaceManagedSqlServer(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts index 3ab42e6f33d7..1ebe9576053e 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. @@ -21,8 +24,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters: ServerVulnerabilityAssessment = { @@ -49,10 +54,6 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters().catch( - console.error -); - /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. * @@ -60,8 +61,10 @@ createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceMangedSqlServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters: ServerVulnerabilityAssessment = { @@ -81,10 +84,6 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified().catch( - console.error -); - /** * This sample demonstrates how to Create or Update workspace managed sql server's vulnerability assessment. * @@ -92,8 +91,10 @@ createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParame * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/PutWorkspaceMangedSqlServerVulnerabilityAssessmentCreateContainerSasKeyMin.json */ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const parameters: ServerVulnerabilityAssessment = { @@ -113,6 +114,10 @@ async function createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWi console.log(result); } -createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified().catch( - console.error -); +async function main() { + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithAllParameters(); + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified(); + createOrUpdateAWorkspaceManagedSqlServerVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts index 82343123db26..40a782b105f2 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Remove workspace managed sql server's vulnerability assessment. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceManagedSqlServerVulnerabilityAssessment.json */ async function removeWorkspaceManagedSqlServerVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function removeWorkspaceManagedSqlServerVulnerabilityAssessment() { console.log(result); } -removeWorkspaceManagedSqlServerVulnerabilityAssessment().catch(console.error); +async function main() { + removeWorkspaceManagedSqlServerVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts index 055defecc219..c75fe3e3795c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get workspace managed sql server's vulnerability assessment. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceManagedSqlServerVulnerabilityAssessment.json */ async function getWorkspaceManagedSqlServerVulnerabilityAssessment() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const vulnerabilityAssessmentName = "default"; const credential = new DefaultAzureCredential(); @@ -32,4 +37,8 @@ async function getWorkspaceManagedSqlServerVulnerabilityAssessment() { console.log(result); } -getWorkspaceManagedSqlServerVulnerabilityAssessment().catch(console.error); +async function main() { + getWorkspaceManagedSqlServerVulnerabilityAssessment(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts index d1527110dbee..7ca85110d579 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceManagedSqlServerVulnerabilityAssessmentsListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the vulnerability assessment policies associated with a workspace managed sql server. @@ -18,8 +21,10 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies.json */ async function getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "wsg-7398"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = process.env["SYNAPSE_RESOURCE_GROUP"] || "wsg-7398"; const workspaceName = "testWorkspace"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -33,6 +38,8 @@ async function getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies() { console.log(resArray); } -getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies().catch( - console.error -); +async function main() { + getWorkspaceManagedSqlServerVulnerabilityAssessmentPolicies(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsCreateOrUpdateSample.ts index ea6cad8fca78..39072a162ff3 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsCreateOrUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace SQL active directory admin @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspaceAadAdmin.json */ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const aadAdminInfo: WorkspaceAadAdminInfo = { administratorType: "ActiveDirectory", @@ -40,4 +46,8 @@ async function createOrUpdateWorkspaceActiveDirectoryAdmin() { console.log(result); } -createOrUpdateWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + createOrUpdateWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsDeleteSample.ts index 7c3d3defb27b..333cfa7f8841 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace SQL active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspaceAadAdmin.json */ async function deleteWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteWorkspaceActiveDirectoryAdmin() { console.log(result); } -deleteWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + deleteWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsGetSample.ts index 29a8187d5be5..91a88f7b0165 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspaceSqlAadAdminsGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace SQL active directory admin @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspaceAadAdmin.json */ async function getWorkspaceActiveDirectoryAdmin() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getWorkspaceActiveDirectoryAdmin() { console.log(result); } -getWorkspaceActiveDirectoryAdmin().catch(console.error); +async function main() { + getWorkspaceActiveDirectoryAdmin(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesCreateOrUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesCreateOrUpdateSample.ts index f8eccb1a35fa..aae2e02c8b7b 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesCreateOrUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesCreateOrUpdateSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { Workspace, SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateWorkspace.json */ async function createOrUpdateAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const workspaceInfo: Workspace = { cspWorkspaceAdminProperties: { @@ -84,4 +90,8 @@ async function createOrUpdateAWorkspace() { console.log(result); } -createOrUpdateAWorkspace().catch(console.error); +async function main() { + createOrUpdateAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesDeleteSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesDeleteSample.ts index f98ba939f221..b5353d17b90c 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesDeleteSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesDeleteSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/DeleteWorkspace.json */ async function deleteAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteAWorkspace() { console.log(result); } -deleteAWorkspace().catch(console.error); +async function main() { + deleteAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesGetSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesGetSample.ts index 5c05cf76292e..0dbf4a1ce5bd 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesGetSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesGetSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a workspace @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/GetWorkspace.json */ async function getAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); @@ -27,4 +33,8 @@ async function getAWorkspace() { console.log(result); } -getAWorkspace().catch(console.error); +async function main() { + getAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListByResourceGroupSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListByResourceGroupSample.ts index 77719faf9548..30e50e4dd24f 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListByResourceGroupSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListByResourceGroupSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of workspaces in a resource group @@ -18,8 +21,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspacesInResourceGroup.json */ async function listWorkspacesInResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -31,4 +37,8 @@ async function listWorkspacesInResourceGroup() { console.log(resArray); } -listWorkspacesInResourceGroup().catch(console.error); +async function main() { + listWorkspacesInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListSample.ts index 40e7d9fc392e..5a25acf2e394 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesListSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Returns a list of workspaces in a subscription @@ -18,7 +21,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListWorkspacesInSubscription.json */ async function listWorkspacesInSubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; const credential = new DefaultAzureCredential(); const client = new SynapseManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function listWorkspacesInSubscription() { console.log(resArray); } -listWorkspacesInSubscription().catch(console.error); +async function main() { + listWorkspacesInSubscription(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesUpdateSample.ts b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesUpdateSample.ts index 4aa5401a5ab9..da5b99ca7a91 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesUpdateSample.ts +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/src/workspacesUpdateSample.ts @@ -13,6 +13,9 @@ import { SynapseManagementClient } from "@azure/arm-synapse"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a workspace @@ -21,8 +24,11 @@ import { DefaultAzureCredential } from "@azure/identity"; * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/UpdateWorkspace.json */ async function updateAWorkspace() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "resourceGroup1"; + const subscriptionId = + process.env["SYNAPSE_SUBSCRIPTION_ID"] || + "00000000-1111-2222-3333-444444444444"; + const resourceGroupName = + process.env["SYNAPSE_RESOURCE_GROUP"] || "resourceGroup1"; const workspaceName = "workspace1"; const workspacePatchInfo: WorkspacePatchInfo = { encryption: { @@ -66,4 +72,8 @@ async function updateAWorkspace() { console.log(result); } -updateAWorkspace().catch(console.error); +async function main() { + updateAWorkspace(); +} + +main().catch(console.error); diff --git a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/tsconfig.json b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/tsconfig.json index 416c2dd82e00..e26ce2a6d8f7 100644 --- a/sdk/synapse/arm-synapse/samples/v8-beta/typescript/tsconfig.json +++ b/sdk/synapse/arm-synapse/samples/v8-beta/typescript/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2018", + "target": "ES2020", "module": "commonjs", "moduleResolution": "node", "resolveJsonModule": true, diff --git a/sdk/synapse/arm-synapse/src/index.ts b/sdk/synapse/arm-synapse/src/index.ts index 1a6a8fc0465c..7a8324dc3aa1 100644 --- a/sdk/synapse/arm-synapse/src/index.ts +++ b/sdk/synapse/arm-synapse/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { SynapseManagementClient } from "./synapseManagementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/synapse/arm-synapse/src/models/index.ts b/sdk/synapse/arm-synapse/src/models/index.ts index 56d8da245015..f9e701426ce9 100644 --- a/sdk/synapse/arm-synapse/src/models/index.ts +++ b/sdk/synapse/arm-synapse/src/models/index.ts @@ -1606,7 +1606,7 @@ export interface Operation { display?: OperationDisplay; /** The intended executor of the operation. */ origin?: string; - /** Any object */ + /** Properties of the operation. */ properties?: Record; } @@ -2303,27 +2303,27 @@ export interface DatabaseStatistics { } /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource {} /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ location: string; -}; +} /** The resource model definition for an Azure Resource Manager resource with an etag. */ -export type AzureEntityResource = Resource & { +export interface AzureEntityResource extends Resource { /** * Resource Etag. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly etag?: string; -}; +} /** Class representing an update to a Kusto kusto pool. */ -export type KustoPoolUpdate = Resource & { +export interface KustoPoolUpdate extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The SKU of the kusto pool. */ @@ -2366,15 +2366,16 @@ export type KustoPoolUpdate = Resource & { readonly languageExtensions?: LanguageExtensionsList; /** The workspace unique identifier. */ workspaceUID?: string; -}; +} -export type PrivateEndpointConnectionForPrivateLinkHub = PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated & { +export interface PrivateEndpointConnectionForPrivateLinkHub + extends PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated { name?: string; type?: string; -}; +} /** Managed integration runtime, including managed elastic and managed dedicated integration runtimes. */ -export type ManagedIntegrationRuntime = IntegrationRuntime & { +export interface ManagedIntegrationRuntime extends IntegrationRuntime { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Managed"; /** @@ -2392,24 +2393,24 @@ export type ManagedIntegrationRuntime = IntegrationRuntime & { computeProperties?: IntegrationRuntimeComputeProperties; /** SSIS properties for managed integration runtime. */ ssisProperties?: IntegrationRuntimeSsisProperties; -}; +} /** Self-hosted integration runtime. */ -export type SelfHostedIntegrationRuntime = IntegrationRuntime & { +export interface SelfHostedIntegrationRuntime extends IntegrationRuntime { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "SelfHosted"; /** Linked integration runtime type from data factory */ linkedInfo?: LinkedIntegrationRuntimeTypeUnion; -}; +} /** Ssis folder. */ -export type SsisFolder = SsisObjectMetadata & { +export interface SsisFolder extends SsisObjectMetadata { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Folder"; -}; +} /** Ssis project. */ -export type SsisProject = SsisObjectMetadata & { +export interface SsisProject extends SsisObjectMetadata { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Project"; /** Folder id which contains project. */ @@ -2420,10 +2421,10 @@ export type SsisProject = SsisObjectMetadata & { environmentRefs?: SsisEnvironmentReference[]; /** Parameters in project */ parameters?: SsisParameter[]; -}; +} /** Ssis Package. */ -export type SsisPackage = SsisObjectMetadata & { +export interface SsisPackage extends SsisObjectMetadata { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Package"; /** Folder id which contains package. */ @@ -2434,20 +2435,21 @@ export type SsisPackage = SsisObjectMetadata & { projectId?: number; /** Parameters in package */ parameters?: SsisParameter[]; -}; +} /** Ssis environment. */ -export type SsisEnvironment = SsisObjectMetadata & { +export interface SsisEnvironment extends SsisObjectMetadata { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Environment"; /** Folder id which contains environment. */ folderId?: number; /** Variable in environment */ variables?: SsisVariable[]; -}; +} /** Managed integration runtime status. */ -export type ManagedIntegrationRuntimeStatus = IntegrationRuntimeStatus & { +export interface ManagedIntegrationRuntimeStatus + extends IntegrationRuntimeStatus { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Managed"; /** @@ -2470,10 +2472,11 @@ export type ManagedIntegrationRuntimeStatus = IntegrationRuntimeStatus & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastOperation?: ManagedIntegrationRuntimeOperationResult; -}; +} /** Self-hosted integration runtime status. */ -export type SelfHostedIntegrationRuntimeStatus = IntegrationRuntimeStatus & { +export interface SelfHostedIntegrationRuntimeStatus + extends IntegrationRuntimeStatus { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "SelfHosted"; /** @@ -2559,18 +2562,18 @@ export type SelfHostedIntegrationRuntimeStatus = IntegrationRuntimeStatus & { serviceRegion?: string; /** The newer versions on download center. */ newerVersions?: string[]; -}; +} /** Azure Synapse secure string definition. The string value will be masked with asterisks '*' during Get or List API calls. */ -export type SecureString = SecretBase & { +export interface SecureString extends SecretBase { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "SecureString"; /** Value of secure string. */ value: string; -}; +} /** The custom setup of running cmdkey commands. */ -export type CmdkeySetup = CustomSetupBase & { +export interface CmdkeySetup extends CustomSetupBase { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "CmdkeySetup"; /** The server name of data source access. */ @@ -2579,46 +2582,48 @@ export type CmdkeySetup = CustomSetupBase & { userName: Record; /** The password of data source access. */ password: SecretBaseUnion; -}; +} /** The custom setup of setting environment variable. */ -export type EnvironmentVariableSetup = CustomSetupBase & { +export interface EnvironmentVariableSetup extends CustomSetupBase { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "EnvironmentVariableSetup"; /** The name of the environment variable. */ variableName: string; /** The value of the environment variable. */ variableValue: string; -}; +} /** The custom setup of installing 3rd party components. */ -export type ComponentSetup = CustomSetupBase & { +export interface ComponentSetup extends CustomSetupBase { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "ComponentSetup"; /** The name of the 3rd party component. */ componentName: string; /** The license key to activate the component. */ licenseKey?: SecretBaseUnion; -}; +} /** The key authorization type integration runtime. */ -export type LinkedIntegrationRuntimeKeyAuthorization = LinkedIntegrationRuntimeType & { +export interface LinkedIntegrationRuntimeKeyAuthorization + extends LinkedIntegrationRuntimeType { /** Polymorphic discriminator, which specifies the different types this object can be */ authorizationType: "Key"; /** The key used for authorization. */ key: SecureString; -}; +} /** The role based access control (RBAC) authorization type integration runtime. */ -export type LinkedIntegrationRuntimeRbacAuthorization = LinkedIntegrationRuntimeType & { +export interface LinkedIntegrationRuntimeRbacAuthorization + extends LinkedIntegrationRuntimeType { /** Polymorphic discriminator, which specifies the different types this object can be */ authorizationType: "RBAC"; /** The resource identifier of the integration runtime to be shared. */ resourceId: string; -}; +} /** Azure Active Directory Only Authentication Info */ -export type AzureADOnlyAuthentication = ProxyResource & { +export interface AzureADOnlyAuthentication extends ProxyResource { /** Azure Active Directory only Authentication enabled. */ azureADOnlyAuthentication?: boolean; /** @@ -2631,10 +2636,10 @@ export type AzureADOnlyAuthentication = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationDate?: Date; -}; +} /** IP firewall rule */ -export type IpFirewallRuleInfo = ProxyResource & { +export interface IpFirewallRuleInfo extends ProxyResource { /** The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress */ endIpAddress?: string; /** @@ -2644,18 +2649,18 @@ export type IpFirewallRuleInfo = ProxyResource & { readonly provisioningState?: ProvisioningState; /** The start IP address of the firewall rule. Must be IPv4 format */ startIpAddress?: string; -}; +} /** A workspace key */ -export type Key = ProxyResource & { +export interface Key extends ProxyResource { /** Used to activate the workspace after a customer managed key is provided. */ isActiveCMK?: boolean; /** The Key Vault Url of the workspace key. */ keyVaultUrl?: string; -}; +} /** A private endpoint connection */ -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { /** The private endpoint which the connection belongs to. */ privateEndpoint?: PrivateEndpoint; /** Connection state of the private endpoint connection. */ @@ -2665,27 +2670,27 @@ export type PrivateEndpointConnection = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; -}; +} /** A private link resource */ -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { /** * The private link resource properties. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly properties?: PrivateLinkResourceProperties; -}; +} /** Configuration for metadata sync */ -export type MetadataSyncConfig = ProxyResource & { +export interface MetadataSyncConfig extends ProxyResource { /** Indicates whether the metadata sync is enabled or disabled */ enabled?: boolean; /** The Sync Interval in minutes. */ syncIntervalInMinutes?: number; -}; +} /** A database geo backup policy. */ -export type GeoBackupPolicy = ProxyResource & { +export interface GeoBackupPolicy extends ProxyResource { /** * Kind of geo backup policy. This is metadata used for the Azure portal experience. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2703,19 +2708,19 @@ export type GeoBackupPolicy = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly storageType?: string; -}; +} /** User activities of a data warehouse */ -export type DataWarehouseUserActivities = ProxyResource & { +export interface DataWarehouseUserActivities extends ProxyResource { /** * Count of running and suspended queries. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly activeQueriesCount?: number; -}; +} /** Database restore points. */ -export type RestorePoint = ProxyResource & { +export interface RestorePoint extends ProxyResource { /** * Resource location. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2741,10 +2746,10 @@ export type RestorePoint = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly restorePointLabel?: string; -}; +} /** Represents a Sql pool replication link. */ -export type ReplicationLink = ProxyResource & { +export interface ReplicationLink extends ProxyResource { /** * Location of the workspace that contains this firewall rule. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2800,15 +2805,15 @@ export type ReplicationLink = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly replicationState?: ReplicationState; -}; +} /** Maintenance windows. */ -export type MaintenanceWindows = ProxyResource & { +export interface MaintenanceWindows extends ProxyResource { timeRanges?: MaintenanceWindowTimeRange[]; -}; +} /** Maintenance window options. */ -export type MaintenanceWindowOptions = ProxyResource & { +export interface MaintenanceWindowOptions extends ProxyResource { /** Whether maintenance windows are enabled for the database. */ isEnabled?: boolean; /** Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, 24*60}. */ @@ -2823,10 +2828,10 @@ export type MaintenanceWindowOptions = ProxyResource & { timeGranularityInMinutes?: number; /** Whether we allow multiple maintenance windows per cycle. */ allowMultipleMaintenanceWindowsPerCycle?: boolean; -}; +} /** Represents a Sql pool transparent data encryption configuration. */ -export type TransparentDataEncryption = ProxyResource & { +export interface TransparentDataEncryption extends ProxyResource { /** * Resource location. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2834,10 +2839,10 @@ export type TransparentDataEncryption = ProxyResource & { readonly location?: string; /** The status of the database transparent data encryption. */ status?: TransparentDataEncryptionStatus; -}; +} /** A Sql pool blob auditing policy. */ -export type SqlPoolBlobAuditingPolicy = ProxyResource & { +export interface SqlPoolBlobAuditingPolicy extends ProxyResource { /** * Resource kind. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2930,10 +2935,10 @@ export type SqlPoolBlobAuditingPolicy = ProxyResource & { * */ isAzureMonitorTargetEnabled?: boolean; -}; +} /** A Sql pool operation. */ -export type SqlPoolOperation = ProxyResource & { +export interface SqlPoolOperation extends ProxyResource { /** * The name of the Sql pool the operation is being performed on. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3004,10 +3009,10 @@ export type SqlPoolOperation = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isCancellable?: boolean; -}; +} /** A sensitivity label. */ -export type SensitivityLabel = ProxyResource & { +export interface SensitivityLabel extends ProxyResource { /** * managed by * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3042,10 +3047,10 @@ export type SensitivityLabel = ProxyResource & { */ readonly isDisabled?: boolean; rank?: SensitivityLabelRank; -}; +} /** A sensitivity label update operation. */ -export type SensitivityLabelUpdate = ProxyResource & { +export interface SensitivityLabelUpdate extends ProxyResource { op?: SensitivityLabelUpdateKind; /** Schema name of the column to update. */ schema?: string; @@ -3055,10 +3060,10 @@ export type SensitivityLabelUpdate = ProxyResource & { column?: string; /** The sensitivity label information to apply on a column. */ sensitivityLabel?: SensitivityLabel; -}; +} /** A recommended sensitivity label update operation. */ -export type RecommendedSensitivityLabelUpdate = ProxyResource & { +export interface RecommendedSensitivityLabelUpdate extends ProxyResource { op?: RecommendedSensitivityLabelUpdateKind; /** Schema name of the column to update. */ schema?: string; @@ -3066,16 +3071,16 @@ export type RecommendedSensitivityLabelUpdate = ProxyResource & { table?: string; /** Column name to update. */ column?: string; -}; +} /** A Sql pool schema resource. */ -export type SqlPoolSchema = ProxyResource & {}; +export interface SqlPoolSchema extends ProxyResource {} /** A Sql pool table resource. */ -export type SqlPoolTable = ProxyResource & {}; +export interface SqlPoolTable extends ProxyResource {} /** A Sql pool column resource. */ -export type SqlPoolColumn = ProxyResource & { +export interface SqlPoolColumn extends ProxyResource { /** The column data type. */ columnType?: ColumnDataType; /** @@ -3083,10 +3088,10 @@ export type SqlPoolColumn = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isComputed?: boolean; -}; +} /** A Sql pool connection policy. */ -export type SqlPoolConnectionPolicy = ProxyResource & { +export interface SqlPoolConnectionPolicy extends ProxyResource { /** * Resource kind. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3111,10 +3116,10 @@ export type SqlPoolConnectionPolicy = ProxyResource & { redirectionState?: string; /** The connection policy state. */ state?: string; -}; +} /** A Sql pool vulnerability assessment. */ -export type SqlPoolVulnerabilityAssessment = ProxyResource & { +export interface SqlPoolVulnerabilityAssessment extends ProxyResource { /** A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set */ storageContainerPath?: string; /** A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. */ @@ -3123,10 +3128,10 @@ export type SqlPoolVulnerabilityAssessment = ProxyResource & { storageAccountAccessKey?: string; /** The recurring scans settings */ recurringScans?: VulnerabilityAssessmentRecurringScansProperties; -}; +} /** A vulnerability assessment scan record. */ -export type VulnerabilityAssessmentScanRecord = ProxyResource & { +export interface VulnerabilityAssessmentScanRecord extends ProxyResource { /** * The scan ID. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3167,19 +3172,20 @@ export type VulnerabilityAssessmentScanRecord = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly numberOfFailedSecurityChecks?: number; -}; +} /** A Sql pool Vulnerability Assessment scan export resource. */ -export type SqlPoolVulnerabilityAssessmentScansExport = ProxyResource & { +export interface SqlPoolVulnerabilityAssessmentScansExport + extends ProxyResource { /** * Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly exportedReportLocation?: string; -}; +} /** A Sql pool security alert policy. */ -export type SqlPoolSecurityAlertPolicy = ProxyResource & { +export interface SqlPoolSecurityAlertPolicy extends ProxyResource { /** Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific Sql pool. */ state?: SecurityAlertPolicyState; /** Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action */ @@ -3199,16 +3205,17 @@ export type SqlPoolSecurityAlertPolicy = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationTime?: Date; -}; +} /** A Sql pool vulnerability assessment rule baseline. */ -export type SqlPoolVulnerabilityAssessmentRuleBaseline = ProxyResource & { +export interface SqlPoolVulnerabilityAssessmentRuleBaseline + extends ProxyResource { /** The rule baseline result */ baselineResults?: SqlPoolVulnerabilityAssessmentRuleBaselineItem[]; -}; +} /** An extended Sql pool blob auditing policy. */ -export type ExtendedSqlPoolBlobAuditingPolicy = ProxyResource & { +export interface ExtendedSqlPoolBlobAuditingPolicy extends ProxyResource { /** Specifies condition of where clause when creating an audit. */ predicateExpression?: string; /** Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. */ @@ -3310,9 +3317,9 @@ export type ExtendedSqlPoolBlobAuditingPolicy = ProxyResource & { * The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. */ queueDelayMs?: number; -}; +} -export type DataMaskingPolicy = ProxyResource & { +export interface DataMaskingPolicy extends ProxyResource { /** * The location of the data masking policy. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3342,10 +3349,10 @@ export type DataMaskingPolicy = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly maskingLevel?: string; -}; +} /** Represents a Sql pool data masking rule. */ -export type DataMaskingRule = ProxyResource & { +export interface DataMaskingRule extends ProxyResource { /** * The location of the data masking rule. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3383,10 +3390,10 @@ export type DataMaskingRule = ProxyResource & { suffixSize?: string; /** If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored. */ replacementString?: string; -}; +} /** Workload group operations for a sql pool */ -export type WorkloadGroup = ProxyResource & { +export interface WorkloadGroup extends ProxyResource { /** The workload group minimum percentage resource. */ minResourcePercent?: number; /** The workload group cap percentage resource. */ @@ -3399,10 +3406,10 @@ export type WorkloadGroup = ProxyResource & { importance?: string; /** The workload group query execution timeout. */ queryExecutionTimeout?: number; -}; +} /** Workload classifier operations for a data warehouse */ -export type WorkloadClassifier = ProxyResource & { +export interface WorkloadClassifier extends ProxyResource { /** The workload classifier member name. */ memberName?: string; /** The workload classifier label. */ @@ -3415,10 +3422,10 @@ export type WorkloadClassifier = ProxyResource & { endTime?: string; /** The workload classifier importance. */ importance?: string; -}; +} /** A server blob auditing policy. */ -export type ServerBlobAuditingPolicy = ProxyResource & { +export interface ServerBlobAuditingPolicy extends ProxyResource { /** Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. */ state?: BlobAuditingPolicyState; /** Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. */ @@ -3532,10 +3539,10 @@ export type ServerBlobAuditingPolicy = ProxyResource & { * */ isDevopsAuditEnabled?: boolean; -}; +} /** An extended server blob auditing policy. */ -export type ExtendedServerBlobAuditingPolicy = ProxyResource & { +export interface ExtendedServerBlobAuditingPolicy extends ProxyResource { /** Specifies condition of where clause when creating an audit. */ predicateExpression?: string; /** Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. */ @@ -3651,10 +3658,10 @@ export type ExtendedServerBlobAuditingPolicy = ProxyResource & { * */ isDevopsAuditEnabled?: boolean; -}; +} /** Workspace managed Sql server security alert policy. */ -export type ServerSecurityAlertPolicy = ProxyResource & { +export interface ServerSecurityAlertPolicy extends ProxyResource { /** Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific server */ state?: SecurityAlertPolicyState; /** Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action */ @@ -3674,10 +3681,10 @@ export type ServerSecurityAlertPolicy = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creationTime?: Date; -}; +} /** A server vulnerability assessment. */ -export type ServerVulnerabilityAssessment = ProxyResource & { +export interface ServerVulnerabilityAssessment extends ProxyResource { /** A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). */ storageContainerPath?: string; /** A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. */ @@ -3686,10 +3693,10 @@ export type ServerVulnerabilityAssessment = ProxyResource & { storageAccountAccessKey?: string; /** The recurring scans settings */ recurringScans?: VulnerabilityAssessmentRecurringScansProperties; -}; +} /** The server encryption protector. */ -export type EncryptionProtector = ProxyResource & { +export interface EncryptionProtector extends ProxyResource { /** * Kind of encryption protector. This is metadata used for the Azure portal experience. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3719,10 +3726,10 @@ export type EncryptionProtector = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly thumbprint?: string; -}; +} /** A recoverable sql pool */ -export type RecoverableSqlPool = ProxyResource & { +export interface RecoverableSqlPool extends ProxyResource { /** * The edition of the database * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3743,10 +3750,10 @@ export type RecoverableSqlPool = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastAvailableBackupDate?: Date; -}; +} /** Dedicated Sql Minimal Tls Settings Info */ -export type DedicatedSQLminimalTlsSettings = ProxyResource & { +export interface DedicatedSQLminimalTlsSettings extends ProxyResource { /** * Resource location. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3754,10 +3761,10 @@ export type DedicatedSQLminimalTlsSettings = ProxyResource & { readonly location?: string; /** The minimal tls version of the sql server. */ minimalTlsVersion?: string; -}; +} /** Workspace active directory administrator */ -export type WorkspaceAadAdminInfo = ProxyResource & { +export interface WorkspaceAadAdminInfo extends ProxyResource { /** Tenant ID of the workspace active directory administrator */ tenantId?: string; /** Login of the workspace active directory administrator */ @@ -3766,16 +3773,16 @@ export type WorkspaceAadAdminInfo = ProxyResource & { administratorType?: string; /** Object ID of the workspace active directory administrator */ sid?: string; -}; +} /** Sql Control Settings for workspace managed identity */ -export type ManagedIdentitySqlControlSettingsModel = ProxyResource & { +export interface ManagedIdentitySqlControlSettingsModel extends ProxyResource { /** Grant sql control to managed identity */ grantSqlControlToManagedIdentity?: ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity; -}; +} /** A restorable dropped Sql pool */ -export type RestorableDroppedSqlPool = ProxyResource & { +export interface RestorableDroppedSqlPool extends ProxyResource { /** * The geo-location where the resource lives * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3821,10 +3828,10 @@ export type RestorableDroppedSqlPool = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly earliestRestoreDate?: Date; -}; +} /** Class representing an attached database configuration. */ -export type AttachedDatabaseConfiguration = ProxyResource & { +export interface AttachedDatabaseConfiguration extends ProxyResource { /** Resource location. */ location?: string; /** @@ -3850,10 +3857,10 @@ export type AttachedDatabaseConfiguration = ProxyResource & { defaultPrincipalsModificationKind?: DefaultPrincipalsModificationKind; /** Table level sharing specifications */ tableLevelSharingProperties?: TableLevelSharingProperties; -}; +} /** Class representing a Kusto database. */ -export type Database = ProxyResource & { +export interface Database extends ProxyResource { /** Resource location. */ location?: string; /** Kind of the database */ @@ -3863,10 +3870,10 @@ export type Database = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; -}; +} /** Class representing a data connection. */ -export type DataConnection = ProxyResource & { +export interface DataConnection extends ProxyResource { /** Resource location. */ location?: string; /** Kind of the endpoint for the data connection */ @@ -3876,10 +3883,10 @@ export type DataConnection = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; -}; +} /** Class representing a cluster principal assignment. */ -export type ClusterPrincipalAssignment = ProxyResource & { +export interface ClusterPrincipalAssignment extends ProxyResource { /** * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3908,10 +3915,10 @@ export type ClusterPrincipalAssignment = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ResourceProvisioningState; -}; +} /** Class representing a database principal assignment. */ -export type DatabasePrincipalAssignment = ProxyResource & { +export interface DatabasePrincipalAssignment extends ProxyResource { /** * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3940,10 +3947,10 @@ export type DatabasePrincipalAssignment = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ResourceProvisioningState; -}; +} /** A privateLinkHub */ -export type PrivateLinkHub = TrackedResource & { +export interface PrivateLinkHub extends TrackedResource { /** PrivateLinkHub provisioning state */ provisioningState?: string; /** @@ -3951,10 +3958,10 @@ export type PrivateLinkHub = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateEndpointConnections?: PrivateEndpointConnectionForPrivateLinkHubBasic[]; -}; +} /** A SQL Analytics pool */ -export type SqlPool = TrackedResource & { +export interface SqlPool extends TrackedResource { /** SQL pool SKU */ sku?: Sku; /** Maximum size in bytes */ @@ -3995,10 +4002,10 @@ export type SqlPool = TrackedResource & { storageAccountType?: StorageAccountType; /** Specifies the time that the sql pool was deleted */ sourceDatabaseDeletionDate?: Date; -}; +} /** A workspace */ -export type Workspace = TrackedResource & { +export interface Workspace extends TrackedResource { /** Identity of the workspace */ identity?: ManagedIdentity; /** Workspace default data lake storage account details */ @@ -4060,10 +4067,10 @@ export type Workspace = TrackedResource & { azureADOnlyAuthentication?: boolean; /** Is trustedServiceBypassEnabled for the workspace */ trustedServiceBypassEnabled?: boolean; -}; +} /** A Big Data pool */ -export type BigDataPoolResourceInfo = TrackedResource & { +export interface BigDataPoolResourceInfo extends TrackedResource { /** The state of the Big Data pool. */ provisioningState?: string; /** Auto-scaling properties */ @@ -4106,10 +4113,10 @@ export type BigDataPoolResourceInfo = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastSucceededTimestamp?: Date; -}; +} /** Class representing a Kusto kusto pool. */ -export type KustoPool = TrackedResource & { +export interface KustoPool extends TrackedResource { /** The SKU of the kusto pool. */ sku: AzureSku; /** @@ -4160,13 +4167,15 @@ export type KustoPool = TrackedResource & { readonly languageExtensions?: LanguageExtensionsList; /** The workspace unique identifier. */ workspaceUID?: string; -}; +} /** Azure Synapse nested resource, which belongs to a workspace. */ -export type SubResource = AzureEntityResource & {}; +export interface SubResource extends AzureEntityResource {} /** Class representing a read write database. */ -export type ReadWriteDatabase = Database & { +export interface ReadWriteDatabase extends Database { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "ReadWrite"; /** * The provisioned state of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -4186,10 +4195,12 @@ export type ReadWriteDatabase = Database & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isFollowed?: boolean; -}; +} /** Class representing a read only following database. */ -export type ReadOnlyFollowingDatabase = Database & { +export interface ReadOnlyFollowingDatabase extends Database { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "ReadOnlyFollowing"; /** * The provisioned state of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -4222,10 +4233,12 @@ export type ReadOnlyFollowingDatabase = Database & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly principalsModificationKind?: PrincipalsModificationKind; -}; +} /** Class representing an event hub data connection. */ -export type EventHubDataConnection = DataConnection & { +export interface EventHubDataConnection extends DataConnection { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "EventHub"; /** The resource ID of the event hub to be used to create a data connection. */ eventHubResourceId?: string; /** The event hub consumer group. */ @@ -4247,10 +4260,12 @@ export type EventHubDataConnection = DataConnection & { readonly provisioningState?: ResourceProvisioningState; /** The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub. */ managedIdentityResourceId?: string; -}; +} /** Class representing an iot hub data connection. */ -export type IotHubDataConnection = DataConnection & { +export interface IotHubDataConnection extends DataConnection { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "IotHub"; /** The resource ID of the Iot hub to be used to create a data connection. */ iotHubResourceId?: string; /** The iot hub consumer group. */ @@ -4270,10 +4285,12 @@ export type IotHubDataConnection = DataConnection & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ResourceProvisioningState; -}; +} /** Class representing an Event Grid data connection. */ -export type EventGridDataConnection = DataConnection & { +export interface EventGridDataConnection extends DataConnection { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "EventGrid"; /** The resource ID of the storage account where the data resides. */ storageAccountResourceId?: string; /** The resource ID where the event grid is configured to send events. */ @@ -4295,10 +4312,10 @@ export type EventGridDataConnection = DataConnection & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ResourceProvisioningState; -}; +} /** Library response details */ -export type LibraryResource = SubResource & { +export interface LibraryResource extends SubResource { /** Name of the library. */ namePropertiesName?: string; /** Storage blob path of library. */ @@ -4319,16 +4336,16 @@ export type LibraryResource = SubResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly creatorId?: string; -}; +} /** Integration runtime resource type. */ -export type IntegrationRuntimeResource = SubResource & { +export interface IntegrationRuntimeResource extends SubResource { /** Integration runtime properties. */ properties: IntegrationRuntimeUnion; -}; +} /** SparkConfiguration response details */ -export type SparkConfigurationResource = SubResource & { +export interface SparkConfigurationResource extends SubResource { /** Description about the SparkConfiguration. */ description?: string; /** SparkConfiguration configs. */ @@ -4341,10 +4358,11 @@ export type SparkConfigurationResource = SubResource & { createdBy?: string; /** The timestamp of resource creation. */ created?: Date; -}; +} /** Known values of {@link AzureADOnlyAuthenticationName} that the service accepts. */ export enum KnownAzureADOnlyAuthenticationName { + /** Default */ Default = "default" } @@ -4359,8 +4377,11 @@ export type AzureADOnlyAuthenticationName = string; /** Known values of {@link StateValue} that the service accepts. */ export enum KnownStateValue { + /** Consistent */ Consistent = "Consistent", + /** InConsistent */ InConsistent = "InConsistent", + /** Updating */ Updating = "Updating" } @@ -4377,10 +4398,15 @@ export type StateValue = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { + /** Provisioning */ Provisioning = "Provisioning", + /** Succeeded */ Succeeded = "Succeeded", + /** Deleting */ Deleting = "Deleting", + /** Failed */ Failed = "Failed", + /** DeleteError */ DeleteError = "DeleteError" } @@ -4399,9 +4425,13 @@ export type ProvisioningState = string; /** Known values of {@link OperationStatus} that the service accepts. */ export enum KnownOperationStatus { + /** InProgress */ InProgress = "InProgress", + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Canceled */ Canceled = "Canceled" } @@ -4419,9 +4449,13 @@ export type OperationStatus = string; /** Known values of {@link CreateMode} that the service accepts. */ export enum KnownCreateMode { + /** Default */ Default = "Default", + /** PointInTimeRestore */ PointInTimeRestore = "PointInTimeRestore", + /** Recovery */ Recovery = "Recovery", + /** Restore */ Restore = "Restore" } @@ -4439,7 +4473,9 @@ export type CreateMode = string; /** Known values of {@link StorageAccountType} that the service accepts. */ export enum KnownStorageAccountType { + /** GRS */ GRS = "GRS", + /** LRS */ LRS = "LRS" } @@ -4455,6 +4491,7 @@ export type StorageAccountType = string; /** Known values of {@link GeoBackupPolicyName} that the service accepts. */ export enum KnownGeoBackupPolicyName { + /** Default */ Default = "Default" } @@ -4469,6 +4506,7 @@ export type GeoBackupPolicyName = string; /** Known values of {@link DataWarehouseUserActivityName} that the service accepts. */ export enum KnownDataWarehouseUserActivityName { + /** Current */ Current = "current" } @@ -4483,9 +4521,13 @@ export type DataWarehouseUserActivityName = string; /** Known values of {@link ReplicationState} that the service accepts. */ export enum KnownReplicationState { + /** Pending */ Pending = "PENDING", + /** Seeding */ Seeding = "SEEDING", + /** CatchUP */ CatchUP = "CATCH_UP", + /** Suspended */ Suspended = "SUSPENDED" } @@ -4503,12 +4545,19 @@ export type ReplicationState = string; /** Known values of {@link DayOfWeek} that the service accepts. */ export enum KnownDayOfWeek { + /** Sunday */ Sunday = "Sunday", + /** Monday */ Monday = "Monday", + /** Tuesday */ Tuesday = "Tuesday", + /** Wednesday */ Wednesday = "Wednesday", + /** Thursday */ Thursday = "Thursday", + /** Friday */ Friday = "Friday", + /** Saturday */ Saturday = "Saturday" } @@ -4529,6 +4578,7 @@ export type DayOfWeek = string; /** Known values of {@link TransparentDataEncryptionName} that the service accepts. */ export enum KnownTransparentDataEncryptionName { + /** Current */ Current = "current" } @@ -4543,11 +4593,17 @@ export type TransparentDataEncryptionName = string; /** Known values of {@link ManagementOperationState} that the service accepts. */ export enum KnownManagementOperationState { + /** Pending */ Pending = "Pending", + /** InProgress */ InProgress = "InProgress", + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** CancelInProgress */ CancelInProgress = "CancelInProgress", + /** Cancelled */ Cancelled = "Cancelled" } @@ -4567,39 +4623,73 @@ export type ManagementOperationState = string; /** Known values of {@link ColumnDataType} that the service accepts. */ export enum KnownColumnDataType { + /** Image */ Image = "image", + /** Text */ Text = "text", + /** Uniqueidentifier */ Uniqueidentifier = "uniqueidentifier", + /** Date */ Date = "date", + /** Time */ Time = "time", + /** Datetime2 */ Datetime2 = "datetime2", + /** Datetimeoffset */ Datetimeoffset = "datetimeoffset", + /** Tinyint */ Tinyint = "tinyint", + /** Smallint */ Smallint = "smallint", + /** Int */ Int = "int", + /** Smalldatetime */ Smalldatetime = "smalldatetime", + /** Real */ Real = "real", + /** Money */ Money = "money", + /** Datetime */ Datetime = "datetime", + /** Float */ Float = "float", + /** SqlVariant */ SqlVariant = "sql_variant", + /** Ntext */ Ntext = "ntext", + /** Bit */ Bit = "bit", + /** Decimal */ Decimal = "decimal", + /** Numeric */ Numeric = "numeric", + /** Smallmoney */ Smallmoney = "smallmoney", + /** Bigint */ Bigint = "bigint", + /** Hierarchyid */ Hierarchyid = "hierarchyid", + /** Geometry */ Geometry = "geometry", + /** Geography */ Geography = "geography", + /** Varbinary */ Varbinary = "varbinary", + /** Varchar */ Varchar = "varchar", + /** Binary */ Binary = "binary", + /** Char */ Char = "char", + /** Timestamp */ Timestamp = "timestamp", + /** Nvarchar */ Nvarchar = "nvarchar", + /** Nchar */ Nchar = "nchar", + /** Xml */ Xml = "xml", + /** Sysname */ Sysname = "sysname" } @@ -4647,6 +4737,7 @@ export type ColumnDataType = string; /** Known values of {@link ConnectionPolicyName} that the service accepts. */ export enum KnownConnectionPolicyName { + /** Default */ Default = "default" } @@ -4661,6 +4752,7 @@ export type ConnectionPolicyName = string; /** Known values of {@link VulnerabilityAssessmentName} that the service accepts. */ export enum KnownVulnerabilityAssessmentName { + /** Default */ Default = "default" } @@ -4675,7 +4767,9 @@ export type VulnerabilityAssessmentName = string; /** Known values of {@link VulnerabilityAssessmentScanTriggerType} that the service accepts. */ export enum KnownVulnerabilityAssessmentScanTriggerType { + /** OnDemand */ OnDemand = "OnDemand", + /** Recurring */ Recurring = "Recurring" } @@ -4691,9 +4785,13 @@ export type VulnerabilityAssessmentScanTriggerType = string; /** Known values of {@link VulnerabilityAssessmentScanState} that the service accepts. */ export enum KnownVulnerabilityAssessmentScanState { + /** Passed */ Passed = "Passed", + /** Failed */ Failed = "Failed", + /** FailedToRun */ FailedToRun = "FailedToRun", + /** InProgress */ InProgress = "InProgress" } @@ -4711,6 +4809,7 @@ export type VulnerabilityAssessmentScanState = string; /** Known values of {@link SecurityAlertPolicyName} that the service accepts. */ export enum KnownSecurityAlertPolicyName { + /** Default */ Default = "default" } @@ -4725,6 +4824,7 @@ export type SecurityAlertPolicyName = string; /** Known values of {@link BlobAuditingPolicyName} that the service accepts. */ export enum KnownBlobAuditingPolicyName { + /** Default */ Default = "default" } @@ -4739,6 +4839,7 @@ export type BlobAuditingPolicyName = string; /** Known values of {@link SecurityAlertPolicyNameAutoGenerated} that the service accepts. */ export enum KnownSecurityAlertPolicyNameAutoGenerated { + /** Default */ Default = "Default" } @@ -4753,6 +4854,7 @@ export type SecurityAlertPolicyNameAutoGenerated = string; /** Known values of {@link EncryptionProtectorName} that the service accepts. */ export enum KnownEncryptionProtectorName { + /** Current */ Current = "current" } @@ -4767,7 +4869,9 @@ export type EncryptionProtectorName = string; /** Known values of {@link ServerKeyType} that the service accepts. */ export enum KnownServerKeyType { + /** ServiceManaged */ ServiceManaged = "ServiceManaged", + /** AzureKeyVault */ AzureKeyVault = "AzureKeyVault" } @@ -4783,6 +4887,7 @@ export type ServerKeyType = string; /** Known values of {@link DedicatedSQLMinimalTlsSettingsName} that the service accepts. */ export enum KnownDedicatedSQLMinimalTlsSettingsName { + /** Default */ Default = "default" } @@ -4797,7 +4902,9 @@ export type DedicatedSQLMinimalTlsSettingsName = string; /** Known values of {@link WorkspacePublicNetworkAccess} that the service accepts. */ export enum KnownWorkspacePublicNetworkAccess { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -4813,7 +4920,9 @@ export type WorkspacePublicNetworkAccess = string; /** Known values of {@link ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState} that the service accepts. */ export enum KnownManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -4829,10 +4938,15 @@ export type ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToMan /** Known values of {@link ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState} that the service accepts. */ export enum KnownManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState { + /** Enabling */ Enabling = "Enabling", + /** Enabled */ Enabled = "Enabled", + /** Disabling */ Disabling = "Disabling", + /** Disabled */ Disabled = "Disabled", + /** Unknown */ Unknown = "Unknown" } @@ -4851,7 +4965,9 @@ export type ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToMan /** Known values of {@link ConfigurationType} that the service accepts. */ export enum KnownConfigurationType { + /** File */ File = "File", + /** Artifact */ Artifact = "Artifact" } @@ -4867,12 +4983,19 @@ export type ConfigurationType = string; /** Known values of {@link NodeSize} that the service accepts. */ export enum KnownNodeSize { + /** None */ None = "None", + /** Small */ Small = "Small", + /** Medium */ Medium = "Medium", + /** Large */ Large = "Large", + /** XLarge */ XLarge = "XLarge", + /** XXLarge */ XXLarge = "XXLarge", + /** XXXLarge */ XXXLarge = "XXXLarge" } @@ -4893,9 +5016,13 @@ export type NodeSize = string; /** Known values of {@link NodeSizeFamily} that the service accepts. */ export enum KnownNodeSizeFamily { + /** None */ None = "None", + /** MemoryOptimized */ MemoryOptimized = "MemoryOptimized", + /** HardwareAcceleratedFpga */ HardwareAcceleratedFpga = "HardwareAcceleratedFPGA", + /** HardwareAcceleratedGPU */ HardwareAcceleratedGPU = "HardwareAcceleratedGPU" } @@ -4913,7 +5040,9 @@ export type NodeSizeFamily = string; /** Known values of {@link IntegrationRuntimeAutoUpdate} that the service accepts. */ export enum KnownIntegrationRuntimeAutoUpdate { + /** On */ On = "On", + /** Off */ Off = "Off" } @@ -4929,7 +5058,9 @@ export type IntegrationRuntimeAutoUpdate = string; /** Known values of {@link IntegrationRuntimeType} that the service accepts. */ export enum KnownIntegrationRuntimeType { + /** Managed */ Managed = "Managed", + /** SelfHosted */ SelfHosted = "SelfHosted" } @@ -4945,9 +5076,13 @@ export type IntegrationRuntimeType = string; /** Known values of {@link SsisObjectMetadataType} that the service accepts. */ export enum KnownSsisObjectMetadataType { + /** Folder */ Folder = "Folder", + /** Project */ Project = "Project", + /** Package */ Package = "Package", + /** Environment */ Environment = "Environment" } @@ -4965,12 +5100,19 @@ export type SsisObjectMetadataType = string; /** Known values of {@link SelfHostedIntegrationRuntimeNodeStatus} that the service accepts. */ export enum KnownSelfHostedIntegrationRuntimeNodeStatus { + /** NeedRegistration */ NeedRegistration = "NeedRegistration", + /** Online */ Online = "Online", + /** Limited */ Limited = "Limited", + /** Offline */ Offline = "Offline", + /** Upgrading */ Upgrading = "Upgrading", + /** Initializing */ Initializing = "Initializing", + /** InitializeFailed */ InitializeFailed = "InitializeFailed" } @@ -4991,8 +5133,11 @@ export type SelfHostedIntegrationRuntimeNodeStatus = string; /** Known values of {@link IntegrationRuntimeUpdateResult} that the service accepts. */ export enum KnownIntegrationRuntimeUpdateResult { + /** None */ None = "None", + /** Succeed */ Succeed = "Succeed", + /** Fail */ Fail = "Fail" } @@ -5009,15 +5154,25 @@ export type IntegrationRuntimeUpdateResult = string; /** Known values of {@link IntegrationRuntimeState} that the service accepts. */ export enum KnownIntegrationRuntimeState { + /** Initial */ Initial = "Initial", + /** Stopped */ Stopped = "Stopped", + /** Started */ Started = "Started", + /** Starting */ Starting = "Starting", + /** Stopping */ Stopping = "Stopping", + /** NeedRegistration */ NeedRegistration = "NeedRegistration", + /** Online */ Online = "Online", + /** Limited */ Limited = "Limited", + /** Offline */ Offline = "Offline", + /** AccessDenied */ AccessDenied = "AccessDenied" } @@ -5041,7 +5196,9 @@ export type IntegrationRuntimeState = string; /** Known values of {@link IntegrationRuntimeAuthKeyName} that the service accepts. */ export enum KnownIntegrationRuntimeAuthKeyName { + /** AuthKey1 */ AuthKey1 = "authKey1", + /** AuthKey2 */ AuthKey2 = "authKey2" } @@ -5057,7 +5214,9 @@ export type IntegrationRuntimeAuthKeyName = string; /** Known values of {@link Reason} that the service accepts. */ export enum KnownReason { + /** Invalid */ Invalid = "Invalid", + /** AlreadyExists */ AlreadyExists = "AlreadyExists" } @@ -5073,7 +5232,9 @@ export type Reason = string; /** Known values of {@link SkuName} that the service accepts. */ export enum KnownSkuName { + /** ComputeOptimized */ ComputeOptimized = "Compute optimized", + /** StorageOptimized */ StorageOptimized = "Storage optimized" } @@ -5089,9 +5250,13 @@ export type SkuName = string; /** Known values of {@link SkuSize} that the service accepts. */ export enum KnownSkuSize { + /** ExtraSmall */ ExtraSmall = "Extra small", + /** Small */ Small = "Small", + /** Medium */ Medium = "Medium", + /** Large */ Large = "Large" } @@ -5109,14 +5274,23 @@ export type SkuSize = string; /** Known values of {@link State} that the service accepts. */ export enum KnownState { + /** Creating */ Creating = "Creating", + /** Unavailable */ Unavailable = "Unavailable", + /** Running */ Running = "Running", + /** Deleting */ Deleting = "Deleting", + /** Deleted */ Deleted = "Deleted", + /** Stopping */ Stopping = "Stopping", + /** Stopped */ Stopped = "Stopped", + /** Starting */ Starting = "Starting", + /** Updating */ Updating = "Updating" } @@ -5139,12 +5313,19 @@ export type State = string; /** Known values of {@link ResourceProvisioningState} that the service accepts. */ export enum KnownResourceProvisioningState { + /** Running */ Running = "Running", + /** Creating */ Creating = "Creating", + /** Deleting */ Deleting = "Deleting", + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Moving */ Moving = "Moving", + /** Canceled */ Canceled = "Canceled" } @@ -5165,7 +5346,9 @@ export type ResourceProvisioningState = string; /** Known values of {@link LanguageExtensionName} that the service accepts. */ export enum KnownLanguageExtensionName { + /** Python */ Python = "PYTHON", + /** R */ R = "R" } @@ -5181,9 +5364,13 @@ export type LanguageExtensionName = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -5201,8 +5388,11 @@ export type CreatedByType = string; /** Known values of {@link AzureScaleType} that the service accepts. */ export enum KnownAzureScaleType { + /** Automatic */ Automatic = "automatic", + /** Manual */ Manual = "manual", + /** None */ None = "none" } @@ -5219,8 +5409,11 @@ export type AzureScaleType = string; /** Known values of {@link DefaultPrincipalsModificationKind} that the service accepts. */ export enum KnownDefaultPrincipalsModificationKind { + /** Union */ Union = "Union", + /** Replace */ Replace = "Replace", + /** None */ None = "None" } @@ -5237,7 +5430,9 @@ export type DefaultPrincipalsModificationKind = string; /** Known values of {@link Kind} that the service accepts. */ export enum KnownKind { + /** ReadWrite */ ReadWrite = "ReadWrite", + /** ReadOnlyFollowing */ ReadOnlyFollowing = "ReadOnlyFollowing" } @@ -5253,8 +5448,11 @@ export type Kind = string; /** Known values of {@link DataConnectionKind} that the service accepts. */ export enum KnownDataConnectionKind { + /** EventHub */ EventHub = "EventHub", + /** EventGrid */ EventGrid = "EventGrid", + /** IotHub */ IotHub = "IotHub" } @@ -5271,7 +5469,9 @@ export type DataConnectionKind = string; /** Known values of {@link ClusterPrincipalRole} that the service accepts. */ export enum KnownClusterPrincipalRole { + /** AllDatabasesAdmin */ AllDatabasesAdmin = "AllDatabasesAdmin", + /** AllDatabasesViewer */ AllDatabasesViewer = "AllDatabasesViewer" } @@ -5287,8 +5487,11 @@ export type ClusterPrincipalRole = string; /** Known values of {@link PrincipalType} that the service accepts. */ export enum KnownPrincipalType { + /** App */ App = "App", + /** Group */ Group = "Group", + /** User */ User = "User" } @@ -5305,11 +5508,17 @@ export type PrincipalType = string; /** Known values of {@link DatabasePrincipalRole} that the service accepts. */ export enum KnownDatabasePrincipalRole { + /** Admin */ Admin = "Admin", + /** Ingestor */ Ingestor = "Ingestor", + /** Monitor */ Monitor = "Monitor", + /** User */ User = "User", + /** UnrestrictedViewer */ UnrestrictedViewer = "UnrestrictedViewer", + /** Viewer */ Viewer = "Viewer" } @@ -5329,8 +5538,11 @@ export type DatabasePrincipalRole = string; /** Known values of {@link DataFlowComputeType} that the service accepts. */ export enum KnownDataFlowComputeType { + /** General */ General = "General", + /** MemoryOptimized */ MemoryOptimized = "MemoryOptimized", + /** ComputeOptimized */ ComputeOptimized = "ComputeOptimized" } @@ -5347,9 +5559,13 @@ export type DataFlowComputeType = string; /** Known values of {@link IntegrationRuntimeSsisCatalogPricingTier} that the service accepts. */ export enum KnownIntegrationRuntimeSsisCatalogPricingTier { + /** Basic */ Basic = "Basic", + /** Standard */ Standard = "Standard", + /** Premium */ Premium = "Premium", + /** PremiumRS */ PremiumRS = "PremiumRS" } @@ -5367,7 +5583,9 @@ export type IntegrationRuntimeSsisCatalogPricingTier = string; /** Known values of {@link IntegrationRuntimeLicenseType} that the service accepts. */ export enum KnownIntegrationRuntimeLicenseType { + /** BasePrice */ BasePrice = "BasePrice", + /** LicenseIncluded */ LicenseIncluded = "LicenseIncluded" } @@ -5383,7 +5601,9 @@ export type IntegrationRuntimeLicenseType = string; /** Known values of {@link IntegrationRuntimeEntityReferenceType} that the service accepts. */ export enum KnownIntegrationRuntimeEntityReferenceType { + /** IntegrationRuntimeReference */ IntegrationRuntimeReference = "IntegrationRuntimeReference", + /** LinkedServiceReference */ LinkedServiceReference = "LinkedServiceReference" } @@ -5399,7 +5619,9 @@ export type IntegrationRuntimeEntityReferenceType = string; /** Known values of {@link IntegrationRuntimeEdition} that the service accepts. */ export enum KnownIntegrationRuntimeEdition { + /** Standard */ Standard = "Standard", + /** Enterprise */ Enterprise = "Enterprise" } @@ -5415,9 +5637,13 @@ export type IntegrationRuntimeEdition = string; /** Known values of {@link ManagedIntegrationRuntimeNodeStatus} that the service accepts. */ export enum KnownManagedIntegrationRuntimeNodeStatus { + /** Starting */ Starting = "Starting", + /** Available */ Available = "Available", + /** Recycling */ Recycling = "Recycling", + /** Unavailable */ Unavailable = "Unavailable" } @@ -5435,8 +5661,11 @@ export type ManagedIntegrationRuntimeNodeStatus = string; /** Known values of {@link IntegrationRuntimeInternalChannelEncryptionMode} that the service accepts. */ export enum KnownIntegrationRuntimeInternalChannelEncryptionMode { + /** NotSet */ NotSet = "NotSet", + /** SslEncrypted */ SslEncrypted = "SslEncrypted", + /** NotEncrypted */ NotEncrypted = "NotEncrypted" } @@ -5453,8 +5682,11 @@ export type IntegrationRuntimeInternalChannelEncryptionMode = string; /** Known values of {@link PrincipalsModificationKind} that the service accepts. */ export enum KnownPrincipalsModificationKind { + /** Union */ Union = "Union", + /** Replace */ Replace = "Replace", + /** None */ None = "None" } @@ -5471,21 +5703,37 @@ export type PrincipalsModificationKind = string; /** Known values of {@link EventHubDataFormat} that the service accepts. */ export enum KnownEventHubDataFormat { + /** Multijson */ Multijson = "MULTIJSON", + /** Json */ Json = "JSON", + /** CSV */ CSV = "CSV", + /** TSV */ TSV = "TSV", + /** Scsv */ Scsv = "SCSV", + /** Sohsv */ Sohsv = "SOHSV", + /** PSV */ PSV = "PSV", + /** TXT */ TXT = "TXT", + /** RAW */ RAW = "RAW", + /** Singlejson */ Singlejson = "SINGLEJSON", + /** Avro */ Avro = "AVRO", + /** Tsve */ Tsve = "TSVE", + /** Parquet */ Parquet = "PARQUET", + /** ORC */ ORC = "ORC", + /** Apacheavro */ Apacheavro = "APACHEAVRO", + /** W3Clogfile */ W3Clogfile = "W3CLOGFILE" } @@ -5515,7 +5763,9 @@ export type EventHubDataFormat = string; /** Known values of {@link Compression} that the service accepts. */ export enum KnownCompression { + /** None */ None = "None", + /** GZip */ GZip = "GZip" } @@ -5531,21 +5781,37 @@ export type Compression = string; /** Known values of {@link IotHubDataFormat} that the service accepts. */ export enum KnownIotHubDataFormat { + /** Multijson */ Multijson = "MULTIJSON", + /** Json */ Json = "JSON", + /** CSV */ CSV = "CSV", + /** TSV */ TSV = "TSV", + /** Scsv */ Scsv = "SCSV", + /** Sohsv */ Sohsv = "SOHSV", + /** PSV */ PSV = "PSV", + /** TXT */ TXT = "TXT", + /** RAW */ RAW = "RAW", + /** Singlejson */ Singlejson = "SINGLEJSON", + /** Avro */ Avro = "AVRO", + /** Tsve */ Tsve = "TSVE", + /** Parquet */ Parquet = "PARQUET", + /** ORC */ ORC = "ORC", + /** Apacheavro */ Apacheavro = "APACHEAVRO", + /** W3Clogfile */ W3Clogfile = "W3CLOGFILE" } @@ -5575,21 +5841,37 @@ export type IotHubDataFormat = string; /** Known values of {@link EventGridDataFormat} that the service accepts. */ export enum KnownEventGridDataFormat { + /** Multijson */ Multijson = "MULTIJSON", + /** Json */ Json = "JSON", + /** CSV */ CSV = "CSV", + /** TSV */ TSV = "TSV", + /** Scsv */ Scsv = "SCSV", + /** Sohsv */ Sohsv = "SOHSV", + /** PSV */ PSV = "PSV", + /** TXT */ TXT = "TXT", + /** RAW */ RAW = "RAW", + /** Singlejson */ Singlejson = "SINGLEJSON", + /** Avro */ Avro = "AVRO", + /** Tsve */ Tsve = "TSVE", + /** Parquet */ Parquet = "PARQUET", + /** ORC */ ORC = "ORC", + /** Apacheavro */ Apacheavro = "APACHEAVRO", + /** W3Clogfile */ W3Clogfile = "W3CLOGFILE" } @@ -5619,7 +5901,9 @@ export type EventGridDataFormat = string; /** Known values of {@link BlobStorageEventType} that the service accepts. */ export enum KnownBlobStorageEventType { + /** MicrosoftStorageBlobCreated */ MicrosoftStorageBlobCreated = "Microsoft.Storage.BlobCreated", + /** MicrosoftStorageBlobRenamed */ MicrosoftStorageBlobRenamed = "Microsoft.Storage.BlobRenamed" } @@ -6363,24 +6647,14 @@ export interface SqlPoolSensitivityLabelsDisableRecommendationOptionalParams /** Optional parameters. */ export interface SqlPoolSensitivityLabelsListCurrentNextOptionalParams - extends coreClient.OperationOptions { - /** An OData filter expression that filters elements in the collection. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listCurrentNext operation. */ export type SqlPoolSensitivityLabelsListCurrentNextResponse = SensitivityLabelListResult; /** Optional parameters. */ export interface SqlPoolSensitivityLabelsListRecommendedNextOptionalParams - extends coreClient.OperationOptions { - /** An OData filter expression that filters elements in the collection. */ - filter?: string; - /** Specifies whether to include disabled recommendations or not. */ - includeDisabledRecommendations?: boolean; - /** An OData query option to indicate how many elements to skip in the collection. */ - skipToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listRecommendedNext operation. */ export type SqlPoolSensitivityLabelsListRecommendedNextResponse = SensitivityLabelListResult; @@ -6408,10 +6682,7 @@ export type SqlPoolSchemasGetResponse = SqlPoolSchema; /** Optional parameters. */ export interface SqlPoolSchemasListNextOptionalParams - extends coreClient.OperationOptions { - /** An OData filter expression that filters elements in the collection. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type SqlPoolSchemasListNextResponse = SqlPoolSchemaListResult; @@ -6435,10 +6706,7 @@ export type SqlPoolTablesGetResponse = SqlPoolTable; /** Optional parameters. */ export interface SqlPoolTablesListBySchemaNextOptionalParams - extends coreClient.OperationOptions { - /** An OData filter expression that filters elements in the collection. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySchemaNext operation. */ export type SqlPoolTablesListBySchemaNextResponse = SqlPoolTableListResult; @@ -6455,10 +6723,7 @@ export type SqlPoolTableColumnsListByTableNameResponse = SqlPoolColumnListResult /** Optional parameters. */ export interface SqlPoolTableColumnsListByTableNameNextOptionalParams - extends coreClient.OperationOptions { - /** An OData filter expression that filters elements in the collection. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByTableNameNext operation. */ export type SqlPoolTableColumnsListByTableNameNextResponse = SqlPoolColumnListResult; diff --git a/sdk/synapse/arm-synapse/src/models/mappers.ts b/sdk/synapse/arm-synapse/src/models/mappers.ts index fcddea9a6da4..89f7d04062ff 100644 --- a/sdk/synapse/arm-synapse/src/models/mappers.ts +++ b/sdk/synapse/arm-synapse/src/models/mappers.ts @@ -8204,7 +8204,7 @@ export const Database: coreClient.CompositeMapper = { type: { name: "Composite", className: "Database", - uberParent: "Resource", + uberParent: "ProxyResource", polymorphicDiscriminator: { serializedName: "kind", clientName: "kind" @@ -8240,7 +8240,7 @@ export const DataConnection: coreClient.CompositeMapper = { type: { name: "Composite", className: "DataConnection", - uberParent: "Resource", + uberParent: "ProxyResource", polymorphicDiscriminator: { serializedName: "kind", clientName: "kind" @@ -8926,8 +8926,8 @@ export const ReadWriteDatabase: coreClient.CompositeMapper = { type: { name: "Composite", className: "ReadWriteDatabase", - uberParent: "Resource", - polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, + uberParent: "Database", + polymorphicDiscriminator: Database.type.polymorphicDiscriminator, modelProperties: { ...Database.type.modelProperties, provisioningState: { @@ -8972,8 +8972,8 @@ export const ReadOnlyFollowingDatabase: coreClient.CompositeMapper = { type: { name: "Composite", className: "ReadOnlyFollowingDatabase", - uberParent: "Resource", - polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, + uberParent: "Database", + polymorphicDiscriminator: Database.type.polymorphicDiscriminator, modelProperties: { ...Database.type.modelProperties, provisioningState: { @@ -9033,8 +9033,8 @@ export const EventHubDataConnection: coreClient.CompositeMapper = { type: { name: "Composite", className: "EventHubDataConnection", - uberParent: "Resource", - polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, + uberParent: "DataConnection", + polymorphicDiscriminator: DataConnection.type.polymorphicDiscriminator, modelProperties: { ...DataConnection.type.modelProperties, eventHubResourceId: { @@ -9106,8 +9106,8 @@ export const IotHubDataConnection: coreClient.CompositeMapper = { type: { name: "Composite", className: "IotHubDataConnection", - uberParent: "Resource", - polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, + uberParent: "DataConnection", + polymorphicDiscriminator: DataConnection.type.polymorphicDiscriminator, modelProperties: { ...DataConnection.type.modelProperties, iotHubResourceId: { @@ -9173,8 +9173,8 @@ export const EventGridDataConnection: coreClient.CompositeMapper = { type: { name: "Composite", className: "EventGridDataConnection", - uberParent: "Resource", - polymorphicDiscriminator: Resource.type.polymorphicDiscriminator, + uberParent: "DataConnection", + polymorphicDiscriminator: DataConnection.type.polymorphicDiscriminator, modelProperties: { ...DataConnection.type.modelProperties, storageAccountResourceId: { @@ -9381,11 +9381,11 @@ export let discriminators = { "CustomSetupBase.ComponentSetup": ComponentSetup, "LinkedIntegrationRuntimeType.Key": LinkedIntegrationRuntimeKeyAuthorization, "LinkedIntegrationRuntimeType.RBAC": LinkedIntegrationRuntimeRbacAuthorization, - "Resource.Database": Database, - "Resource.DataConnection": DataConnection, - "Resource.ReadWrite": ReadWriteDatabase, - "Resource.ReadOnlyFollowing": ReadOnlyFollowingDatabase, - "Resource.EventHub": EventHubDataConnection, - "Resource.IotHub": IotHubDataConnection, - "Resource.EventGrid": EventGridDataConnection + "ProxyResource.Database": Database, + "ProxyResource.DataConnection": DataConnection, + "Database.ReadWrite": ReadWriteDatabase, + "Database.ReadOnlyFollowing": ReadOnlyFollowingDatabase, + "DataConnection.EventHub": EventHubDataConnection, + "DataConnection.IotHub": IotHubDataConnection, + "DataConnection.EventGrid": EventGridDataConnection }; diff --git a/sdk/synapse/arm-synapse/src/operations/azureADOnlyAuthentications.ts b/sdk/synapse/arm-synapse/src/operations/azureADOnlyAuthentications.ts index 01629d81bf6b..dd0b95114108 100644 --- a/sdk/synapse/arm-synapse/src/operations/azureADOnlyAuthentications.ts +++ b/sdk/synapse/arm-synapse/src/operations/azureADOnlyAuthentications.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { AzureADOnlyAuthentications } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { AzureADOnlyAuthentication, AzureADOnlyAuthenticationsListNextOptionalParams, AzureADOnlyAuthenticationsListOptionalParams, + AzureADOnlyAuthenticationsListResponse, AzureADOnlyAuthenticationName, AzureADOnlyAuthenticationsGetOptionalParams, AzureADOnlyAuthenticationsGetResponse, AzureADOnlyAuthenticationsCreateOptionalParams, AzureADOnlyAuthenticationsCreateResponse, - AzureADOnlyAuthenticationsListResponse, AzureADOnlyAuthenticationsListNextResponse } from "../models"; @@ -60,8 +61,16 @@ export class AzureADOnlyAuthenticationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -69,11 +78,18 @@ export class AzureADOnlyAuthenticationsImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: AzureADOnlyAuthenticationsListOptionalParams + options?: AzureADOnlyAuthenticationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: AzureADOnlyAuthenticationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -82,7 +98,9 @@ export class AzureADOnlyAuthenticationsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -357,7 +375,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/bigDataPools.ts b/sdk/synapse/arm-synapse/src/operations/bigDataPools.ts index 49f806b65ba0..d0ba6bfe2256 100644 --- a/sdk/synapse/arm-synapse/src/operations/bigDataPools.ts +++ b/sdk/synapse/arm-synapse/src/operations/bigDataPools.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { BigDataPools } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { BigDataPoolResourceInfo, BigDataPoolsListByWorkspaceNextOptionalParams, BigDataPoolsListByWorkspaceOptionalParams, + BigDataPoolsListByWorkspaceResponse, BigDataPoolsGetOptionalParams, BigDataPoolsGetResponse, BigDataPoolPatchInfo, @@ -27,7 +29,6 @@ import { BigDataPoolsCreateOrUpdateResponse, BigDataPoolsDeleteOptionalParams, BigDataPoolsDeleteResponse, - BigDataPoolsListByWorkspaceResponse, BigDataPoolsListByWorkspaceNextResponse } from "../models"; @@ -67,11 +68,15 @@ export class BigDataPoolsImpl implements BigDataPools { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -80,15 +85,22 @@ export class BigDataPoolsImpl implements BigDataPools { private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: BigDataPoolsListByWorkspaceOptionalParams + options?: BigDataPoolsListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: BigDataPoolsListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -97,7 +109,9 @@ export class BigDataPoolsImpl implements BigDataPools { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -552,7 +566,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/dataMaskingRules.ts b/sdk/synapse/arm-synapse/src/operations/dataMaskingRules.ts index f166976c55f4..45b6803cc091 100644 --- a/sdk/synapse/arm-synapse/src/operations/dataMaskingRules.ts +++ b/sdk/synapse/arm-synapse/src/operations/dataMaskingRules.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { DataMaskingRules } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,11 +15,11 @@ import { SynapseManagementClient } from "../synapseManagementClient"; import { DataMaskingRule, DataMaskingRulesListBySqlPoolOptionalParams, + DataMaskingRulesListBySqlPoolResponse, DataMaskingRulesCreateOrUpdateOptionalParams, DataMaskingRulesCreateOrUpdateResponse, DataMaskingRulesGetOptionalParams, - DataMaskingRulesGetResponse, - DataMaskingRulesListBySqlPoolResponse + DataMaskingRulesGetResponse } from "../models"; /// @@ -61,12 +61,16 @@ export class DataMaskingRulesImpl implements DataMaskingRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listBySqlPoolPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -76,9 +80,11 @@ export class DataMaskingRulesImpl implements DataMaskingRules { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: DataMaskingRulesListBySqlPoolOptionalParams + options?: DataMaskingRulesListBySqlPoolOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySqlPool( + let result: DataMaskingRulesListBySqlPoolResponse; + result = await this._listBySqlPool( resourceGroupName, workspaceName, sqlPoolName, diff --git a/sdk/synapse/arm-synapse/src/operations/extendedSqlPoolBlobAuditingPolicies.ts b/sdk/synapse/arm-synapse/src/operations/extendedSqlPoolBlobAuditingPolicies.ts index 8a78ece29469..2fe23a807002 100644 --- a/sdk/synapse/arm-synapse/src/operations/extendedSqlPoolBlobAuditingPolicies.ts +++ b/sdk/synapse/arm-synapse/src/operations/extendedSqlPoolBlobAuditingPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ExtendedSqlPoolBlobAuditingPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,11 +17,11 @@ import { ExtendedSqlPoolBlobAuditingPolicy, ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolNextOptionalParams, ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams, + ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolResponse, ExtendedSqlPoolBlobAuditingPoliciesGetOptionalParams, ExtendedSqlPoolBlobAuditingPoliciesGetResponse, ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdateOptionalParams, ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdateResponse, - ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolResponse, ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolNextResponse } from "../models"; @@ -64,12 +65,16 @@ export class ExtendedSqlPoolBlobAuditingPoliciesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listBySqlPoolPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -79,16 +84,23 @@ export class ExtendedSqlPoolBlobAuditingPoliciesImpl resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams + options?: ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySqlPool( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ExtendedSqlPoolBlobAuditingPoliciesListBySqlPoolResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySqlPool( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySqlPoolNext( resourceGroupName, @@ -98,7 +110,9 @@ export class ExtendedSqlPoolBlobAuditingPoliciesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -280,7 +294,6 @@ const listBySqlPoolNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/integrationRuntimes.ts b/sdk/synapse/arm-synapse/src/operations/integrationRuntimes.ts index 604c2e277b38..a506677afc96 100644 --- a/sdk/synapse/arm-synapse/src/operations/integrationRuntimes.ts +++ b/sdk/synapse/arm-synapse/src/operations/integrationRuntimes.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { IntegrationRuntimes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { IntegrationRuntimeResource, IntegrationRuntimesListByWorkspaceNextOptionalParams, IntegrationRuntimesListByWorkspaceOptionalParams, + IntegrationRuntimesListByWorkspaceResponse, UpdateIntegrationRuntimeRequest, IntegrationRuntimesUpdateOptionalParams, IntegrationRuntimesUpdateResponse, @@ -27,7 +29,6 @@ import { IntegrationRuntimesCreateResponse, IntegrationRuntimesDeleteOptionalParams, IntegrationRuntimesUpgradeOptionalParams, - IntegrationRuntimesListByWorkspaceResponse, IntegrationRuntimesStartOptionalParams, IntegrationRuntimesStartResponse, IntegrationRuntimesStopOptionalParams, @@ -74,11 +75,15 @@ export class IntegrationRuntimesImpl implements IntegrationRuntimes { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -87,15 +92,22 @@ export class IntegrationRuntimesImpl implements IntegrationRuntimes { private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: IntegrationRuntimesListByWorkspaceOptionalParams + options?: IntegrationRuntimesListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: IntegrationRuntimesListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -104,7 +116,9 @@ export class IntegrationRuntimesImpl implements IntegrationRuntimes { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -1083,7 +1097,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/ipFirewallRules.ts b/sdk/synapse/arm-synapse/src/operations/ipFirewallRules.ts index 54dfddd423c8..3854de9a7699 100644 --- a/sdk/synapse/arm-synapse/src/operations/ipFirewallRules.ts +++ b/sdk/synapse/arm-synapse/src/operations/ipFirewallRules.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { IpFirewallRules } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -67,11 +68,15 @@ export class IpFirewallRulesImpl implements IpFirewallRules { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -80,15 +85,22 @@ export class IpFirewallRulesImpl implements IpFirewallRules { private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: IpFirewallRulesListByWorkspaceOptionalParams + options?: IpFirewallRulesListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: IpFirewallRulesListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -97,7 +109,9 @@ export class IpFirewallRulesImpl implements IpFirewallRules { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -626,7 +640,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/keys.ts b/sdk/synapse/arm-synapse/src/operations/keys.ts index dd4039aaff64..9ba3fecc6c52 100644 --- a/sdk/synapse/arm-synapse/src/operations/keys.ts +++ b/sdk/synapse/arm-synapse/src/operations/keys.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Keys } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -62,11 +63,15 @@ export class KeysImpl implements Keys { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -75,15 +80,22 @@ export class KeysImpl implements Keys { private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: KeysListByWorkspaceOptionalParams + options?: KeysListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: KeysListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -92,7 +104,9 @@ export class KeysImpl implements Keys { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -313,7 +327,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/kustoOperations.ts b/sdk/synapse/arm-synapse/src/operations/kustoOperations.ts index 26213fa3e103..4c1cb103f365 100644 --- a/sdk/synapse/arm-synapse/src/operations/kustoOperations.ts +++ b/sdk/synapse/arm-synapse/src/operations/kustoOperations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { KustoOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,22 +49,34 @@ export class KustoOperationsImpl implements KustoOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: KustoOperationsListOptionalParams + options?: KustoOperationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: KustoOperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/synapse/arm-synapse/src/operations/kustoPoolAttachedDatabaseConfigurations.ts b/sdk/synapse/arm-synapse/src/operations/kustoPoolAttachedDatabaseConfigurations.ts index c528eebe8ff8..3fd10d5540e0 100644 --- a/sdk/synapse/arm-synapse/src/operations/kustoPoolAttachedDatabaseConfigurations.ts +++ b/sdk/synapse/arm-synapse/src/operations/kustoPoolAttachedDatabaseConfigurations.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { KustoPoolAttachedDatabaseConfigurations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -65,12 +65,16 @@ export class KustoPoolAttachedDatabaseConfigurationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByKustoPoolPagingPage( workspaceName, kustoPoolName, resourceGroupName, - options + options, + settings ); } }; @@ -80,9 +84,11 @@ export class KustoPoolAttachedDatabaseConfigurationsImpl workspaceName: string, kustoPoolName: string, resourceGroupName: string, - options?: KustoPoolAttachedDatabaseConfigurationsListByKustoPoolOptionalParams + options?: KustoPoolAttachedDatabaseConfigurationsListByKustoPoolOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByKustoPool( + let result: KustoPoolAttachedDatabaseConfigurationsListByKustoPoolResponse; + result = await this._listByKustoPool( workspaceName, kustoPoolName, resourceGroupName, diff --git a/sdk/synapse/arm-synapse/src/operations/kustoPoolDataConnections.ts b/sdk/synapse/arm-synapse/src/operations/kustoPoolDataConnections.ts index 3e3ca2241c51..5d46d7cc5fd1 100644 --- a/sdk/synapse/arm-synapse/src/operations/kustoPoolDataConnections.ts +++ b/sdk/synapse/arm-synapse/src/operations/kustoPoolDataConnections.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { KustoPoolDataConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,13 +17,13 @@ import { LroImpl } from "../lroImpl"; import { DataConnectionUnion, KustoPoolDataConnectionsListByDatabaseOptionalParams, + KustoPoolDataConnectionsListByDatabaseResponse, DataConnectionCheckNameRequest, KustoPoolDataConnectionsCheckNameAvailabilityOptionalParams, KustoPoolDataConnectionsCheckNameAvailabilityResponse, DataConnectionValidation, KustoPoolDataConnectionsDataConnectionValidationOptionalParams, KustoPoolDataConnectionsDataConnectionValidationResponse, - KustoPoolDataConnectionsListByDatabaseResponse, KustoPoolDataConnectionsGetOptionalParams, KustoPoolDataConnectionsGetResponse, KustoPoolDataConnectionsCreateOrUpdateOptionalParams, @@ -75,13 +75,17 @@ export class KustoPoolDataConnectionsImpl implements KustoPoolDataConnections { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByDatabasePagingPage( resourceGroupName, workspaceName, kustoPoolName, databaseName, - options + options, + settings ); } }; @@ -92,9 +96,11 @@ export class KustoPoolDataConnectionsImpl implements KustoPoolDataConnections { workspaceName: string, kustoPoolName: string, databaseName: string, - options?: KustoPoolDataConnectionsListByDatabaseOptionalParams + options?: KustoPoolDataConnectionsListByDatabaseOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByDatabase( + let result: KustoPoolDataConnectionsListByDatabaseResponse; + result = await this._listByDatabase( resourceGroupName, workspaceName, kustoPoolName, diff --git a/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabasePrincipalAssignments.ts b/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabasePrincipalAssignments.ts index 7847ea6900fb..984e77e766cf 100644 --- a/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabasePrincipalAssignments.ts +++ b/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabasePrincipalAssignments.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { KustoPoolDatabasePrincipalAssignments } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,10 +17,10 @@ import { LroImpl } from "../lroImpl"; import { DatabasePrincipalAssignment, KustoPoolDatabasePrincipalAssignmentsListOptionalParams, + KustoPoolDatabasePrincipalAssignmentsListResponse, DatabasePrincipalAssignmentCheckNameRequest, KustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilityOptionalParams, KustoPoolDatabasePrincipalAssignmentsCheckNameAvailabilityResponse, - KustoPoolDatabasePrincipalAssignmentsListResponse, KustoPoolDatabasePrincipalAssignmentsGetOptionalParams, KustoPoolDatabasePrincipalAssignmentsGetResponse, KustoPoolDatabasePrincipalAssignmentsCreateOrUpdateOptionalParams, @@ -71,13 +71,17 @@ export class KustoPoolDatabasePrincipalAssignmentsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( workspaceName, kustoPoolName, databaseName, resourceGroupName, - options + options, + settings ); } }; @@ -88,9 +92,11 @@ export class KustoPoolDatabasePrincipalAssignmentsImpl kustoPoolName: string, databaseName: string, resourceGroupName: string, - options?: KustoPoolDatabasePrincipalAssignmentsListOptionalParams + options?: KustoPoolDatabasePrincipalAssignmentsListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( + let result: KustoPoolDatabasePrincipalAssignmentsListResponse; + result = await this._list( workspaceName, kustoPoolName, databaseName, diff --git a/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabases.ts b/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabases.ts index 49a0de7f06df..d3cd222e6b1d 100644 --- a/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabases.ts +++ b/sdk/synapse/arm-synapse/src/operations/kustoPoolDatabases.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { KustoPoolDatabases } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -66,12 +66,16 @@ export class KustoPoolDatabasesImpl implements KustoPoolDatabases { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByKustoPoolPagingPage( resourceGroupName, workspaceName, kustoPoolName, - options + options, + settings ); } }; @@ -81,9 +85,11 @@ export class KustoPoolDatabasesImpl implements KustoPoolDatabases { resourceGroupName: string, workspaceName: string, kustoPoolName: string, - options?: KustoPoolDatabasesListByKustoPoolOptionalParams + options?: KustoPoolDatabasesListByKustoPoolOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByKustoPool( + let result: KustoPoolDatabasesListByKustoPoolResponse; + result = await this._listByKustoPool( resourceGroupName, workspaceName, kustoPoolName, diff --git a/sdk/synapse/arm-synapse/src/operations/kustoPoolPrincipalAssignments.ts b/sdk/synapse/arm-synapse/src/operations/kustoPoolPrincipalAssignments.ts index b67a3c5d4e24..fc4e3a86ab74 100644 --- a/sdk/synapse/arm-synapse/src/operations/kustoPoolPrincipalAssignments.ts +++ b/sdk/synapse/arm-synapse/src/operations/kustoPoolPrincipalAssignments.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { KustoPoolPrincipalAssignments } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,10 +17,10 @@ import { LroImpl } from "../lroImpl"; import { ClusterPrincipalAssignment, KustoPoolPrincipalAssignmentsListOptionalParams, + KustoPoolPrincipalAssignmentsListResponse, ClusterPrincipalAssignmentCheckNameRequest, KustoPoolPrincipalAssignmentsCheckNameAvailabilityOptionalParams, KustoPoolPrincipalAssignmentsCheckNameAvailabilityResponse, - KustoPoolPrincipalAssignmentsListResponse, KustoPoolPrincipalAssignmentsGetOptionalParams, KustoPoolPrincipalAssignmentsGetResponse, KustoPoolPrincipalAssignmentsCreateOrUpdateOptionalParams, @@ -68,12 +68,16 @@ export class KustoPoolPrincipalAssignmentsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( workspaceName, kustoPoolName, resourceGroupName, - options + options, + settings ); } }; @@ -83,9 +87,11 @@ export class KustoPoolPrincipalAssignmentsImpl workspaceName: string, kustoPoolName: string, resourceGroupName: string, - options?: KustoPoolPrincipalAssignmentsListOptionalParams + options?: KustoPoolPrincipalAssignmentsListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( + let result: KustoPoolPrincipalAssignmentsListResponse; + result = await this._list( workspaceName, kustoPoolName, resourceGroupName, diff --git a/sdk/synapse/arm-synapse/src/operations/kustoPools.ts b/sdk/synapse/arm-synapse/src/operations/kustoPools.ts index 036cec6c0712..bb7ca735196c 100644 --- a/sdk/synapse/arm-synapse/src/operations/kustoPools.ts +++ b/sdk/synapse/arm-synapse/src/operations/kustoPools.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { KustoPools } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,13 +17,16 @@ import { LroImpl } from "../lroImpl"; import { SkuDescription, KustoPoolsListSkusOptionalParams, + KustoPoolsListSkusResponse, AzureResourceSku, KustoPoolsListSkusByResourceOptionalParams, + KustoPoolsListSkusByResourceResponse, LanguageExtension, KustoPoolsListLanguageExtensionsOptionalParams, + KustoPoolsListLanguageExtensionsResponse, FollowerDatabaseDefinition, KustoPoolsListFollowerDatabasesOptionalParams, - KustoPoolsListSkusResponse, + KustoPoolsListFollowerDatabasesResponse, KustoPoolCheckNameRequest, KustoPoolsCheckNameAvailabilityOptionalParams, KustoPoolsCheckNameAvailabilityResponse, @@ -40,12 +43,9 @@ import { KustoPoolsDeleteOptionalParams, KustoPoolsStopOptionalParams, KustoPoolsStartOptionalParams, - KustoPoolsListSkusByResourceResponse, - KustoPoolsListLanguageExtensionsResponse, LanguageExtensionsList, KustoPoolsAddLanguageExtensionsOptionalParams, KustoPoolsRemoveLanguageExtensionsOptionalParams, - KustoPoolsListFollowerDatabasesResponse, KustoPoolsDetachFollowerDatabasesOptionalParams } from "../models"; @@ -77,16 +77,21 @@ export class KustoPoolsImpl implements KustoPools { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listSkusPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listSkusPagingPage(options, settings); } }; } private async *listSkusPagingPage( - options?: KustoPoolsListSkusOptionalParams + options?: KustoPoolsListSkusOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listSkus(options); + let result: KustoPoolsListSkusResponse; + result = await this._listSkus(options); yield result.value || []; } @@ -124,12 +129,16 @@ export class KustoPoolsImpl implements KustoPools { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listSkusByResourcePagingPage( workspaceName, kustoPoolName, resourceGroupName, - options + options, + settings ); } }; @@ -139,9 +148,11 @@ export class KustoPoolsImpl implements KustoPools { workspaceName: string, kustoPoolName: string, resourceGroupName: string, - options?: KustoPoolsListSkusByResourceOptionalParams + options?: KustoPoolsListSkusByResourceOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listSkusByResource( + let result: KustoPoolsListSkusByResourceResponse; + result = await this._listSkusByResource( workspaceName, kustoPoolName, resourceGroupName, @@ -192,12 +203,16 @@ export class KustoPoolsImpl implements KustoPools { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listLanguageExtensionsPagingPage( workspaceName, kustoPoolName, resourceGroupName, - options + options, + settings ); } }; @@ -207,9 +222,11 @@ export class KustoPoolsImpl implements KustoPools { workspaceName: string, kustoPoolName: string, resourceGroupName: string, - options?: KustoPoolsListLanguageExtensionsOptionalParams + options?: KustoPoolsListLanguageExtensionsOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listLanguageExtensions( + let result: KustoPoolsListLanguageExtensionsResponse; + result = await this._listLanguageExtensions( workspaceName, kustoPoolName, resourceGroupName, @@ -261,12 +278,16 @@ export class KustoPoolsImpl implements KustoPools { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listFollowerDatabasesPagingPage( workspaceName, kustoPoolName, resourceGroupName, - options + options, + settings ); } }; @@ -276,9 +297,11 @@ export class KustoPoolsImpl implements KustoPools { workspaceName: string, kustoPoolName: string, resourceGroupName: string, - options?: KustoPoolsListFollowerDatabasesOptionalParams + options?: KustoPoolsListFollowerDatabasesOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listFollowerDatabases( + let result: KustoPoolsListFollowerDatabasesResponse; + result = await this._listFollowerDatabases( workspaceName, kustoPoolName, resourceGroupName, diff --git a/sdk/synapse/arm-synapse/src/operations/libraries.ts b/sdk/synapse/arm-synapse/src/operations/libraries.ts index d634f2645ec1..1795bd6eeeb6 100644 --- a/sdk/synapse/arm-synapse/src/operations/libraries.ts +++ b/sdk/synapse/arm-synapse/src/operations/libraries.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Libraries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -56,11 +57,15 @@ export class LibrariesImpl implements Libraries { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -69,15 +74,22 @@ export class LibrariesImpl implements Libraries { private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: LibrariesListByWorkspaceOptionalParams + options?: LibrariesListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: LibrariesListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -86,7 +98,9 @@ export class LibrariesImpl implements Libraries { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -176,7 +190,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/privateEndpointConnections.ts b/sdk/synapse/arm-synapse/src/operations/privateEndpointConnections.ts index ea97e093c92c..16f216734444 100644 --- a/sdk/synapse/arm-synapse/src/operations/privateEndpointConnections.ts +++ b/sdk/synapse/arm-synapse/src/operations/privateEndpointConnections.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateEndpointConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { PrivateEndpointConnection, PrivateEndpointConnectionsListNextOptionalParams, PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, PrivateEndpointConnectionsGetOptionalParams, PrivateEndpointConnectionsGetResponse, PrivateEndpointConnectionsCreateOptionalParams, PrivateEndpointConnectionsCreateResponse, PrivateEndpointConnectionsDeleteOptionalParams, - PrivateEndpointConnectionsListResponse, PrivateEndpointConnectionsListNextResponse } from "../models"; @@ -60,8 +61,16 @@ export class PrivateEndpointConnectionsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -69,11 +78,18 @@ export class PrivateEndpointConnectionsImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: PrivateEndpointConnectionsListOptionalParams + options?: PrivateEndpointConnectionsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: PrivateEndpointConnectionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -82,7 +98,9 @@ export class PrivateEndpointConnectionsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -473,7 +491,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/privateEndpointConnectionsPrivateLinkHub.ts b/sdk/synapse/arm-synapse/src/operations/privateEndpointConnectionsPrivateLinkHub.ts index eeee43cc27a2..bea89033072d 100644 --- a/sdk/synapse/arm-synapse/src/operations/privateEndpointConnectionsPrivateLinkHub.ts +++ b/sdk/synapse/arm-synapse/src/operations/privateEndpointConnectionsPrivateLinkHub.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateEndpointConnectionsPrivateLinkHub } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -59,11 +60,15 @@ export class PrivateEndpointConnectionsPrivateLinkHubImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, privateLinkHubName, - options + options, + settings ); } }; @@ -72,15 +77,18 @@ export class PrivateEndpointConnectionsPrivateLinkHubImpl private async *listPagingPage( resourceGroupName: string, privateLinkHubName: string, - options?: PrivateEndpointConnectionsPrivateLinkHubListOptionalParams + options?: PrivateEndpointConnectionsPrivateLinkHubListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - privateLinkHubName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: PrivateEndpointConnectionsPrivateLinkHubListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, privateLinkHubName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -89,7 +97,9 @@ export class PrivateEndpointConnectionsPrivateLinkHubImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -228,7 +238,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/privateLinkHubPrivateLinkResources.ts b/sdk/synapse/arm-synapse/src/operations/privateLinkHubPrivateLinkResources.ts index f9b3f7e38a80..3073ca7caedd 100644 --- a/sdk/synapse/arm-synapse/src/operations/privateLinkHubPrivateLinkResources.ts +++ b/sdk/synapse/arm-synapse/src/operations/privateLinkHubPrivateLinkResources.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateLinkHubPrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -59,11 +60,15 @@ export class PrivateLinkHubPrivateLinkResourcesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, privateLinkHubName, - options + options, + settings ); } }; @@ -72,15 +77,18 @@ export class PrivateLinkHubPrivateLinkResourcesImpl private async *listPagingPage( resourceGroupName: string, privateLinkHubName: string, - options?: PrivateLinkHubPrivateLinkResourcesListOptionalParams + options?: PrivateLinkHubPrivateLinkResourcesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - privateLinkHubName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: PrivateLinkHubPrivateLinkResourcesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, privateLinkHubName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -89,7 +97,9 @@ export class PrivateLinkHubPrivateLinkResourcesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -226,7 +236,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/privateLinkHubs.ts b/sdk/synapse/arm-synapse/src/operations/privateLinkHubs.ts index 0b497881f3bf..9ebffa476490 100644 --- a/sdk/synapse/arm-synapse/src/operations/privateLinkHubs.ts +++ b/sdk/synapse/arm-synapse/src/operations/privateLinkHubs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateLinkHubs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { PrivateLinkHub, PrivateLinkHubsListByResourceGroupNextOptionalParams, PrivateLinkHubsListByResourceGroupOptionalParams, + PrivateLinkHubsListByResourceGroupResponse, PrivateLinkHubsListNextOptionalParams, PrivateLinkHubsListOptionalParams, - PrivateLinkHubsListByResourceGroupResponse, + PrivateLinkHubsListResponse, PrivateLinkHubsGetOptionalParams, PrivateLinkHubsGetResponse, PrivateLinkHubPatchInfo, @@ -29,7 +31,6 @@ import { PrivateLinkHubsCreateOrUpdateOptionalParams, PrivateLinkHubsCreateOrUpdateResponse, PrivateLinkHubsDeleteOptionalParams, - PrivateLinkHubsListResponse, PrivateLinkHubsListByResourceGroupNextResponse, PrivateLinkHubsListNextResponse } from "../models"; @@ -64,19 +65,33 @@ export class PrivateLinkHubsImpl implements PrivateLinkHubs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: PrivateLinkHubsListByResourceGroupOptionalParams + options?: PrivateLinkHubsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: PrivateLinkHubsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -84,7 +99,9 @@ export class PrivateLinkHubsImpl implements PrivateLinkHubs { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -115,22 +132,34 @@ export class PrivateLinkHubsImpl implements PrivateLinkHubs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: PrivateLinkHubsListOptionalParams + options?: PrivateLinkHubsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: PrivateLinkHubsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -492,7 +521,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -513,7 +541,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/privateLinkResources.ts b/sdk/synapse/arm-synapse/src/operations/privateLinkResources.ts index a7205b406961..daebba36ad0b 100644 --- a/sdk/synapse/arm-synapse/src/operations/privateLinkResources.ts +++ b/sdk/synapse/arm-synapse/src/operations/privateLinkResources.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { PrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -54,8 +55,16 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -63,11 +72,18 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: PrivateLinkResourcesListOptionalParams + options?: PrivateLinkResourcesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: PrivateLinkResourcesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -76,7 +92,9 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -208,7 +226,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/restorableDroppedSqlPools.ts b/sdk/synapse/arm-synapse/src/operations/restorableDroppedSqlPools.ts index 4f7864265f56..6f5d7c2bff35 100644 --- a/sdk/synapse/arm-synapse/src/operations/restorableDroppedSqlPools.ts +++ b/sdk/synapse/arm-synapse/src/operations/restorableDroppedSqlPools.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { RestorableDroppedSqlPools } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -15,9 +15,9 @@ import { SynapseManagementClient } from "../synapseManagementClient"; import { RestorableDroppedSqlPool, RestorableDroppedSqlPoolsListByWorkspaceOptionalParams, + RestorableDroppedSqlPoolsListByWorkspaceResponse, RestorableDroppedSqlPoolsGetOptionalParams, - RestorableDroppedSqlPoolsGetResponse, - RestorableDroppedSqlPoolsListByWorkspaceResponse + RestorableDroppedSqlPoolsGetResponse } from "../models"; /// @@ -57,11 +57,15 @@ export class RestorableDroppedSqlPoolsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -70,9 +74,11 @@ export class RestorableDroppedSqlPoolsImpl private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: RestorableDroppedSqlPoolsListByWorkspaceOptionalParams + options?: RestorableDroppedSqlPoolsListByWorkspaceOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( + let result: RestorableDroppedSqlPoolsListByWorkspaceResponse; + result = await this._listByWorkspace( resourceGroupName, workspaceName, options diff --git a/sdk/synapse/arm-synapse/src/operations/sparkConfigurations.ts b/sdk/synapse/arm-synapse/src/operations/sparkConfigurations.ts index 12165cfb3760..3a71ca5c9496 100644 --- a/sdk/synapse/arm-synapse/src/operations/sparkConfigurations.ts +++ b/sdk/synapse/arm-synapse/src/operations/sparkConfigurations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SparkConfigurations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -56,11 +57,15 @@ export class SparkConfigurationsImpl implements SparkConfigurations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -69,15 +74,22 @@ export class SparkConfigurationsImpl implements SparkConfigurations { private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: SparkConfigurationsListByWorkspaceOptionalParams + options?: SparkConfigurationsListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SparkConfigurationsListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -86,7 +98,9 @@ export class SparkConfigurationsImpl implements SparkConfigurations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -176,7 +190,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolBlobAuditingPolicies.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolBlobAuditingPolicies.ts index 50e1bc7ed173..7ee54521e7f6 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolBlobAuditingPolicies.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolBlobAuditingPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolBlobAuditingPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,11 +17,11 @@ import { SqlPoolBlobAuditingPolicy, SqlPoolBlobAuditingPoliciesListBySqlPoolNextOptionalParams, SqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams, + SqlPoolBlobAuditingPoliciesListBySqlPoolResponse, SqlPoolBlobAuditingPoliciesGetOptionalParams, SqlPoolBlobAuditingPoliciesGetResponse, SqlPoolBlobAuditingPoliciesCreateOrUpdateOptionalParams, SqlPoolBlobAuditingPoliciesCreateOrUpdateResponse, - SqlPoolBlobAuditingPoliciesListBySqlPoolResponse, SqlPoolBlobAuditingPoliciesListBySqlPoolNextResponse } from "../models"; @@ -64,12 +65,16 @@ export class SqlPoolBlobAuditingPoliciesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listBySqlPoolPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -79,16 +84,23 @@ export class SqlPoolBlobAuditingPoliciesImpl resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams + options?: SqlPoolBlobAuditingPoliciesListBySqlPoolOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySqlPool( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolBlobAuditingPoliciesListBySqlPoolResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySqlPool( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySqlPoolNext( resourceGroupName, @@ -98,7 +110,9 @@ export class SqlPoolBlobAuditingPoliciesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -280,7 +294,6 @@ const listBySqlPoolNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolGeoBackupPolicies.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolGeoBackupPolicies.ts index 0adbebd42fcb..c64eb4b69d9f 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolGeoBackupPolicies.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolGeoBackupPolicies.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { SqlPoolGeoBackupPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -62,12 +62,16 @@ export class SqlPoolGeoBackupPoliciesImpl implements SqlPoolGeoBackupPolicies { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -77,9 +81,11 @@ export class SqlPoolGeoBackupPoliciesImpl implements SqlPoolGeoBackupPolicies { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolGeoBackupPoliciesListOptionalParams + options?: SqlPoolGeoBackupPoliciesListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( + let result: SqlPoolGeoBackupPoliciesListResponse; + result = await this._list( resourceGroupName, workspaceName, sqlPoolName, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolOperations.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolOperations.ts index 90538e225b85..a0c6d5b792e5 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolOperations.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolOperations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -59,12 +60,16 @@ export class SqlPoolOperationsImpl implements SqlPoolOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -74,16 +79,23 @@ export class SqlPoolOperationsImpl implements SqlPoolOperations { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolOperationsListOptionalParams + options?: SqlPoolOperationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolOperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -93,7 +105,9 @@ export class SqlPoolOperationsImpl implements SqlPoolOperations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -186,7 +200,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolReplicationLinks.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolReplicationLinks.ts index 336243b7f519..3dc69dc9afae 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolReplicationLinks.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolReplicationLinks.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolReplicationLinks } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -61,12 +62,16 @@ export class SqlPoolReplicationLinksImpl implements SqlPoolReplicationLinks { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -76,16 +81,23 @@ export class SqlPoolReplicationLinksImpl implements SqlPoolReplicationLinks { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolReplicationLinksListOptionalParams + options?: SqlPoolReplicationLinksListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolReplicationLinksListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -95,7 +107,9 @@ export class SqlPoolReplicationLinksImpl implements SqlPoolReplicationLinks { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -237,7 +251,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolRestorePoints.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolRestorePoints.ts index d4946ac24b9b..b644185109d2 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolRestorePoints.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolRestorePoints.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolRestorePoints } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -67,12 +68,16 @@ export class SqlPoolRestorePointsImpl implements SqlPoolRestorePoints { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -82,16 +87,23 @@ export class SqlPoolRestorePointsImpl implements SqlPoolRestorePoints { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolRestorePointsListOptionalParams + options?: SqlPoolRestorePointsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolRestorePointsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -101,7 +113,9 @@ export class SqlPoolRestorePointsImpl implements SqlPoolRestorePoints { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -420,7 +434,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolSchemas.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolSchemas.ts index b0f2ec80ebb3..7cf45a576aea 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolSchemas.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolSchemas.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolSchemas } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -61,12 +62,16 @@ export class SqlPoolSchemasImpl implements SqlPoolSchemas { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -76,16 +81,23 @@ export class SqlPoolSchemasImpl implements SqlPoolSchemas { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolSchemasListOptionalParams + options?: SqlPoolSchemasListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolSchemasListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -95,7 +107,9 @@ export class SqlPoolSchemasImpl implements SqlPoolSchemas { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -231,7 +245,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolSecurityAlertPolicies.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolSecurityAlertPolicies.ts index 705d723b413f..4f96dbc698dd 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolSecurityAlertPolicies.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolSecurityAlertPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolSecurityAlertPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -65,12 +66,16 @@ export class SqlPoolSecurityAlertPoliciesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -80,16 +85,23 @@ export class SqlPoolSecurityAlertPoliciesImpl resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolSecurityAlertPoliciesListOptionalParams + options?: SqlPoolSecurityAlertPoliciesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolSecurityAlertPoliciesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -99,7 +111,9 @@ export class SqlPoolSecurityAlertPoliciesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -298,7 +312,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolSensitivityLabels.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolSensitivityLabels.ts index 7fa75eb8f820..b1dad2aefa61 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolSensitivityLabels.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolSensitivityLabels.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolSensitivityLabels } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,12 +17,12 @@ import { SensitivityLabel, SqlPoolSensitivityLabelsListCurrentNextOptionalParams, SqlPoolSensitivityLabelsListCurrentOptionalParams, + SqlPoolSensitivityLabelsListCurrentResponse, SqlPoolSensitivityLabelsListRecommendedNextOptionalParams, SqlPoolSensitivityLabelsListRecommendedOptionalParams, - SqlPoolSensitivityLabelsListCurrentResponse, + SqlPoolSensitivityLabelsListRecommendedResponse, SensitivityLabelUpdateList, SqlPoolSensitivityLabelsUpdateOptionalParams, - SqlPoolSensitivityLabelsListRecommendedResponse, SqlPoolSensitivityLabelsCreateOrUpdateOptionalParams, SqlPoolSensitivityLabelsCreateOrUpdateResponse, SqlPoolSensitivityLabelsDeleteOptionalParams, @@ -73,12 +74,16 @@ export class SqlPoolSensitivityLabelsImpl implements SqlPoolSensitivityLabels { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listCurrentPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -88,16 +93,23 @@ export class SqlPoolSensitivityLabelsImpl implements SqlPoolSensitivityLabels { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolSensitivityLabelsListCurrentOptionalParams + options?: SqlPoolSensitivityLabelsListCurrentOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listCurrent( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolSensitivityLabelsListCurrentResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listCurrent( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listCurrentNext( resourceGroupName, @@ -107,7 +119,9 @@ export class SqlPoolSensitivityLabelsImpl implements SqlPoolSensitivityLabels { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -153,12 +167,16 @@ export class SqlPoolSensitivityLabelsImpl implements SqlPoolSensitivityLabels { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listRecommendedPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -168,16 +186,23 @@ export class SqlPoolSensitivityLabelsImpl implements SqlPoolSensitivityLabels { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolSensitivityLabelsListRecommendedOptionalParams + options?: SqlPoolSensitivityLabelsListRecommendedOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listRecommended( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolSensitivityLabelsListRecommendedResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listRecommended( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listRecommendedNext( resourceGroupName, @@ -187,7 +212,9 @@ export class SqlPoolSensitivityLabelsImpl implements SqlPoolSensitivityLabels { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -673,7 +700,6 @@ const listCurrentNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -694,12 +720,6 @@ const listRecommendedNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.includeDisabledRecommendations, - Parameters.skipToken - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolTableColumns.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolTableColumns.ts index e20035cba2e4..958ff542af71 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolTableColumns.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolTableColumns.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolTableColumns } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -65,14 +66,18 @@ export class SqlPoolTableColumnsImpl implements SqlPoolTableColumns { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByTableNamePagingPage( resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, - options + options, + settings ); } }; @@ -84,18 +89,25 @@ export class SqlPoolTableColumnsImpl implements SqlPoolTableColumns { sqlPoolName: string, schemaName: string, tableName: string, - options?: SqlPoolTableColumnsListByTableNameOptionalParams + options?: SqlPoolTableColumnsListByTableNameOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByTableName( - resourceGroupName, - workspaceName, - sqlPoolName, - schemaName, - tableName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolTableColumnsListByTableNameResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByTableName( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByTableNameNext( resourceGroupName, @@ -107,7 +119,9 @@ export class SqlPoolTableColumnsImpl implements SqlPoolTableColumns { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -229,7 +243,6 @@ const listByTableNameNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolTables.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolTables.ts index b8904b192e6e..c78665896c07 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolTables.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolTables.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolTables } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -64,13 +65,17 @@ export class SqlPoolTablesImpl implements SqlPoolTables { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listBySchemaPagingPage( resourceGroupName, workspaceName, sqlPoolName, schemaName, - options + options, + settings ); } }; @@ -81,17 +86,24 @@ export class SqlPoolTablesImpl implements SqlPoolTables { workspaceName: string, sqlPoolName: string, schemaName: string, - options?: SqlPoolTablesListBySchemaOptionalParams + options?: SqlPoolTablesListBySchemaOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySchema( - resourceGroupName, - workspaceName, - sqlPoolName, - schemaName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolTablesListBySchemaResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySchema( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySchemaNext( resourceGroupName, @@ -102,7 +114,9 @@ export class SqlPoolTablesImpl implements SqlPoolTables { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -262,7 +276,6 @@ const listBySchemaNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolTransparentDataEncryptions.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolTransparentDataEncryptions.ts index 734932205b98..94c429f2516c 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolTransparentDataEncryptions.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolTransparentDataEncryptions.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolTransparentDataEncryptions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,12 +17,12 @@ import { TransparentDataEncryption, SqlPoolTransparentDataEncryptionsListNextOptionalParams, SqlPoolTransparentDataEncryptionsListOptionalParams, + SqlPoolTransparentDataEncryptionsListResponse, TransparentDataEncryptionName, SqlPoolTransparentDataEncryptionsGetOptionalParams, SqlPoolTransparentDataEncryptionsGetResponse, SqlPoolTransparentDataEncryptionsCreateOrUpdateOptionalParams, SqlPoolTransparentDataEncryptionsCreateOrUpdateResponse, - SqlPoolTransparentDataEncryptionsListResponse, SqlPoolTransparentDataEncryptionsListNextResponse } from "../models"; @@ -65,12 +66,16 @@ export class SqlPoolTransparentDataEncryptionsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -80,16 +85,23 @@ export class SqlPoolTransparentDataEncryptionsImpl resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolTransparentDataEncryptionsListOptionalParams + options?: SqlPoolTransparentDataEncryptionsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolTransparentDataEncryptionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -99,7 +111,9 @@ export class SqlPoolTransparentDataEncryptionsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -302,7 +316,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolUsages.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolUsages.ts index 89cf3627e0b5..10207dc8440a 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolUsages.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolUsages.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolUsages } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -59,12 +60,16 @@ export class SqlPoolUsagesImpl implements SqlPoolUsages { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -74,16 +79,23 @@ export class SqlPoolUsagesImpl implements SqlPoolUsages { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolUsagesListOptionalParams + options?: SqlPoolUsagesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolUsagesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -93,7 +105,9 @@ export class SqlPoolUsagesImpl implements SqlPoolUsages { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -190,7 +204,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessmentScans.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessmentScans.ts index be8886e079b3..06b95d84ec42 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessmentScans.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessmentScans.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolVulnerabilityAssessmentScans } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -71,13 +72,17 @@ export class SqlPoolVulnerabilityAssessmentScansImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, - options + options, + settings ); } }; @@ -88,17 +93,24 @@ export class SqlPoolVulnerabilityAssessmentScansImpl workspaceName: string, sqlPoolName: string, vulnerabilityAssessmentName: VulnerabilityAssessmentName, - options?: SqlPoolVulnerabilityAssessmentScansListOptionalParams + options?: SqlPoolVulnerabilityAssessmentScansListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - vulnerabilityAssessmentName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolVulnerabilityAssessmentScansListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -109,7 +121,9 @@ export class SqlPoolVulnerabilityAssessmentScansImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -452,7 +466,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessments.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessments.ts index 9dc6b9187639..765e126f19b9 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessments.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolVulnerabilityAssessments.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolVulnerabilityAssessments } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -66,12 +67,16 @@ export class SqlPoolVulnerabilityAssessmentsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -81,16 +86,23 @@ export class SqlPoolVulnerabilityAssessmentsImpl resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolVulnerabilityAssessmentsListOptionalParams + options?: SqlPoolVulnerabilityAssessmentsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolVulnerabilityAssessmentsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -100,7 +112,9 @@ export class SqlPoolVulnerabilityAssessmentsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -342,7 +356,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadClassifier.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadClassifier.ts index 253e01bb6a5e..535f0427c99b 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadClassifier.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadClassifier.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolWorkloadClassifier } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { WorkloadClassifier, SqlPoolWorkloadClassifierListNextOptionalParams, SqlPoolWorkloadClassifierListOptionalParams, + SqlPoolWorkloadClassifierListResponse, SqlPoolWorkloadClassifierGetOptionalParams, SqlPoolWorkloadClassifierGetResponse, SqlPoolWorkloadClassifierCreateOrUpdateOptionalParams, SqlPoolWorkloadClassifierCreateOrUpdateResponse, SqlPoolWorkloadClassifierDeleteOptionalParams, - SqlPoolWorkloadClassifierListResponse, SqlPoolWorkloadClassifierListNextResponse } from "../models"; @@ -70,13 +71,17 @@ export class SqlPoolWorkloadClassifierImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, - options + options, + settings ); } }; @@ -87,17 +92,24 @@ export class SqlPoolWorkloadClassifierImpl workspaceName: string, sqlPoolName: string, workloadGroupName: string, - options?: SqlPoolWorkloadClassifierListOptionalParams + options?: SqlPoolWorkloadClassifierListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - workloadGroupName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolWorkloadClassifierListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -108,7 +120,9 @@ export class SqlPoolWorkloadClassifierImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -544,7 +558,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadGroup.ts b/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadGroup.ts index f3032a33158b..4eea79233b8a 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadGroup.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPoolWorkloadGroup.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPoolWorkloadGroup } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { WorkloadGroup, SqlPoolWorkloadGroupListNextOptionalParams, SqlPoolWorkloadGroupListOptionalParams, + SqlPoolWorkloadGroupListResponse, SqlPoolWorkloadGroupGetOptionalParams, SqlPoolWorkloadGroupGetResponse, SqlPoolWorkloadGroupCreateOrUpdateOptionalParams, SqlPoolWorkloadGroupCreateOrUpdateResponse, SqlPoolWorkloadGroupDeleteOptionalParams, - SqlPoolWorkloadGroupListResponse, SqlPoolWorkloadGroupListNextResponse } from "../models"; @@ -66,12 +67,16 @@ export class SqlPoolWorkloadGroupImpl implements SqlPoolWorkloadGroup { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, workspaceName, sqlPoolName, - options + options, + settings ); } }; @@ -81,16 +86,23 @@ export class SqlPoolWorkloadGroupImpl implements SqlPoolWorkloadGroup { resourceGroupName: string, workspaceName: string, sqlPoolName: string, - options?: SqlPoolWorkloadGroupListOptionalParams + options?: SqlPoolWorkloadGroupListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - workspaceName, - sqlPoolName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolWorkloadGroupListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + sqlPoolName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -100,7 +112,9 @@ export class SqlPoolWorkloadGroupImpl implements SqlPoolWorkloadGroup { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -498,7 +512,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/sqlPools.ts b/sdk/synapse/arm-synapse/src/operations/sqlPools.ts index 1648db2e0f26..a09b27c5a69b 100644 --- a/sdk/synapse/arm-synapse/src/operations/sqlPools.ts +++ b/sdk/synapse/arm-synapse/src/operations/sqlPools.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SqlPools } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { SqlPool, SqlPoolsListByWorkspaceNextOptionalParams, SqlPoolsListByWorkspaceOptionalParams, + SqlPoolsListByWorkspaceResponse, SqlPoolsGetOptionalParams, SqlPoolsGetResponse, SqlPoolPatchInfo, @@ -27,7 +29,6 @@ import { SqlPoolsCreateResponse, SqlPoolsDeleteOptionalParams, SqlPoolsDeleteResponse, - SqlPoolsListByWorkspaceResponse, SqlPoolsPauseOptionalParams, SqlPoolsPauseResponse, SqlPoolsResumeOptionalParams, @@ -73,11 +74,15 @@ export class SqlPoolsImpl implements SqlPools { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -86,15 +91,22 @@ export class SqlPoolsImpl implements SqlPools { private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: SqlPoolsListByWorkspaceOptionalParams + options?: SqlPoolsListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SqlPoolsListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -103,7 +115,9 @@ export class SqlPoolsImpl implements SqlPools { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -849,7 +863,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerBlobAuditingPolicies.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerBlobAuditingPolicies.ts index b8bbb1132fab..e9bca34fa75e 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerBlobAuditingPolicies.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerBlobAuditingPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerBlobAuditingPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { ServerBlobAuditingPolicy, WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceNextOptionalParams, WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceOptionalParams, + WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceResponse, BlobAuditingPolicyName, WorkspaceManagedSqlServerBlobAuditingPoliciesGetOptionalParams, WorkspaceManagedSqlServerBlobAuditingPoliciesGetResponse, WorkspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateOptionalParams, WorkspaceManagedSqlServerBlobAuditingPoliciesCreateOrUpdateResponse, - WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceResponse, WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceNextResponse } from "../models"; @@ -64,11 +65,15 @@ export class WorkspaceManagedSqlServerBlobAuditingPoliciesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -77,15 +82,22 @@ export class WorkspaceManagedSqlServerBlobAuditingPoliciesImpl private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceOptionalParams + options?: WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerBlobAuditingPoliciesListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -94,7 +106,9 @@ export class WorkspaceManagedSqlServerBlobAuditingPoliciesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -363,7 +377,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerDedicatedSQLMinimalTlsSettings.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerDedicatedSQLMinimalTlsSettings.ts index 140ffb1f2fdf..a73f4ab3f4f8 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerDedicatedSQLMinimalTlsSettings.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerDedicatedSQLMinimalTlsSettings.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { DedicatedSQLminimalTlsSettings, WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListNextOptionalParams, WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListOptionalParams, + WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListResponse, DedicatedSQLMinimalTlsSettingsName, WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsUpdateOptionalParams, WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsUpdateResponse, WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsGetOptionalParams, WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsGetResponse, - WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListResponse, WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListNextResponse } from "../models"; @@ -60,8 +61,16 @@ export class WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -69,11 +78,18 @@ export class WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListOptionalParams + options?: WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -82,7 +98,9 @@ export class WorkspaceManagedSqlServerDedicatedSQLMinimalTlsSettingsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -366,7 +384,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerEncryptionProtector.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerEncryptionProtector.ts index 72dad16f552c..23cdb5a8a07b 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerEncryptionProtector.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerEncryptionProtector.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerEncryptionProtector } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { EncryptionProtector, WorkspaceManagedSqlServerEncryptionProtectorListNextOptionalParams, WorkspaceManagedSqlServerEncryptionProtectorListOptionalParams, + WorkspaceManagedSqlServerEncryptionProtectorListResponse, EncryptionProtectorName, WorkspaceManagedSqlServerEncryptionProtectorGetOptionalParams, WorkspaceManagedSqlServerEncryptionProtectorGetResponse, WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateOptionalParams, WorkspaceManagedSqlServerEncryptionProtectorCreateOrUpdateResponse, - WorkspaceManagedSqlServerEncryptionProtectorListResponse, WorkspaceManagedSqlServerEncryptionProtectorRevalidateOptionalParams, WorkspaceManagedSqlServerEncryptionProtectorListNextResponse } from "../models"; @@ -61,8 +62,16 @@ export class WorkspaceManagedSqlServerEncryptionProtectorImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -70,11 +79,18 @@ export class WorkspaceManagedSqlServerEncryptionProtectorImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerEncryptionProtectorListOptionalParams + options?: WorkspaceManagedSqlServerEncryptionProtectorListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerEncryptionProtectorListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -83,7 +99,9 @@ export class WorkspaceManagedSqlServerEncryptionProtectorImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -454,7 +472,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerExtendedBlobAuditingPolicies.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerExtendedBlobAuditingPolicies.ts index be78673c7ec5..38de1d3bbca6 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerExtendedBlobAuditingPolicies.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerExtendedBlobAuditingPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerExtendedBlobAuditingPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { ExtendedServerBlobAuditingPolicy, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceNextOptionalParams, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceOptionalParams, + WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceResponse, BlobAuditingPolicyName, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesGetOptionalParams, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesGetResponse, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateOptionalParams, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesCreateOrUpdateResponse, - WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceResponse, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceNextResponse } from "../models"; @@ -64,11 +65,15 @@ export class WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByWorkspacePagingPage( resourceGroupName, workspaceName, - options + options, + settings ); } }; @@ -77,15 +82,22 @@ export class WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl private async *listByWorkspacePagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceOptionalParams + options?: WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByWorkspace( - resourceGroupName, - workspaceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesListByWorkspaceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByWorkspaceNext( resourceGroupName, @@ -94,7 +106,9 @@ export class WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -363,7 +377,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerRecoverableSqlPools.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerRecoverableSqlPools.ts index 1e5be5702b2a..d0a255241ea3 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerRecoverableSqlPools.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerRecoverableSqlPools.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerRecoverableSqlPools } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -55,8 +56,16 @@ export class WorkspaceManagedSqlServerRecoverableSqlPoolsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -64,11 +73,18 @@ export class WorkspaceManagedSqlServerRecoverableSqlPoolsImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerRecoverableSqlPoolsListOptionalParams + options?: WorkspaceManagedSqlServerRecoverableSqlPoolsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerRecoverableSqlPoolsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -77,7 +93,9 @@ export class WorkspaceManagedSqlServerRecoverableSqlPoolsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -203,7 +221,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerSecurityAlertPolicy.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerSecurityAlertPolicy.ts index 221e09551de9..1edb35ca0128 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerSecurityAlertPolicy.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerSecurityAlertPolicy.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerSecurityAlertPolicy } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { ServerSecurityAlertPolicy, WorkspaceManagedSqlServerSecurityAlertPolicyListNextOptionalParams, WorkspaceManagedSqlServerSecurityAlertPolicyListOptionalParams, + WorkspaceManagedSqlServerSecurityAlertPolicyListResponse, SecurityAlertPolicyNameAutoGenerated, WorkspaceManagedSqlServerSecurityAlertPolicyGetOptionalParams, WorkspaceManagedSqlServerSecurityAlertPolicyGetResponse, WorkspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateOptionalParams, WorkspaceManagedSqlServerSecurityAlertPolicyCreateOrUpdateResponse, - WorkspaceManagedSqlServerSecurityAlertPolicyListResponse, WorkspaceManagedSqlServerSecurityAlertPolicyListNextResponse } from "../models"; @@ -60,8 +61,16 @@ export class WorkspaceManagedSqlServerSecurityAlertPolicyImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -69,11 +78,18 @@ export class WorkspaceManagedSqlServerSecurityAlertPolicyImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerSecurityAlertPolicyListOptionalParams + options?: WorkspaceManagedSqlServerSecurityAlertPolicyListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerSecurityAlertPolicyListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -82,7 +98,9 @@ export class WorkspaceManagedSqlServerSecurityAlertPolicyImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -347,7 +365,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerUsages.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerUsages.ts index 670d3a5b7ca8..6bcd2b669ff1 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerUsages.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerUsages.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerUsages } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -53,8 +54,16 @@ export class WorkspaceManagedSqlServerUsagesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -62,11 +71,18 @@ export class WorkspaceManagedSqlServerUsagesImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerUsagesListOptionalParams + options?: WorkspaceManagedSqlServerUsagesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerUsagesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -75,7 +91,9 @@ export class WorkspaceManagedSqlServerUsagesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -161,7 +179,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerVulnerabilityAssessments.ts b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerVulnerabilityAssessments.ts index e4a1ccaddc69..56bc8ac49638 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerVulnerabilityAssessments.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaceManagedSqlServerVulnerabilityAssessments.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { WorkspaceManagedSqlServerVulnerabilityAssessments } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,13 +17,13 @@ import { ServerVulnerabilityAssessment, WorkspaceManagedSqlServerVulnerabilityAssessmentsListNextOptionalParams, WorkspaceManagedSqlServerVulnerabilityAssessmentsListOptionalParams, + WorkspaceManagedSqlServerVulnerabilityAssessmentsListResponse, VulnerabilityAssessmentName, WorkspaceManagedSqlServerVulnerabilityAssessmentsGetOptionalParams, WorkspaceManagedSqlServerVulnerabilityAssessmentsGetResponse, WorkspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateOptionalParams, WorkspaceManagedSqlServerVulnerabilityAssessmentsCreateOrUpdateResponse, WorkspaceManagedSqlServerVulnerabilityAssessmentsDeleteOptionalParams, - WorkspaceManagedSqlServerVulnerabilityAssessmentsListResponse, WorkspaceManagedSqlServerVulnerabilityAssessmentsListNextResponse } from "../models"; @@ -59,8 +60,16 @@ export class WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, workspaceName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); } }; } @@ -68,11 +77,18 @@ export class WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl private async *listPagingPage( resourceGroupName: string, workspaceName: string, - options?: WorkspaceManagedSqlServerVulnerabilityAssessmentsListOptionalParams + options?: WorkspaceManagedSqlServerVulnerabilityAssessmentsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, workspaceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspaceManagedSqlServerVulnerabilityAssessmentsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -81,7 +97,9 @@ export class WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -308,7 +326,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { }, default: {} }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/operations/workspaces.ts b/sdk/synapse/arm-synapse/src/operations/workspaces.ts index 8caf3bdc0e64..aa5d08f8e9d2 100644 --- a/sdk/synapse/arm-synapse/src/operations/workspaces.ts +++ b/sdk/synapse/arm-synapse/src/operations/workspaces.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Workspaces } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { Workspace, WorkspacesListByResourceGroupNextOptionalParams, WorkspacesListByResourceGroupOptionalParams, + WorkspacesListByResourceGroupResponse, WorkspacesListNextOptionalParams, WorkspacesListOptionalParams, - WorkspacesListByResourceGroupResponse, + WorkspacesListResponse, WorkspacesGetOptionalParams, WorkspacesGetResponse, WorkspacePatchInfo, @@ -30,7 +32,6 @@ import { WorkspacesCreateOrUpdateResponse, WorkspacesDeleteOptionalParams, WorkspacesDeleteResponse, - WorkspacesListResponse, WorkspacesListByResourceGroupNextResponse, WorkspacesListNextResponse } from "../models"; @@ -65,19 +66,33 @@ export class WorkspacesImpl implements Workspaces { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: WorkspacesListByResourceGroupOptionalParams + options?: WorkspacesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspacesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -85,7 +100,9 @@ export class WorkspacesImpl implements Workspaces { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -116,22 +133,34 @@ export class WorkspacesImpl implements Workspaces { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: WorkspacesListOptionalParams + options?: WorkspacesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: WorkspacesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -670,7 +699,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -691,7 +719,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/synapse/arm-synapse/src/pagingHelper.ts b/sdk/synapse/arm-synapse/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/synapse/arm-synapse/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/synapse/arm-synapse/src/synapseManagementClient.ts b/sdk/synapse/arm-synapse/src/synapseManagementClient.ts index 1d4818b95525..f15f445b383c 100644 --- a/sdk/synapse/arm-synapse/src/synapseManagementClient.ts +++ b/sdk/synapse/arm-synapse/src/synapseManagementClient.ts @@ -198,41 +198,47 @@ export class SynapseManagementClient extends coreClient.ServiceClient { ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; diff --git a/sdk/synapse/arm-synapse/test/sampleTest.ts b/sdk/synapse/arm-synapse/test/sampleTest.ts deleted file mode 100644 index 7ed89b043e1b..000000000000 --- a/sdk/synapse/arm-synapse/test/sampleTest.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - record, - RecorderEnvironmentSetup, - Recorder -} from "@azure-tools/test-recorder"; -import * as assert from "assert"; - -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] -}; - -describe("My test", () => { - let recorder: Recorder; - - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); - }); - - afterEach(async function() { - await recorder.stop(); - }); - - it("sample test", async function() { - console.log("Hi, I'm a test!"); - }); -}); diff --git a/sdk/synapse/arm-synapse/test/synapse_examples.spec.ts b/sdk/synapse/arm-synapse/test/synapse_examples.spec.ts new file mode 100644 index 000000000000..46e3772bd5df --- /dev/null +++ b/sdk/synapse/arm-synapse/test/synapse_examples.spec.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + Recorder, + RecorderStartOptions, + delay, + isPlaybackMode, +} from "@azure-tools/test-recorder"; +import { createTestCredential } from "@azure-tools/test-credential"; +import { assert } from "chai"; +import { Context } from "mocha"; +import { SynapseManagementClient } from "../src/synapseManagementClient"; +import { apiVersion } from "../src/models/parameters"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +export const testPollingOptions = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("Synapse test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: SynapseManagementClient; + let location: string; + let resourceGroup: string; + let workspaceName: string; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + subscriptionId = env.SUBSCRIPTION_ID || ''; + // This is an example of how the environment variables are used + const credential = createTestCredential(); + client = new SynapseManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); + location = "eastus"; + resourceGroup = "myjstest"; + workspaceName = "workspace1" + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("operations checkNameAvailability test", async function () { + const res = await client.operations.checkNameAvailability({ + name: "workspaceabc", + type: "Microsoft.Synapse/workspaces" + }); + }); +});