-
-
Save ypcode/5bf5826691f818bb48001e6a73a12196 to your computer and use it in GitHub Desktop.
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
import { Logger } from "@azure/functions"; | |
import { createSubscription } from "./subscriptions-helper"; | |
import { getExpirationDateTimeISOString } from "./date-helper"; | |
import { SETUP_RESOURCE, SETUP_CHANGE_TYPE, SETUP_NOTIFICATION_URL } from "./configure"; | |
export const setupNewSubscription = async function(log: Logger) { | |
log("Let's create a new subscription..."); | |
const created = await createSubscription({ | |
resource: SETUP_RESOURCE, | |
changeType: SETUP_CHANGE_TYPE, | |
notificationUrl: SETUP_NOTIFICATION_URL, | |
expirationDateTime: getExpirationDateTimeISOString(3) | |
}, log); | |
log(`A new subscription has been created with id ${created.id}`); | |
log("Please update the configuration accordingly..."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment