Skip to content

Commit e5f2132

Browse files
authored
Enhance scripts with additional parameters for tenant and service principal support (#2860)
1 parent 7d8f844 commit e5f2132

8 files changed

Lines changed: 156 additions & 47 deletions

File tree

package-lock.json

Lines changed: 42 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"devDependencies": {
3232
"@azure/identity": "^4.0.1",
33-
"@azure/storage-blob": "12.16.0",
33+
"@azure/storage-blob": "^12.16.0",
3434
"@playwright/test": "1.40.1",
3535
"@types/chai": "^4.3.6",
3636
"@types/google-maps": "^3.2.3",

scripts.v3/capture.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
* --serviceName < your service name >
1616
*/
1717

18+
/*
19+
* 12.18.2025 - Added the following arguments to align with migrate.js
20+
* --TenantId "< optional (needed if tenant ID is different > \r
21+
* --ServicePrincipal "< optional service principal or user name. > \r
22+
* --ServicePrincipalSecret "< optional secret or password for service principal or az login for the destination. >\n`)
23+
*/
24+
1825
const path = require("path");
1926
const { ImporterExporter } = require("./utils");
2027

@@ -38,6 +45,21 @@ const yargs = require('yargs')
3845
description: 'API Management service name.',
3946
demandOption: true
4047
})
48+
.option('tenantId', {
49+
type: 'string',
50+
description: 'Azure tenant ID (optional, required if different from default).',
51+
demandOption: false
52+
})
53+
.option('servicePrincipal', {
54+
type: 'string',
55+
description: 'service principal or user name.',
56+
demandOption: false
57+
})
58+
.option('servicePrincipalSecret', {
59+
type: 'string',
60+
description: 'service principal secret.',
61+
demandOption: false
62+
})
4163
.option('folder', {
4264
type: 'string',
4365
default: '../dist/snapshot',
@@ -79,9 +101,9 @@ async function capture() {
79101
yargs.subscriptionId,
80102
yargs.resourceGroupName,
81103
yargs.serviceName,
82-
null,
83-
null,
84-
null,
104+
yargs.tenantId,
105+
yargs.servicePrincipal,
106+
yargs.servicePrincipalSecret,
85107
absoluteFolder
86108
);
87109

0 commit comments

Comments
 (0)