summary import { StaticSiteUserInvitationRequestResource , WebSiteManagementClient } from "@msinternal/web-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createAnInvitationLinkForAUserForAStaticSite ( ) { const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345" ; const resourceGroupName = "rg" ; const name = "testStaticSite0" ; const staticSiteUserRolesInvitationEnvelope = { domain : "happy-sea-15afae3e.azurestaticwebsites.net" , numHoursToExpiration : 1 , provider : "aad" , roles : "admin,contributor" , userDetails : "username" } ; const credential = new DefaultAzureCredential ( ) ; const client = new WebSiteManagementClient ( credential , subscriptionId ) ; const result = await client . staticSites . createUserRolesInvitationLink ( resourceGroupName , name , staticSiteUserRolesInvitationEnvelope ) ; console . log ( result ) ; } createAnInvitationLinkForAUserForAStaticSite ( ) . catch ( console . error ) ;