This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add command to export local settings
- Loading branch information
1 parent
99a0280
commit 549b9be
Showing
4 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { CommandDefinition } from './CommandDefinition' | ||
import { WebSiteManagementClient } from '@azure/arm-appservice' | ||
|
||
export const functionsSettingsCommand = ({ | ||
websiteClient, | ||
appName, | ||
resourceGroup, | ||
}: { | ||
websiteClient: () => Promise<WebSiteManagementClient> | ||
appName: string | ||
resourceGroup: string | ||
}): CommandDefinition => ({ | ||
command: 'functions-settings', | ||
action: async () => { | ||
const client = await websiteClient() | ||
const { properties } = await client.webApps.listApplicationSettings( | ||
resourceGroup, | ||
`${appName}API`, | ||
) | ||
console.log( | ||
JSON.stringify( | ||
{ | ||
IsEncrypted: false, | ||
Values: properties, | ||
Host: { | ||
CORS: '*', | ||
CORSCredentials: false, | ||
}, | ||
}, | ||
null, | ||
2, | ||
), | ||
) | ||
}, | ||
help: 'Exports the function app setting for local development.', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters