summary import { Certificate , WebSiteManagementClient } from "@msinternal/web-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createOrUpdateCertificate ( ) { const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345" ; const resourceGroupName = "testrg123" ; const name = "testc6282" ; const certificateEnvelope = { hostNames : [ "ServerCert" ] , location : "East US" , password : "<password>" } ; const credential = new DefaultAzureCredential ( ) ; const client = new WebSiteManagementClient ( credential , subscriptionId ) ; const result = await client . certificates . createOrUpdate ( resourceGroupName , name , certificateEnvelope ) ; console . log ( result ) ; } createOrUpdateCertificate ( ) . catch ( console . error ) ;