summary import { StorageAccountUpdateParameters , StorageManagementClient } from "@msinternal/storage-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function storageAccountUpdateDisablePublicNetworkAccess ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "res9407" ; const accountName = "sto8596" ; const parameters = { allowBlobPublicAccess : false , allowSharedKeyAccess : true , encryption : { keySource : "Microsoft.Storage" , services : { blob : { enabled : true , keyType : "Account" } , file : { enabled : true , keyType : "Account" } } } , keyPolicy : { keyExpirationPeriodInDays : 20 } , minimumTlsVersion : "TLS1_2" , networkRuleSet : { defaultAction : "Allow" , resourceAccessRules : [ { resourceId : "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace" , tenantId : "72f988bf-86f1-41af-91ab-2d7cd011db47" } ] } , publicNetworkAccess : "Disabled" , routingPreference : { publishInternetEndpoints : true , publishMicrosoftEndpoints : true , routingChoice : "MicrosoftRouting" } , sasPolicy : { expirationAction : "Log" , sasExpirationPeriod : "1.15:59:59" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new StorageManagementClient ( credential , subscriptionId ) ; const result = await client . storageAccounts . update ( resourceGroupName , accountName , parameters ) ; console . log ( result ) ; } storageAccountUpdateDisablePublicNetworkAccess ( ) . catch ( console . error ) ;